Browse Source

尝试修复发送人异常问题

fuyuchuan 4 days ago
parent
commit
cba0aacc70

+ 8 - 11
flow-workflow/flow-workflow-biz/src/main/java/com/flow/listener/GlobalActivityEventListener.java

@@ -133,9 +133,6 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
             @Override
             public void afterCommit() {
                 Notify notify = new Notify();
-                Map<String, Object> params = new HashMap<>();
-
-
                 // notify.setContent(String.format("您有一条待处理的审批任务【%s】,请及时处理。", entity.getName()));
                 String instanceId = entity.getProcessInstanceId();
                 FormInfo form = flowInstanceService.getForm(instanceId);
@@ -149,10 +146,13 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
                 notify.setReceiver(entity.getAssignee());
                 notify.setReceivingTime(LocalDateTime.now());
                 notify.setUrl("/flow/todo");
-
-                params.put("approvalNode", entity.getName());
-                notify.setParams(params);
                 notifyService.notify(notify);
+
+                log.info("登录用户:{}", SecurityContextUtil.getUserId());
+                log.info("Assignee:{}", entity.getAssignee());
+                log.info("Owner:{}", entity.getOwner());
+                log.info("LocalizedName:{}", entity.getLocalizedName());
+                log.info("EventName:{}", entity.getEventName());
             }
         });
     }
@@ -190,10 +190,6 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
         flowInstanceService.updateById(flowInstance);
         redisService.del(event.getProcessInstanceId());
 
-        // 利用空闲参数设置审批节点
-        Map<String, Object> params = new HashMap<>();
-        params.put("approvalNode", entity.getName());
-
         // 消息通知
         TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
             @Override
@@ -214,8 +210,9 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
                 notify.setReceiver(entity.getStartUserId());
                 notify.setReceivingTime(LocalDateTime.now());
                 notify.setUrl("/flow/instance");
-                notify.setParams(params);
                 notifyService.notify(notify);
+
+                log.info("通过{}", (entity.getStartUserId()));
             }
         });
     }

+ 2 - 0
flow-workflow/flow-workflow-biz/src/main/java/com/flow/service/impl/FlowInstanceServiceImpl.java

@@ -26,6 +26,7 @@ import com.flow.service.FlowDefineService;
 import com.flow.service.FlowInstanceService;
 import com.flow.service.FlowTaskService;
 import com.flow.service.NotifyService;
+import lombok.extern.slf4j.Slf4j;
 import org.flowable.engine.HistoryService;
 import org.flowable.engine.RuntimeService;
 import org.flowable.engine.TaskService;
@@ -41,6 +42,7 @@ import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
+@Slf4j
 @Service
 public class FlowInstanceServiceImpl extends BaseServiceImpl<FlowInstanceDao, FlowInstance> implements FlowInstanceService {
     @Autowired