|
|
@@ -614,14 +614,9 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
|
|
|
if (!distributeShared.getIsBind()) {
|
|
|
return;
|
|
|
}
|
|
|
+ //分销订单
|
|
|
+ orderDon.setIsDistribute(Boolean.TRUE);
|
|
|
Long sharedId = distributeShared.getSharedId();
|
|
|
- UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class)
|
|
|
- .eq(UserDistribute::getUserId, sharedId)
|
|
|
- .eq(UserDistribute::getDeleted, Boolean.TRUE)
|
|
|
- .last("limit 1"));
|
|
|
- if (userDistribute == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
Long goodsId = Constant.VIP_RELATE_GOODS_ID;
|
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
|
|
|
if (goodsDon == null) {
|
|
|
@@ -635,6 +630,11 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
|
|
|
if (distributePointsExchangeMoney == null) {
|
|
|
log.info("分销兑换积分比例未配置");
|
|
|
} else {
|
|
|
+ //渠道推广
|
|
|
+ UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class)
|
|
|
+ .eq(UserDistribute::getUserId, sharedId)
|
|
|
+ .eq(UserDistribute::getDeleted, Boolean.TRUE)
|
|
|
+ .last("limit 1"));
|
|
|
//分销比例
|
|
|
Integer rate = 0;
|
|
|
if (userDistribute == null) {
|
|
|
@@ -654,12 +654,13 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
|
|
|
}
|
|
|
returnMoney = orderMoney.multiply(BigDecimal.valueOf(rate)).divide(BigDecimal.valueOf(100));
|
|
|
} else {
|
|
|
+ //渠道推广
|
|
|
+ orderDon.setIsFixedDistribute(Boolean.TRUE);
|
|
|
//固定推广分销 平台比例
|
|
|
UserPlatDistributeRate userPlatDistributeRate = userPlatDistributeRateMapper.selectOne(Wrappers.lambdaQuery(UserPlatDistributeRate.class)
|
|
|
.eq(UserPlatDistributeRate::getGoodsId, goodsId)
|
|
|
.eq(UserPlatDistributeRate::getDistributeId, userDistribute.getId())
|
|
|
.last("limit 1"));
|
|
|
- ;
|
|
|
//未配置平台分销比例 寻找默认比例
|
|
|
if (userPlatDistributeRate == null) {
|
|
|
BusinessDistributeDefaultRateConfig defaultRateConfig = businessDistributeDefaultRateConfigMapper.selectOne(Wrappers.lambdaQuery(BusinessDistributeDefaultRateConfig.class)
|