Authored by chenchao

fix ship show info

... ... @@ -88,6 +88,47 @@ public class ShoppingSupport {
}
/**
* build express formula
* @param chargeResult
* @return
*/
private PromotionFormula buildExpressFormula(ChargeResult chargeResult){
PromotionFormula expressFormula = new PromotionFormula();
String shipFee = null;
double finalShipFee;
//香港直邮订单 运费数据存在shipFeeDetail
boolean showShipFee = false;
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);
showShipFee = true;
}else{
//非香港直邮订单 直接从chargeResult取值
finalShipFee = chargeResult.getShippingAmount();
//0元 不展示
if (finalShipFee > 0D){
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 +163,9 @@ 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);
}
}
expressFormula.setPromotionAmount(shipFee);
PromotionFormula expressFormula = buildExpressFormula(chargeResult);
formulas.add(expressFormula);
//税费
SingleFeeDetail tariffFee;
if ((tariffFee = chargeResult.getTariffFee()) != null){
... ...