|
|
@@ -151,34 +151,42 @@ public class UserBusinessFrontServiceImpl implements UserBusinessFrontService {
|
|
|
record.setOrderId(order.getId());
|
|
|
record.setPreRelationId(order.getRelationId());
|
|
|
//是否超过默认配置平台比例
|
|
|
- Integer defaultGoodsMaxRate = defaultGoodsRateConfig.getMaxRate();
|
|
|
+ Integer defaultGoodsRate = defaultGoodsRateConfig.getRate();
|
|
|
//首单提成比例
|
|
|
BigDecimal orderMoney = order.getMoney();
|
|
|
- BigDecimal takeMoney = null;
|
|
|
+ BigDecimal takeMoney = BigDecimal.ZERO;
|
|
|
if (firstOrderRate != null) {
|
|
|
- if (distributeRate > defaultGoodsMaxRate) {
|
|
|
+ if (distributeRate > defaultGoodsRate) {
|
|
|
if (defaultGoodsRateConfig.getIsPlatPay()) {
|
|
|
- log.info("首单,平台承担商务businessId:{}配置分销者sharedId:{}超过平台goodsId:{}最高分销比例:{}", businessId, sharedId, order.getGoodsId(), defaultGoodsMaxRate);
|
|
|
- }else {
|
|
|
- firstOrderRate -= distributeRate - defaultGoodsMaxRate;
|
|
|
- log.info("商务businessId:{}配置分销者sharedId:{}比例超过默认比例,可获取首单提成比例为:{}", businessId, sharedId, firstOrderRate);
|
|
|
+ log.info("首单,平台承担商务businessId:{}配置分销者sharedId:{}超过平台goodsId:{}标准分销比例:{}", businessId, sharedId, order.getGoodsId(), defaultGoodsRate);
|
|
|
+ } else {
|
|
|
+ firstOrderRate -= distributeRate - defaultGoodsRate;
|
|
|
+ log.info("商务businessId:{}配置分销者sharedId:{}比例超过标准比例,可获取首单提成比例为:{}", businessId, sharedId, firstOrderRate);
|
|
|
+ if (firstOrderRate <= 0) {
|
|
|
+ log.info("商务businessId:{}获得分销者sharedId:{}首单提成比例不大于0", businessId, sharedId);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- BigDecimal firstRate = BigDecimal.valueOf(firstOrderRate).divide(BigDecimal.valueOf(100));
|
|
|
record.setRate(firstOrderRate);
|
|
|
+ BigDecimal firstRate = BigDecimal.valueOf(firstOrderRate).divide(BigDecimal.valueOf(100));
|
|
|
takeMoney = orderMoney.multiply(firstRate);
|
|
|
}
|
|
|
if (renewOrderRate != null) {
|
|
|
- if (distributeRate > defaultGoodsMaxRate) {
|
|
|
+ if (distributeRate > defaultGoodsRate) {
|
|
|
if (defaultGoodsRateConfig.getIsPlatPay()) {
|
|
|
- log.info("首单续费,平台承担商务businessId:{}配置分销者sharedId:{}超过平台goodsId:{}最高分销比例:{}", businessId, sharedId, order.getGoodsId(), defaultGoodsMaxRate);
|
|
|
- }else {
|
|
|
- renewOrderRate -= distributeRate - defaultGoodsMaxRate;
|
|
|
- log.info("商务businessId:{}配置分销者sharedId:{}比例超过默认比例,可获取首单续费提成比例为:{}", businessId, sharedId, firstOrderRate);
|
|
|
+ log.info("首单续费,平台承担商务businessId:{}配置分销者sharedId:{}超过平台goodsId:{}标准分销比例:{}", businessId, sharedId, order.getGoodsId(), defaultGoodsRate);
|
|
|
+ } else {
|
|
|
+ renewOrderRate -= distributeRate - defaultGoodsRate;
|
|
|
+ log.info("商务businessId:{}配置分销者sharedId:{}比例超过标准比例,可获取首单续费提成比例为:{}", businessId, sharedId, renewOrderRate);
|
|
|
+ if (renewOrderRate <= 0) {
|
|
|
+ log.info("商务businessId:{}获得分销者sharedId:{}首单续费提成比例不大于0", businessId, sharedId);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- BigDecimal renewRate = BigDecimal.valueOf(renewOrderRate).divide(BigDecimal.valueOf(100));
|
|
|
record.setRate(renewOrderRate);
|
|
|
+ BigDecimal renewRate = BigDecimal.valueOf(renewOrderRate).divide(BigDecimal.valueOf(100));
|
|
|
takeMoney = orderMoney.multiply(renewRate);
|
|
|
}
|
|
|
record.setTakeMoney(takeMoney);
|