动火审批过程中审批信息统一

liujun-2024-05-23-接口漏洞修复
liujun 2024-02-05 09:55:13 +08:00
parent 11585c5133
commit 1dd8bfad94
2 changed files with 43 additions and 30 deletions

View File

@ -623,8 +623,9 @@ public class AppHotworkCfdController extends BaseController {
} }
switch (status) { switch (status) {
// created by liu jun 2024-01-30 description: 安全项检查人签字
// 作业负责人审批 // 作业负责人审批
case "2": {//确认 case "1.5": {//确认
if (files != null && files.length > 0) { if (files != null && files.length > 0) {
MultipartFile file = files[0]; MultipartFile file = files[0];
@ -643,7 +644,7 @@ public class AppHotworkCfdController extends BaseController {
} }
// created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字 // created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字
// 项目主管部门审批 // 项目主管部门审批
case "2.5": { case "2": {
if (files != null && files.length > 0) { if (files != null && files.length > 0) {
MultipartFile file = files[0]; MultipartFile file = files[0];
String ffile = DateUtil.getDays(); String ffile = DateUtil.getDays();
@ -651,9 +652,9 @@ public class AppHotworkCfdController extends BaseController {
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
// 如果审批通过则进入下一阶段 // 如果审批通过则进入下一阶段
if (pd.get("APPROVAL_STATUS").equals("1")) { if (pd.get("APPROVAL_STATUS").equals("1")) {
pd2.put("APPLY_STATUS", "3"); pd2.put("APPLY_STATUS", "2");
} else { } else {
pd2.put("APPLY_STATUS", "-2.5"); pd2.put("APPLY_STATUS", "-2");
} }
hotworkCfdService.edit(pd2); hotworkCfdService.edit(pd2);
// 保存审批信息 // 保存审批信息

View File

@ -189,6 +189,15 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
message = message + "动火交底人未签字"; message = message + "动火交底人未签字";
passFlag = "0"; passFlag = "0";
} }
condition.put("TYPE", "2");
List<PageData> 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(); PageData result = new PageData();
result.put("passFlag", passFlag); result.put("passFlag", passFlag);
result.put("message", message); result.put("message", message);
@ -388,33 +397,36 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
condition.put("IS_DELETE", "0"); condition.put("IS_DELETE", "0");
condition.put("VALID_FLAG", "1"); condition.put("VALID_FLAG", "1");
List<PageData> approvalInfos = busHotworkCfdExamineMapper.findByCondition(condition); List<PageData> approvalInfos = busHotworkCfdExamineMapper.findByCondition(condition);
if(approvalInfos == null || approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息"); if(approvalInfos != null && approvalInfos.size() > 0) {
// 动火交底人 // 动火交底人
List<PageData> confess = approvalInfos.stream().filter(x -> "0".equals(x.getString("TYPE"))).collect(Collectors.toList()); List<PageData> confess = approvalInfos.stream().filter(x -> "0".equals(x.getString("TYPE"))).collect(Collectors.toList());
for (PageData x : confess) { for (PageData x : confess) {
x.put("CONFESS_USER_ID", x.get("USER_ID")); x.put("CONFESS_USER_ID", x.get("USER_ID"));
x.put("CONFESS_USER_NAME", x.get("USER_NAME")); x.put("CONFESS_USER_NAME", x.get("USER_NAME"));
x.put("CONFESS_DEPARTMENT_ID", x.get("DEPARTMENT_ID")); x.put("CONFESS_DEPARTMENT_ID", x.get("DEPARTMENT_ID"));
x.put("CONFESS_DEPARTMENT_NAME", x.get("DEPARTMENT_NAME")); 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"));
} }
} }