From 6d0aec668641b24a14e262cc5526fa2dca421977 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 11 May 2022 18:13:45 +0800 Subject: [PATCH] ... --- .../listener/CorrectionListener.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java index 6f7fd3a5..b17738a7 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java @@ -13,24 +13,18 @@ import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysRoleService; import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysUserService; -import org.activiti.engine.HistoryService; -import org.activiti.engine.ProcessEngine; -import org.activiti.engine.ProcessEngines; import org.activiti.engine.TaskService; import org.activiti.engine.delegate.*; import org.activiti.engine.delegate.event.ActivitiEvent; import org.activiti.engine.delegate.event.ActivitiEventListener; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.task.Task; -import org.activiti.engine.task.TaskQuery; -import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.util.*; +import java.util.Map; +import java.util.Optional; /** * 部门动态审批人 @@ -146,6 +140,7 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti logger.error("第二级别审批仍然为 " + bigDateDeptName); taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + endTake(delegateTask.getVariables()); } } else { logger.error("表单内单位名称:" + abilityApplicationDTO.getUnit()); @@ -167,5 +162,15 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti logger.error("未查到该部门对应的 " + roleName); taskService.setAssignee(delegateTask.getId(), "1516728698224427010"); } + + Optional resourceDTOOptional = Optional.ofNullable(resourceService.get(Long.valueOf(abilityApplicationDTO.getResourceId()))); + resourceDTOOptional.ifPresent(resource -> { + if ("免批申请".equals(resource.getShareCondition())) { // 针对免批资源申请 + taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过"); + taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + endTake(delegateTask.getVariables()); + } + }); + } }