From 05f777e58c9c5372739890568045469789a1cc53 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 28 Jun 2023 10:39:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E5=AE=A1=E9=A9=B3=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E5=9B=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/model/entity/Project.java | 1 + .../pmapi/todocenter/manage/HandlerManage.java | 23 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index 596003e..f151df2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -311,6 +311,7 @@ public class Project implements Serializable { private Long updateBy; @ApiModelProperty("项目预审申请单文件ID") + private Long pretrialFileId; @ApiModelProperty("项目预审申请单文件名") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index cf89a03..07e15a2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java @@ -8,6 +8,7 @@ import java.util.*; import java.util.stream.Collectors; import cn.hutool.core.date.DatePattern; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.file.service.FileService; @@ -340,6 +341,19 @@ public class HandlerManage { */ public void afterBackTodo(Project declaredProject, HistoricProcessInstance instance) { Long userId = LoginUserUtil.getUserId(); + // 获取当前流程实例类型 + String instanceId = declaredProject.getInstCode(); + ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) + .eq(ProjectInst::getInstCode, instanceId)); + Integer instType = projectInst.getInstType(); + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(); + // 如果是预审审批退回,需要重新盖章,原来盖过章的文件要清空 + if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)){ + updateWrapper.set(Project::getPretrialFileId,null) + .set(Project::getPretrialFileName,null) + .eq(Project::getId,declaredProject.getId()); + } + projectService.update(updateWrapper); // 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。 //发送消息 noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), @@ -380,14 +394,17 @@ public class HandlerManage { */ private void updateRejectProjectStatus(Long userId, Project declaredProject, Integer instType) { stateMachineUtils.reject(declaredProject); + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(); declaredProject.setUpdateOn(LocalDateTime.now()); declaredProject.setUpdateBy(userId); + projectService.updateById(declaredProject); // 如果是预审审批驳回,需要重新盖章,原来盖过章的文件要清空 if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)){ - declaredProject.setPretrialFileId(null); - declaredProject.setPretrialFileName(null); + updateWrapper.set(Project::getPretrialFileId,null) + .set(Project::getPretrialFileName,null) + .eq(Project::getId,declaredProject.getId()); } - projectService.updateById(declaredProject); + projectService.update(updateWrapper); } /**