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; } }