From ce3fbf8902f15402858e64f38523ccd723a40e0c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 4 Apr 2023 18:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/TodoCenterManage.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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 63d65cd..f571c4a 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 @@ -14,10 +14,13 @@ import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle; import com.wflow.workflow.enums.ProcessHandlerEnum; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import org.assertj.core.util.Lists; import org.flowable.engine.HistoryService; import org.flowable.engine.RuntimeService; +import org.flowable.engine.TaskService; import org.flowable.engine.history.HistoricProcessInstance; +import org.flowable.engine.task.Comment; import org.flowable.variable.api.history.HistoricVariableInstance; import org.springframework.beans.BeanUtils; import org.springframework.mock.web.MockMultipartFile; @@ -81,9 +84,7 @@ import com.ningdatech.pmapi.todocenter.service.StatisticsService; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.ningdatech.pmapi.todocenter.utils.PdfUtils; import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.pmapi.user.util.LoginUserUtil; -import com.wflow.contants.ProcessConstant; import com.wflow.exception.BusinessException; import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; import com.wflow.workflow.bean.dto.TodoCenterListReqDTO; @@ -123,14 +124,12 @@ public class TodoCenterManage { private final IProjectApplicationService projectApplicationService; private final UserInfoHelper userInfoHelper; private final BuildUserUtils buildUserUtils; - private final IProjectStagingService projectStagingService; + private final TaskService taskService; private final IProjectInstService projectInstService; private final PdfUtils pdfUtils; private final FileService fileService; private final ICompanySignatureService companySignatureService; private final StatisticsService statisticsService; - private final INotifyService notifyService; - private final DeclaredProjectManage declaredProjectManage; private final HandlerManage handlerManage; @@ -897,6 +896,17 @@ public class TodoCenterManage { if(approve.getValue() instanceof ProcessHandlerEnum){ if(ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue())))){ runtimeService.removeVariable(approve.getProcessInstanceId(),approve.getVariableName()); + + Comment comment; + Optional first = taskService.getProcessInstanceComments(approve.getProcessInstanceId()) + .stream() + .filter(c -> c.getTaskId().equals(approve.getVariableName().replace("approve_", StringUtils.EMPTY))) + .findFirst(); + if (first.isPresent()){ + comment = first.get(); + taskService.deleteComment(comment.getId()); + } + break; } }