...
|
...
|
@@ -22,6 +22,7 @@ import com.yohoufo.order.model.dto.ServiceFeeRate; |
|
|
import com.yohoufo.order.service.proxy.ResourcesProxyService;
|
|
|
import com.yohoufo.order.service.support.CouponSupport;
|
|
|
import com.yohoufo.order.utils.MathUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
...
|
...
|
@@ -51,7 +52,7 @@ public final class SellerOrderConvertor { |
|
|
}
|
|
|
|
|
|
PlatformFee platformFeeWrapper = PlatformFee.builder()
|
|
|
.amount(buildSubtractFee(formatFee(platformFeeDto.getTotal())))
|
|
|
.amount(PriceFormater.addSubtract4Fee(formatFee(platformFeeDto.getTotal())))
|
|
|
.appraiseFee(formatFee(platformFeeDto.getAppraiseFee()))
|
|
|
.packageFee(formatFee(platformFeeDto.getPackageFee()))
|
|
|
.serviceFee(formatFee(platformFeeDto.getServiceFee()))
|
...
|
...
|
@@ -67,7 +68,7 @@ public final class SellerOrderConvertor { |
|
|
.earnestMoney(earnestMoney.doubleValue())
|
|
|
.earnestMoneyStr(earnestMoneyStr)
|
|
|
.platformFee(platformFeeWrapper)
|
|
|
.bankTransferFee(buildSubtractFee(bankTransferFeeStr))
|
|
|
.bankTransferFee(PriceFormater.addSubtract4Fee(bankTransferFeeStr))
|
|
|
.income(incomeStr)
|
|
|
.build();
|
|
|
return computeBo;
|
...
|
...
|
@@ -96,7 +97,7 @@ public final class SellerOrderConvertor { |
|
|
}
|
|
|
}
|
|
|
PlatformFee platformFeeWrapper = PlatformFee.builder()
|
|
|
.amount(buildSubtractFee(formatFee(platformFeeDto.getTotal())))
|
|
|
.amount(PriceFormater.addSubtract4Fee(formatFee(platformFeeDto.getTotal())))
|
|
|
.appraiseFee(formatFee(platformFeeDto.getAppraiseFee()))
|
|
|
.packageFee(formatFee(platformFeeDto.getPackageFee()))
|
|
|
.serviceFee(formatFee(platformFeeDto.getServiceFee()))
|
...
|
...
|
@@ -130,14 +131,14 @@ public final class SellerOrderConvertor { |
|
|
//
|
|
|
BigDecimal couponCutAmount = computeResult.getCouponCutAmount();
|
|
|
CouponInfo couponInfo = Objects.isNull(couponCutAmount) || couponCutAmount.compareTo(BigDecimal.ZERO) <= 0? null
|
|
|
: CouponInfo.builder().couponAmountStr(formatFee(couponCutAmount)).build();
|
|
|
: CouponInfo.builder().couponAmountStr(PriceFormater.addPlusSign4Fee(formatFee(couponCutAmount))).build();
|
|
|
|
|
|
//
|
|
|
SoldPrdComputeBo computeBo = SoldPrdComputeBo.builder()
|
|
|
.earnestMoney(earnestMoney.doubleValue())
|
|
|
.earnestMoneyStr(earnestMoneyStr)
|
|
|
.platformFee(platformFeeWrapper)
|
|
|
.bankTransferFee(buildSubtractFee(bankTransferFeeStr))
|
|
|
.bankTransferFee(PriceFormater.addSubtract4Fee(bankTransferFeeStr))
|
|
|
.income(incomeStr)
|
|
|
.couponInfo(couponInfo)
|
|
|
.build();
|
...
|
...
|
@@ -163,7 +164,7 @@ public final class SellerOrderConvertor { |
|
|
}
|
|
|
|
|
|
PlatformFee platformFeeWrapper = PlatformFee.builder()
|
|
|
.amount(buildSubtractFee(formatFee(platformFeeDto.getTotal())))
|
|
|
.amount(PriceFormater.addSubtract4Fee(formatFee(platformFeeDto.getTotal())))
|
|
|
.appraiseFee(formatFee(platformFeeDto.getAppraiseFee()))
|
|
|
.packageFee(formatFee(platformFeeDto.getPackageFee()))
|
|
|
.serviceFee(formatFee(platformFeeDto.getServiceFee()))
|
...
|
...
|
@@ -180,7 +181,7 @@ public final class SellerOrderConvertor { |
|
|
.earnestMoney(earnestMoney.doubleValue())
|
|
|
.earnestMoneyStr(earnestMoneyStr)
|
|
|
.platformFee(platformFeeWrapper)
|
|
|
.bankTransferFee(buildSubtractFee(bankTransferFeeStr))
|
|
|
.bankTransferFee(PriceFormater.addSubtract4Fee(bankTransferFeeStr))
|
|
|
.income(incomeStr)
|
|
|
.build();
|
|
|
return computeBo;
|
...
|
...
|
@@ -239,7 +240,7 @@ public final class SellerOrderConvertor { |
|
|
switch (chargeParam.getChargeStage()){
|
|
|
case COMPUTE:{
|
|
|
CouponInfo couponInfo = CouponSupport.buildCouponInfo(computeResult.getCouponPayResultList().getCouponPayResults());
|
|
|
couponInfo.setCouponAmountStr(OrderConstant.PLUS_SIGN+couponInfo.getCouponAmountStr());
|
|
|
couponInfo.setCouponAmountStr(PriceFormater.addPlusSign4Fee(couponInfo.getCouponAmountStr()));
|
|
|
bo.setCouponInfo(couponInfo);
|
|
|
List<String> couponCodes = Lists.newArrayList(sorboc.getCouponCode());
|
|
|
//
|
...
|
...
|
@@ -253,12 +254,6 @@ public final class SellerOrderConvertor { |
|
|
}
|
|
|
|
|
|
|
|
|
public static String buildSubtractFee(String fmtFee){
|
|
|
if (null == fmtFee){
|
|
|
return null;
|
|
|
}
|
|
|
return "-" + fmtFee;
|
|
|
}
|
|
|
|
|
|
|
|
|
public static String formatFee(BigDecimal fee){
|
...
|
...
|
|