桌位费问题
This commit is contained in:
@@ -242,6 +242,12 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
if (param.getPointsNum() > 0 && !pointSetting.getEnableDeduction().equals(1)) {
|
if (param.getPointsNum() > 0 && !pointSetting.getEnableDeduction().equals(1)) {
|
||||||
throw new ValidateException("生成支付订单失败,该店铺未开启积分抵扣");
|
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;
|
ShopUser shopUser = null;
|
||||||
if (param.getUserId() != null) {
|
if (param.getUserId() != null) {
|
||||||
UserInfo userInfo = userInfoService.getById(param.getUserId());
|
UserInfo userInfo = userInfoService.getById(param.getUserId());
|
||||||
@@ -277,7 +283,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
|
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
|
||||||
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
|
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
|
||||||
}
|
}
|
||||||
orderInfo.setOriginAmount(totalAmount.getPrice());
|
orderInfo.setOriginAmount(totalAmount.getPrice().add(orderInfo.getSeatAmount()));
|
||||||
BigDecimal newTotalAmount = totalAmount.getPrice();
|
BigDecimal newTotalAmount = totalAmount.getPrice();
|
||||||
//折扣金额 如 9折 计算 为 订单金额*0.9 向上取整
|
//折扣金额 如 9折 计算 为 订单金额*0.9 向上取整
|
||||||
if (param.getDiscountRatio().compareTo(BigDecimal.ZERO) > 0) {
|
if (param.getDiscountRatio().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user