提交 f8e5643c authored 作者: Whispa's avatar Whispa

commit

上级 6b5f15f7
......@@ -213,8 +213,8 @@ public class TbCfOrder {
BigDecimal priceTotal = item.getItemPriceTotal();
TbCfExpressTemplate template = item.getTemplate();
itemsPrice = itemsPrice.add(priceTotal);
tax = tax.add(calculateDutyFee(BigDecimal.valueOf(item.getItemNum()), template));
fee = fee.add(calculateHandlingFee(BigDecimal.valueOf(item.getItemNum()), template));
tax = tax.add(calculateDutyFee(itemsPrice, template));
fee = fee.add(calculateHandlingFee(itemsPrice, template));
if (template != null)
templateList.add(new TemplateVo(template, template.getTemplateId(), item.getItemNum(), itemsPrice));
});
......@@ -295,13 +295,14 @@ public class TbCfOrder {
private List<String> usedList = new ArrayList<>();
private BigDecimal calculateHandlingFee(BigDecimal itemNum, TbCfExpressTemplate expressTemplate) {
private BigDecimal calculateHandlingFee(BigDecimal itemPrice, TbCfExpressTemplate expressTemplate) {
if (expressTemplate == null) return BigDecimal.ZERO;
//计算手续费
//计算手续费
BigDecimal handlingFee = expressTemplate.getHandlingFee()
.multiply(itemNum);
.multiply(itemPrice);
return handlingFee.setScale(BigDecimal.ROUND_DOWN, 2);
return handlingFee;
}
......@@ -331,10 +332,9 @@ public class TbCfOrder {
private BigDecimal calculateDutyFee(BigDecimal itemPrice, TbCfExpressTemplate expressTemplate) {
if (expressTemplate == null) return BigDecimal.ZERO;
//计算关税
BigDecimal dutyFee = expressTemplate.getTariff().multiply(itemPrice);
return dutyFee.setScale(BigDecimal.ROUND_DOWN, 2);
return expressTemplate.getTariff().multiply(itemPrice);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论