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 558677ac..69df9042 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java @@ -623,8 +623,9 @@ public class AppHotworkCfdController extends BaseController { } switch (status) { + // created by liu jun 2024-01-30 description: 安全项检查人签字 // 作业负责人审批 - case "2": {//确认 + case "1.5": {//确认 if (files != null && files.length > 0) { MultipartFile file = files[0]; @@ -643,7 +644,7 @@ public class AppHotworkCfdController extends BaseController { } // created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字 // 项目主管部门审批 - case "2.5": { + case "2": { if (files != null && files.length > 0) { MultipartFile file = files[0]; String ffile = DateUtil.getDays(); @@ -651,9 +652,9 @@ public class AppHotworkCfdController extends BaseController { Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); // 如果审批通过则进入下一阶段 if (pd.get("APPROVAL_STATUS").equals("1")) { - pd2.put("APPLY_STATUS", "3"); + pd2.put("APPLY_STATUS", "2"); } else { - pd2.put("APPLY_STATUS", "-2.5"); + pd2.put("APPLY_STATUS", "-2"); } hotworkCfdService.edit(pd2); // 保存审批信息 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 77e53fdc..998d425a 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -189,6 +189,15 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { message = message + "动火交底人未签字"; passFlag = "0"; } + + condition.put("TYPE", "2"); + List safetyList = busHotworkCfdExamineMapper.findByCondition(condition); + if (safetyList == null || safetyList.size() == 0) throw new RuntimeException("未找到审批信息"); + unApprovalNum = (int) safetyList.stream().filter(x -> "0".equals(x.getString("APPROVAL_STATUS"))).count(); + if (unApprovalNum > 0) { + message = message + "安全项检查人未签字"; + passFlag = "0"; + } PageData result = new PageData(); result.put("passFlag", passFlag); result.put("message", message); @@ -388,33 +397,36 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { condition.put("IS_DELETE", "0"); condition.put("VALID_FLAG", "1"); List approvalInfos = busHotworkCfdExamineMapper.findByCondition(condition); - if(approvalInfos == null || approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息"); - // 动火交底人 - List confess = approvalInfos.stream().filter(x -> "0".equals(x.getString("TYPE"))).collect(Collectors.toList()); - for (PageData x : confess) { - x.put("CONFESS_USER_ID", x.get("USER_ID")); - 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")); + if(approvalInfos != null && approvalInfos.size() > 0) { + // 动火交底人 + List confess = approvalInfos.stream().filter(x -> "0".equals(x.getString("TYPE"))).collect(Collectors.toList()); + for (PageData x : confess) { + x.put("CONFESS_USER_ID", x.get("USER_ID")); + 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")); + } + pd.put("confessUserNames", confess.stream().map(x -> x.getString("USER_NAME")).collect(Collectors.joining(","))); + pd.put("confessList", confess); + + // 项目责任负责人 + PageData belong = approvalInfos.stream().filter(x -> "1".equals(x.getString("TYPE"))).findFirst().orElse(null); + pd.put("BELONGING_USER_ID", belong.getString("USER_ID")); + pd.put("BELONGING_USER_NAME", belong.getString("USER_NAME")); + pd.put("BELONGING_DEPARTMENT_ID", belong.getString("DEPARTMENT_ID")); + pd.put("BELONGING_DEPARTMENT_NAME", belong.getString("DEPARTMENT_NAME")); + pd.put("BELONGING_OPINIONS", belong.getString("APPROVAL_OPINIONS")); + pd.put("BELONGING_SIGNATURE", belong.getString("APPROVAL_SIGNATURE")); + pd.put("BELONGING_SIGNATURE_TIME", belong.getString("APPROVAL_SIGNATURE_TIME")); + // 安全项检查人 + PageData safety = approvalInfos.stream().filter(x -> "2".equals(x.getString("TYPE"))).findFirst().orElse(null); + pd.put("SAFETY_USER_ID", safety.getString("USER_ID")); + pd.put("SAFETY_USER_NAME", safety.getString("USER_NAME")); + pd.put("SAFETY_DEPARTMENT_ID", safety.getString("DEPARTMENT_ID")); + pd.put("SAFETY_DEPARTMENT_NAME", safety.getString("DEPARTMENT_NAME")); + pd.put("SAFETY_SIGNATURE", safety.getString("APPROVAL_SIGNATURE")); + pd.put("SAFETY_SIGNATURE_TIME", safety.getString("APPROVAL_SIGNATURE_TIME")); } - pd.put("confessUserNames", confess.stream().map(x -> x.getString("USER_NAME")).collect(Collectors.joining(","))); - pd.put("confessList", confess); - // 项目责任负责人 - PageData belong = approvalInfos.stream().filter(x -> "1".equals(x.getString("TYPE"))).findFirst().orElse(null); - pd.put("BELONGING_USER_ID", belong.getString("USER_ID")); - pd.put("BELONGING_USER_NAME", belong.getString("USER_NAME")); - pd.put("BELONGING_DEPARTMENT_ID", belong.getString("DEPARTMENT_ID")); - pd.put("BELONGING_DEPARTMENT_NAME", belong.getString("DEPARTMENT_NAME")); - pd.put("BELONGING_SIGNATURE", belong.getString("APPROVAL_SIGNATURE")); - pd.put("BELONGING_SIGNATURE_TIME", belong.getString("APPROVAL_SIGNATURE_TIME")); - // 安全项检查人 - PageData safety = approvalInfos.stream().filter(x -> "2".equals(x.getString("TYPE"))).findFirst().orElse(null); - pd.put("SAFETY_USER_ID", safety.getString("USER_ID")); - pd.put("SAFETY_USER_NAME", safety.getString("USER_NAME")); - pd.put("SAFETY_DEPARTMENT_ID", safety.getString("DEPARTMENT_ID")); - pd.put("SAFETY_DEPARTMENT_NAME", safety.getString("DEPARTMENT_NAME")); - pd.put("SAFETY_SIGNATURE", safety.getString("APPROVAL_SIGNATURE")); - pd.put("SAFETY_SIGNATURE_TIME", safety.getString("APPROVAL_SIGNATURE_TIME")); } }