...
|
...
|
@@ -13,6 +13,7 @@ import com.yohoufo.order.utils.MathUtils; |
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* Created by chenchao on 2018/9/20.
|
...
|
...
|
@@ -26,13 +27,20 @@ public final class SellerOrderConvertor { |
|
|
PlatformFeeDto platformFeeDto = computeResult.getPlatformFee();
|
|
|
BigDecimal income = computeResult.getIncome();
|
|
|
//
|
|
|
String payPersent = computeResult.getServiceFeeRate() != null ? computeResult.getServiceFeeRate().getPayChannelPercent() : "";
|
|
|
ServiceFeeRate serviceFeeRate;
|
|
|
String payPercent = "", goodsPaymentRatePercent = "";
|
|
|
if (Objects.nonNull(serviceFeeRate = computeResult.getServiceFeeRate())){
|
|
|
payPercent = serviceFeeRate.getPayChannelPercent();
|
|
|
goodsPaymentRatePercent = serviceFeeRate.getGoodsPaymentRatePercent();
|
|
|
}
|
|
|
|
|
|
PlatformFee platformFeeWrapper = PlatformFee.builder()
|
|
|
.amount(buildSubtractFee(formatFee(platformFeeDto.getTotal())))
|
|
|
.appraiseFee(formatFee(platformFeeDto.getAppraiseFee()))
|
|
|
.packageFee(formatFee(platformFeeDto.getPackageFee()))
|
|
|
.serviceFee(formatFee(platformFeeDto.getServiceFee()))
|
|
|
.payChannelPercentage(payPersent)
|
|
|
.payChannelPercentage(payPercent)
|
|
|
.goodsPaymentRatePercent(goodsPaymentRatePercent)
|
|
|
.build();
|
|
|
//
|
|
|
String incomeStr = formatFee(income);
|
...
|
...
|
@@ -60,18 +68,18 @@ public final class SellerOrderConvertor { |
|
|
BigDecimal income = computeResult.getIncome();
|
|
|
//service tips
|
|
|
String serviceTipsDesc = null;
|
|
|
String serviceTipsSummary = null;
|
|
|
//
|
|
|
boolean feeRateExists;
|
|
|
ServiceFeeRate serviceFeeRate;
|
|
|
String payPercent = (feeRateExists = ((serviceFeeRate=computeResult.getServiceFeeRate()) != null)) ? serviceFeeRate.getPayChannelPercent() : "";
|
|
|
BigDecimal goodsPaymentRate;
|
|
|
String goodsPaymentRatePercent = "";
|
|
|
if (feeRateExists && (goodsPaymentRate=serviceFeeRate.getGoodsPaymentRate()) != null){
|
|
|
serviceTipsSummary = String.format("(%s)", MathUtils.convert2Percent(goodsPaymentRate));
|
|
|
goodsPaymentRatePercent = MathUtils.convert2Percent(goodsPaymentRate);
|
|
|
}else{
|
|
|
if(tipsConfig!=null){
|
|
|
serviceTipsDesc = tipsConfig.get(ResourcesProxyService.KEY_SERVICETIPSDESC);
|
|
|
serviceTipsSummary = tipsConfig.get(ResourcesProxyService.KEY_SERVICETIPSSUMARY);
|
|
|
goodsPaymentRatePercent = tipsConfig.get(ResourcesProxyService.KEY_SERVICETIPSSUMARY);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -81,6 +89,8 @@ public final class SellerOrderConvertor { |
|
|
.packageFee(formatFee(platformFeeDto.getPackageFee()))
|
|
|
.serviceFee(formatFee(platformFeeDto.getServiceFee()))
|
|
|
.payChannelPercentage(payPercent)
|
|
|
.goodsPaymentRatePercent(goodsPaymentRatePercent)
|
|
|
.serviceTipsDesc(serviceTipsDesc)
|
|
|
.build();
|
|
|
//
|
|
|
String incomeStr = formatFee(income);
|
...
|
...
|
@@ -93,8 +103,6 @@ public final class SellerOrderConvertor { |
|
|
.platformFee(platformFeeWrapper)
|
|
|
.bankTransferFee(buildSubtractFee(bankTransferFeeStr))
|
|
|
.income(incomeStr)
|
|
|
.serviceTipsDesc(serviceTipsDesc)
|
|
|
.serviceTipsSummary(serviceTipsSummary)
|
|
|
.build();
|
|
|
return computeBo;
|
|
|
|
...
|
...
|
|