Commit 326b920b951888ce0fd4d211a045f5b8965f99de
1 parent
7937a4a5
添加错误捕获
Showing
2 changed files
with
8 additions
and
2 deletions
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,6 +4,7 @@ import cn.fw.valhalla.common.utils.DateUtil; | ||
4 | import cn.fw.valhalla.domain.db.follow.ClueTask; | 4 | import cn.fw.valhalla.domain.db.follow.ClueTask; |
5 | import cn.fw.valhalla.domain.db.follow.FollowClue; | 5 | import cn.fw.valhalla.domain.db.follow.FollowClue; |
6 | import cn.fw.valhalla.domain.enums.ClueStatusEnum; | 6 | import cn.fw.valhalla.domain.enums.ClueStatusEnum; |
7 | +import cn.fw.valhalla.domain.enums.FollowTypeEnum; | ||
7 | import cn.fw.valhalla.domain.enums.TaskStateEnum; | 8 | import cn.fw.valhalla.domain.enums.TaskStateEnum; |
8 | import cn.fw.valhalla.service.bus.follow.FollowBizService; | 9 | import cn.fw.valhalla.service.bus.follow.FollowBizService; |
9 | import cn.fw.valhalla.service.data.ClueTaskService; | 10 | import cn.fw.valhalla.service.data.ClueTaskService; |
@@ -44,10 +45,11 @@ public class FollowTaskDealTask { | @@ -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 | public void startClue() { | 49 | public void startClue() { |
49 | List<FollowClue> list = followClueService.list(Wrappers.<FollowClue>lambdaQuery() | 50 | List<FollowClue> list = followClueService.list(Wrappers.<FollowClue>lambdaQuery() |
50 | .eq(FollowClue::getClueState, ClueStatusEnum.WAITING) | 51 | .eq(FollowClue::getClueState, ClueStatusEnum.WAITING) |
52 | + .ne(FollowClue::getClueType, FollowTypeEnum.IR) | ||
51 | .ge(FollowClue::getStartTime, DateUtil.localDateTime2Date(LocalDate.now().minusDays(1L).atTime(23, 59, 59))) | 53 | .ge(FollowClue::getStartTime, DateUtil.localDateTime2Date(LocalDate.now().minusDays(1L).atTime(23, 59, 59))) |
52 | .le(FollowClue::getStartTime, DateUtil.localDateTime2Date(LocalDateTime.now())) | 54 | .le(FollowClue::getStartTime, DateUtil.localDateTime2Date(LocalDateTime.now())) |
53 | .last("limit 0, 500") | 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,7 +169,11 @@ public class CommonService { | ||
169 | .eq(Customer::getYn, Boolean.TRUE) | 169 | .eq(Customer::getYn, Boolean.TRUE) |
170 | ); | 170 | ); |
171 | for (Customer customer : list) { | 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 |