|
|
@@ -1343,21 +1343,24 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
log.info("分销兑换积分比例未配置");
|
|
|
} else {
|
|
|
UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class).eq(UserDistribute::getUserId, userDistributeShared.getSharedId()).eq(UserDistribute::getDeleted, true).last("limit 1"));
|
|
|
+ //普通分销
|
|
|
+ GoodsDon goodsDon = goodsDonMapper.selectById(order.getGoodsId());
|
|
|
+ //分销比例
|
|
|
+ Integer rate = 0;
|
|
|
if (userDistribute == null) {
|
|
|
- //普通分销
|
|
|
- GoodsDon goodsDon = goodsDonMapper.selectById(order.getGoodsId());
|
|
|
if (goodsDon != null) {
|
|
|
+ rate = goodsDon.getRate();
|
|
|
//实物分销比例
|
|
|
if (goodsDon.getType() == 2) {
|
|
|
GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectById(order.getSkuId());
|
|
|
if (goodsDonSku != null) {
|
|
|
//不包含套餐权益
|
|
|
if (!goodsDonSku.getIsBenefits()) {
|
|
|
- goodsDon.setRate(goodsDon.getSecondRate());
|
|
|
+ rate = goodsDon.getSecondRate();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- returnMoney = orderMoney.multiply(BigDecimal.valueOf(goodsDon.getRate())).divide(BigDecimal.valueOf(100));
|
|
|
+ returnMoney = orderMoney.multiply(BigDecimal.valueOf(rate)).divide(BigDecimal.valueOf(100));
|
|
|
}
|
|
|
}else {
|
|
|
//固定推广分销
|
|
|
@@ -1366,7 +1369,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
.eq(UserPlatDistributeRate::getDistributeId, userDistribute.getId())
|
|
|
.last("limit 1"));
|
|
|
if (userPlatDistributeRate != null) {
|
|
|
- returnMoney = orderMoney.multiply(BigDecimal.valueOf(userPlatDistributeRate.getRate())).divide(BigDecimal.valueOf(100));
|
|
|
+ rate = userPlatDistributeRate.getRate();
|
|
|
+ if (goodsDon != null && goodsDon.getType() == 2) {
|
|
|
+ rate = userPlatDistributeRate.getSecondRate();
|
|
|
+ }
|
|
|
+ returnMoney = orderMoney.multiply(BigDecimal.valueOf(rate)).divide(BigDecimal.valueOf(100));
|
|
|
}
|
|
|
}
|
|
|
if (returnMoney != null) {
|