Commit 9d273089 authored by 赵啸非's avatar 赵啸非

修改部分pom

parent eb902629
package com.mortals.flowable.listener; package com.mortals.flowable.listener;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEvent; import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.FormService; import org.flowable.engine.FormService;
...@@ -18,7 +19,7 @@ import java.util.Map; ...@@ -18,7 +19,7 @@ import java.util.Map;
* @description: * @description:
**/ **/
//@Component //@Component
@CommonsLog @Slf4j
public class ProcessInstanceCompleteListener extends AbstractFlowableEngineEventListener { public class ProcessInstanceCompleteListener extends AbstractFlowableEngineEventListener {
@Autowired @Autowired
......
package com.mortals.flowable.listener; package com.mortals.flowable.listener;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEvent; import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.FormService; import org.flowable.engine.FormService;
...@@ -19,7 +20,7 @@ import java.util.Map; ...@@ -19,7 +20,7 @@ import java.util.Map;
* @description: * @description:
**/ **/
//@Component //@Component
@CommonsLog @Slf4j
public class ProcessInstanceStartListener extends AbstractFlowableEngineEventListener { public class ProcessInstanceStartListener extends AbstractFlowableEngineEventListener {
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
......
...@@ -13,6 +13,7 @@ import com.mortals.xhx.module.platform.service.PlatformListenerService; ...@@ -13,6 +13,7 @@ import com.mortals.xhx.module.platform.service.PlatformListenerService;
import com.mortals.xhx.module.platform.service.PlatformModelinfoService; import com.mortals.xhx.module.platform.service.PlatformModelinfoService;
import com.mortals.xhx.module.platform.service.PlatformService; import com.mortals.xhx.module.platform.service.PlatformService;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
...@@ -44,11 +45,13 @@ import java.util.stream.Collectors; ...@@ -44,11 +45,13 @@ import java.util.stream.Collectors;
* @date: 2021/9/9 11:48 * @date: 2021/9/9 11:48
*/ */
@Component @Component
@CommonsLog @Slf4j
public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListener { public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListener {
public static String TaskCreate = "2"; public static String TaskCreate = "2";
public static String TaskComplete = "4";
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired @Autowired
...@@ -63,27 +66,18 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene ...@@ -63,27 +66,18 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene
@Override @Override
protected void taskCreated(FlowableEngineEntityEvent event) { protected void taskCreated(FlowableEngineEntityEvent event) {
log.info("进入任务创建全局监听"); log.info("进入任务创建全局监听");
List<String> userNameList = new ArrayList<>(); List<String> userNameList = new ArrayList<>();
FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) event; FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) event;
TaskEntity taskEntity = (TaskEntity) (flowableEntityEvent).getEntity(); TaskEntity taskEntity = (TaskEntity) (flowableEntityEvent).getEntity();
if (!ObjectUtils.isEmpty(taskEntity.getParentTaskId())) { if (!ObjectUtils.isEmpty(taskEntity.getParentTaskId())) {
log.info("当前任务为子任务"); log.info("当前任务为子任务");
return; return;
} }
String taskId = taskEntity.getId(); String taskId = taskEntity.getId();
String scopeType = taskEntity.getScopeType(); String scopeType = taskEntity.getScopeType();
log.info(String.format("任务类型:%s", scopeType)); log.info(String.format("任务类型:%s", scopeType));
String scopeId = taskEntity.getScopeId(); String scopeId = taskEntity.getScopeId();
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(taskEntity.getProcessInstanceId()).singleResult(); HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(taskEntity.getProcessInstanceId()).singleResult();
if (historicProcessInstance == null) { if (historicProcessInstance == null) {
log.info("historicProcessInstance is null!"); log.info("historicProcessInstance is null!");
return; return;
...@@ -94,9 +88,7 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene ...@@ -94,9 +88,7 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene
log.info("idList is null!"); log.info("idList is null!");
} }
log.info("idList:" + JSON.toJSONString(idList)); log.info("idList:" + JSON.toJSONString(idList));
// 获取接收人,区分审核人,候选组,并行等 todo // 获取接收人,区分审核人,候选组,并行等 todo
idList.forEach(identityLink -> { idList.forEach(identityLink -> {
if (StringUtils.isNotBlank(identityLink.getUserId())) { if (StringUtils.isNotBlank(identityLink.getUserId())) {
...@@ -162,6 +154,19 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene ...@@ -162,6 +154,19 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene
@Override @Override
protected void taskCompleted(FlowableEngineEntityEvent event) { protected void taskCompleted(FlowableEngineEntityEvent event) {
log.info("进入任务完成全局监听");
FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) event;
TaskEntity taskEntity = (TaskEntity) (flowableEntityEvent).getEntity();
if (!ObjectUtils.isEmpty(taskEntity.getParentTaskId())) {
log.info("当前任务为子任务");
return;
}
// String taskId = taskEntity.getId();
// Object flowPerson = taskEntity.getVariable("flowPerson");
log.info("taskId:{},taskName:{}", taskEntity.getId(), taskEntity.getName());
super.taskCompleted(event); super.taskCompleted(event);
} }
......
...@@ -475,8 +475,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IApiFlowT ...@@ -475,8 +475,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IApiFlowT
flowTask.setAttachmentList(attachmentEntities); flowTask.setAttachmentList(attachmentEntities);
hisFlowList.add(flowTask); hisFlowList.add(flowTask);
} }
//查询当前任务是否存在子任务 //查询当前任务是否存在子任务
List<HistoricTaskInstance> subList = historyService.createHistoricTaskInstanceQuery() List<HistoricTaskInstance> subList = historyService.createHistoricTaskInstanceQuery()
.taskParentTaskId(histIns.getTaskId()) .taskParentTaskId(histIns.getTaskId())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment