|
|
@@ -203,6 +203,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
private final UserBindDetailMapper userBindDetailMapper;
|
|
|
|
|
|
+ private final UserDistributeCycleConfigMapper distributeCycleConfigMapper;
|
|
|
+
|
|
|
private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
|
|
|
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
@@ -538,6 +540,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
updateCarParkAndSendMsg(goodsDon, sku, order);
|
|
|
}
|
|
|
if (order.getMoney().compareTo(BigDecimal.ZERO) > 0 && order.getIsDistribute()) {
|
|
|
+ //分销积分
|
|
|
TASK_POOL.execute(() -> distributeWaitingSendPointsRecord(order));
|
|
|
}
|
|
|
if (goodsDon.getType() == 1) {
|
|
|
@@ -881,6 +884,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
updateCarParkAndSendMsg(goodsDon, sku, orderDon);
|
|
|
}
|
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0 && orderDon.getIsDistribute()) {
|
|
|
+ //分销积分
|
|
|
TASK_POOL.execute(() -> distributeWaitingSendPointsRecord(orderDon));
|
|
|
}
|
|
|
if (goodsDon.getType() == 1) {
|
|
|
@@ -1664,6 +1668,24 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
.eq(UserPlatDistributeRate::getDistributeId, userDistribute.getId())
|
|
|
.last("limit 1"));
|
|
|
if (userPlatDistributeRate != null) {
|
|
|
+ //是否打开默认分销首单循环
|
|
|
+ UserDistributeCycleConfig userDistributeCycleConfig = distributeCycleConfigMapper.selectOne(Wrappers.lambdaQuery(UserDistributeCycleConfig.class)
|
|
|
+ .eq(UserDistributeCycleConfig::getGoodsId, goodsDon.getId())
|
|
|
+ .eq(UserDistributeCycleConfig::getIsOpen, true)
|
|
|
+ .select(UserDistributeCycleConfig::getId).last("limit 1"));
|
|
|
+ if (userDistributeCycleConfig != null) {
|
|
|
+ //是否享受过该用户首单
|
|
|
+ DistributeWaitingSendPoints exists = distributeWaitingSendPointsMapper.selectOne(Wrappers.lambdaQuery(DistributeWaitingSendPoints.class)
|
|
|
+ .in(DistributeWaitingSendPoints::getSendStatus, List.of(DistributeWaitingSendPoints.Status.waiting, DistributeWaitingSendPoints.Status.success))
|
|
|
+ .eq(DistributeWaitingSendPoints::getSharedId, userDistribute.getUserId())
|
|
|
+ .eq(DistributeWaitingSendPoints::getUserId, order.getUserId())
|
|
|
+ .select(DistributeWaitingSendPoints::getId)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (exists != null) {
|
|
|
+ log.info("分销用户id:{}已享受用户id:{}首单提成", userDistribute.getUserId(), order.getUserId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
rate = userPlatDistributeRate.getRate();
|
|
|
if (goodsDon != null && goodsDon.getType() == 2) {
|
|
|
GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectById(order.getSkuId());
|