From 830d5928e216388ba8e19f1389981a71e703bab4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 5 May 2023 09:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E8=8E=B7=E5=8F=96=20?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E4=B8=8B=E4=B8=80=E4=B8=AA?= =?UTF-8?q?taskId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/todocenter/constant/TodoCenterContant.java | 1 + .../com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java index bf8fb8e..ef8ce19 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/TodoCenterContant.java @@ -11,6 +11,7 @@ public interface TodoCenterContant { public static final String OR_SIGN_FLAG = "MI_END"; + public static final String TASKID_ERROR = "TASKID_ERROR"; } public class Declared { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 75e590c..db6814d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -10,7 +10,9 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletResponse; +import cn.hutool.core.util.ObjectUtil; import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; +import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant; import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle; import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO; import com.wflow.workflow.enums.ProcessHandlerEnum; @@ -24,6 +26,7 @@ import org.flowable.engine.history.HistoricProcessInstance; import org.flowable.engine.runtime.ActivityInstance; import org.flowable.engine.runtime.ActivityInstanceQuery; import org.flowable.engine.task.Comment; +import org.flowable.task.api.Task; import org.flowable.variable.api.history.HistoricVariableInstance; import org.springframework.beans.BeanUtils; import org.springframework.mock.web.MockMultipartFile; @@ -309,6 +312,11 @@ public class TodoCenterManage { * @since 2023/02/01 */ public String handler(ReqProcessHandlerDTO param) { + //前置判断前端传的taskId是否存在不存在的情况 有可能是 或签被别人审批掉了 + Task task = taskService.createTaskQuery().taskId(param.getTaskId()).active().singleResult(); + if (ObjectUtil.isNull(task)) { + return TodoCenterContant.Handler.TASKID_ERROR; + } // 获取登录用户ID UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); // 获取登录用户浙政钉code