...
|
...
|
@@ -50,13 +50,13 @@ public class ChargeService { |
|
|
//1.计算商品金额
|
|
|
calculateGoodsAmount(chargeContext);
|
|
|
//2.计算运费
|
|
|
calculateExpressDeliveryAmount(chargeContext);
|
|
|
calculateShippingAmount(chargeContext);
|
|
|
//3.计算优惠券
|
|
|
calculateCouponIfNeed(chargeContext);
|
|
|
}
|
|
|
|
|
|
private void initCharge(ChargeContext chargeContext) {
|
|
|
logger.info("[{}] init charge,charge param:{},charge goods:{}",
|
|
|
logger.info("[{}] step init charge,charge param:{},charge goods:{}",
|
|
|
chargeContext.getChargeParam().getUid(),
|
|
|
chargeContext.getChargeParam(),
|
|
|
chargeContext.getChargeGoods());
|
...
|
...
|
@@ -75,7 +75,7 @@ public class ChargeService { |
|
|
|
|
|
chargeContext.getChargeResult().setGoodsAmount(chargeGoods.getGoodsAmount().doubleValue());
|
|
|
chargeContext.getChargeResult().setFinalAmount(chargeGoods.getGoodsAmount().doubleValue());
|
|
|
logger.info("[{}] STEP goods charge,goodsPrice:{},goodsAmount:{},amount:{}",
|
|
|
logger.info("[{}] step goods charge,goodsPrice:{},goodsAmount:{},amount:{}",
|
|
|
chargeContext.getChargeParam().getUid(),
|
|
|
chargeGoods.getGoodsPrice(),
|
|
|
chargeContext.getChargeResult().getGoodsAmount(),
|
...
|
...
|
@@ -87,9 +87,9 @@ public class ChargeService { |
|
|
*
|
|
|
* @param chargeContext
|
|
|
*/
|
|
|
private void calculateExpressDeliveryAmount(ChargeContext chargeContext) {
|
|
|
private void calculateShippingAmount(ChargeContext chargeContext) {
|
|
|
//运费
|
|
|
chargeContext.getChargeResult().setExpressDeliveryAmount(delivery_way_sf_cost);
|
|
|
chargeContext.getChargeResult().setShippingAmount(delivery_way_sf_cost);
|
|
|
|
|
|
ChargeResult chargeResult = chargeContext.getChargeResult();
|
|
|
|
...
|
...
|
@@ -97,9 +97,9 @@ public class ChargeService { |
|
|
//包括运费
|
|
|
double newFinalAmount = YHMath.add(oldFinalAmount, delivery_way_sf_cost);
|
|
|
chargeResult.setFinalAmount(newFinalAmount);
|
|
|
logger.info("[{}] STEP express charge,sfExpressAmount:{},oldFinalAmount:{},newFinalAmount:{}",
|
|
|
logger.info("[{}] step shipping charge,sfExpressAmount:{},oldFinalAmount:{},newFinalAmount:{}",
|
|
|
chargeContext.getChargeParam().getUid(),
|
|
|
chargeResult.getExpressDeliveryAmount(),
|
|
|
chargeResult.getShippingAmount(),
|
|
|
oldFinalAmount,
|
|
|
chargeResult.getFinalAmount());
|
|
|
}
|
...
|
...
|
@@ -131,7 +131,7 @@ public class ChargeService { |
|
|
|
|
|
chargeResult.setCouponPayResult(couponPayResult);
|
|
|
|
|
|
logger.info("[{}] STEP coupon charge,oldFinalAmount:{},newFinalAmount:{},couponPayResult:{}",
|
|
|
logger.info("[{}] step coupon charge,oldFinalAmount:{},newFinalAmount:{},couponPayResult:{}",
|
|
|
chargeContext.getChargeParam().getUid(),
|
|
|
couponPayAmount, oldFinalAmount, chargeResult.getFinalAmount(), chargeResult.getCouponPayResult());
|
|
|
|
...
|
...
|
|