...
|
...
|
@@ -4,6 +4,7 @@ import com.yoho.core.common.utils.YHMath; |
|
|
import com.yohobuy.ufo.model.order.bo.AmountCutPolicy;
|
|
|
import com.yohobuy.ufo.model.order.constants.AmountCutType;
|
|
|
import com.yohobuy.ufo.model.order.constants.DeliveryWayEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
|
|
import com.yohobuy.ufo.model.promotion.UserCouponsBo;
|
|
|
import com.yohobuy.ufo.model.promotion.constant.CouponTypeEnum;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
...
|
...
|
@@ -125,11 +126,11 @@ public class ChargeService { |
|
|
}
|
|
|
|
|
|
|
|
|
SingleFeeDetail tariffDetail = SingleFeeDetail.builder()
|
|
|
SingleFeeDetail feeDetail = SingleFeeDetail.builder()
|
|
|
.amount(initAmount)
|
|
|
.cutAmount(cutAmount)
|
|
|
.finalAmount(finalAmount).build();
|
|
|
return tariffDetail;
|
|
|
return feeDetail;
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -168,21 +169,23 @@ public class ChargeService { |
|
|
|
|
|
double oldFinalAmount = chargeResult.getFinalAmount();
|
|
|
double newFinalAmount = Math.max(0, YHMath.sub(oldFinalAmount, realCutPrice.doubleValue()));
|
|
|
|
|
|
double tariffAmount = 0D;
|
|
|
//税费
|
|
|
BigDecimal goodsPrice = chargeGoods.getGoodsPrice();
|
|
|
AmountCutPolicy tariffCutPolicy = chargeContext.getChargeParam().getTariffCutPolicy();
|
|
|
SingleFeeDetail tariffFeeDetail = calculateTariffAmount(goodsPrice, tariffRate, tariffCutPolicy);
|
|
|
chargeResult.setTariffFee(tariffFeeDetail);
|
|
|
//加上税费
|
|
|
double tariffAmount = tariffFeeDetail.getAmount();
|
|
|
double finalTariffAmount = tariffFeeDetail.getFinalAmount();
|
|
|
if (finalTariffAmount > 0D){
|
|
|
//calculate final amount of goods
|
|
|
newFinalAmount = YHMath.add(finalTariffAmount, newFinalAmount);
|
|
|
}
|
|
|
if (chargeGoods.getRegion().equals(RegionEnum.HONGKONG)) {
|
|
|
BigDecimal goodsPrice = chargeGoods.getGoodsPrice();
|
|
|
AmountCutPolicy tariffCutPolicy = chargeContext.getChargeParam().getTariffCutPolicy();
|
|
|
SingleFeeDetail tariffFeeDetail = calculateTariffAmount(goodsPrice, tariffRate, tariffCutPolicy);
|
|
|
chargeResult.setTariffFee(tariffFeeDetail);
|
|
|
//加上税费
|
|
|
tariffAmount = tariffFeeDetail.getAmount();
|
|
|
double finalTariffAmount = tariffFeeDetail.getFinalAmount();
|
|
|
if (finalTariffAmount > 0D) {
|
|
|
//calculate final amount of goods
|
|
|
newFinalAmount = YHMath.add(finalTariffAmount, newFinalAmount);
|
|
|
}
|
|
|
|
|
|
chargeResult.setFinalAmount(newFinalAmount);
|
|
|
chargeResult.setFinalAmount(newFinalAmount);
|
|
|
}
|
|
|
|
|
|
ActivityCutResult activityCutResult = ActivityCutResult.builder()
|
|
|
.userActivityId(activityPrice.getUserActivityId())
|
...
|
...
|
|