Merge remote-tracking branch 'origin/order' into order

dev-discount
袁野 2 years ago
commit 1b57e0e4a8
  1. 11
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  2. 7
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java

@ -201,7 +201,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString())));
childOrder.setTotalActualPrice(childOrder.getGoodsActualPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString())));
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setTotalDeductionPrice(childOrder.getGoodsPrice().subtract(childOrder.getTotalActualPrice()));
childOrderList.add(childOrder);
// 是否赠送卡卷
@ -237,7 +237,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
childOrder.setPraiseStatus(0);
childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString())));
childOrder.setTotalActualPrice(new BigDecimal("0"));
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setTotalDeductionPrice(new BigDecimal("0"));
childOrder.setCreateTime(new Date());
childOrderList.add(childOrder);
}
@ -380,11 +380,10 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+discountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券");
}
gasOrder.setDeductionCouponPrice(discountUserRel.getHighDiscount().getDiscountPrice());
}
else if (discountUserRel.getHighDiscount().getDiscountType() == 2) {
} else if (discountUserRel.getHighDiscount().getDiscountType() == 2) {
gasOrder.setDeductionCouponPrice(discountUserRel.getHighDiscount().getDiscountPrice());
}
else if (discountUserRel.getHighDiscount().getDiscountType() == 3) {
} else if (discountUserRel.getHighDiscount().getDiscountType() == 3) {
// 加油金额 * 折扣
BigDecimal deductionPrice = gasOrder.getGasRefuelPrice()
.multiply(discountUserRel.getHighDiscount().getDiscountPrice())

@ -145,6 +145,7 @@ public class OrderServiceImpl implements OrderService {
order.setCreateTime(new Date());
order.setPayGold(0);
order.setDeductionCouponPrice(new BigDecimal("0"));
order.setDeductionProductPrice(new BigDecimal("0"));
order.setCompanyId(createOrderModel.getCompanyId());
@ -324,8 +325,10 @@ public class OrderServiceImpl implements OrderService {
// 计算订单金额
Map<String, Object> calculateOrderPrice = OrderUtil.calculateOrderPrice(order.getHighChildOrderList());
order.setTotalPrice(new BigDecimal(calculateOrderPrice.get("totalPrice").toString()));
order.setTotalDeductionPrice(new BigDecimal(calculateOrderPrice.get("deductionPrice").toString()).add(order.getDeductionCouponPrice()));
order.setPayablePrice(order.getTotalPrice().subtract(order.getTotalDeductionPrice()));
order.setDeductionCouponPrice(order.getDeductionCouponPrice());
order.setDeductionProductPrice(new BigDecimal(calculateOrderPrice.get("deductionPrice").toString()));
order.setTotalDeductionPrice(order.getDeductionCouponPrice().add(order.getDeductionProductPrice()));
order.setPayablePrice(new BigDecimal(calculateOrderPrice.get("payablePrice").toString()));
order.setPayPrice(order.getPayablePrice());
// 积分抵扣

Loading…
Cancel
Save