退菜 打包数量问题

This commit is contained in:
wangw 2025-03-15 10:14:04 +08:00
parent f10c5c8808
commit 425571a6b9
2 changed files with 4 additions and 1 deletions

View File

@ -266,6 +266,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
if (param.isVipPrice() && !shopInfo.getIsMemberPrice().equals(1)) {
throw new ValidateException("生成订单失败,该店铺不支持使用会员价");
}
if (param.getOrderAmount().compareTo(BigDecimal.ZERO) < 0) {
throw new ValidateException("生成订单失败订单金额不能小于0");
}
log.info("订单信息:{},优惠信息:{}", JSONObject.toJSONString(orderInfo), JSONObject.toJSONString(param));
Long shopId = orderInfo.getShopId();
AssertUtil.isNull(shopId, "生成支付订单失败,订单信息异常");

View File

@ -550,7 +550,7 @@ public class PayServiceImpl implements PayService {
} else {
orderDetail.setReturnNum(orderDetail.getReturnNum().add(refNum));
if (orderDetail.getPackNumber().compareTo(BigDecimal.ZERO) > 0 && orderDetail.getPackNumber().compareTo(orderDetail.getNum().subtract(orderDetail.getReturnNum())) > 0) {
orderDetail.setPackNumber(orderDetail.getPackNumber().subtract(orderDetail.getReturnNum()));
orderDetail.setPackNumber(orderDetail.getNum().subtract(orderDetail.getReturnNum()));
}
}
orderDetail.setRefundNo(refPayOrderNo);