|
@@ -3,6 +3,7 @@ package com.cyksj.service.scheduler.impl;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.util.StringUtil;
|
|
import com.cyksj.common.util.StringUtil;
|
|
@@ -29,6 +30,8 @@ import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
*项目名: netflix
|
|
*项目名: netflix
|
|
@@ -63,6 +66,8 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
|
|
|
|
|
private final UserRelationChangeErrorRecordMapper userRelationChangeErrorRecordMapper;
|
|
private final UserRelationChangeErrorRecordMapper userRelationChangeErrorRecordMapper;
|
|
|
|
|
|
|
|
|
|
+ private final GoodsDonMapper goodsDonMapper;
|
|
|
|
|
+
|
|
|
private final RedisService redisService;
|
|
private final RedisService redisService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -117,6 +122,8 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
*/
|
|
*/
|
|
|
public void reAssign(Long g_groupsId, DateTime now, List<GroupsRelationView> groupsRelations) {
|
|
public void reAssign(Long g_groupsId, DateTime now, List<GroupsRelationView> groupsRelations) {
|
|
|
log.info("迁移groupsId:{}未过期用户数量:{}", g_groupsId, groupsRelations.size());
|
|
log.info("迁移groupsId:{}未过期用户数量:{}", g_groupsId, groupsRelations.size());
|
|
|
|
|
+ Map<Long, GoodsDon> goodsMap = new ConcurrentHashMap<>();
|
|
|
|
|
+ Map<Long, GoodsDonSku> skuMap = new ConcurrentHashMap<>();
|
|
|
groupsRelations.forEach(relationView -> {
|
|
groupsRelations.forEach(relationView -> {
|
|
|
Long change_relationId = relationView.getId();
|
|
Long change_relationId = relationView.getId();
|
|
|
Long userId = relationView.getUserId();
|
|
Long userId = relationView.getUserId();
|
|
@@ -193,6 +200,19 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
orderDon.setRefundBalance(re_balance);
|
|
orderDon.setRefundBalance(re_balance);
|
|
|
orderDon.setRefundMoney(BigDecimal.ZERO);
|
|
orderDon.setRefundMoney(BigDecimal.ZERO);
|
|
|
orderDonMapper.updateById(orderDon);
|
|
orderDonMapper.updateById(orderDon);
|
|
|
|
|
+ GoodsDon goodsDon = goodsMap.get(relationView.getGoodsId());
|
|
|
|
|
+ if (goodsDon == null) {
|
|
|
|
|
+ goodsDon = goodsDonMapper.selectById(relationView.getGoodsId());
|
|
|
|
|
+ if (goodsDon == null) return;
|
|
|
|
|
+ goodsMap.putIfAbsent(relationView.getGoodsId(), goodsDon);
|
|
|
|
|
+ }
|
|
|
|
|
+ GoodsDonSku sku = skuMap.get(orderDon.getSkuId());
|
|
|
|
|
+ if (sku == null) {
|
|
|
|
|
+ sku = skuMapper.selectById(orderDon.getSkuId());
|
|
|
|
|
+ if (sku == null) return;
|
|
|
|
|
+ skuMap.putIfAbsent(orderDon.getSkuId(), sku);
|
|
|
|
|
+ }
|
|
|
|
|
+ cmsOrderDonService.refundRecord(orderDon, goodsDon, sku, StrUtil.EMPTY, "balance");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.timing_change_ticket);
|
|
changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.timing_change_ticket);
|