Commit 326b920b951888ce0fd4d211a045f5b8965f99de

Authored by 张志伟
1 parent 7937a4a5

添加错误捕获

fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/task/FollowTaskDealTask.java
... ... @@ -4,6 +4,7 @@ import cn.fw.valhalla.common.utils.DateUtil;
4 4 import cn.fw.valhalla.domain.db.follow.ClueTask;
5 5 import cn.fw.valhalla.domain.db.follow.FollowClue;
6 6 import cn.fw.valhalla.domain.enums.ClueStatusEnum;
  7 +import cn.fw.valhalla.domain.enums.FollowTypeEnum;
7 8 import cn.fw.valhalla.domain.enums.TaskStateEnum;
8 9 import cn.fw.valhalla.service.bus.follow.FollowBizService;
9 10 import cn.fw.valhalla.service.data.ClueTaskService;
... ... @@ -44,10 +45,11 @@ public class FollowTaskDealTask {
44 45 /**
45 46 * 开始任务
46 47 */
47   -// @Scheduled(initialDelay = 1000 * 10, fixedRate = 1000 * 10)
  48 + @Scheduled(initialDelay = 1000 * 10, fixedRate = 1000 * 10)
48 49 public void startClue() {
49 50 List<FollowClue> list = followClueService.list(Wrappers.<FollowClue>lambdaQuery()
50 51 .eq(FollowClue::getClueState, ClueStatusEnum.WAITING)
  52 + .ne(FollowClue::getClueType, FollowTypeEnum.IR)
51 53 .ge(FollowClue::getStartTime, DateUtil.localDateTime2Date(LocalDate.now().minusDays(1L).atTime(23, 59, 59)))
52 54 .le(FollowClue::getStartTime, DateUtil.localDateTime2Date(LocalDateTime.now()))
53 55 .last("limit 0, 500")
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CommonService.java
... ... @@ -169,7 +169,11 @@ public class CommonService {
169 169 .eq(Customer::getYn, Boolean.TRUE)
170 170 );
171 171 for (Customer customer : list) {
172   - createClue(customer);
  172 + try {
  173 + createClue(customer);
  174 + } catch (Exception e) {
  175 + log.error("手动生成续保任务失败:", e);
  176 + }
173 177 }
174 178 }
175 179  
... ...