1.代客下单 创建订单直接付款不增加placeNum

This commit is contained in:
SongZhang 2024-09-12 14:54:53 +08:00
parent 7f0056304d
commit 7c00d0d9a0
1 changed files with 3 additions and 2 deletions

View File

@ -1037,7 +1037,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
Integer mealNum = null;
if (addMaterId && cashierCarts.stream().noneMatch(item -> item.getPlaceNum() == null)) {
boolean unAdd = cashierCarts.stream().noneMatch(item -> item.getPlaceNum() == null);
if (addMaterId && unAdd) {
throw new BadRequestException("此次未添加新商品,清先添加商品");
}
for (TbCashierCart cashierCart : cashierCarts) {
@ -1101,7 +1102,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
orderInfo.setUseType(createOrderDTO.isPostPay() ? "postPay" : "afterPay");
orderInfo.setUserId(createOrderDTO.getVipUserId() == null ? null : String.valueOf(createOrderDTO.getVipUserId()));
orderInfo.setCreatedAt(DateUtil.current());
if (addMaterId) {
if (!unAdd) {
orderInfo.setPlaceNum(placeNum);
}
orderInfoMapper.updateById(orderInfo);