部门审批人为发起人时 默认通过

This commit is contained in:
wangliwen 2022-10-10 09:50:28 +08:00
parent bb9d5847bf
commit f72463d3bf
5 changed files with 13 additions and 6 deletions

View File

@ -109,7 +109,6 @@ public class ApplyDeptListener implements TaskListener, ExecutionListener, Activ
Map<String, Object> kv = delegateTask.getVariables();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()));
Gson gson = builder.create();
JsonElement jsonElement = gson.toJsonTree(kv);
TAbilityApplicationDTO abilityApplicationDTO = gson.fromJson(jsonElement, TAbilityApplicationDTO.class);
@ -132,6 +131,7 @@ public class ApplyDeptListener implements TaskListener, ExecutionListener, Activ
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
assignee = defaultAssigneeRoleId;
}
logger.error("分配的用户id为:{}", assignee);
List<TAbilityApplicationDTO> dtoList = delegateTask.getVariable("tAbilityApplicationDTOList", List.class);
Optional<TAbilityApplicationDTO> tAbilityApplicationDTO = dtoList.stream().filter(index -> {
@ -148,5 +148,12 @@ public class ApplyDeptListener implements TaskListener, ExecutionListener, Activ
sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1);
return;
}
String creator = kv.getOrDefault("creator", "").toString(); // 发起人
if (StringUtils.isNotEmpty(creator) && creator.equals(assignee)) { // 本节点审核人为发起人默认通过
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "本节点审核人为发起人,默认通过");
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1);
}
}
}

View File

@ -135,7 +135,7 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A
if (StringUtils.isNotEmpty(assignee)
&& StringUtils.isNotEmpty(delegateTask.getVariable("creator", String.class))
&& delegateTask.getVariable("creator", String.class).equals(assignee)) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人为发起人,默认通过");
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "本节点审核人为发起人,默认通过");
taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId());
@ -169,8 +169,8 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过");
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1);
return;
}
}
@Override

View File

@ -136,7 +136,7 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv
if (StringUtils.isNotEmpty(assignee)
&& StringUtils.isNotEmpty(delegateTask.getVariable("creator", String.class))
&& delegateTask.getVariable("creator", String.class).equals(assignee)) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人为发起人,默认通过");
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "本节点审核人为发起人,默认通过");
taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId());

View File

@ -224,7 +224,7 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac
if (StringUtils.isNotEmpty(assignee)
&& StringUtils.isNotEmpty(delegateTask.getVariable("creator", String.class))
&& delegateTask.getVariable("creator", String.class).equals(assignee)) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人为发起人,默认通过");
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "本节点审核人为发起人,默认通过");
taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId());

View File

@ -132,7 +132,7 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A
if (StringUtils.isNotEmpty(assignee)
&& StringUtils.isNotEmpty(delegateTask.getVariable("creator", String.class))
&& delegateTask.getVariable("creator", String.class).equals(assignee)) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人为发起人,默认通过");
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "本节点审核人为发起人,默认通过");
taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId());