diff --git a/src/main/java/com/zcloud/FHmainApplication.java b/src/main/java/com/zcloud/FHmainApplication.java index 1251f755..75b6e36d 100644 --- a/src/main/java/com/zcloud/FHmainApplication.java +++ b/src/main/java/com/zcloud/FHmainApplication.java @@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Conditional; import org.springframework.scheduling.annotation.EnableScheduling; diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java index 4ce80844..3b6aaa03 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java @@ -38,7 +38,7 @@ import java.util.*; * 官网:www.zcloudchina.com */ @Controller -@RequestMapping("/app/electricity") +@RequestMapping("c") public class AppElectricityController extends BaseController { @Autowired diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java index e7250d05..70e028c4 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java @@ -23,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartRequest; import javax.annotation.Resource; +import java.io.File; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -650,33 +651,33 @@ public class AppHotworkCfdController extends BaseController { * @param * @throws Exception */ - @RequestMapping(value = "/editAcceptconfess") - @ResponseBody - @Transactional - @LogAnno(menuType = "手机", menuServer = "动土作业", instructionsOperate = "动土作业", instructionsType = "修改") - public Object editAcceptconfess(MultipartRequest request) throws Exception { - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData pd2 = new PageData(); - pd2 = hotworkCfdService.findById(pd); - pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - List fileList = new ArrayList(); - String signertime = ""; - String SIGNTIME[] = pd.getString("SIGNTIME").split(","); - - for (int i = 0; i < SIGNTIME.length; i++) { - signertime = SIGNTIME[i]; - fileList.add(request.getFile("file" + i)); - MultipartFile[] fileArr = new MultipartFile[fileList.size()]; - saveImg(fileList.toArray(fileArr), signertime, pd.getString("HOTWORK_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_CONFESS_USER_ID"), pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID")); - fileList.clear(); - } - map.put("result", errInfo); - return map; - } +// @RequestMapping(value = "/editAcceptconfess") +// @ResponseBody +// @Transactional +// @LogAnno(menuType = "手机", menuServer = "动土作业", instructionsOperate = "动土作业", instructionsType = "修改") +// public Object editAcceptconfess(MultipartRequest request) throws Exception { +// Map map = new HashMap(); +// String errInfo = "success"; +// PageData pd = new PageData(); +// pd = this.getPageData(); +// PageData pd2 = new PageData(); +// pd2 = hotworkCfdService.findById(pd); +// pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 +// pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 +// List fileList = new ArrayList(); +// String signertime = ""; +// String SIGNTIME[] = pd.getString("SIGNTIME").split(","); +// +// for (int i = 0; i < SIGNTIME.length; i++) { +// signertime = SIGNTIME[i]; +// fileList.add(request.getFile("file" + i)); +// MultipartFile[] fileArr = new MultipartFile[fileList.size()]; +// saveImg(fileList.toArray(fileArr), signertime, pd.getString("HOTWORK_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_CONFESS_USER_ID"), pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID")); +// fileList.clear(); +// } +// map.put("result", errInfo); +// return map; +// } private void saveImg(MultipartFile[] files, String signertime, String HOTWORK_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception { if (files != null && files.length > 0) { @@ -721,6 +722,7 @@ public class AppHotworkCfdController extends BaseController { pd = this.getPageData(); PageData pd2 = new PageData(); pd2 = hotworkCfdService.findById(pd); + pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 PageData log = new PageData(); @@ -739,13 +741,49 @@ public class AppHotworkCfdController extends BaseController { pd2.put("OTHER_PROTECTIVE_MEASURES", ""); } + List fileList = new ArrayList(); + String signertime = ""; + String[] SIGNTIME = pd.getString("SIGNTIME").split(","); + switch (status) { + case "8": // 验收人 + for (int i = 0; i < SIGNTIME.length; i++) { + signertime = SIGNTIME[i]; + fileList.add(request.getFile("file" + i)); + MultipartFile[] fileArr = new MultipartFile[fileList.size()]; + saveAcceptImg(fileList.toArray(fileArr), signertime, pd.getString("HOTWORK_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_USER_ID"), pd.getString("ACCEPT_DEPARTMENT_ID")); + fileList.clear(); + } + pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("FIRE_COMPLETED", pd.get("FIRE_COMPLETED")); // 动火是否完成 + pd2.put("SITE_CLEANED", pd.get("SITE_CLEANED")); // 作业现场是否清理 + pd2.put("NO_REMAINING_EMBERS", pd.get("NO_REMAINING_EMBERS")); // 是否存在遗留火种 + hotworkCfdService.edit(pd2); + log.put("ACTION", "验收通过"); - case "8"://验收人 - List fileList = new ArrayList(); - String signertime = ""; - String SIGNTIME[] = pd.getString("SIGNTIME").split(","); + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID")); // 收信人userid + mes.put("templateCode", "DH_Y08"); // 短信模板编码 + mes.put("SMSCode", "SMS_227250920"); // 短信模板编码 + mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID")); // 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number"); // 存入短信模板中的参数名称 + params1.put("value", pd2.get("CHECK_NO")); // 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "type"); // 存入短信模板中的参数名称 + params2.put("value", "动火作业"); // 存入上面参数名称所传递的值 + paramsList.add(params2); + // sendMessageUtil.sendMessages(mes, paramsList); + break; + case "-8": // 审批打回 for (int i = 0; i < SIGNTIME.length; i++) { signertime = SIGNTIME[i]; fileList.add(request.getFile("file" + i)); @@ -756,59 +794,32 @@ public class AppHotworkCfdController extends BaseController { pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); hotworkCfdService.edit(pd2); - log.put("ACTION", "验收通过"); - - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes.put("templateCode", "DH_Y08");// 短信模板编码 - mes.put("SMSCode", "SMS_227250920");// 短信模板编码 - mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "type");// 存入短信模板中的参数名称 - params2.put("value", "动火作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - //sendMessageUtil.sendMessages(mes, paramsList); - break; - - case "-8"://审批打回 log.put("ACTION", "验收人打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); // 发短信 PageData mes6 = new PageData(); - mes6.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes6.put("templateCode", "DH_N08");// 短信模板编码 - mes6.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes6.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + mes6.put("RECEIVER_ID", pd2.get("APPLY_USER_ID")); // 收信人userid + mes6.put("templateCode", "DH_N08"); // 短信模板编码 + mes6.put("SMSCode", "SMS_223580715"); // 短信模板编码 + mes6.put("CORPINFO_ID", pd2.get("CORPINFO_ID")); // 企业id // 参数集合 List paramsList6 = new ArrayList(); // 第1个参数 PageData params19 = new PageData(); - params19.put("name", "params1");// 存入短信模板中的参数名称 - params19.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + params19.put("name", "params1"); // 存入短信模板中的参数名称 + params19.put("value", pd2.get("CHECK_NO")); // 存入上面参数名称所传递的值 paramsList6.add(params19); // 第2个参数 PageData params20 = new PageData(); - params20.put("name", "params2");// 存入短信模板中的参数名称 - params20.put("value", "动火作业");// 存入上面参数名称所传递的值 + params20.put("name", "params2"); // 存入短信模板中的参数名称 + params20.put("value", "动火作业"); // 存入上面参数名称所传递的值 paramsList6.add(params20); // 第3个参数 PageData params21 = new PageData(); - params21.put("name", "params3");// 存入短信模板中的参数名称 - params21.put("value", "验收归档");// 存入上面参数名称所传递的值 + params21.put("name", "params3"); // 存入短信模板中的参数名称 + params21.put("value", "验收归档"); // 存入上面参数名称所传递的值 paramsList6.add(params21); - //sendMessageUtil.sendMessages(mes6, paramsList6); + // sendMessageUtil.sendMessages(mes6, paramsList6); break; default: break; @@ -921,12 +932,12 @@ public class AppHotworkCfdController extends BaseController { // 保存审批信息 PageData condition = new PageData(); condition.put("HOTWORK_ID", pd2.get("HOTWORK_ID")); - condition.put("TYPE","1"); - condition.put("APPROVAL_OPINIONS",pd.get("CONTENT")); - condition.put("APPROVAL_SIGNATURE",Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - condition.put("APPROVAL_SIGNATURE_TIME",pd.get("SIGNER_TIME")); - condition.put("APPROVAL_STATUS",pd.getString("APPROVAL_STATUS")); - condition.put("APPROVAL_CONTENT",pd.getString("APPROVAL_CONTENT")); + condition.put("TYPE", "1"); + condition.put("APPROVAL_OPINIONS", pd.get("CONTENT")); + condition.put("APPROVAL_SIGNATURE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + condition.put("APPROVAL_SIGNATURE_TIME", pd.get("SIGNER_TIME")); + condition.put("APPROVAL_STATUS", pd.getString("APPROVAL_STATUS")); + condition.put("APPROVAL_CONTENT", pd.getString("APPROVAL_CONTENT")); hotworkCfdService.approval(condition); } break; @@ -1098,11 +1109,14 @@ public class AppHotworkCfdController extends BaseController { case "7"://班长 if (files != null && files.length > 0) { PageData condition = new PageData(); - condition.put("HOTWORK_ID",pd2.getString("HOTWORK_ID")); - List acceptUsers = hotworkAcceptUserCfdService.listAll(condition); - if (acceptUsers.size() <= 0){ - map.put("code","9999"); - map.put("errorMessage","接受交底人未签字"); + pd.put("HOTWORK_ID", pd2.getString("HOTWORK_ID")); +// condition.put("HOTWORK_ID",pd2.getString("HOTWORK_ID")); + hotworkCfdService.addInfo(pd); + //List acceptUsers = hotworkAcceptUserCfdService.listAll(condition); + List acceptConfessList = (List) pd.get("acceptConfessList"); + if (acceptConfessList == null || acceptConfessList.size() <= 0 || "0".equals(pd.getString("acceptConfessStatus"))) { + map.put("code", "9999"); + map.put("errorMessage", "接受交底人未签字"); return map; } MultipartFile file = files[0]; @@ -1208,17 +1222,50 @@ public class AppHotworkCfdController extends BaseController { } break; case "-1.5": {//确认 - log.put("ACTION", "作业负责人打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); +// log.put("ACTION", "作业负责人打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); +// break; + if (files != null && files.length > 0) { + MultipartFile file = files[0]; + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd2.put("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); + pd2.put("CONFIRM_OTHER_CONTENT", pd.get("APPROVAL_CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + log.put("ACTION", "作业负责人打回"); + } break; } case "-2": {//确认打回 - log.put("ACTION", "作业单位打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); +// log.put("ACTION", "作业单位打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); + if (files != null && files.length > 0) { + MultipartFile file = files[0]; + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + // 保存审批信息 + PageData condition = new PageData(); + condition.put("HOTWORK_ID", pd2.get("HOTWORK_ID")); + condition.put("TYPE", "1"); + condition.put("APPROVAL_OPINIONS", pd.get("CONTENT")); + condition.put("APPROVAL_SIGNATURE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + condition.put("APPROVAL_SIGNATURE_TIME", pd.get("SIGNER_TIME")); + condition.put("APPROVAL_STATUS", pd.getString("APPROVAL_STATUS")); + condition.put("APPROVAL_CONTENT", pd.getString("APPROVAL_CONTENT")); + hotworkCfdService.approval(condition); + } // 发短信 PageData mes = new PageData(); @@ -1248,9 +1295,24 @@ public class AppHotworkCfdController extends BaseController { } case "-4"://单位负责人打回 log.put("ACTION", "单位负责人打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); + if (files != null && files.length > 0) { + MultipartFile file = files[0]; + + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd2.put("LEADER_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("LEADER_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("LEADER_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + log.put("ACTION", "单位负责人打回"); + } +// log.put("ACTION", "单位负责人打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); // 发短信 PageData mes2 = new PageData(); @@ -1278,126 +1340,184 @@ public class AppHotworkCfdController extends BaseController { //sendMessageUtil.sendMessages(mes2, paramsList2); break; case "-5"://审批部门打回 - log.put("ACTION", "安全部门打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); + if (files != null && files.length > 0) { + MultipartFile file = files[0]; - // 发短信 - PageData mes3 = new PageData(); - mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes3.put("templateCode", "DH_N05");// 短信模板编码 - mes3.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList3 = new ArrayList(); - // 第1个参数 - PageData params10 = new PageData(); - params10.put("name", "params1");// 存入短信模板中的参数名称 - params10.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList3.add(params10); - // 第2个参数 - PageData params11 = new PageData(); - params11.put("name", "params2");// 存入短信模板中的参数名称 - params11.put("value", "动火作业");// 存入上面参数名称所传递的值 - paramsList3.add(params11); - // 第3个参数 - PageData params12 = new PageData(); - params12.put("name", "params3");// 存入短信模板中的参数名称 - params12.put("value", "安全部门");// 存入上面参数名称所传递的值 - paramsList3.add(params12); - //sendMessageUtil.sendMessages(mes3, paramsList3); - break; + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd2.put("AUDIT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("AUDIT_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + log.put("ACTION", "安全部门打回"); + +// log.put("ACTION", "安全部门打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); + + // 发短信 + PageData mes3 = new PageData(); + mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes3.put("templateCode", "DH_N05");// 短信模板编码 + mes3.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList3 = new ArrayList(); + // 第1个参数 + PageData params10 = new PageData(); + params10.put("name", "params1");// 存入短信模板中的参数名称 + params10.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList3.add(params10); + // 第2个参数 + PageData params11 = new PageData(); + params11.put("name", "params2");// 存入短信模板中的参数名称 + params11.put("value", "动火作业");// 存入上面参数名称所传递的值 + paramsList3.add(params11); + // 第3个参数 + PageData params12 = new PageData(); + params12.put("name", "params3");// 存入短信模板中的参数名称 + params12.put("value", "安全部门");// 存入上面参数名称所传递的值 + paramsList3.add(params12); + //sendMessageUtil.sendMessages(mes3, paramsList3); + break; + } case "-6"://审批打回 - log.put("ACTION", "审批部门打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); - // 发短信 - PageData mes4 = new PageData(); - mes4.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes4.put("templateCode", "DH_N06");// 短信模板编码 - mes4.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes4.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList4 = new ArrayList(); - // 第1个参数 - PageData params13 = new PageData(); - params13.put("name", "params1");// 存入短信模板中的参数名称 - params13.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList4.add(params13); - // 第2个参数 - PageData params14 = new PageData(); - params14.put("name", "params2");// 存入短信模板中的参数名称 - params14.put("value", "动火作业");// 存入上面参数名称所传递的值 - paramsList4.add(params14); - // 第3个参数 - PageData params15 = new PageData(); - params15.put("name", "params3");// 存入短信模板中的参数名称 - params15.put("value", "审批人审核");// 存入上面参数名称所传递的值 - paramsList4.add(params15); - //sendMessageUtil.sendMessages(mes4, paramsList4); - break; - case "-7"://审批打回 - log.put("ACTION", "动火前验票打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); - // 发短信 - PageData mes5 = new PageData(); - mes5.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes5.put("templateCode", "DH_N07");// 短信模板编码 - mes5.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes5.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList5 = new ArrayList(); - // 第1个参数 - PageData params16 = new PageData(); - params16.put("name", "params1");// 存入短信模板中的参数名称 - params16.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList5.add(params16); - // 第2个参数 - PageData params17 = new PageData(); - params17.put("name", "params2");// 存入短信模板中的参数名称 - params17.put("value", "动火作业");// 存入上面参数名称所传递的值 - paramsList5.add(params17); - // 第3个参数 - PageData params18 = new PageData(); - params18.put("name", "params3");// 存入短信模板中的参数名称 - params18.put("value", "动火前验票");// 存入上面参数名称所传递的值 - paramsList5.add(params18); - //sendMessageUtil.sendMessages(mes5, paramsList5); - break; - case "-8"://审批打回 - log.put("ACTION", "验收人打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - hotworkCfdService.edit(pd2); + if (files != null && files.length > 0) { + MultipartFile file = files[0]; - // 发短信 - PageData mes6 = new PageData(); - mes6.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes6.put("templateCode", "DH_N08");// 短信模板编码 - mes6.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes6.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList6 = new ArrayList(); - // 第1个参数 - PageData params19 = new PageData(); - params19.put("name", "params1");// 存入短信模板中的参数名称 - params19.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList6.add(params19); - // 第2个参数 - PageData params20 = new PageData(); - params20.put("name", "params2");// 存入短信模板中的参数名称 - params20.put("value", "动火作业");// 存入上面参数名称所传递的值 - paramsList6.add(params20); - // 第3个参数 - PageData params21 = new PageData(); - params21.put("name", "params3");// 存入短信模板中的参数名称 - params21.put("value", "验收归档");// 存入上面参数名称所传递的值 - paramsList6.add(params21); - //sendMessageUtil.sendMessages(mes6, paramsList6); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd2.put("APPROVE_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("APPROVE_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + log.put("ACTION", "审批部门打回"); +// log.put("ACTION", "审批部门打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); + // 发短信 + PageData mes4 = new PageData(); + mes4.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes4.put("templateCode", "DH_N06");// 短信模板编码 + mes4.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes4.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList4 = new ArrayList(); + // 第1个参数 + PageData params13 = new PageData(); + params13.put("name", "params1");// 存入短信模板中的参数名称 + params13.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList4.add(params13); + // 第2个参数 + PageData params14 = new PageData(); + params14.put("name", "params2");// 存入短信模板中的参数名称 + params14.put("value", "动火作业");// 存入上面参数名称所传递的值 + paramsList4.add(params14); + // 第3个参数 + PageData params15 = new PageData(); + params15.put("name", "params3");// 存入短信模板中的参数名称 + params15.put("value", "审批人审核");// 存入上面参数名称所传递的值 + paramsList4.add(params15); + //sendMessageUtil.sendMessages(mes4, paramsList4); + break; + } + case "-7"://审批打回 + if (files != null && files.length > 0) { + MultipartFile file = files[0]; + + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd2.put("MONITOR_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("MONITOR_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("MONITOR_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("WORK_START_DATE", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))); + hotworkCfdService.edit(pd2); + log.put("ACTION", "动火前验票打回"); +// log.put("ACTION", "动火前验票打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); + // 发短信 + PageData mes5 = new PageData(); + mes5.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes5.put("templateCode", "DH_N07");// 短信模板编码 + mes5.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes5.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList5 = new ArrayList(); + // 第1个参数 + PageData params16 = new PageData(); + params16.put("name", "params1");// 存入短信模板中的参数名称 + params16.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList5.add(params16); + // 第2个参数 + PageData params17 = new PageData(); + params17.put("name", "params2");// 存入短信模板中的参数名称 + params17.put("value", "动火作业");// 存入上面参数名称所传递的值 + paramsList5.add(params17); + // 第3个参数 + PageData params18 = new PageData(); + params18.put("name", "params3");// 存入短信模板中的参数名称 + params18.put("value", "动火前验票");// 存入上面参数名称所传递的值 + paramsList5.add(params18); + //sendMessageUtil.sendMessages(mes5, paramsList5); + break; + } + case "-8"://审批打回 + if (files != null && files.length > 0) { + MultipartFile file = files[0]; + + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd2.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("ACCEPT_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + log.put("ACTION", "验收人打回"); +// log.put("ACTION", "验收人打回"); +// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); +// pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); +// hotworkCfdService.edit(pd2); + + // 发短信 + PageData mes6 = new PageData(); + mes6.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes6.put("templateCode", "DH_N08");// 短信模板编码 + mes6.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes6.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList6 = new ArrayList(); + // 第1个参数 + PageData params19 = new PageData(); + params19.put("name", "params1");// 存入短信模板中的参数名称 + params19.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList6.add(params19); + // 第2个参数 + PageData params20 = new PageData(); + params20.put("name", "params2");// 存入短信模板中的参数名称 + params20.put("value", "动火作业");// 存入上面参数名称所传递的值 + paramsList6.add(params20); + // 第3个参数 + PageData params21 = new PageData(); + params21.put("name", "params3");// 存入短信模板中的参数名称 + params21.put("value", "验收归档");// 存入上面参数名称所传递的值 + paramsList6.add(params21); + //sendMessageUtil.sendMessages(mes6, paramsList6); + } break; default: break; @@ -1656,16 +1776,52 @@ public class AppHotworkCfdController extends BaseController { PageData condition = new PageData(); condition.put("showInfo",pd.getString("showInfo")); condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID")); - map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); - +// map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); + List measuresList = hotworkCfdService.listAllMeasures(condition); + for (PageData measure : measuresList) { + String order = measure.getString("ORDER"); + String protectiveMeasures = measure.getString("PROTECTIVE_MEASURES"); + if ("2".equals(order)) { + String answer1 = measure.getString("ANSWER1"); + int startIndex = protectiveMeasures.indexOf('('); + int endIndex = protectiveMeasures.indexOf(')'); + if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { + protectiveMeasures = protectiveMeasures.substring(0, endIndex) + answer1 + protectiveMeasures.substring(endIndex); + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } else if ("8".equals(order)) { + String[] answers = {measure.getString("ANSWER1"), measure.getString("ANSWER2"), measure.getString("ANSWER3")}; + for (String answer : answers) { + int index = protectiveMeasures.indexOf("()"); + if (index != -1) { + protectiveMeasures = protectiveMeasures.substring(0, index + 1) + answer + protectiveMeasures.substring(index + 1); + } + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } + } + map.put("measuresList", measuresList); pd = hotworkCfdService.findById(pd); //根据ID读取 + // created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人) hotworkCfdService.addInfo(pd); + //气体检测数据 map.put("gasList", hotworkGasCfdService.listAll(pd)); // imgList是接受交底人签字 - map.put("imgList", hotworkAcceptUserCfdService.findByIds(pd)); - map.put("imgList1", hotworkAcceptUserCfdService.findById(pd)); + List acceptConfessList = (List) pd.get("acceptConfessList"); + List imgList = new ArrayList<>(); + if (acceptConfessList != null) { + for (PageData acceptConfess : acceptConfessList) { + String signerPath = acceptConfess.getString("ACCEPT_CONFESS_USER_SIGNER_PATH"); + if (signerPath != null && !signerPath.isEmpty()) { + imgList.add(signerPath); + } + } + } + map.put("imgList", imgList); +// map.put("imgList", hotworkAcceptUserCfdService.findByIds(pd)); +// map.put("imgList1", hotworkAcceptUserCfdService.findById(pd)); condition.clear(); condition.put("TYPE","115"); condition.put("FOREIGN_KEY",pd.getString("HOTWORK_ID")); @@ -1675,6 +1831,26 @@ public class AppHotworkCfdController extends BaseController { return map; } + /**删除动火操作人图片 + * @param + * @throws Exception + */ + @RequestMapping(value="/delImg") + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "删除动火操作人图片") + public Object delImg() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = imgFilesService.findById(pd); //根据ID读取 + File file = new File(PathUtil.getProjectpath()+pd.getString("FILEPATH")); + file.delete(); + imgFilesService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + /**去修改页面获取数据 * @param * @throws Exception @@ -1846,6 +2022,36 @@ public class AppHotworkCfdController extends BaseController { } } + /** + * 接受交底人审批 + * @param files + * @return + * @throws Exception + */ + @RequestMapping(value = "/editAcceptconfess") + @ResponseBody + public Object editAcceptconfess(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception { + PageData response = new PageData(); + try { + PageData request = this.getPageData(); + PageData condition = new PageData(); + condition.put("HOTWORK_ID",request.get("HOTWORK_ID")); + condition.put("USER_ID",request.get("USER_ID")); + condition.put("CORPINFO_ID",request.get("CORPINFO_ID")); + condition.put("TYPE","3"); + condition.put("APPROVAL_STATUS","1"); + hotworkCfdService.confessApproval(condition, files); + response.put("result", "success"); + return response; + } catch (Exception e) { + e.printStackTrace(); + response.put("result", "error"); + response.put("message", e.getMessage()); + return response; + } + } + + /** * 安全交底人审批 * created by liu jun diff --git a/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java b/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java index a68e9cad..10739baa 100644 --- a/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java @@ -141,13 +141,36 @@ public class HotworkCfdController extends BaseController { PageData condition = new PageData(); condition.put("showInfo",pd.getString("showInfo")); condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID")); - map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); - +// map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); + List measuresList = hotworkCfdService.listAllMeasures(condition); + for (PageData measure : measuresList) { + String order = measure.getString("ORDER"); + String protectiveMeasures = measure.getString("PROTECTIVE_MEASURES"); + if ("2".equals(order)) { + String answer1 = measure.getString("ANSWER1"); + int startIndex = protectiveMeasures.indexOf('('); + int endIndex = protectiveMeasures.indexOf(')'); + if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { + protectiveMeasures = protectiveMeasures.substring(0, endIndex) + answer1 + protectiveMeasures.substring(endIndex); + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } else if ("8".equals(order)) { + String[] answers = {measure.getString("ANSWER1"), measure.getString("ANSWER2"), measure.getString("ANSWER3")}; + for (String answer : answers) { + int index = protectiveMeasures.indexOf("()"); + if (index != -1) { + protectiveMeasures = protectiveMeasures.substring(0, index + 1) + answer + protectiveMeasures.substring(index + 1); + } + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } + } + map.put("measuresList", measuresList); pd = hotworkCfdService.findById(pd); //根据ID读取 // created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人) hotworkCfdService.addInfo(pd); - map.put("measuresList", hotworkCfdService.listAllMeasures(pd)); +// map.put("measuresList", hotworkCfdService.listAllMeasures(pd)); map.put("gasList", hotworkGasCfdService.listAll(pd)); // imgList是接受交底人签字 map.put("imgList", hotworkAcceptUserCfdService.findByIds(pd)); diff --git a/src/main/java/com/zcloud/controller/system/LoginController.java b/src/main/java/com/zcloud/controller/system/LoginController.java index 5c93c4f0..0b3c188e 100644 --- a/src/main/java/com/zcloud/controller/system/LoginController.java +++ b/src/main/java/com/zcloud/controller/system/LoginController.java @@ -187,7 +187,7 @@ public class LoginController extends BaseController { PageData pathData = corpPathService.getCorpPathByCorpId(pd); map.put("baseImgPath",pathData.getString("PIC_PATH")); map.put("USER_IDENTITY",pathData.getString("USER_IDENTITY")); - map.put("BACKENDADDR", pathData.getString("BACK_END_PATH")); + map.put("BACKENDADDR", "http://192.168.0.49:8091/"); } else { PageData pathData = corpPathService.getCorpPathByPersonInfo(pd); map.put("baseImgPath",pathData.getString("PIC_PATH")); diff --git a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java index aad1eeb9..e13a816d 100644 --- a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java +++ b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java @@ -65,13 +65,14 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/approvePlus") @ResponseBody - public Object approvePlus(@RequestParam(value="chengNuoShu",required=false) MultipartFile[] chengNuoShu) throws Exception { - PageData request = this.getPageData(); - xgfUserService.approvePlus(request,chengNuoShu); + public Object approvePlus(@RequestParam(value = "chengNuoShu", required = false) MultipartFile[] chengNuoShu) throws Exception { PageData response = new PageData(); response.put("result", "success"); + PageData request = this.getPageData(); + xgfUserService.approvePlus(request, chengNuoShu); response.put("data", request); return response; + } /** @@ -79,18 +80,26 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/approveMax") @ResponseBody - public Object approveMax(@RequestParam(value="chengNuoShu",required=false) MultipartFile[] chengNuoShu) throws Exception { + public Object approveMax(@RequestParam(value = "chengNuoShu", required = false) MultipartFile[] chengNuoShu) throws Exception { PageData request = this.getPageData(); - xgfUserService.approveMax(request,chengNuoShu); PageData response = new PageData(); response.put("result", "success"); + response.put("code","0"); response.put("data", request); + try { + xgfUserService.approveMax(request, chengNuoShu); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("errorMessage", e.getMessage()); + return response; + } return response; } @RequestMapping(value = "/regulatoryUserList") @ResponseBody - public Object regulatoryUserList() throws Exception{ + public Object regulatoryUserList() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("result", "success"); @@ -132,7 +141,7 @@ public class XgfUserController extends BaseController { @RequestMapping(value = "/getAppointApproveList") @ResponseBody - public Object getAppointApproveList(Page page) throws Exception{ + public Object getAppointApproveList(Page page) throws Exception { PageData request = this.getPageData(); request.put("USER_ID", Jurisdiction.getUSER_ID()); page.setPd(request); @@ -145,11 +154,11 @@ public class XgfUserController extends BaseController { @RequestMapping(value = "/getWorkTask") @ResponseBody - public Object getWorkTask() throws Exception{ + public Object getWorkTask() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("result", "success"); - response.put("list",xgfUserService.getWorkTask(request)); + response.put("list", xgfUserService.getWorkTask(request)); return response; } @@ -159,7 +168,7 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/appointApprove") @ResponseBody - public Object appointApprove() throws Exception{ + public Object appointApprove() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("result", "success"); @@ -172,7 +181,7 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/getApproveInfo") @ResponseBody - public Object getApproveInfo() throws Exception{ + public Object getApproveInfo() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("list", xgfUserService.getApproveInfo(request)); diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java index 8c529cba..7b0f3ae3 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java @@ -54,70 +54,79 @@ public class GuFenCharge extends NodeSwitchComponent { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); - PageData userInfo = xgfUserDetailsMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData userInfo = xgfUserDetailsMapper.findById(condition); - // 如果不是当前流程,进入下一流程判断 - if (!"0".equals(info.getIterator())) { - // 根据是否有委托书判断是否走委托流程 - if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))) { + // 如果不是当前流程,进入下一流程判断 + if (!"0".equals(info.getIterator())) { + // 根据是否有委托书判断是否走委托流程 + if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))) { + return "GuFenWeiTuo"; + } + return "GuFenSupervise"; + } + + flows.put("APPOINT_ZERO_CORP_ID", "1"); + flows.put("APPOINT_ZERO_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); + flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); + flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + return ""; + } else { + xgfFlowsMapper.edit(flows); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 + if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + } + // created by liu jun 2024-02-04 如果有委托书则保存委托书 + if (StringUtils.isNotBlank(info.getATTORNEY())) { + userInfo.put("ATTORNEY", info.getAPPOINT_ANNEX()); + xgfUserDetailsMapper.edit(userInfo); + } + xgfUserMapper.edit(entity); + // 将指针清空 + info.setIterator(""); + } + + if (StringUtils.isNotBlank(info.getATTORNEY())) { + xgfUserService.saveLog(info, "1", "0"); return "GuFenWeiTuo"; + } else { + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); } return "GuFenSupervise"; - } - - flows.put("APPOINT_ZERO_CORP_ID", "1"); - flows.put("APPOINT_ZERO_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); - flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); - flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows, info); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); return ""; - } else { - xgfFlowsMapper.edit(flows); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 - if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - } - // created by liu jun 2024-02-04 如果有委托书则保存委托书 - if (StringUtils.isNotBlank(info.getATTORNEY())) { - userInfo.put("ATTORNEY", info.getAPPOINT_ANNEX()); - xgfUserDetailsMapper.edit(userInfo); - } - xgfUserMapper.edit(entity); - // 将指针清空 - info.setIterator(""); } - - if (StringUtils.isNotBlank(info.getATTORNEY())) { - xgfUserService.saveLog(info, "1", "0"); - return "GuFenWeiTuo"; - }else { - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } - return "GuFenSupervise"; } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "0".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java index 43ed5672..0b5f20f8 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java @@ -50,49 +50,55 @@ public class GuFenSupervise extends NodeComponent { @Override public void process() throws Exception { System.out.println(getName() + "节点"); - - XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - if (flows == null || flows.size() == 0) { - throw new RuntimeException("系统异常"); - } + if (flows == null || flows.size() == 0) { + throw new RuntimeException("系统异常"); + } - flows.put("APPOINT_ONE_CORP_ID", "1"); - flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); + flows.put("APPOINT_ONE_CORP_ID", "1"); + flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("STATUS", "2"); - xgfUserMapper.edit(entity); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("STATUS", "2"); + xgfUserMapper.edit(entity); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + info.setErrorMsg(e.getMessage()); + e.printStackTrace(); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java index 28a0fd93..2633f7d2 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java @@ -53,69 +53,72 @@ public class GuFenWeiTuoCharge extends NodeComponent { @Override public void process() throws Exception { - System.out.println(getName() + "节点"); - - XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("1"); - flows.put("APPOINT_ONE_CORP_TYPE", "0"); - flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 1); - xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"1".equals(info.getIterator())) { - return; - } + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("1"); + flows.put("APPOINT_ONE_CORP_TYPE", "0"); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 1); + xgfFlowsMapper.edit(flows); + return; + } + // 如果不是当前流程,进入下一流程判断 + if (!"1".equals(info.getIterator())) { + return; + } - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - xgfUserMapper.edit(entity); - // 清空指针 - info.setIterator(""); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); + + flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + xgfUserMapper.edit(entity); + // 清空指针 + info.setIterator(""); + } + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } - - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "1".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java index 4c399549..23bbaef2 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java @@ -56,46 +56,54 @@ public class GuFenWeiTuoSupervise extends NodeComponent { public void process() throws Exception { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); - flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); - flows.put("APPOINT_TWO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("STATUS", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - xgfUserMapper.edit(entity); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); - info.setIterator(""); + flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); + flows.put("APPOINT_TWO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("STATUS", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + xgfUserMapper.edit(entity); + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + info.setIterator(""); + } + } catch (Exception e) { + info.setErrorMsg(e.getMessage()); + e.printStackTrace(); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "2".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java index 70c82eb1..1b88bcae 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java @@ -52,72 +52,81 @@ public class JiTuanCharge extends NodeSwitchComponent { @Override @SuppressWarnings("all") public String processSwitch() throws Exception { - System.out.println(getName()+ "节点"); + System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_DETAILS_ID",flows.getString("FLOWS_ID")); - PageData userInfo = xgfUserDetailsMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData userInfo = xgfUserDetailsMapper.findById(condition); - // 如果不是当前流程,进入下一流程判断 - if (!"1".equals(info.getIterator())) { - if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))){ + // 如果不是当前流程,进入下一流程判断 + if (!"1".equals(info.getIterator())) { + if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))) { + return "WeiTuo"; + } + return "JiTuanSupervise"; + } + + flows.put("APPOINT_ONE_CORP_ID", "1"); + flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + return ""; + } else { + xgfFlowsMapper.edit(flows); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 + if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + } + // created by liu jun 2024-02-04 如果有委托书则保存委托书 + if (StringUtils.isNotBlank(info.getATTORNEY())) { + userInfo.put("ATTORNEY", info.getATTORNEY()); + xgfUserDetailsMapper.edit(userInfo); + } + xgfUserMapper.edit(entity); + // 将指针清空 + info.setIterator(""); + } + + // 保存操作记录 + if (StringUtils.isNotBlank(info.getATTORNEY())) { + xgfUserService.saveLog(info, "1", "0"); return "WeiTuo"; + } else { + xgfUserService.saveLog(info, info.getSTATUS(), "0"); } return "JiTuanSupervise"; - } - - flows.put("APPOINT_ONE_CORP_ID", "1"); - flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); return ""; - } else { - xgfFlowsMapper.edit(flows); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 - if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - } - // created by liu jun 2024-02-04 如果有委托书则保存委托书 - if (StringUtils.isNotBlank(info.getATTORNEY())) { - userInfo.put("ATTORNEY", info.getATTORNEY()); - xgfUserDetailsMapper.edit(userInfo); - } - xgfUserMapper.edit(entity); - // 将指针清空 - info.setIterator(""); } - - // 保存操作记录 - if (StringUtils.isNotBlank(info.getATTORNEY())){ - xgfUserService.saveLog(info, "1", "0"); - return "WeiTuo"; - }else { - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } - return "JiTuanSupervise"; } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "1".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java index 03d76e6d..334b5550 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java @@ -54,45 +54,53 @@ public class JiTuanSupervise extends NodeComponent { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - if (flows == null || flows.size() == 0) { - throw new RuntimeException("系统异常"); - } - flows.put("APPOINT_TWO_CORP_ID", "1"); - flows.put("APPOINT_TWO_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); - flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); - flows.put("APPOINT_TWO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); + if (flows == null || flows.size() == 0) { + throw new RuntimeException("系统异常"); + } + flows.put("APPOINT_TWO_CORP_ID", "1"); + flows.put("APPOINT_TWO_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); + flows.put("APPOINT_TWO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("STATUS", "2"); - xgfUserMapper.edit(entity); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("STATUS", "2"); + xgfUserMapper.edit(entity); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java index 7adb8cc1..1c716945 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java @@ -55,49 +55,55 @@ public class JiTuanWeiTuoCharge extends NodeComponent { @Override public void process() throws Exception { System.out.println(getName() + "节点"); - XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); - flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); - flows.put("APPOINT_TWO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - xgfUserMapper.edit(entity); - // 清空指针 - info.setIterator(""); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); + + flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); + flows.put("APPOINT_TWO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + xgfUserMapper.edit(entity); + // 清空指针 + info.setIterator(""); + } + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } - - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "2".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java index 783cf372..a91befe9 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java @@ -55,39 +55,44 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_THREE_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_THREE_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_THREE_TIME", DateUtil.getTime()); - flows.put("APPOINT_THREE_STATUS", info.getSTATUS()); - flows.put("APPOINT_THREE_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("STATUS", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - xgfUserMapper.edit(entity); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + flows.put("APPOINT_THREE_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_THREE_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_THREE_TIME", DateUtil.getTime()); + flows.put("APPOINT_THREE_STATUS", info.getSTATUS()); + flows.put("APPOINT_THREE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("STATUS", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + xgfUserMapper.edit(entity); + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } } @@ -95,6 +100,9 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "3".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java index 2d9bfabb..4617bbd3 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java @@ -57,47 +57,55 @@ public class YiBanCharge extends NodeComponent { public void process() throws Exception { System.out.println("YiBanCharge节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + try { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - if (flows == null || flows.size() == 0) { - throw new RuntimeException("系统异常"); - } - - flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); - flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); - flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - } else { - xgfFlowsMapper.edit(flows); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData user = xgfUserMapper.findById(condition); - user.put("CHECK_STEP", 1); - user.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - // created by liu jun 2024-02-26 如果有委托书则保存委托书 - if (StringUtils.isNotBlank(info.getAPPOINT_ANNEX())) { - condition.clear(); - condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); - PageData userInfo = xgfUserDetailsMapper.findById(condition); - userInfo.put("COMMITMENT_LETTER", info.getAPPOINT_ANNEX()); - xgfUserDetailsMapper.edit(userInfo); + if (flows == null || flows.size() == 0) { + throw new RuntimeException("系统异常"); } - xgfUserMapper.edit(user); - // 将指针清空 - info.setIterator(""); + + flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); + flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); + flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); + flows.put("OPINION",info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows,info); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData user = xgfUserMapper.findById(condition); + user.put("CHECK_STEP", 1); + user.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + // created by liu jun 2024-02-26 如果有委托书则保存委托书 + if (StringUtils.isNotBlank(info.getAPPOINT_ANNEX())) { + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData userInfo = xgfUserDetailsMapper.findById(condition); + userInfo.put("COMMITMENT_LETTER", info.getAPPOINT_ANNEX()); + xgfUserDetailsMapper.edit(userInfo); + } + xgfUserMapper.edit(user); + // 将指针清空 + info.setIterator(""); + } + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + }catch (Exception e){ + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())){ + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "0".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java index 3f02448a..f5d2f5eb 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java @@ -57,76 +57,83 @@ public class YiBanSupervise extends NodeComponent { public void process() throws Exception { System.out.println(getName()); XgfFlowDto info = this.getRequestData(); + try { + PageData condition = new PageData(); - PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("1"); + flows.put("APPOINT_ONE_CORP_TYPE", "0"); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 1); + xgfFlowsMapper.edit(flows); + return; + } + // 如果不是当前流程,进入下一流程判断 + if (!"1".equals(info.getIterator())) { + return; + } - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("1"); - flows.put("APPOINT_ONE_CORP_TYPE", "0"); - flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 1); - xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"1".equals(info.getIterator())) { - return; - } - - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("1"); - flows.put("APPOINT_ONE_CORP_TYPE", "0"); - flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 1); - xgfFlowsMapper.edit(flows); - return; - } - - flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("STATUS", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - xgfUserMapper.edit(entity); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("1"); + flows.put("APPOINT_ONE_CORP_TYPE", "0"); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 1); + xgfFlowsMapper.edit(flows); + return; + } + + flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("STATUS", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + xgfUserMapper.edit(entity); + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())){ + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java b/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java index f27de069..03585717 100644 --- a/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java +++ b/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java @@ -49,4 +49,5 @@ public class XgfFlowDto { // 打回节点游标 private String BACK_STEP; + private String errorMsg; } diff --git a/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java b/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java index 0536d207..2d1fdc87 100644 --- a/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/highriskwork/HotworkCfdMapper.java @@ -85,5 +85,8 @@ public interface HotworkCfdMapper { PageData countCheck(PageData pd); PageData getCode(PageData pd); + + List datalistPageHistory(Page page); + } diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java index a5940710..3c9f940a 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -2,6 +2,7 @@ package com.zcloud.service.highriskwork.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.flow.xgf.GuFen.GuFenCharge; import com.zcloud.mapper.datasource.highriskwork.BusHotworkCfdExamineMapper; import com.zcloud.mapper.datasource.highriskwork.HotworkAcceptUserCfdMapper; import com.zcloud.mapper.datasource.highriskwork.HotworkCfdMapper; @@ -65,6 +66,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { @Transactional public void saveConfess(PageData info) throws Exception{ List list = Warden.getList(info.getString("confessList")); + List listAccept = Warden.getList(info.getString("acceptconfessList")); String flowsId = Warden.get32UUID(); String time = DateUtil.getTime(); PageData condition = new PageData(); @@ -80,7 +82,27 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { entity.put("DEPARTMENT_NAME", x.get("CONFESS_DEPARTMENT_NAME")); this.getCorpInfo(entity); entity.put("TYPE", "0"); - entity.put("TYPE_NAME", "动火交底人"); + entity.put("TYPE_NAME", "安全交底人"); + entity.put("APPROVAL_OPINIONS",info.getString("CONFESS_DEPARTMENT_OPINIONS")); + entity.put("APPROVAL_STATUS", "0"); + entity.put("STATUS", "0"); + entity.put("CREATE_TIME", time); + entity.put("VALID_FLAG", "1"); + entity.put("IS_DELETE", "0"); + busHotworkCfdExamineMapper.save(entity); + } + for (PageData x : listAccept) { + PageData entity = new PageData(); + entity.put("HOTWORK_EXAMINE_ID", Warden.get32UUID()); + entity.put("HOTWORK_ID", info.getString("HOTWORK_ID")); + entity.put("FLOW_ID", flowsId);// 流程id + entity.put("USER_ID", x.get("ACCEPT_CONFESS_USER_ID")); + entity.put("USER_NAME", x.get("ACCEPT_CONFESS_USER_NAME")); + entity.put("DEPARTMENT_ID", x.get("ACCEPT_CONFESS_DEPARTMENT_ID")); + entity.put("DEPARTMENT_NAME", x.get("ACCEPT_CONFESS_DEPARTMENT_NAME")); + this.getCorpInfo(entity); + entity.put("TYPE", "3"); + entity.put("TYPE_NAME", "接受交底人"); entity.put("APPROVAL_OPINIONS",info.getString("CONFESS_DEPARTMENT_OPINIONS")); entity.put("APPROVAL_STATUS", "0"); entity.put("STATUS", "0"); @@ -228,16 +250,32 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { conditon.put("VALID_FLAG", "1"); conditon.put("TYPE", request.getString("TYPE")); conditon.put("USER_ID", request.get("USER_ID")); + String userId = Jurisdiction.getUSER_ID(); List approvalInfos = busHotworkCfdExamineMapper.findByCondition(conditon); if(approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息,请联系管理员"); - if (approvalInfos.size() > 1) throw new RuntimeException("审批信息异常,请联系管理员"); +// if (approvalInfos.size() > 1) throw new RuntimeException("审批信息异常,请联系管理员"); PageData entity = approvalInfos.get(0); + String newFilePath = Warden.saveFile(files, request.getString("CORPINFO_ID")); + + // 判断条件 + if (entity.getString("APPROVAL_SIGNATURE") != null && !entity.getString("APPROVAL_SIGNATURE").isEmpty() + && userId.equals(entity.getString("USER_ID")) + && "3".equals(entity.getString("TYPE"))) { + + // 拼接新的文件路径 + String existingFilePaths = entity.getString("APPROVAL_SIGNATURE"); + entity.put("APPROVAL_SIGNATURE", existingFilePaths + ";" + newFilePath); + } else { + // 走原有逻辑 + entity.put("APPROVAL_SIGNATURE", newFilePath); + } entity.put("APPROVAL_STATUS", request.getString("APPROVAL_STATUS")); - entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID"))); +// entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID"))); +// List filePaths = Warden.saveFiles(files, request.getString("CORPINFO_ID")); +// entity.put("APPROVAL_SIGNATURE", String.join(";", filePaths)); entity.put("APPROVAL_SIGNATURE_TIME", DateUtil.getTime()); entity.put("APPROVAL_CONTENT",request.getString("APPROVAL_CONTENT")); busHotworkCfdExamineMapper.edit(entity); - } @Override @@ -309,13 +347,32 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { * @param page * @throws Exception */ - public List list(Page page)throws Exception{ + public List list(Page page) throws Exception { List list = hotworkCfdMapper.datalistPage(page); - // created by liu jun 2024/02/03 description: 拼接动火交底人、项目主管部门、安全项检查人 - for(PageData dto: list){ + String applyStatus = page.getPd().getString("APPLY_STATUS"); + + for (PageData dto : list) { + + page.getPd().put("HOTWORK_ID", dto.getString("HOTWORK_ID")); + + if ("1".equals(applyStatus) || "1.5".equals(applyStatus) || "2".equals(applyStatus)) { + List historyList = hotworkCfdMapper.datalistPageHistory(page); + if (historyList != null && !historyList.isEmpty()) { + for (PageData historyPd : historyList) { + if (historyPd.getString("HOTWORK_ID").equals(dto.getString("HOTWORK_ID"))) { + dto.put("historyPd", historyPd); + break; + } + } + } + } + this.addInfo(dto); } - return list; + + return list.stream() + .sorted((o1, o2) -> o2.getString("CREATTIME").compareTo(o1.getString("CREATTIME"))) + .collect(Collectors.toList()); } public List jhlist(Page page)throws Exception{ return hotworkCfdMapper.jhdatalistPage(page); @@ -413,6 +470,9 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { condition.put("isValid","1"); //动火交底人需处理数 info.put("confessNum", busHotworkCfdExamineMapper.findByCondition(condition).size()); + //接受交底人需处理数 + condition.put("TYPE", "3"); + info.put("acceptConfessNum", busHotworkCfdExamineMapper.findByCondition(condition).size()); condition.put("TYPE", "1"); // 项目主管部门需处理数 List _belongingList = busHotworkCfdExamineMapper.findByCondition(condition); @@ -431,6 +491,24 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { condition.put("TYPE", "2"); // 安全项检查人需处理数 info.put("safetyNum", busHotworkCfdExamineMapper.findByCondition(condition).size()); + int sumCount = 0; + sumCount += Integer.parseInt(info.getString("COUNTBACK", "0")); + sumCount += Integer.parseInt(info.getString("COUNTLEADER", "0")); + sumCount += Integer.parseInt(info.getString("COUNTMONITOR", "0")); + sumCount += Integer.parseInt(info.getString("COUNTACCEPT", "0")); + sumCount += Integer.parseInt(info.getString("COUNTAPPROVE", "0")); + sumCount += Integer.parseInt(info.getString("COUNTANALYZE", "0")); + sumCount += Integer.parseInt(info.getString("safetyNum", "0")); + sumCount += Integer.parseInt(info.getString("belongingNum", "0")); + sumCount += Integer.parseInt(info.getString("COUNTGUARDIAN", "0")); + sumCount += Integer.parseInt(info.getString("confessNum", "0")); +// sumCount += Integer.parseInt(info.getString("COUNTACCEPTCONFESS", "0")); + sumCount += Integer.parseInt(info.getString("COUNTCONFIRM", "0")); + sumCount += Integer.parseInt(info.getString("COUNTCONFESS", "0")); + sumCount += Integer.parseInt(info.getString("COUNTAUDIT", "0")); + sumCount += Integer.parseInt(info.getString("acceptConfessNum", "0")); + + info.put("SUMCOUNT", sumCount); // 气体分析人需处理数 return info; } @@ -457,6 +535,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { x.put("CONFESS_USER_NAME", x.get("USER_NAME")); x.put("CONFESS_DEPARTMENT_ID", x.get("DEPARTMENT_ID")); x.put("CONFESS_DEPARTMENT_NAME", x.get("DEPARTMENT_NAME")); + x.put("CONFESS_USER_SIGNER_PATH", x.get("APPROVAL_SIGNATURE")); } pd.put("confessUserNames", confess.stream().map(x -> x.getString("USER_NAME")).collect(Collectors.joining(","))); pd.put("confessList", confess); @@ -465,7 +544,33 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { }else { pd.put("confessStatus", "1"); } - + //接受交底人 + List acceptConfess = approvalInfos.stream() + .filter(x -> "3".equals(x.getString("TYPE"))) + .collect(Collectors.toList()); + for (PageData x : acceptConfess) { + x.put("ACCEPT_CONFESS_USER_ID", x.get("USER_ID")); + x.put("ACCEPT_CONFESS_USER_NAME", x.get("USER_NAME")); + x.put("ACCEPT_CONFESS_DEPARTMENT_ID", x.get("DEPARTMENT_ID")); + x.put("ACCEPT_CONFESS_DEPARTMENT_NAME", x.get("DEPARTMENT_NAME")); + x.put("ACCEPT_CONFESS_USER_SIGNER_PATH", x.get("APPROVAL_SIGNATURE")); + } + pd.put("acceptConfessUserNames", acceptConfess.stream().map(x -> x.getString("USER_NAME")).collect(Collectors.joining(","))); + pd.put("acceptConfessList", acceptConfess); + if (acceptConfess.stream().anyMatch(x -> "0".equals(x.getString("APPROVAL_STATUS")))){ + pd.put("acceptConfessStatus", "0"); + }else { + pd.put("acceptConfessStatus", "1"); + } + //安全措施数据 + List safetyList = approvalInfos.stream() + .filter(x -> "2".equals(x.getString("TYPE"))) + .collect(Collectors.toList()); + for (PageData x : safetyList) { + x.put("APPROVAL_STATUS", x.get("APPROVAL_STATUS")); + x.put("APPROVAL_SIGNATURE", x.get("APPROVAL_SIGNATURE")); + } + pd.put("safetyList", safetyList); // 项目责任负责人 PageData belong = approvalInfos.stream().filter(x -> "1".equals(x.getString("TYPE"))).findFirst().orElse(null); pd.put("BELONGING_USER_ID", belong.getString("USER_ID")); diff --git a/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java b/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java index 4706a68c..66a265a2 100644 --- a/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java @@ -62,7 +62,31 @@ public class MapEightCfdServiceImpl implements MapEightCfdService { PageData condition = new PageData(); condition.put("showInfo",pd.getString("showInfo")); condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID")); - map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); +// map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); + List measuresList = hotworkCfdService.listAllMeasures(condition); + for (PageData measure : measuresList) { + String order = measure.getString("ORDER"); + String protectiveMeasures = measure.getString("PROTECTIVE_MEASURES"); + if ("2".equals(order)) { + String answer1 = measure.getString("ANSWER1"); + int startIndex = protectiveMeasures.indexOf('('); + int endIndex = protectiveMeasures.indexOf(')'); + if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { + protectiveMeasures = protectiveMeasures.substring(0, endIndex) + answer1 + protectiveMeasures.substring(endIndex); + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } else if ("8".equals(order)) { + String[] answers = {measure.getString("ANSWER1"), measure.getString("ANSWER2"), measure.getString("ANSWER3")}; + for (String answer : answers) { + int index = protectiveMeasures.indexOf("()"); + if (index != -1) { + protectiveMeasures = protectiveMeasures.substring(0, index + 1) + answer + protectiveMeasures.substring(index + 1); + } + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } + } + map.put("measuresList", measuresList); map.put("gasList", hotworkGasCfdService.listAll(pd)); map.put("imgList", hotworkacceptuserCfdService.findByIds(pd)); map.put("imgList1", hotworkacceptuserCfdService.findById(pd)); diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java index f2408266..9ba052a7 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -19,11 +19,9 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.math.BigDecimal; import java.net.PasswordAuthentication; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Service @@ -383,7 +381,9 @@ public class XgfUserServiceImpl implements XgfUserService { for (PageData x : list) { condition.clear(); condition.put("FLOW_ID", x.getString("FLOW_ID")); - x.put("flow", flowDetailMapper.getList(condition)); + List flow = flowDetailMapper.getList(condition); + flow = flow.stream().sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT"))))).collect(Collectors.toList()); + x.put("flow",flow); } return list; } @@ -992,27 +992,117 @@ public class XgfUserServiceImpl implements XgfUserService { @Override public void repulse(PageData flows, XgfFlowDto info) throws Exception { - PageData condition = new PageData(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("STATUS", "0"); - entity.put("VALID_FLAG", "0"); - entity.put("CHECK_STATUS", "-2"); - PageData key = new PageData(); - key.putAll(entity); - key.put("USER_ID", condition.get("XGF_USER_ID")); - key.put("STATUS", "1"); - key.put("OPINION", flows.get("OPINION")); - Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", key); - if (result == null || !"succeed".equals(result.get("result"))) { - throw new RuntimeException("请求失败"); + // add by liu jun 相关方可指定打回至指定节点 -1 为默认打回至相关方端 + if ("-1".equals(info.getBACK_STEP())){ + PageData condition = new PageData(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("STATUS", "0"); + entity.put("VALID_FLAG", "0"); + entity.put("CHECK_STATUS", "-2"); + PageData key = new PageData(); + key.putAll(entity); + key.put("USER_ID", condition.get("XGF_USER_ID")); + key.put("STATUS", "1"); + key.put("OPINION", flows.get("OPINION")); + Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", key); + if (result == null || !"succeed".equals(result.get("result"))) { + throw new RuntimeException("请求失败"); + } + xgfUserMapper.edit(entity); + this.clearInfo(flows); + xgfFlowsMapper.edit(flows); + } else { + // 1、判断不能自己打回到自己 + PageData condition = new PageData(); + condition.put("FLOWS_ID",flows.getString("FLOWS_ID")); + PageData flowEntity = xgfFlowsMapper.findById(condition); + if (flowEntity != null && flowEntity.size() > 0 && (flowEntity.get("FLOWS_STEP").toString()).equals(info.getBACK_STEP())){ + info.setErrorMsg("不能自己打回到自己"); + } + flowEntity.put("FLOWS_STEP", info.getBACK_STEP()); + xgfFlowsMapper.edit(flowEntity); + // 清理数据 + clearsInfo(flowEntity,info.getBACK_STEP()); + xgfFlowsMapper.edit(flowEntity); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STEP",info.getBACK_STEP()); + xgfUserMapper.edit(entity); + + // 判断要不要清理委托书 + if (clearWeiTuo(flowEntity, info.getBACK_STEP())) { + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData infoEntity = xgfUserDetailsMapper.findById(condition); + infoEntity.put("ATTORNEY", null); + xgfUserDetailsMapper.edit(infoEntity); + } + } + } + private boolean clearWeiTuo(PageData flowEntity,String backStep) throws Exception{ + if ("1".equals(flowEntity.getString("FLOWS_TYPE"))){ + return 1 <= Integer.parseInt(backStep); + } + if ("2".equals(flowEntity.getString("FLOWS_TYPE"))){ + return 0 <= Integer.parseInt(backStep); + } + return false; + } + private void clearsInfo(PageData entity,String step) throws Exception { + if ("0".equals(step)){ + entity.put("APPOINT_ONE_USER_ID", ""); + entity.put("APPOINT_TWO_USER_ID", ""); + entity.put("APPOINT_THREE_USER_ID", ""); + entity.put("APPOINT_FOUR_USER_ID", ""); + entity.put("APPOINT_FIVE_USER_ID", ""); + entity.put("APPOINT_SIX_USER_ID", ""); + entity.put("APPOINT_SEVEN_USER_ID", ""); + } + + if ("1".equals(step)){ + entity.put("APPOINT_TWO_USER_ID", ""); + entity.put("APPOINT_THREE_USER_ID", ""); + entity.put("APPOINT_FOUR_USER_ID", ""); + entity.put("APPOINT_FIVE_USER_ID", ""); + entity.put("APPOINT_SIX_USER_ID", ""); + entity.put("APPOINT_SEVEN_USER_ID", ""); + } + + if ("2".equals(step)){ + entity.put("APPOINT_THREE_USER_ID", ""); + entity.put("APPOINT_FOUR_USER_ID", ""); + entity.put("APPOINT_FIVE_USER_ID", ""); + entity.put("APPOINT_SIX_USER_ID", ""); + entity.put("APPOINT_SEVEN_USER_ID", ""); + } + + if ("3".equals(step)){ + entity.put("APPOINT_FOUR_USER_ID", ""); + entity.put("APPOINT_FIVE_USER_ID", ""); + entity.put("APPOINT_SIX_USER_ID", ""); + entity.put("APPOINT_SEVEN_USER_ID", ""); + } + + if ("4".equals(step)){ + entity.put("APPOINT_FIVE_USER_ID", ""); + entity.put("APPOINT_SIX_USER_ID", ""); + entity.put("APPOINT_SEVEN_USER_ID", ""); + } + + if ("5".equals(step)){ + entity.put("APPOINT_SIX_USER_ID", ""); + entity.put("APPOINT_SEVEN_USER_ID", ""); + } + + if ("6".equals(step)){ + entity.put("APPOINT_SEVEN_USER_ID", ""); } - xgfUserMapper.edit(entity); - this.clearInfo(flows); - xgfFlowsMapper.edit(flows); } @Override + @Transactional public void approveMax(PageData request, MultipartFile[] chengNuoShu) throws Exception { if (chengNuoShu != null && chengNuoShu.length > 0) { request.put("APPOINT_ANNEX", Warden.saveFile(Warden.createZip(chengNuoShu), Jurisdiction.getCORPINFO_ID())); @@ -1057,16 +1147,16 @@ public class XgfUserServiceImpl implements XgfUserService { if (request.get("APPOINT_ANNEX") != null) { info.setAPPOINT_ANNEX(request.getString("APPOINT_ANNEX")); } + info.setBACK_STEP(request.getString("BACK_STEP")); // 进行数据审核 LiteflowResponse response = flowExecutor.execute2Resp("chain1", info); - if (!response.isSuccess()) { + if (response.isSuccess()) { + System.out.println("流程信息:" + response.getExecuteStepStrWithTime()); + } else { Exception e = response.getCause(); e.printStackTrace(); - System.out.println(response.getMessage()); - throw new RuntimeException("系统异常"); - } else { - System.out.println("流程信息:" + response.getExecuteStepStrWithTime()); + throw new RuntimeException(e.getMessage()); } } diff --git a/src/main/java/com/zcloud/util/Warden.java b/src/main/java/com/zcloud/util/Warden.java index 3de3e253..5eb5629a 100644 --- a/src/main/java/com/zcloud/util/Warden.java +++ b/src/main/java/com/zcloud/util/Warden.java @@ -381,6 +381,19 @@ public class Warden { return saveFile(files, CORPINFO_ID); } + //保存多图片 + public static List saveFiles(MultipartFile[] files, String number) throws Exception { + if (files.length == 0) throw new RuntimeException("文件为空"); + List filePaths = new ArrayList<>(); + for (MultipartFile file : files) { + String ffile = DateUtil.getDays(); + String fileName = get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + number + "/" + ffile); + filePaths.add(Const.FILEPATHFILE + number + "/" + ffile + "/" + fileName); + } + return filePaths; + } + /** * 压缩文件 */ @@ -479,5 +492,6 @@ public class Warden { } throw new IOException("压缩文件失败"); } + } diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 04090df3..97fd2b76 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -62,6 +62,12 @@ spring.main.banner-mode=off #qa-regulatory-gwj.api.url=http://192.168.0.79:8008 preventionxgf.api.url=https://qgxgf.qhdsafety.com/qa-prevention-xgf/ qa-regulatory-gwj.api.url=https://qgjg.qhdsafety.com/qa-regulatory-gwj/ + +baseimgpath =http://192.168.192.201:8991/file/ + +heBeiQinAnFile=https://file.zcloudchina.com/YTHFile + +dw.url=http://192.168.192.201:8888/qa-dingWei-gwj/ #????? smb.host=39.101.130.96 smb.port=22 @@ -74,7 +80,7 @@ rocketmq.consumer.group2=edu-admin-edit rocketmq.consumer.group1=edu-admin-add #rocketmq.name-server=10.0.140.141:9876 #rocketmq.name-server=192.168.0.70:9876 -rocketmq.name-server=192.168.0.2:9876 +rocketmq.name-server=39.100.115.58:8899 rocketmq.producer.group=libmiddle rocketmq.producer.send-message-timeout=3000 rocketmq.producer.compress-message-body-threshold=4096 @@ -88,6 +94,8 @@ mq.topic.info=info mq.topic.eightWork=eightWork mq.group.info=scheduled_tasks mq.group.eightWork=scheduled_tasks_eightWork +mq.gwj.data.topic=czks_docking +mq.gwj.file.topic=czks_dockingPicture corp.default.pic-path=https://qgqy.qhdsafety.com/ diff --git a/src/main/resources/application-master.properties b/src/main/resources/application-master.properties index c42d42de..72e91e17 100644 --- a/src/main/resources/application-master.properties +++ b/src/main/resources/application-master.properties @@ -1,12 +1,12 @@ # ?????? datasource.no1.driver-class-name: com.mysql.cj.jdbc.Driver -datasource.no1.url=jdbc:mysql://192.168.192.202:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 +datasource.no1.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 datasource.no1.username=root -datasource.no1.password=gwjsjkzcloud888888 +datasource.no1.password=Mysql@zcloud88888 datasource.no2.driver-class-name: com.mysql.cj.jdbc.Driver -datasource.no2.url=jdbc:mysql://192.168.192.202:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 +datasource.no2.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 datasource.no2.username=root -datasource.no2.password=gwjsjkzcloud888888 +datasource.no2.password=Mysql@zcloud88888 #druid连接池 spring.datasource.type: com.alibaba.druid.pool.DruidDataSource diff --git a/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml b/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml index da5034b2..de873929 100644 --- a/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/BlindBoardMapper.xml @@ -1350,20 +1350,29 @@ - diff --git a/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml b/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml index ab53bbf7..4795cc08 100644 --- a/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml +++ b/src/main/resources/mybatis/datasource/gf/ElectricityMapper.xml @@ -1517,16 +1517,25 @@ COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTAPPROVE, COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTACCEPT, COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTANALYZE, - COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTGUARDIAN, - COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTCONFESS, - COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and - not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) - THEN f.ELECTRICITY_ID END) COUNTACCEPTCONFESS + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTGUARDIAN, + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTCONFESS, + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.ELECTRICITY_ID END) COUNTACCEPTCONFESS, + + ( + COUNT(CASE WHEN (f.APPLY_STATUS+0) < 1 AND f.CREATOR = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.CONFIRM_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '5' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.ELECTRICITY_ID END) + ) AS SUMCOUNT FROM f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID} - SELECT - COUNT(CASE WHEN (f.APPLY_STATUS+0) < 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTBACK, + COUNT(CASE WHEN (f.APPLY_STATUS + 0) < 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTBACK, COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTCONSTRUCTION, COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.LEADER_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTLEADER, COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTAUDIT, COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTAPPROVE, COUNT(CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) COUNTACCEPT, - COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.HIGHWORK_ID END) COUNTGUARDIAN, - COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.HIGHWORK_ID END) COUNTCONFESS, - COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from GF_HIGHWORK_ACCEPTUSER m where m.HIGHWORK_ID = f.HIGHWORK_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.HIGHWORK_ID END) COUNTACCEPTCONFESS + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) COUNTGUARDIAN, + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) COUNTCONFESS, + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} AND NOT EXISTS (SELECT 1 FROM GF_HIGHWORK_ACCEPTUSER m WHERE m.HIGHWORK_ID = f.HIGHWORK_ID AND m.CORPINFO_ID = f.CORPINFO_ID AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.HIGHWORK_ID END) COUNTACCEPTCONFESS, + -- 求和所有计数项 + ( + COUNT(CASE WHEN (f.APPLY_STATUS + 0) < 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.LEADER_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.GUARDIAN_USER_ID = #{USER_ID} AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.CONFESS_USER_ID = #{USER_ID} AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN f.HIGHWORK_ID END) + + COUNT(CASE WHEN f.APPLY_STATUS < '6' AND f.APPLY_STATUS > 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} AND NOT EXISTS (SELECT 1 FROM GF_HIGHWORK_ACCEPTUSER m WHERE m.HIGHWORK_ID = f.HIGHWORK_ID AND m.CORPINFO_ID = f.CORPINFO_ID AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID) THEN f.HIGHWORK_ID END) + ) AS SUMCOUNT FROM f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID} - - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml index bb442595..7f0973a9 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml @@ -359,6 +359,9 @@ ACCEPT_CONFESS_USER_SIGNER_PATH = #{ACCEPT_CONFESS_USER_SIGNER_PATH}, ACCEPT_CONFESS_USER_SIGNER_TIME = #{ACCEPT_CONFESS_USER_SIGNER_TIME}, CONFIRM_OTHER_CONTENT = #{CONFIRM_OTHER_CONTENT}, + FIRE_COMPLETED = #{FIRE_COMPLETED}, + SITE_CLEANED = #{SITE_CLEANED}, + NO_REMAINING_EMBERS = #{NO_REMAINING_EMBERS}, HOTWORK_ID = HOTWORK_ID where HOTWORK_ID = #{HOTWORK_ID} @@ -474,6 +477,9 @@ f.OPERATTIME, f.OPERATOR, f.CHECK_NO, + f.FIRE_COMPLETED, + f.SITE_CLEANED, + f.NO_REMAINING_EMBERS, f.WORK_CONTENT, f.WORK_START_DATE, f.WORK_END_DATE, @@ -490,7 +496,6 @@ f.APPROVE_USER_SIGNER_PATH, f.APPROVE_USER_SIGNER_TIME, f.APPLY_STATUS, - (SELECT a.ANALYZE_TIME from bus_hotworkgas_cfd a where a.ISDELETE = '0' AND a.HOTWORK_ID = #{HOTWORK_ID} ORDER BY @@ -501,9 +506,9 @@ f.OTHER_PROTECTIVE_MEASURES, f.ACCEPT_DEPARTMENT_ID, f.ACCEPT_USER_ID, - f.ACCEPT_USER_SIGNER_PATH, - f.ACCEPT_USER_SIGNER_TIME, - IFNULL(f.ACCEPT_CONTENT,'无') as ACCEPT_CONTENT, + bhac.ACCEPT_USER_SIGNER_PATH, + bhac.ACCEPT_USER_SIGNER_TIME, + IFNULL(f.ACCEPT_CONTENT,'同意') as ACCEPT_CONTENT, f.APPLY_DEPARTMENT_ID, f.APPLY_USER_ID, f.WORK_PLACE, @@ -549,75 +554,72 @@ f.CONFIRM_OTHER_CONTENT, ad.NAME as APPLY_DEPARTMENT_NAME, au.NAME as APPLY_USER_NAME, - cd.NAME as CONFIRM_DEPARTMENT_NAME, cu.NAME as CONFIRM_USER_NAME, - gd.NAME as GUARDIAN_DEPARTMENT_NAME, gu.NAME as GUARDIAN_USER_NAME, - ld.NAME as LEADER_DEPARTMENT_NAME, lu.NAME as LEADER_USER_NAME, - aud.NAME as AUDIT_DEPARTMENT_NAME, auu.NAME as AUDIT_USER_NAME, - apd.NAME as APPROVE_DEPARTMENT_NAME, apu.NAME as APPROVE_USER_NAME, - md.NAME as MONITOR_DEPARTMENT_NAME, mu.NAME as MONITOR_USER_NAME, - acd.NAME as ACCEPT_DEPARTMENT_NAME, acu.NAME as ACCEPT_USER_NAME, - ac.NAME as CONFESS_DEPARTMENT_NAME, accu.NAME as CONFESS_USER_NAME, - aac.NAME as ACCEPT_CONFESS_DEPARTMENT_NAME, aacu.NAME as ACCEPT_CONFESS_USER_NAME, - anad.NAME as ANALYZE_DEPARTMENT_NAME, - anau.NAME as ANALYZE_USER_NAME + anau.NAME as ANALYZE_USER_NAME, + bhe.USER_NAME as EXAMINE_USER_NAME, + bhe.APPROVAL_OPINIONS as EXAMINE_APPROVAL_OPINIONS, + bhe.APPROVAL_SIGNATURE as EXAMINE_APPROVAL_SIGNATURE, + bhe.CREATE_TIME as EXAMINE_APPROVAL_CREATE_TIME from f left join OA_DEPARTMENT ad on ad.DEPARTMENT_ID = f.APPLY_DEPARTMENT_ID left join SYS_USER au on au.USER_ID = f.APPLY_USER_ID - left join OA_DEPARTMENT aac on aac.DEPARTMENT_ID = f.ACCEPT_CONFESS_DEPARTMENT_ID left join SYS_USER aacu on aacu.USER_ID = f.ACCEPT_CONFESS_USER_ID - left join OA_DEPARTMENT ac on ac.DEPARTMENT_ID = f.CONFESS_DEPARTMENT_ID left join SYS_USER accu on accu.USER_ID = f.CONFESS_USER_ID - left join OA_DEPARTMENT cd on cd.DEPARTMENT_ID = f.CONFIRM_DEPARTMENT_ID left join SYS_USER cu on cu.USER_ID = f.CONFIRM_USER_ID - left join OA_DEPARTMENT gd on gd.DEPARTMENT_ID = f.GUARDIAN_DEPARTMENT_ID left join SYS_USER gu on gu.USER_ID = f.GUARDIAN_USER_ID - left join OA_DEPARTMENT ld on ld.DEPARTMENT_ID = f.LEADER_DEPARTMENT_ID left join SYS_USER lu on lu.USER_ID = f.LEADER_USER_ID - left join OA_DEPARTMENT aud on aud.DEPARTMENT_ID = f.AUDIT_DEPARTMENT_ID left join SYS_USER auu on auu.USER_ID = f.AUDIT_USER_ID - left join OA_DEPARTMENT apd on apd.DEPARTMENT_ID = f.APPROVE_DEPARTMENT_ID left join SYS_USER apu on apu.USER_ID = f.APPROVE_USER_ID - left join OA_DEPARTMENT md on md.DEPARTMENT_ID = f.MONITOR_DEPARTMENT_ID left join SYS_USER mu on mu.USER_ID = f.MONITOR_USER_ID - left join OA_DEPARTMENT acd on acd.DEPARTMENT_ID = f.ACCEPT_DEPARTMENT_ID left join SYS_USER acu on acu.USER_ID = f.ACCEPT_USER_ID - left join OA_DEPARTMENT anad on anad.DEPARTMENT_ID = f.ANALYZE_DEPARTMENT_ID left join SYS_USER anau on anau.USER_ID = f.ANALYZE_USER_ID - + left join bus_hotwork_cfd_examine bhe on + bhe.HOTWORK_ID = f.HOTWORK_ID + and bhe.TYPE = 1 + and bhe.IS_DELETE = '0' +-- left join bus_hotwork_acceptuser_cfd bhac on bhac.HOTWORK_ID = f.HOTWORK_ID + left join ( + select + HOTWORK_ID, + GROUP_CONCAT(ACCEPT_USER_SIGNER_PATH SEPARATOR ',') as ACCEPT_USER_SIGNER_PATH, + GROUP_CONCAT(ACCEPT_USER_SIGNER_TIME SEPARATOR ',') as ACCEPT_USER_SIGNER_TIME + from bus_hotwork_acceptuser_cfd + group by HOTWORK_ID + ) bhac on bhac.HOTWORK_ID = f.HOTWORK_ID where - f.HOTWORK_ID = #{HOTWORK_ID} + f.HOTWORK_ID = #{HOTWORK_ID} + + +