update 会签节点结束后,未处理任务发送同一平台删除待办
This commit is contained in:
+48
@@ -60,6 +60,9 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
||||
case PROCESS_COMPLETED:
|
||||
this.activityComplete(event);
|
||||
break;
|
||||
case ENTITY_DELETED:
|
||||
this.entityDeleted(event);
|
||||
break;
|
||||
default:
|
||||
//log.info("Event received: " + event.getType());
|
||||
}
|
||||
@@ -300,6 +303,51 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
||||
pushWorkflowIntegrationAPI.sendActivityComplete(list);
|
||||
}
|
||||
|
||||
private void entityDeleted(ActivitiEvent event) {
|
||||
log.info("===================任务删除事件===================");
|
||||
ActivitiEntityEventImpl activitiEntityEvent = (ActivitiEntityEventImpl) event;
|
||||
TaskEntity delegateTask;
|
||||
if (activitiEntityEvent.getEntity() instanceof TaskEntity){
|
||||
delegateTask = (TaskEntity) activitiEntityEvent.getEntity();
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
ExecutionEntity execution = delegateTask.getExecution();
|
||||
ProcessApprovalRecordService recordService = SpringContextUtil.getBean(ProcessApprovalRecordService.class);
|
||||
String taskId = delegateTask.getId();
|
||||
String assignee = delegateTask.getAssignee();
|
||||
String processDefinitionId = delegateTask.getProcessDefinitionId();
|
||||
//更新审批信息为完成
|
||||
LambdaQueryWrapper<ProcessApprovalRecord> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProcessApprovalRecord::getTaskId,taskId);
|
||||
wrapper.ne(ProcessApprovalRecord::getFinishFlag,FinishFlagEnum.COMPLETE.getValue());
|
||||
wrapper.ne(ProcessApprovalRecord::getFinishFlag,FinishFlagEnum.WITHDRAWN.getValue());
|
||||
ProcessApprovalRecord approvalRecord = recordService.getOne(wrapper);
|
||||
if (approvalRecord == null){
|
||||
return;
|
||||
}
|
||||
Integer finishFlag = approvalRecord.getFinishFlag();
|
||||
if (FinishFlagEnum.COMPLETE.getValue().equals(finishFlag)){
|
||||
return;
|
||||
}
|
||||
log.info("id = " + delegateTask.getId());
|
||||
log.info("name = " + delegateTask.getName());
|
||||
log.info("taskEntity.getAssignee() = " + delegateTask.getAssignee());
|
||||
log.info("taskEntity.getIdentityLinks() = " + delegateTask.getIdentityLinks());
|
||||
log.info("execution.getActivityId() = " + execution.getActivityId());
|
||||
log.info("taskEntity.getVariables() = " + delegateTask.getVariables());
|
||||
// 对接统一平台
|
||||
PushWorkflowIntegrationAPI pushWorkflowIntegrationAPI = SpringContextUtil.getBean(PushWorkflowIntegrationAPI.class);
|
||||
|
||||
List<HiworkTodoAdd> todoAddList = new ArrayList<>();
|
||||
HiworkTodoAdd hiworkTodoAdd = new HiworkTodoAdd();
|
||||
hiworkTodoAdd.setRecordId(approvalRecord.getId());
|
||||
hiworkTodoAdd.setProcessDefinitionId(processDefinitionId);
|
||||
todoAddList.add(hiworkTodoAdd);
|
||||
//对接统一平台生成删除
|
||||
pushWorkflowIntegrationAPI.sendDeleteTask(todoAddList);
|
||||
}
|
||||
|
||||
private void activityComplete(ActivitiEvent event) {
|
||||
log.info("===================流程完成事件===================");
|
||||
ActivitiEntityEventImpl activitiEntityEvent = (ActivitiEntityEventImpl) event;
|
||||
|
||||
Reference in New Issue
Block a user