This commit is contained in:
wangliwen 2022-05-11 18:13:45 +08:00
parent 5b1c97b802
commit 6d0aec6686
1 changed files with 13 additions and 8 deletions

View File

@ -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<ResourceDTO> 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());
}
});
}
}