Browse Source

替换封禁账号发送短信通知

zoujiajian 2 năm trước cách đây
mục cha
commit
7f8ac47c88

+ 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);
 
 	Integer getAvailableRelation(Long goodsId, Long skuId);
+
+    void sendChangeAccountMsg(Long groupsId, Long goodsId);
 }

+ 2 - 1
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;
     }
 
-    private void sendChangeAccountMsg(Long groupsId, Long goodsId) {
+    @Override
+    public void sendChangeAccountMsg(Long groupsId, Long goodsId) {
         GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
         String title = goodsDon != null ? goodsDon.getTitle() : "车票";
         DateTime now = DateTime.now();

+ 11 - 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.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.dto.RedisKey;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
@@ -105,6 +106,8 @@ public class CmsAccountController {
 
 	private final SysEmailMapper sysEmailMapper;
 
+	private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
+
 	@GetMapping("/get")
 	@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) {
@@ -952,6 +955,14 @@ public class CmsAccountController {
 				dbAccount.setStartTime(DateTime.now());
 				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);
+					}
+				});;
 			}
 
 			@Override