From 88722aa3210a42a9e778ffcfc638f47b7ded33c5 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Tue, 23 Jan 2024 11:25:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BC=81=E6=A0=87=E7=A8=BD=E6=9F=A5?= =?UTF-8?q?=E6=95=B4=E6=94=B9):=2081096?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EsInspectRectifyFlowServiceImpl.java | 85 ++++++++++--------- 1 file changed, 47 insertions(+), 38 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/esinspectrectify/service/impl/EsInspectRectifyFlowServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/esinspectrectify/service/impl/EsInspectRectifyFlowServiceImpl.java index 38cbde3b..d70fd7e8 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/esinspectrectify/service/impl/EsInspectRectifyFlowServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/esinspectrectify/service/impl/EsInspectRectifyFlowServiceImpl.java @@ -263,49 +263,58 @@ public class EsInspectRectifyFlowServiceImpl implements IEsInspectRectifyFlowSer SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date parse = dateFormat.parse(dateFormat.format(date)); // 是否申请延期 - if (EsInspectRectifyCommon.OPERATION_TYPE_2.equals(processEsInspectReportVO.getOperationType()) - && (processEsInspectReportVO.getApplyDelayDate().before(parse) - || processEsInspectReportVO.getApplyDelayDate().equals(parse))){ - // 生成新整改流程 - EsInspectRectifyFlowVO newEsInspectReportFlowVO = new EsInspectRectifyFlowVO(); - // 处理流程信息 - ProcessAll newProcessAll = new ProcessAll(); - newProcessAll.setProjectId(String.valueOf(SnowflakeUtils.snowflake())); - newProcessAll.setPrcName(processAll.getPrcName()); - newEsInspectReportFlowVO.setProcessAll(newProcessAll); + if (EsInspectRectifyCommon.OPERATION_TYPE_2.equals(processEsInspectReportVO.getOperationType())){ + // 更新整改计划完成日期 + enterpriseStandardInspectRectifyPlanService.update( + new LambdaUpdateWrapper() + .eq(EnterpriseStandardInspectRectifyPlan::getId, processEsInspectReportVO.getInspectRectifyPlanId()) + .set(EnterpriseStandardInspectRectifyPlan::getPlanCompleteDate, processEsInspectReportVO.getApplyDelayDate())); - // 整改计划 - EnterpriseStandardInspectRectifyPlan enterpriseStandardInspectRectifyPlan = enterpriseStandardInspectRectifyPlanService.getById(processEsInspectReportVO.getInspectRectifyPlanId()); + // 申请延期日期 <= 当前日期 立即生成新流程 + if (processEsInspectReportVO.getApplyDelayDate().before(parse) + || processEsInspectReportVO.getApplyDelayDate().equals(parse)){ + // 生成新整改流程 + EsInspectRectifyFlowVO newEsInspectReportFlowVO = new EsInspectRectifyFlowVO(); + // 处理流程信息 + ProcessAll newProcessAll = new ProcessAll(); + newProcessAll.setProjectId(String.valueOf(SnowflakeUtils.snowflake())); + newProcessAll.setPrcName(processAll.getPrcName()); + newEsInspectReportFlowVO.setProcessAll(newProcessAll); - // 处理流程审批信息 - ProcessApprovalRecord newProcessApprovalRecord = new ProcessApprovalRecord(); - newProcessApprovalRecord.setId(String.valueOf(SnowflakeUtils.snowflake())); - newProcessApprovalRecord.setProjectId(newProcessAll.getProjectId()); - newProcessApprovalRecord.setUserId(enterpriseStandardInspectRectifyPlan.getResponseUser()); - newEsInspectReportFlowVO.setProcessApprovalRecord(newProcessApprovalRecord); + // 整改计划 + EnterpriseStandardInspectRectifyPlan enterpriseStandardInspectRectifyPlan = + enterpriseStandardInspectRectifyPlanService.getById(processEsInspectReportVO.getInspectRectifyPlanId()); - // 处理业务表数据 - ProcessEsInspectRectify processEsInspectRectify = new ProcessEsInspectRectify(); - processEsInspectRectify.setId(String.valueOf(SnowflakeUtils.snowflake())); - processEsInspectRectify.setProjectId(newProcessAll.getProjectId()); - processEsInspectRectify.setIsDelayCreate(YesOrNoEnum.NO.getValue()); - processEsInspectRectify.setInspectRectifyPlanId(processEsInspectReportVO.getInspectRectifyPlanId()); - newEsInspectReportFlowVO.setProcessEsInspectRectify(processEsInspectRectify); - processEsInspectRectifyService.save(processEsInspectRectify); + // 处理流程审批信息 + ProcessApprovalRecord newProcessApprovalRecord = new ProcessApprovalRecord(); + newProcessApprovalRecord.setId(String.valueOf(SnowflakeUtils.snowflake())); + newProcessApprovalRecord.setProjectId(newProcessAll.getProjectId()); + newProcessApprovalRecord.setUserId(enterpriseStandardInspectRectifyPlan.getResponseUser()); + newEsInspectReportFlowVO.setProcessApprovalRecord(newProcessApprovalRecord); - // 处理人员信息 - Map newMap = new HashMap<>(); - newMap.put("responsible", enterpriseStandardInspectRectifyPlan.getResponseUser()); - newMap.put("leader", "请选择"); - newMap.put("responsibleApproval", "请选择"); - newEsInspectReportFlowVO.setMap(newMap); - createReportFlow(newEsInspectReportFlowVO); + // 处理业务表数据 + ProcessEsInspectRectify processEsInspectRectify = new ProcessEsInspectRectify(); + processEsInspectRectify.setId(String.valueOf(SnowflakeUtils.snowflake())); + processEsInspectRectify.setProjectId(newProcessAll.getProjectId()); + processEsInspectRectify.setIsDelayCreate(YesOrNoEnum.NO.getValue()); + processEsInspectRectify.setInspectRectifyPlanId(processEsInspectReportVO.getInspectRectifyPlanId()); + newEsInspectReportFlowVO.setProcessEsInspectRectify(processEsInspectRectify); + processEsInspectRectifyService.save(processEsInspectRectify); - // 修改状态 - processEsInspectRectifyService.update( - new LambdaUpdateWrapper() - .in(ProcessEsInspectRectify::getId, processEsInspectReportVO.getId()) - .set(ProcessEsInspectRectify::getIsDelayCreate, YesOrNoEnum.YES.getValue())); + // 处理人员信息 + Map newMap = new HashMap<>(); + newMap.put("responsible", enterpriseStandardInspectRectifyPlan.getResponseUser()); + newMap.put("leader", "请选择"); + newMap.put("responsibleApproval", "请选择"); + newEsInspectReportFlowVO.setMap(newMap); + createReportFlow(newEsInspectReportFlowVO); + + // 修改状态 + processEsInspectRectifyService.update( + new LambdaUpdateWrapper() + .in(ProcessEsInspectRectify::getId, processEsInspectReportVO.getId()) + .set(ProcessEsInspectRectify::getIsDelayCreate, YesOrNoEnum.YES.getValue())); + } }else { // 更新整改状态 enterpriseStandardInspectRectifyPlanService.update(new LambdaUpdateWrapper()