Explorar o código

Merge remote-tracking branch 'origin/master' into import_prepare

zoujiajian %!s(int64=2) %!d(string=hai) anos
pai
achega
49724c3a83

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/mange/CmsGroupService.java

@@ -19,4 +19,6 @@ public interface CmsGroupService extends IService<GroupsTrips> {
     void replaceTripsAccount(ReplaceTripsAccountReq req);
     void replaceTripsAccount(ReplaceTripsAccountReq req);
 
 
 	Integer getAvailableRelation(Long goodsId, Long skuId);
 	Integer getAvailableRelation(Long goodsId, Long skuId);
+
+    void sendChangeAccountMsg(Long groupsId, Long goodsId);
 }
 }

+ 4 - 2
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -397,7 +397,8 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
         return available;
         return available;
     }
     }
 
 
-    private void sendChangeAccountMsg(Long groupsId, Long goodsId) {
+    @Override
+    public void sendChangeAccountMsg(Long groupsId, Long goodsId) {
         GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
         GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
         String title = goodsDon != null ? goodsDon.getTitle() : "车票";
         String title = goodsDon != null ? goodsDon.getTitle() : "车票";
         DateTime now = DateTime.now();
         DateTime now = DateTime.now();
@@ -411,7 +412,8 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
             if (now.after(DateUtil.offsetDay(relation.getExpiryTime(), -5))) {
             if (now.after(DateUtil.offsetDay(relation.getExpiryTime(), -5))) {
                 return;
                 return;
             }
             }
-            if (Constant.CHANGE_ACCOUNT_PWD_FILTER_GIDS.contains(goodsId)) {
+            //去掉GPT过滤平台
+            if (Constant.CHANGE_ACCOUNT_PWD_FILTER_GIDS.get(1) == goodsId) {
                 return;
                 return;
             }
             }
             if (relation.getUserId() != 0 && isPrd && relation.getYhsId() == 0) {
             if (relation.getUserId() != 0 && isPrd && relation.getYhsId() == 0) {

+ 18 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -17,6 +17,7 @@ import com.cyksj.common.annotation.Log;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.dto.RedisKey;
 import com.cyksj.dto.RedisKey;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.BusinessType;
@@ -106,6 +107,8 @@ public class CmsAccountController {
 
 
 	private final SysEmailMapper sysEmailMapper;
 	private final SysEmailMapper sysEmailMapper;
 
 
+	private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
+
 	@GetMapping("/get")
 	@GetMapping("/get")
 	@SaCheckPermission("account:view")
 	@SaCheckPermission("account:view")
 	public Result<SearchResult<AccountView>> get(Long userId, String showId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday, Integer noChangeMonths) {
 	public Result<SearchResult<AccountView>> get(Long userId, String showId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday, Integer noChangeMonths) {
@@ -926,6 +929,7 @@ public class CmsAccountController {
 	@PostMapping("/replace/banned")
 	@PostMapping("/replace/banned")
 	public Result<List<String>> replaceBannedAccount(Long goodsId, MultipartFile file) throws IOException {
 	public Result<List<String>> replaceBannedAccount(Long goodsId, MultipartFile file) throws IOException {
 		List<String> repeat = new ArrayList<>();
 		List<String> repeat = new ArrayList<>();
+		List<Long> sendMsgList = new ArrayList<>();
 		EasyExcel.read(file.getInputStream(), ExcelBannedAccountData.class, new AnalysisEventListener<ExcelBannedAccountData>() {
 		EasyExcel.read(file.getInputStream(), ExcelBannedAccountData.class, new AnalysisEventListener<ExcelBannedAccountData>() {
 			@Override
 			@Override
 			public void invoke(ExcelBannedAccountData data, AnalysisContext analysisContext) {
 			public void invoke(ExcelBannedAccountData data, AnalysisContext analysisContext) {
@@ -953,6 +957,8 @@ public class CmsAccountController {
 				dbAccount.setStartTime(DateTime.now());
 				dbAccount.setStartTime(DateTime.now());
 				dbAccount.setExpiryTime(DateUtil.offsetMonth(DateTime.now(), 1));
 				dbAccount.setExpiryTime(DateUtil.offsetMonth(DateTime.now(), 1));
 				accountService.updateById(dbAccount);
 				accountService.updateById(dbAccount);
+
+				sendMsgList.add(dbAccount.getId());
 			}
 			}
 
 
 			@Override
 			@Override
@@ -960,6 +966,18 @@ public class CmsAccountController {
 
 
 			}
 			}
 		}).sheet().doRead();
 		}).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);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(repeat);
 	}
 	}