From f26dbe09801b265bd394a6c3715e155724122848 Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Thu, 29 Feb 2024 08:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8A=E8=A3=85=E4=BD=9C=E4=B8=9A=EF=BC=8C?= =?UTF-8?q?=E6=96=AD=E8=B7=AF=E4=BD=9C=E4=B8=9A=EF=BC=8C=E5=8A=A8=E5=9C=9F?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=EF=BC=8C=E7=9B=B2=E6=9D=BFPC=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ler.java => AppElectricityController.java} | 2 +- .../eightwork/BlindBoardController.java | 4 + .../eightwork/CutRoadController.java | 91 +++++++++++++++++ .../eightwork/ElectricityController.java | 97 +++++++++++++++++++ .../eightwork/HighworkController.java | 2 + .../eightwork/BlindBoardMapper.java | 3 + .../eightwork/BreakGroundMapper.java | 3 + .../eightwork/ConfinedspaceMapper.java | 3 + .../datasource/eightwork/CutRoadMapper.java | 3 + .../eightwork/ElectricityMapper.java | 3 + .../datasource/eightwork/HighworkMapper.java | 3 + .../datasource/eightwork/HoistingMapper.java | 3 + .../eightwork/impl/BlindBoardServiceImpl.java | 71 +++++++++++++- .../impl/BreakGroundServiceImpl.java | 68 ++++++++++++- .../impl/ConfinedspaceServiceImpl.java | 70 ++++++++++++- .../eightwork/impl/CutRoadServiceImpl.java | 67 +++++++++++++ .../impl/ElectricityServiceImpl.java | 71 +++++++++++++- .../eightwork/impl/HighworkServiceImpl.java | 67 +++++++++++++ .../eightwork/impl/HoistingServiceImpl.java | 67 +++++++++++++ .../datasource/eightwork/BlindBoardMapper.xml | 35 ++++++- .../eightwork/BreakGroundMapper.xml | 8 ++ .../eightwork/ConfinedspaceMapper.xml | 9 +- .../datasource/eightwork/CutRoadMapper.xml | 9 ++ .../eightwork/ElectricityMapper.xml | 8 ++ .../datasource/eightwork/HighWorkMapper.xml | 9 +- .../datasource/eightwork/HoistingMapper.xml | 55 ++++++++--- 26 files changed, 803 insertions(+), 28 deletions(-) rename src/main/java/com/zcloud/controller/eightwork/{AppElertricityController.java => AppElectricityController.java} (99%) create mode 100644 src/main/java/com/zcloud/controller/eightwork/CutRoadController.java create mode 100644 src/main/java/com/zcloud/controller/eightwork/ElectricityController.java diff --git a/src/main/java/com/zcloud/controller/eightwork/AppElertricityController.java b/src/main/java/com/zcloud/controller/eightwork/AppElectricityController.java similarity index 99% rename from src/main/java/com/zcloud/controller/eightwork/AppElertricityController.java rename to src/main/java/com/zcloud/controller/eightwork/AppElectricityController.java index 12e454f..1e7845f 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppElertricityController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppElectricityController.java @@ -25,7 +25,7 @@ import java.util.Map; */ @Controller @RequestMapping("/app/electricity") -public class AppElertricityController extends BaseController { +public class AppElectricityController extends BaseController { @Autowired private ElectricityService electricityService; diff --git a/src/main/java/com/zcloud/controller/eightwork/BlindBoardController.java b/src/main/java/com/zcloud/controller/eightwork/BlindBoardController.java index f8cce9a..ea24d18 100644 --- a/src/main/java/com/zcloud/controller/eightwork/BlindBoardController.java +++ b/src/main/java/com/zcloud/controller/eightwork/BlindBoardController.java @@ -4,6 +4,7 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.logs.LogAnno; +import com.zcloud.service.eightwork.BlindBoardInfoService; import com.zcloud.service.eightwork.BlindBoardService; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; @@ -26,6 +27,8 @@ public class BlindBoardController extends BaseController { @Autowired private BlindBoardService blindboardService; + @Autowired + private BlindBoardInfoService blindBoardInfoService; /**列表 @@ -83,6 +86,7 @@ public class BlindBoardController extends BaseController { List finishMeasuresList = blindboardService.listSignFinishMeasures(pd); map.put("measuresList",finishMeasuresList); map.put("signs",signs); + map.put("boardList", blindBoardInfoService.listAll(pd)); map.put("pd",pd); map.put("result",errInfo); return map; diff --git a/src/main/java/com/zcloud/controller/eightwork/CutRoadController.java b/src/main/java/com/zcloud/controller/eightwork/CutRoadController.java new file mode 100644 index 0000000..a3a89bf --- /dev/null +++ b/src/main/java/com/zcloud/controller/eightwork/CutRoadController.java @@ -0,0 +1,91 @@ +package com.zcloud.controller.eightwork; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.logs.LogAnno; +import com.zcloud.service.eightwork.CutRoadService; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:断路作业 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/cutroad") +public class CutRoadController extends BaseController { + + @Autowired + private CutRoadService cutroadService; + + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "断路作业",instructionsOperate = "断路作业",instructionsType = "列表") + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + page.setPd(pd); + List varList = cutroadService.list(page); //列出cutroad列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + + return map; + } + + /**获取断路作业流程 + * @param + * @throws Exception + */ + @RequestMapping(value="/getFlowList") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "断路作业",instructionsOperate = "断路作业",instructionsType = "获取断路作业流程") + public Object getFlowList() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + List flowList = cutroadService.getFlowList(pd); + map.put("flowList", flowList); + map.put("result", errInfo); //返回结果 + return map; + } + + @RequestMapping("/findById") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "断路作业",instructionsOperate = "断路作业",instructionsType = "获取详情") + public Object findById() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = cutroadService.findById(pd); + PageData signs = cutroadService.listSignFinished(pd); + List finishMeasuresList = cutroadService.listSignFinishMeasures(pd); + map.put("measuresList",finishMeasuresList); + map.put("signs",signs); + map.put("pd",pd); + map.put("result",errInfo); + return map; + } + +} diff --git a/src/main/java/com/zcloud/controller/eightwork/ElectricityController.java b/src/main/java/com/zcloud/controller/eightwork/ElectricityController.java new file mode 100644 index 0000000..9c7569e --- /dev/null +++ b/src/main/java/com/zcloud/controller/eightwork/ElectricityController.java @@ -0,0 +1,97 @@ +package com.zcloud.controller.eightwork; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.logs.LogAnno; +import com.zcloud.service.eightwork.ElectricityGasService; +import com.zcloud.service.eightwork.ElectricityService; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:临时用电作业 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/electricity") +public class ElectricityController extends BaseController { + + @Autowired + private ElectricityService electricityService; + @Autowired + private ElectricityGasService electricityGasService; + + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "临时用电作业",instructionsOperate = "临时用电作业",instructionsType = "列表") + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + page.setPd(pd); + List varList = electricityService.list(page); //列出electricity列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + + return map; + } + + /**获取临时用电作业流程 + * @param + * @throws Exception + */ + @RequestMapping(value="/getFlowList") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "临时用电作业",instructionsOperate = "临时用电作业",instructionsType = "获取临时用电作业流程") + public Object getFlowList() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = electricityService.findById(pd); + List flowList = electricityService.getFlowList(pd); + map.put("flowingWork", pd); + map.put("flowList", flowList); + map.put("result", errInfo); //返回结果 + return map; + } + + @RequestMapping("/findById") + @ResponseBody + @LogAnno(menuType= "高危作业管理",menuServer= "临时用电作业",instructionsOperate = "临时用电作业",instructionsType = "获取详情") + public Object findById() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = electricityService.findById(pd); + PageData signs = electricityService.listSignFinished(pd); + List finishMeasuresList = electricityService.listSignFinishMeasures(pd); + map.put("measuresList",finishMeasuresList); + map.put("gasList", electricityGasService.listAll(pd)); + map.put("signs",signs); + map.put("pd",pd); + map.put("result",errInfo); + return map; + } + +} diff --git a/src/main/java/com/zcloud/controller/eightwork/HighworkController.java b/src/main/java/com/zcloud/controller/eightwork/HighworkController.java index 9f90022..177a200 100644 --- a/src/main/java/com/zcloud/controller/eightwork/HighworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/HighworkController.java @@ -64,8 +64,10 @@ public class HighworkController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + pd = highworkService.findById(pd); List flowList = highworkService.getFlowList(pd); map.put("flowList", flowList); + map.put("flowingWork", pd); map.put("result", errInfo); //返回结果 return map; } diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/BlindBoardMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/BlindBoardMapper.java index 0e96cc1..5996e31 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/BlindBoardMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/BlindBoardMapper.java @@ -17,6 +17,9 @@ public interface BlindBoardMapper { void edit(PageData pd); void editStep(PageData pd); void editContent(PageData pd); + + void editVideo(PageData pd); + List datalistPage(Page page); List listAllMeasures(); diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/BreakGroundMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/BreakGroundMapper.java index 2ab2ab5..44242b4 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/BreakGroundMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/BreakGroundMapper.java @@ -17,6 +17,9 @@ public interface BreakGroundMapper { void edit(PageData pd); void editStep(PageData pd); void editContent(PageData pd); + + void editVideo(PageData pd); + List datalistPage(Page page); List listAllMeasures(); diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java index 689b6f7..9ba4a3f 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java @@ -17,6 +17,9 @@ public interface ConfinedspaceMapper { void edit(PageData pd); void editGasTime(PageData pd); void editStep(PageData pd); + + void editVideo(PageData pd); + void setPosition(PageData pd); List datalistPage(Page page); diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/CutRoadMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/CutRoadMapper.java index fe96bf3..4b32df7 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/CutRoadMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/CutRoadMapper.java @@ -17,6 +17,9 @@ public interface CutRoadMapper { void edit(PageData pd); void editStep(PageData pd); void editContent(PageData pd); + + void editVideo(PageData pd); + List datalistPage(Page page); List listAllMeasures(); diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/ElectricityMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/ElectricityMapper.java index dbbc48a..eb2aab9 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/ElectricityMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/ElectricityMapper.java @@ -20,6 +20,9 @@ public interface ElectricityMapper { void edit(PageData pd); void editGasTime(PageData pd); void editStep(PageData pd); + + void editVideo(PageData pd); + void setPosition(PageData pd); List datalistPage(Page page); diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java index b4eec56..abf52a5 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java @@ -16,6 +16,9 @@ public interface HighworkMapper { void delete(PageData pd); void edit(PageData pd); void editStep(PageData pd); + + void editVideo(PageData pd); + List datalistPage(Page page); List listAllMeasures(); diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HoistingMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HoistingMapper.java index 4d03bc7..229ffea 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HoistingMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HoistingMapper.java @@ -16,6 +16,9 @@ public interface HoistingMapper { void delete(PageData pd); void edit(PageData pd); void editStep(PageData pd); + + void editVideo(PageData pd); + List datalistPage(Page page); List listAllMeasures(); diff --git a/src/main/java/com/zcloud/service/eightwork/impl/BlindBoardServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/BlindBoardServiceImpl.java index 88a8fc5..99ca403 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/BlindBoardServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/BlindBoardServiceImpl.java @@ -40,6 +40,8 @@ public class BlindBoardServiceImpl implements BlindBoardService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "BLINDBOARD_ID"; private final String work_type = "BLINDBOARD"; @@ -55,7 +57,7 @@ public class BlindBoardServiceImpl implements BlindBoardService { pd2.put("CREATDATE",year + "-" + month + "-" + day); pd2.put("CORPINFO_ID",pd.get("CORPINFO_ID")); pd2 = blindboardMapper.getCode(pd2); //根据ID读取 - String code = "DT" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1)); + String code = "MB" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1)); pd.put("CHECK_NO", code); pd.put(primary_key, UuidUtil.get32UUID()); //主键 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 @@ -131,6 +133,7 @@ public class BlindBoardServiceImpl implements BlindBoardService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); + blindboardMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -168,7 +171,7 @@ public class BlindBoardServiceImpl implements BlindBoardService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); - + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); return; } if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 @@ -182,9 +185,36 @@ public class BlindBoardServiceImpl implements BlindBoardService { work.put("STEP_ID",-1); blindboardMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); + } } + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "盲板作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } @Override public PageData findById(PageData pd) throws Exception { PageData pageData = blindboardMapper.findById(pd); @@ -286,7 +316,39 @@ public class BlindBoardServiceImpl implements BlindBoardService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); blindboardSignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "盲板作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + private void saveMeasures(PageData pd) { List list = (List) JSON.parse(pd.get("MEASURES").toString()); @@ -331,6 +393,11 @@ public class BlindBoardServiceImpl implements BlindBoardService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); blindboardSignMapper.saveBatch(nextSigners); diff --git a/src/main/java/com/zcloud/service/eightwork/impl/BreakGroundServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/BreakGroundServiceImpl.java index 21d36b1..909a4ee 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/BreakGroundServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/BreakGroundServiceImpl.java @@ -38,6 +38,8 @@ public class BreakGroundServiceImpl implements BreakGroundService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "BREAKGROUND_ID"; private final String work_type = "BREAKGROUND"; @@ -114,6 +116,7 @@ public class BreakGroundServiceImpl implements BreakGroundService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); + breakgroundMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -152,7 +155,7 @@ public class BreakGroundServiceImpl implements BreakGroundService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); - + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); return; } if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 @@ -166,6 +169,33 @@ public class BreakGroundServiceImpl implements BreakGroundService { work.put("STEP_ID",-1); breakgroundMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); + + } + } + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "动土作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); } } @@ -270,6 +300,37 @@ public class BreakGroundServiceImpl implements BreakGroundService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); breakgroundSignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + + } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "动土作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } } private void saveMeasures(PageData pd) { @@ -315,6 +376,11 @@ public class BreakGroundServiceImpl implements BreakGroundService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); breakgroundSignMapper.saveBatch(nextSigners); diff --git a/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java index 0dfe872..fff5c41 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java @@ -40,6 +40,8 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "CONFINEDSPACE_ID"; private final String work_type = "CONFINEDSPACE"; @@ -116,7 +118,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); - + confinedspaceMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -146,6 +148,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); return; } @@ -160,6 +163,33 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { work.put("STEP_ID",-1); confinedspaceMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); + + } + } + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "受限作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); } } @@ -285,7 +315,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { saveLog(work,pd.getString("USER_ID"),"-2"); work.put("STEP_ID",-1); confinedspaceMapper.editStep(work); - + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); } } @@ -321,6 +351,37 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); confinedspaceSignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + + } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "受限作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } } private void saveMeasures(PageData pd) { @@ -369,6 +430,11 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); confinedspaceSignMapper.saveBatch(nextSigners); diff --git a/src/main/java/com/zcloud/service/eightwork/impl/CutRoadServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/CutRoadServiceImpl.java index ae65f89..d1ae346 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/CutRoadServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/CutRoadServiceImpl.java @@ -38,6 +38,8 @@ public class CutRoadServiceImpl implements CutRoadService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "CUTROAD_ID"; private final String work_type = "CUTROAD"; @@ -114,6 +116,7 @@ public class CutRoadServiceImpl implements CutRoadService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); + cutroadMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -152,6 +155,7 @@ public class CutRoadServiceImpl implements CutRoadService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); return; } @@ -166,6 +170,8 @@ public class CutRoadServiceImpl implements CutRoadService { work.put("STEP_ID",-1); cutroadMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); + } } @@ -270,6 +276,8 @@ public class CutRoadServiceImpl implements CutRoadService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); cutroadSignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } private void saveMeasures(PageData pd) { @@ -315,6 +323,11 @@ public class CutRoadServiceImpl implements CutRoadService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); cutroadSignMapper.saveBatch(nextSigners); @@ -352,5 +365,59 @@ public class CutRoadServiceImpl implements CutRoadService { pd.put("WORK_POSITION", String.join(",",positions)); cutroadMapper.setPosition(pd); } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "断路作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "断路作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/ElectricityServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/ElectricityServiceImpl.java index cf7de02..dd7ce2d 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/ElectricityServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/ElectricityServiceImpl.java @@ -40,6 +40,8 @@ public class ElectricityServiceImpl implements ElectricityService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "ELECTRICITY_ID"; private final String work_type = "ELECTRICITY"; @@ -121,7 +123,7 @@ public class ElectricityServiceImpl implements ElectricityService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); - + electricityMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -151,7 +153,7 @@ public class ElectricityServiceImpl implements ElectricityService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); - + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); return; } if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 @@ -165,6 +167,8 @@ public class ElectricityServiceImpl implements ElectricityService { work.put("STEP_ID",-1); electricityMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); + } } @@ -290,6 +294,7 @@ public class ElectricityServiceImpl implements ElectricityService { saveLog(work,pd.getString("USER_ID"),"-2"); work.put("STEP_ID",-1); electricityMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); } } @@ -326,6 +331,8 @@ public class ElectricityServiceImpl implements ElectricityService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); electricitySignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } private void saveMeasures(PageData pd) { @@ -374,6 +381,12 @@ public class ElectricityServiceImpl implements ElectricityService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); electricitySignMapper.saveBatch(nextSigners); @@ -424,5 +437,59 @@ public class ElectricityServiceImpl implements ElectricityService { pd.put("WORK_POSITION", String.join(",",positions)); electricityMapper.setPosition(pd); } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "临时用电作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "临时用电作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java index 4f8cb4e..bc0a3da 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java @@ -39,6 +39,8 @@ public class HighworkServiceImpl implements HighworkService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "HIGHWORK_ID"; private final String work_type = "HIGHWORK"; @@ -115,6 +117,7 @@ public class HighworkServiceImpl implements HighworkService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); + highworkMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -141,6 +144,7 @@ public class HighworkServiceImpl implements HighworkService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); return; } @@ -155,6 +159,8 @@ public class HighworkServiceImpl implements HighworkService { work.put("STEP_ID",-1); highworkMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_ACCEPT",work.getString("CHECK_NO")); + } } @@ -254,6 +260,8 @@ public class HighworkServiceImpl implements HighworkService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); highworkSignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } private void saveMeasures(PageData pd) { @@ -299,6 +307,11 @@ public class HighworkServiceImpl implements HighworkService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); highworkSignMapper.saveBatch(nextSigners); @@ -336,5 +349,59 @@ public class HighworkServiceImpl implements HighworkService { pd.put("WORK_POSITION", String.join(",",positions)); highworkMapper.setPosition(pd); } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "高处作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "高处作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/HoistingServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/HoistingServiceImpl.java index ec56178..2046377 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HoistingServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HoistingServiceImpl.java @@ -38,6 +38,8 @@ public class HoistingServiceImpl implements HoistingService { private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper; @Autowired private Smb smb; + @Autowired + private SendMessageUtil sendMessageUtil; private final String primary_key = "HOISTING_ID"; private final String work_type = "HOISTING"; @@ -114,6 +116,7 @@ public class HoistingServiceImpl implements HoistingService { } PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID")); + hoistingMapper.editVideo(work); //保存签名信息 PageData sign = new PageData(); @@ -140,6 +143,7 @@ public class HoistingServiceImpl implements HoistingService { if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ eightworkvideomanagerMapper.editStatus(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); return; } @@ -154,6 +158,8 @@ public class HoistingServiceImpl implements HoistingService { work.put("STEP_ID",-1); hoistingMapper.editStep(work); + sendMessageForFinished(work.getString("CORPINFO_ID"),work.getString("CREATOR"),"EIGHTWORK_REJECT",work.getString("CHECK_NO")); + } } @@ -253,6 +259,8 @@ public class HoistingServiceImpl implements HoistingService { signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); signers.add(signer); hoistingSignMapper.saveBatch(signers); + sendMessageForNext(pd.getString("CORPINFO_ID"),pd.getString(flow.get("NEXT_ACTOR_FIELD")),pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } private void saveMeasures(PageData pd) { @@ -298,6 +306,11 @@ public class HoistingServiceImpl implements HoistingService { signer.put("SIGN_USER_ID", item); signer.put("STEP_ID", flow.get("NEXT_STEP_ID")); nextSigners.add(signer); + try { + sendMessageForNext(pd.getString("CORPINFO_ID"),item,pd.getString("CHECK_NO"),flow.getString("NEXT_STEP_NAME")); + } catch (Exception e) { + throw new RuntimeException(e); + } }); hoistingSignMapper.saveBatch(nextSigners); @@ -335,5 +348,59 @@ public class HoistingServiceImpl implements HoistingService { pd.put("WORK_POSITION", String.join(",",positions)); hoistingMapper.setPosition(pd); } + private void sendMessageForNext(String corpinfo_id,String userId,String number,String flow_name) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", "EIGHTWORK_REMINDER");// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "动火作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + PageData params3 = new PageData(); + params3.put("name", "flow");// 存入短信模板中的参数名称 + params3.put("value", flow_name);// 存入上面参数名称所传递的值 + paramsList.add(params3); + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void sendMessageForFinished(String corpinfo_id,String userId,String template,String number) throws Exception { + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人userid + mes.put("templateCode", template);// 短信模板编码 + mes.put("CORPINFO_ID", corpinfo_id);// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", number);// 存入上面参数名称所传递的值 + paramsList.add(params1); + + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "动火作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + + try { + sendMessageUtil.sendMessages(mes, paramsList); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } diff --git a/src/main/resources/mybatis/datasource/eightwork/BlindBoardMapper.xml b/src/main/resources/mybatis/datasource/eightwork/BlindBoardMapper.xml index 53a450e..9f24cc7 100644 --- a/src/main/resources/mybatis/datasource/eightwork/BlindBoardMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/BlindBoardMapper.xml @@ -49,7 +49,9 @@ f.PLS_NAME, f.WORK_POSITION, f.VIDEO_PATH, - f.BOARD_PATH + f.BOARD_PATH, + f.WORKSHOP_DEPARTMENT_ID, + f.WORKSHOP_USER_ID @@ -95,7 +97,9 @@ PLS_NAME, WORK_POSITION, VIDEO_PATH, - BOARD_PATH + BOARD_PATH, + WORKSHOP_DEPARTMENT_ID, + WORKSHOP_USER_ID @@ -141,7 +145,9 @@ #{PLS_NAME}, #{WORK_POSITION}, #{VIDEO_PATH}, - #{BOARD_PATH} + #{BOARD_PATH}, + #{WORKSHOP_DEPARTMENT_ID}, + #{WORKSHOP_USER_ID} @@ -219,7 +225,9 @@ PLS_ID = #{PLS_ID}, PLS_NAME = #{PLS_NAME}, WORK_POSITION = #{WORK_POSITION}, - VIDEO_PATH = #{VIDEO_PATH} + VIDEO_PATH = #{VIDEO_PATH}, + WORKSHOP_DEPARTMENT_ID = #{WORKSHOP_DEPARTMENT_ID}, + WORKSHOP_USER_ID = #{WORKSHOP_USER_ID} where BLINDBOARD_ID = #{BLINDBOARD_ID} @@ -233,6 +241,8 @@ f.WORK_START_DATE, f.SPECIAL_WORK, f.RISK_IDENTIFICATION, + worko.`NAME` as WORKSHOP_DEPARTMENT_NAME, + worku.`NAME` as WORKSHOP_USER_NAME, woro.`NAME` as WORK_USER_DEPARTMENT_NAME, woru.`NAME` as WORK_USER_NAME, cono.`NAME` as CONFESS_DEPARTMENT_NAME, @@ -254,6 +264,9 @@ left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID left join sys_user as appu on f.APPLY_USER_ID = appu.USER_ID + left join oa_department as worko on f.WORKSHOP_DEPARTMENT_ID = worko.DEPARTMENT_ID + left join sys_user as worku on f.WORKSHOP_USER_ID = worku.USER_ID + left join oa_department as woro on f.WORK_USER_DEPARTMENT_ID = woro.DEPARTMENT_ID left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID @@ -308,6 +321,15 @@ BLINDBOARD_ID = #{BLINDBOARD_ID} + + update + + set + VIDEO_PATH = #{VIDEO_PATH} + where + BLINDBOARD_ID = #{BLINDBOARD_ID} + + diff --git a/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml b/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml index bcfba50..ee41f01 100644 --- a/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml @@ -315,7 +315,14 @@ WHERE f.CONFINEDSPACE_ID = #{CONFINEDSPACE_ID} - + + update + + set + VIDEO_PATH = #{VIDEO_PATH} + where + CONFINEDSPACE_ID = #{CONFINEDSPACE_ID} + update diff --git a/src/main/resources/mybatis/datasource/eightwork/CutRoadMapper.xml b/src/main/resources/mybatis/datasource/eightwork/CutRoadMapper.xml index d82cd96..b1325a9 100644 --- a/src/main/resources/mybatis/datasource/eightwork/CutRoadMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/CutRoadMapper.xml @@ -347,6 +347,15 @@ CUTROAD_ID = #{CUTROAD_ID} + + update + + set + VIDEO_PATH = #{VIDEO_PATH} + where + CUTROAD_ID = #{CUTROAD_ID} + + + + update + + set + VIDEO_PATH = #{VIDEO_PATH} + where + ELECTRICITY_ID = #{ELECTRICITY_ID} + diff --git a/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml index 9191516..022f0c3 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml @@ -314,7 +314,14 @@ WHERE f.HIGHWORK_ID = #{HIGHWORK_ID} - + + update + + set + VIDEO_PATH = #{VIDEO_PATH} + where + HIGHWORK_ID = #{HIGHWORK_ID} + update diff --git a/src/main/resources/mybatis/datasource/eightwork/HoistingMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HoistingMapper.xml index 5b77b5b..1c7532b 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HoistingMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HoistingMapper.xml @@ -57,7 +57,9 @@ f.PLS_ID, f.PLS_NAME, f.WORK_POSITION, - f.VIDEO_PATH + f.VIDEO_PATH, + f.APPLY_DEPARTMENT_ID, + f.APPLY_USER_ID @@ -111,7 +113,9 @@ PLS_ID, PLS_NAME, WORK_POSITION, - VIDEO_PATH + VIDEO_PATH, + APPLY_DEPARTMENT_ID, + APPLY_USER_ID @@ -165,7 +169,9 @@ #{PLS_ID}, #{PLS_NAME}, #{WORK_POSITION}, - #{VIDEO_PATH} + #{VIDEO_PATH}, + #{APPLY_DEPARTMENT_ID}, + #{APPLY_USER_ID} @@ -252,7 +258,9 @@ PLS_ID = #{PLS_ID}, PLS_NAME = #{PLS_NAME}, WORK_POSITION = #{WORK_POSITION}, - VIDEO_PATH = #{VIDEO_PATH} + VIDEO_PATH = #{VIDEO_PATH}, + APPLY_DEPARTMENT_ID = #{APPLY_DEPARTMENT_ID}, + APPLY_USER_ID = #{APPLY_USER_ID} where HOISTING_ID = #{HOISTING_ID} @@ -261,13 +269,15 @@ + + update + + set + VIDEO_PATH = #{VIDEO_PATH} + where + HOISTING_ID = #{HOISTING_ID} + + update @@ -359,8 +381,8 @@