diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index eadd2bf2..d831c4a3 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -164,8 +164,9 @@ public class HighOrderController { totalPrice = totalPrice.add(childOrder.getTotalPrice()); } + highOrder.setTotalPrice(totalPrice); highOrder.setPayPrice(highOrder.getTotalPrice()); - + // 是否使用了优惠券 if (highDiscountUserRel != null) { highOrder.setMemDiscountName(highDiscountUserRel.getHighDiscount().getDiscountName()); @@ -209,7 +210,7 @@ public class HighOrderController { BigDecimal discountPrice = highDiscountUserRel.getHighDiscount().getDiscountPrice().divide(new BigDecimal("10")); // 订单总额 * 折扣 BigDecimal payPrice = highOrder.getTotalPrice().multiply(discountPrice); - highOrder.setDeductionPrice(highDiscountUserRel.getHighDiscount().getDiscountPrice()); + highOrder.setDeductionPrice(highOrder.getTotalPrice().subtract(payPrice)); highOrder.setPayPrice(payPrice); } } @@ -218,13 +219,12 @@ public class HighOrderController { highOrder.setMemId(userInfoModel.getHighUser().getId()); highOrder.setMemName(userInfoModel.getHighUser().getName()); highOrder.setMemPhone(userInfoModel.getHighUser().getPhone()); - highOrder.setTotalPrice(totalPrice); highOrder.setCreateTime(new Date()); highOrder.setOrderStatus(1); highOrderService.insertOrder(highOrder); - return ResponseMsgUtil.success(getOrderById(highOrder.getId())); + return ResponseMsgUtil.success(highOrderService.getOrderById(highOrder.getId())); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!",e);