Commit 4fb35da5c5bff865aac12ee8318ea5a106374c07
1 parent
de033769
feature(*): 新增调试接口
- 新增调试接口
Showing
2 changed files
with
16 additions
and
8 deletions
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java
... | ... | @@ -12,15 +12,13 @@ import cn.fw.valhalla.service.bus.CustomerImportBizService; |
12 | 12 | import cn.fw.valhalla.service.bus.CustomerRetentionRatioBizService; |
13 | 13 | import cn.fw.valhalla.service.bus.LeaveNeedDoBizService; |
14 | 14 | import cn.fw.valhalla.service.bus.follow.FollowBizService; |
15 | +import cn.fw.valhalla.service.bus.pub.PubStandBizService; | |
15 | 16 | import lombok.RequiredArgsConstructor; |
16 | 17 | import lombok.extern.slf4j.Slf4j; |
17 | 18 | import org.apache.commons.lang3.StringUtils; |
18 | 19 | import org.apache.commons.lang3.math.NumberUtils; |
19 | 20 | import org.springframework.validation.annotation.Validated; |
20 | -import org.springframework.web.bind.annotation.GetMapping; | |
21 | -import org.springframework.web.bind.annotation.RequestMapping; | |
22 | -import org.springframework.web.bind.annotation.RequestParam; | |
23 | -import org.springframework.web.bind.annotation.RestController; | |
21 | +import org.springframework.web.bind.annotation.*; | |
24 | 22 | |
25 | 23 | import javax.validation.constraints.NotBlank; |
26 | 24 | import javax.validation.constraints.NotNull; |
... | ... | @@ -51,6 +49,7 @@ public class CommonController { |
51 | 49 | private final CustomerImportBizService customerImportBizService; |
52 | 50 | private final CustomerRetentionRatioBizService customerRetentionRatioBizService; |
53 | 51 | private final FollowBizService followBizService; |
52 | + private final PubStandBizService pubStandBizService; | |
54 | 53 | |
55 | 54 | |
56 | 55 | @GetMapping("/staff/list") |
... | ... | @@ -132,4 +131,15 @@ public class CommonController { |
132 | 131 | followBizService.manualStartClue(); |
133 | 132 | return success(); |
134 | 133 | } |
134 | + | |
135 | + @PutMapping("/stand/sync") | |
136 | + @IgnoreAuth | |
137 | + @ControllerMethod("同步站岗队列") | |
138 | + public Message<Void> syncStand(Long groupId) { | |
139 | + if (Objects.isNull(groupId)) { | |
140 | + groupId = 2L; | |
141 | + } | |
142 | + pubStandBizService.syncQueue(groupId); | |
143 | + return success(); | |
144 | + } | |
135 | 145 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/pub/PubStandBizService.java
... | ... | @@ -83,7 +83,7 @@ public class PubStandBizService { |
83 | 83 | * @param groupId |
84 | 84 | */ |
85 | 85 | public void syncQueue(final Long groupId) { |
86 | - String key = generateKey(groupId); | |
86 | + final String key = generateKey(groupId); | |
87 | 87 | List<PubStandStaffInfo> staffList = pubStandStaffInfoService.queryLiningStaff(groupId); |
88 | 88 | if (CollectionUtils.isEmpty(staffList)) { |
89 | 89 | return; |
... | ... | @@ -227,8 +227,6 @@ public class PubStandBizService { |
227 | 227 | staffInfo.ifPresent(r -> { |
228 | 228 | r.setLining(Boolean.FALSE); |
229 | 229 | r.setNoInvolved(Boolean.TRUE); |
230 | - r.setQueueable(Boolean.FALSE); | |
231 | - r.setReasonOfNoLining("主动退出"); | |
232 | 230 | boolean updated = pubStandStaffInfoService.updateById(r); |
233 | 231 | if (updated) { |
234 | 232 | CompletableFuture.runAsync(() -> syncQueue(groupId)); |
... | ... | @@ -263,7 +261,6 @@ public class PubStandBizService { |
263 | 261 | */ |
264 | 262 | private void join(final PubStandStaffInfo info) { |
265 | 263 | final String key = generateKey(info.getGroupId()); |
266 | - final Boolean hasKey = redisTemplate.hasKey(key); | |
267 | 264 | BoundListOperations<String, String> ops = redisTemplate.boundListOps(key); |
268 | 265 | |
269 | 266 | final boolean lining = Boolean.TRUE.equals(info.getLining()); |
... | ... | @@ -284,6 +281,7 @@ public class PubStandBizService { |
284 | 281 | pubStandStaffInfoService.saveOrUpdate(info); |
285 | 282 | ops.rightPush(id); |
286 | 283 | Date ashita = DateUtil.localDateTime2Date(LocalDate.now().plusDays(1).atStartOfDay().plusHours(1L)); |
284 | + final Boolean hasKey = redisTemplate.hasKey(key); | |
287 | 285 | if (!Boolean.TRUE.equals(hasKey)) { |
288 | 286 | redisTemplate.expireAt(key, ashita); |
289 | 287 | } | ... | ... |