fixbug #139 我的申请,免批申请的资源,查看流程时,无法展示资源部门负责人

This commit is contained in:
wangliwen 2022-05-13 10:15:30 +08:00
parent 7edd5ae2fd
commit d34303b92f
1 changed files with 7 additions and 3 deletions

View File

@ -148,10 +148,13 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti
sysDeptService.get(resourceEntityDto.getDeptId());
if (deptDTO != null && deptDTO.getName().equals(bigDateDeptName)) {
logger.error("第二级别审批仍然为 " + bigDateDeptName);
SysUserDTO userDTO = sysUserService.getByDeptIdAndRoleId(deptId, roleDTO.getId()); // 搜出审批人
if (userDTO != null) {
taskService.setAssignee(delegateTask.getId(), userDTO.getId().toString());
}
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "默认通过");
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
return;
// endTake(delegateTask.getVariables());
}
} else {
logger.error("表单内单位名称:" + abilityApplicationDTO.getUnit());
@ -173,16 +176,17 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti
logger.error("未查到该部门对应的 " + roleName);
taskService.setAssignee(delegateTask.getId(), "1516728698224427010");
}
mpComplete(abilityApplicationDTO, delegateTask);
}
private void mpComplete(TAbilityApplicationDTO abilityApplicationDTO, DelegateTask delegateTask) {
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());
}
});
}
private void complete(DelegateTask delegateTask) {