桌位费问题

This commit is contained in:
2025-03-05 18:29:23 +08:00
parent 28ce495bd7
commit 88e8efda26

View File

@@ -242,6 +242,12 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
if (param.getPointsNum() > 0 && !pointSetting.getEnableDeduction().equals(1)) {
throw new ValidateException("生成支付订单失败,该店铺未开启积分抵扣");
}
orderInfo.setSeatNum(param.getSeatNum());
if (shopInfo.getIsTableFee() != 0 && shopInfo.getTableFee().compareTo(BigDecimal.ZERO) != 0) {
orderInfo.setSeatAmount(new BigDecimal(param.getSeatNum()).multiply(shopInfo.getTableFee()));
}else {
orderInfo.setSeatAmount(BigDecimal.ZERO);
}
ShopUser shopUser = null;
if (param.getUserId() != null) {
UserInfo userInfo = userInfoService.getById(param.getUserId());
@@ -277,7 +283,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
}
orderInfo.setOriginAmount(totalAmount.getPrice());
orderInfo.setOriginAmount(totalAmount.getPrice().add(orderInfo.getSeatAmount()));
BigDecimal newTotalAmount = totalAmount.getPrice();
//折扣金额 如 9折 计算 为 订单金额*0.9 向上取整
if (param.getDiscountRatio().compareTo(BigDecimal.ZERO) > 0) {