...
|
...
|
@@ -88,6 +88,49 @@ public class ShoppingSupport { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* build express formula
|
|
|
* @param chargeResult
|
|
|
* @return
|
|
|
*/
|
|
|
private PromotionFormula buildExpressFormula(ChargeResult chargeResult){
|
|
|
PromotionFormula expressFormula = null;
|
|
|
|
|
|
String shipFee = null;
|
|
|
double finalShipFee;
|
|
|
//香港直邮订单 运费数据存在shipFeeDetail
|
|
|
boolean showShipFee = false;
|
|
|
SingleFeeDetail shipFeeDetail;
|
|
|
if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){
|
|
|
expressFormula = new PromotionFormula();
|
|
|
if (shipFeeDetail.getCutAmount()>0D){
|
|
|
String normalShipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(shipFeeDetail.getAmount());
|
|
|
expressFormula.setNormalAmount(normalShipFee);
|
|
|
}
|
|
|
finalShipFee = shipFeeDetail.getFinalAmount();
|
|
|
if (finalShipFee == 0D){
|
|
|
expressFormula.setPromotionAside(OrderConstant.DELIVERY_DESC_ASIDE);
|
|
|
}
|
|
|
//0元也得展示
|
|
|
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
|
|
|
showShipFee = true;
|
|
|
}else{
|
|
|
//非香港直邮订单 直接从chargeResult取值
|
|
|
finalShipFee = chargeResult.getShippingAmount();
|
|
|
//0元 不展示
|
|
|
if (finalShipFee > 0D){
|
|
|
expressFormula = new PromotionFormula();
|
|
|
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
|
|
|
showShipFee = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (showShipFee){
|
|
|
expressFormula.setPromotion(OrderConstant.DELIVERY_DESC);
|
|
|
expressFormula.setPromotionAmount(shipFee);
|
|
|
}
|
|
|
return expressFormula;
|
|
|
}
|
|
|
/**
|
|
|
* 付款信息
|
|
|
* @param chargeResult
|
|
|
* @return
|
...
|
...
|
@@ -122,33 +165,11 @@ public class ShoppingSupport { |
|
|
}
|
|
|
|
|
|
//运费
|
|
|
PromotionFormula expressFormula = new PromotionFormula();
|
|
|
expressFormula.setPromotion(OrderConstant.DELIVERY_DESC);
|
|
|
String shipFee = null;
|
|
|
double finalShipFee;
|
|
|
//香港直邮订单 运费数据存在shipFeeDetail
|
|
|
SingleFeeDetail shipFeeDetail;
|
|
|
if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){
|
|
|
if (shipFeeDetail.getCutAmount()>0D){
|
|
|
String normalShipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(shipFeeDetail.getAmount());
|
|
|
expressFormula.setNormalAmount(normalShipFee);
|
|
|
}
|
|
|
finalShipFee = shipFeeDetail.getFinalAmount();
|
|
|
if (finalShipFee == 0D){
|
|
|
expressFormula.setPromotionAside(OrderConstant.DELIVERY_DESC_ASIDE);
|
|
|
}
|
|
|
//0元也得展示
|
|
|
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
|
|
|
}else{
|
|
|
//非香港直邮订单 直接从chargeResult取值
|
|
|
finalShipFee = chargeResult.getShippingAmount();
|
|
|
//0元 不展示
|
|
|
if (finalShipFee > 0D){
|
|
|
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
|
|
|
}
|
|
|
PromotionFormula expressFormula = buildExpressFormula(chargeResult);
|
|
|
if (Objects.nonNull(expressFormula)){
|
|
|
formulas.add(expressFormula);
|
|
|
}
|
|
|
expressFormula.setPromotionAmount(shipFee);
|
|
|
formulas.add(expressFormula);
|
|
|
|
|
|
//税费
|
|
|
SingleFeeDetail tariffFee;
|
|
|
if ((tariffFee = chargeResult.getTariffFee()) != null){
|
...
|
...
|
|