|
|
@@ -928,6 +928,7 @@ public class CmsAccountController {
|
|
|
@PostMapping("/replace/banned")
|
|
|
public Result<List<String>> replaceBannedAccount(Long goodsId, MultipartFile file) throws IOException {
|
|
|
List<String> repeat = new ArrayList<>();
|
|
|
+ List<Long> sendMsgList = new ArrayList<>();
|
|
|
EasyExcel.read(file.getInputStream(), ExcelBannedAccountData.class, new AnalysisEventListener<ExcelBannedAccountData>() {
|
|
|
@Override
|
|
|
public void invoke(ExcelBannedAccountData data, AnalysisContext analysisContext) {
|
|
|
@@ -956,13 +957,7 @@ public class CmsAccountController {
|
|
|
dbAccount.setExpiryTime(DateUtil.offsetMonth(DateTime.now(), 1));
|
|
|
accountService.updateById(dbAccount);
|
|
|
|
|
|
- TASK_EXECUTOR.execute(() -> {
|
|
|
- GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
- .eq(GroupsTrips::getAccountId, dbAccount.getId()).last("limit 1"));
|
|
|
- if (groupsTrips != null) {
|
|
|
- cmsGroupService.sendChangeAccountMsg(groupsTrips.getId(), goodsId);
|
|
|
- }
|
|
|
- });;
|
|
|
+ sendMsgList.add(dbAccount.getId());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -970,6 +965,18 @@ public class CmsAccountController {
|
|
|
|
|
|
}
|
|
|
}).sheet().doRead();
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(sendMsgList)) {
|
|
|
+ TASK_EXECUTOR.execute(() -> {
|
|
|
+ sendMsgList.forEach(accountId -> {
|
|
|
+ GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
+ .eq(GroupsTrips::getAccountId, accountId).last("limit 1"));
|
|
|
+ if (groupsTrips != null) {
|
|
|
+ cmsGroupService.sendChangeAccountMsg(groupsTrips.getId(), goodsId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(repeat);
|
|
|
}
|
|
|
|