...
|
...
|
@@ -170,11 +170,9 @@ public class SellerService { |
|
|
*/
|
|
|
public SellerPlatformServiceFeeResp platformServiceFeeDetail(int uid) {
|
|
|
logger.info("platformServiceFeeDetail uid {}", uid);
|
|
|
SellerPlatformServiceFee currentServiceFee = getCurrentTimeSellerPlatformServiceFee(uid);
|
|
|
|
|
|
SellerPlatformServiceFee nextPeriodServiceFee = getNextPeriodSellerPlatformServiceFee(uid);
|
|
|
|
|
|
if (!currentServiceFee.isRuleConfigured() || !nextPeriodServiceFee.isRuleConfigured()) {
|
|
|
SellerPlatformServiceFee currentServiceFee, nextPeriodServiceFee;
|
|
|
if (!(currentServiceFee = getCurrentTimeSellerPlatformServiceFee(uid)).isRuleConfigured()
|
|
|
|| !(nextPeriodServiceFee = getNextPeriodSellerPlatformServiceFee(uid)).isRuleConfigured()) {
|
|
|
logger.info("platformServiceFee rule is not configured,uid {}", uid);
|
|
|
return SellerPlatformServiceFeeResp.builder()
|
|
|
.nodes(Lists.newArrayList())
|
...
|
...
|
@@ -193,16 +191,16 @@ public class SellerService { |
|
|
List<SellerPlatformServiceFeeResp.Node> nodes = rules.stream().map(rule -> {
|
|
|
SellerPlatformServiceFeeResp.Node node = new SellerPlatformServiceFeeResp.Node();
|
|
|
node.setKey(rule.getThreshold());
|
|
|
node.setValue(MathUtils.convert2Percent(rule.getRate()));
|
|
|
node.setValue(MathUtils.convert2Percent(rule.getRate(), 1));
|
|
|
return node;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
//最终返回结果
|
|
|
SellerPlatformServiceFeeResp resp = SellerPlatformServiceFeeResp.builder()
|
|
|
.currentRate(MathUtils.convert2Percent(currentServiceFee.getFeeRate()))
|
|
|
.currentRate(MathUtils.convert2Percent(currentServiceFee.getFeeRate(), 1))
|
|
|
.nodes(nodes)
|
|
|
.finishedOrderQuantity(nextPeriodOrderQuantity)
|
|
|
.nextRateToReach(MathUtils.convert2Percent(unsatisfiedFeeRule.getRate()))
|
|
|
.nextRateToReach(MathUtils.convert2Percent(unsatisfiedFeeRule.getRate(), 1))
|
|
|
.nextRateRequiredIncOrderQuantity(Math.max(0, unsatisfiedFeeRule.getThreshold() - nextPeriodOrderQuantity))
|
|
|
.build();
|
|
|
|
...
|
...
|
|