chenjiahe
2024-08-01 b93883c8dc88b418e5ec054ce6f92cadc5b2ae44
订单折扣-优化
1个文件已修改
4 ■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java
@@ -2497,8 +2497,8 @@
            BigDecimal total = promotionInfo.getDiscountAfterPrice().multiply(new BigDecimal(vo.getBuyNum())).setScale(2,RoundingMode.HALF_UP);
            if(orderItemSon.getDiscountAlgorithm() == OrderItemConstants.DISCOUNT_ALGORITHM_TOTAL){
                orderItemSon.setTotal(promotionInfo.getDiscountAfterPrice().multiply(new BigDecimal(vo.getBuyNum())).setScale(2,RoundingMode.HALF_UP));
                orderItemSon.setTotal(vo.getTotal().multiply(vo.getDiscount().divide(new BigDecimal(100),15,RoundingMode.HALF_UP)).setScale(2,RoundingMode.HALF_UP));
                orderItemSon.setDiscountMoney(vo.getTotal().divide(new BigDecimal(vo.getBuyNum()),5,RoundingMode.HALF_UP));
                orderItemSon.setTotal(orderItemSon.getTotal().multiply(vo.getDiscount().divide(new BigDecimal(100),15,RoundingMode.HALF_UP)).setScale(2,RoundingMode.HALF_UP));
                orderItemSon.setDiscountMoney(orderItemSon.getTotal().divide(new BigDecimal(vo.getBuyNum()),5,RoundingMode.HALF_UP));
                //折扣金额
                orderItemSon.setDiscountOrderPrice(total.subtract(orderItemSon.getTotal()));
            }else{