部门审批人为发起人时 默认通过
This commit is contained in:
parent
bb9d5847bf
commit
f72463d3bf
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue