Commit 14f3c1f12ccbb86eee7d01b40d36816df164d237

Authored by 张志伟
1 parent 7c457605

:bug: v1.1.0 bug修改

fw-valhalla-service/src/main/java/cn/fw/valhalla/component/FlowConsumer.java
... ... @@ -5,15 +5,18 @@ import cn.fw.flow.result.ApproveCheckMessageDto;
5 5 import cn.fw.valhalla.domain.db.ApproveRecord;
6 6 import cn.fw.valhalla.domain.db.follow.FollowTask;
7 7 import cn.fw.valhalla.domain.enums.ApproveStateEnum;
  8 +import cn.fw.valhalla.domain.enums.FollowTypeEnum;
8 9 import cn.fw.valhalla.domain.enums.TaskStateEnum;
9 10 import cn.fw.valhalla.service.bus.cust.CustomerBizService;
10 11 import cn.fw.valhalla.service.data.ApproveRecordService;
11 12 import cn.fw.valhalla.service.data.FollowTaskService;
  13 +import cn.fw.valhalla.service.event.StopTaskEvent;
12 14 import com.alibaba.fastjson.JSONObject;
13 15 import lombok.extern.slf4j.Slf4j;
14 16 import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
15 17 import org.apache.rocketmq.spring.core.RocketMQListener;
16 18 import org.springframework.beans.factory.annotation.Autowired;
  19 +import org.springframework.context.ApplicationEventPublisher;
17 20 import org.springframework.stereotype.Service;
18 21 import org.springframework.transaction.annotation.Transactional;
19 22  
... ... @@ -33,15 +36,18 @@ public class FlowConsumer implements RocketMQListener<ApproveCheckMessageDto> {
33 36 private final CustomerBizService customerBizService;
34 37 private final ApproveRecordService approveRecordService;
35 38 private final FollowTaskService followTaskService;
  39 + private final ApplicationEventPublisher eventPublisher;
36 40  
37 41  
38 42 @Autowired
39 43 public FlowConsumer(final CustomerBizService customerBizService,
40 44 final ApproveRecordService approveRecordService,
41   - final FollowTaskService followTaskService) {
  45 + final FollowTaskService followTaskService,
  46 + final ApplicationEventPublisher eventPublisher) {
42 47 this.customerBizService = customerBizService;
43 48 this.approveRecordService = approveRecordService;
44 49 this.followTaskService = followTaskService;
  50 + this.eventPublisher = eventPublisher;
45 51 }
46 52  
47 53 @Override
... ... @@ -71,6 +77,11 @@ public class FlowConsumer implements RocketMQListener<ApproveCheckMessageDto> {
71 77 if (Objects.isNull(task) || !TaskStateEnum.ONGOING.equals(task.getState())) {
72 78 return;
73 79 }
  80 + if (FollowTypeEnum.AC.equals(task.getType())) {
  81 + StopTaskEvent stopTaskEvent = new StopTaskEvent(task);
  82 + eventPublisher.publishEvent(stopTaskEvent);
  83 + return;
  84 + }
74 85 customerBizService.abandon(task);
75 86 }
76 87 }
... ...