'提交代码'

dev-discount
胡锐 4 years ago
parent 59c8627ce3
commit 025ae10f17
  1. 6
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java

@ -164,6 +164,7 @@ public class HighOrderController {
totalPrice = totalPrice.add(childOrder.getTotalPrice());
}
highOrder.setTotalPrice(totalPrice);
highOrder.setPayPrice(highOrder.getTotalPrice());
// 是否使用了优惠券
@ -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);

Loading…
Cancel
Save