|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.service.mange.group;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
@@ -16,12 +17,14 @@ import com.cyksj.mapper.manage.GroupsTripsAccountReplaceRecordMapper;
|
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
|
+import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
import com.cyksj.model.request.ReplaceTripsAccountReq;
|
|
|
import com.cyksj.model.views.GroupsAccountView;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.mange.AccountCommonService;
|
|
|
import com.cyksj.service.mange.CmsGroupService;
|
|
|
import com.cyksj.service.sms.SmsService;
|
|
|
+import com.cyksj.service.user.UserSysMsgNotifyService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapBuilder;
|
|
|
@@ -74,6 +77,8 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
|
|
|
private final GroupsRelationAlertMapper alertMapper;
|
|
|
|
|
|
+ private final UserSysMsgNotifyService userSysMsgNotifyService;
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
|
|
|
@@ -273,6 +278,9 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
}
|
|
|
updateById(groupsTrips);
|
|
|
|
|
|
+ GoodsDon goodsDon = goodsDonMapper.selectById(account.getGoodsId());
|
|
|
+ userSysMsgNotifyService.recordUserAccountSetSysMsg(account.getGoodsId(), groupsTrips.getSkuId(), groupsRelations, account.getAccount(), goodsDon.getTitle());
|
|
|
+
|
|
|
Integer alertCount = alertMapper.selectCount(Wrappers.lambdaQuery(GroupsRelationAlert.class)
|
|
|
.eq(GroupsRelationAlert::getSkuId, sku.getId())
|
|
|
.last("limit 1"));
|
|
|
@@ -364,7 +372,7 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
|
|
|
replaceRecordMapper.insert(replaceRecord);
|
|
|
|
|
|
- TASK_EXECUTOR.execute(() -> sendChangeAccountMsg(groupsId, goodsId));;
|
|
|
+ TASK_EXECUTOR.execute(() -> sendChangeAccountMsg(groupsId, goodsId, account));;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -419,12 +427,17 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void sendChangeAccountMsg(Long groupsId, Long goodsId) {
|
|
|
+ public void sendChangeAccountMsg(Long groupsId, Long goodsId, String account) {
|
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
|
|
|
String title = goodsDon != null ? goodsDon.getTitle() : "车票";
|
|
|
DateTime now = DateTime.now();
|
|
|
Boolean isPrd = envCommonService.isPrdEnv();
|
|
|
- List<GroupsRelation> groupsRelations = beanSearcher.searchAll(GroupsRelation.class, MapUtils.builder().field(GroupsRelation::getGroupsId, groupsId).build());
|
|
|
+ List<GroupsRelationView> groupsRelations = beanSearcher.searchAll(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getGroupsId, groupsId).build());
|
|
|
+ if (CollUtil.isEmpty(groupsRelations)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Long skuId = groupsMapper.selectById(groupsId).getSkuId();
|
|
|
+ userSysMsgNotifyService.recordUserAccountUpdateSysMsg(goodsId, skuId, groupsRelations, account, goodsDon.getTitle());
|
|
|
groupsRelations.forEach(relation -> {
|
|
|
if (relation.getExpiryTime() == null) {
|
|
|
return;
|