Commit a515d3cad2eba1f41569a168dcc3a67de829529b

Authored by 王明元
1 parent 70ac486d

2023年3月10日10:50:32 修复待办不完成bug

fw-dalaran-domain/src/main/java/cn/fw/dalaran/domain/vo/LiveCheckVo.java
... ... @@ -19,13 +19,13 @@ public class LiveCheckVo {
19 19 /**
20 20 * 待审核直播列表
21 21 */
22   - private List<liveSummary> liveList;
  22 + private List<LiveSummary> liveList;
23 23  
24 24 /**
25 25 * 待审核直播
26 26 */
27 27 @Data
28   - public static class liveSummary {
  28 + public static class LiveSummary {
29 29 /**
30 30 * 主键id
31 31 */
... ...
fw-dalaran-server/src/main/java/cn/fw/dalaran/server/controller/app/OtherController.java
... ... @@ -74,7 +74,7 @@ public class OtherController {
74 74 */
75 75 @GetMapping("/getLiveCheckDetails")
76 76 @ControllerMethod("获取某条审计详情")
77   - public Message<LiveCheckVo.liveSummary> getLiveCheckDetails(@NotNull(message = "请必须指定数据id") Long id) {
  77 + public Message<LiveCheckVo.LiveSummary> getLiveCheckDetails(@NotNull(message = "请必须指定数据id") Long id) {
78 78 return success(otherBizService.getLiveCheckDetails(id));
79 79 }
80 80  
... ...
fw-dalaran-server/src/main/java/cn/fw/dalaran/server/controller/web/TestBizService.java
1 1 package cn.fw.dalaran.server.controller.web;
2 2  
  3 +import cn.fw.attendance.sdk.api.AttendanceApi;
  4 +import cn.fw.attendance.sdk.api.StaffStatusApi;
  5 +import cn.fw.attendance.sdk.api.dto.UsersScheduleDetailsDto;
  6 +import cn.fw.attendance.sdk.api.result.UserStatusVo;
  7 +import cn.fw.attendance.sdk.api.result.UsersScheduleDetailsVo;
3 8 import cn.fw.dalaran.domain.db.Account;
4 9 import cn.fw.dalaran.domain.enums.PlatformEnum;
5 10 import cn.fw.dalaran.service.data.AccountService;
  11 +import cn.fw.data.base.domain.common.Message;
6 12 import lombok.RequiredArgsConstructor;
7 13 import lombok.extern.slf4j.Slf4j;
8 14 import org.springframework.aop.framework.AopContext;
... ... @@ -10,6 +16,10 @@ import org.springframework.beans.factory.annotation.Autowired;
10 16 import org.springframework.stereotype.Service;
11 17 import org.springframework.transaction.annotation.Transactional;
12 18  
  19 +import java.util.Arrays;
  20 +import java.util.Date;
  21 +import java.util.List;
  22 +
13 23 /**
14 24 * @author wmy3969
15 25 * @version 1.0
... ... @@ -35,6 +45,8 @@ public class TestBizService {
35 45 */
36 46  
37 47 private TestBizService testBizService;
  48 + private final StaffStatusApi staffStatusApi;
  49 + private final AttendanceApi attendanceApi;
38 50  
39 51 @Autowired
40 52 public void inject(TestBizService testBizService) {
... ... @@ -45,6 +57,13 @@ public class TestBizService {
45 57  
46 58 @Transactional(rollbackFor = Exception.class)
47 59 public void methodA() {
  60 + Message<UserStatusVo> details = staffStatusApi.getUserStatusDetails(Arrays.asList(760L, 1545L, 1486L, 1342L), 1611975222000L, 1675047222937L);
  61 + UsersScheduleDetailsDto dto = new UsersScheduleDetailsDto();
  62 + dto.setGroupId(2L);
  63 + dto.setUserIds(Arrays.asList(760L, 1545L, 1486L, 1342L));
  64 + dto.setStartTime(new Date(1646818372000L));
  65 + dto.setEndTime(new Date(1678354372000L));
  66 + Message<List<UsersScheduleDetailsVo>> scheduleDetails = attendanceApi.getUsersScheduleDetails(dto);
48 67 Account account = new Account();
49 68 account.setAccount("methodA");
50 69 account.setYn(Boolean.FALSE);
... ...
fw-dalaran-server/src/main/java/cn/fw/dalaran/server/task/TodoTask.java
... ... @@ -117,17 +117,16 @@ public class TodoTask {
117 117 return;
118 118 }
119 119 for (TodoHistory history : list) {
120   - if (Objects.equals(history.getTodoCode(), Constants.ACCOUNT_INVALID)) {// 账号失效待办
121   - /*Account account = accountService.getById(history.getDataId());
  120 + /*if (Objects.equals(history.getTodoCode(), Constants.ACCOUNT_INVALID)) {// 账号失效待办
  121 + Account account = accountService.getById(history.getDataId());
122 122 if (Objects.isNull(account)) {
123 123 continue;
124   - }*/
125   -
126   - BackLogItemDTO dto = new BackLogItemDTO(history.getUserId(), history.getTodoCode(),
127   - history.getDataId().toString(), new Date(), history.getShopId());// 构造待办参数
128   - if (todoRpcService.complete(dto)) {
129   - history.setTodoDone(Boolean.TRUE);
130 124 }
  125 + }*/
  126 + BackLogItemDTO dto = new BackLogItemDTO(history.getUserId(), history.getTodoCode(),
  127 + history.getDataId().toString(), new Date(), history.getShopId());// 构造待办参数
  128 + if (todoRpcService.complete(dto)) {
  129 + history.setTodoDone(Boolean.TRUE);
131 130 }
132 131 }
133 132 todoHistoryService.updateBatchById(list);
... ...
fw-dalaran-service/src/main/java/cn/fw/dalaran/service/biz/CommonBizService.java
... ... @@ -782,8 +782,8 @@ public class CommonBizService {
782 782  
783 783 public static void main(String[] args) {
784 784 System.out.println(System.getProperty("java.io.tmpdir"));
785   - String workTitle = "#SL03全电数字轿跑";
786   - String setTopic = "#深蓝SL03燃油轿车进阶之选,#SL03全电数字轿跑,#SL03长续航低能耗,#SL03感受深蓝爱上电动,#SL03增程版燃油车终结者,#深蓝SL03无惧battle赢翻了,#市区纯电长途混动SL03增程版里程无忧,#都2022年了你还在买燃油车,#回个老家充n次电不如换一台长安深蓝1200km续航真的很绝".replace(",", "");
  785 + String workTitle = "#现车加\\\"免\\\"开新过新年";
  786 + String setTopic = "#温暖回家路提现车过新年,#现车加\\免\\开新过新年,#温暖回家路春节不打烊,#开年有礼大展宏兔,#智电超能体验,#开新年夜FUN,#温暖回家路一路有你,#展厅实车带货UNI-K iDD".replace(",", "");
787 787 Set<String> strings1 = processTags(workTitle);
788 788 Set<String> strings2 = processTags(setTopic);
789 789 System.out.println(CollectionUtils.containsAny(strings1, strings2));
... ...
fw-dalaran-service/src/main/java/cn/fw/dalaran/service/biz/OtherBizService.java
... ... @@ -105,13 +105,13 @@ public class OtherBizService {
105 105 }
106 106 if (!CollectionUtils.isEmpty(waitCheckLives)) {
107 107 vo.setTheme(ActivityTheme.toVO(Objects.requireNonNull(activityThemeService.getById(themeId))));
108   - vo.setLiveList(PublicUtil.copyList(waitCheckLives, LiveCheckVo.liveSummary.class).stream()
  108 + vo.setLiveList(PublicUtil.copyList(waitCheckLives, LiveCheckVo.LiveSummary.class).stream()
109 109 .peek(item -> {
110 110 final LivePool live = livePoolService.getById(item.getLiveId());
111 111 item.setTitle(live.getTitle());
112 112 item.setPlaybackUrl(live.getPlaybackUrl());
113 113 })
114   - .sorted(Comparator.comparing(LiveCheckVo.liveSummary::getCounterfeit))
  114 + .sorted(Comparator.comparing(LiveCheckVo.LiveSummary::getCounterfeit))
115 115 .collect(Collectors.toList())
116 116 );
117 117 }
... ... @@ -174,7 +174,7 @@ public class OtherBizService {
174 174 liveCheckResult.setValid(Objects.equals(liveCheckResult.getCounterfeit(), 0) && Objects.equals(liveCheckResult.getPay(), 0) ? 1 : 0);
175 175 return liveCheckResultService.updateById(liveCheckResult);
176 176 } else if (Objects.equals(type, 1)) {// 完成待办
177   - final List<LiveCheckVo.liveSummary> summaries = this.getLiveCheck(userId, dataId).getLiveList();
  177 + final List<LiveCheckVo.LiveSummary> summaries = this.getLiveCheck(userId, dataId).getLiveList();
178 178 if (summaries.stream().anyMatch(item -> Objects.equals(item.getCounterfeit(), -1))) {
179 179 throw new BusinessException("还有未完成审核的直播, 请完成所有直播审核后重新提交");
180 180 } else {
... ... @@ -187,7 +187,7 @@ public class OtherBizService {
187 187 throw new BusinessException("完成待办失败");
188 188 final List<Long> invalidLiveIds = summaries.stream()
189 189 .filter(item -> Objects.equals(item.getValid(), 0))
190   - .map(LiveCheckVo.liveSummary::getLiveId)
  190 + .map(LiveCheckVo.LiveSummary::getLiveId)
191 191 .collect(Collectors.toList());
192 192 if (!CollectionUtils.isEmpty(invalidLiveIds)) {
193 193 ActivityTheme activityTheme = activityThemeService.getById(param.getDataId());
... ... @@ -214,7 +214,7 @@ public class OtherBizService {
214 214 .set(LiveCheckResult::getStatus, type)
215 215 .in(LiveCheckResult::getId, summaries
216 216 .stream()
217   - .map(LiveCheckVo.liveSummary::getId)
  217 + .map(LiveCheckVo.LiveSummary::getId)
218 218 .collect(Collectors.toList())
219 219 ).update();
220 220 }
... ... @@ -228,9 +228,9 @@ public class OtherBizService {
228 228 * @param id
229 229 * @return
230 230 */
231   - public LiveCheckVo.liveSummary getLiveCheckDetails(Long id) {
  231 + public LiveCheckVo.LiveSummary getLiveCheckDetails(Long id) {
232 232 final LiveCheckResult checkResult = liveCheckResultService.getById(id);
233   - final LiveCheckVo.liveSummary liveSummary = PublicUtil.copy(checkResult, LiveCheckVo.liveSummary.class);
  233 + final LiveCheckVo.LiveSummary liveSummary = PublicUtil.copy(checkResult, LiveCheckVo.LiveSummary.class);
234 234 final LivePool live = livePoolService.getById(checkResult.getLiveId());
235 235 liveSummary.setTitle(live.getTitle());
236 236 liveSummary.setPlaybackUrl(live.getPlaybackUrl());
... ...