1.代客下单 创建订单placeNum不正常修复
This commit is contained in:
parent
90d5e3888b
commit
5c2b995d1f
|
|
@ -970,7 +970,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
|
||||
|
||||
@Override
|
||||
public TbOrderInfo createOrder(CreateOrderDTO createOrderDTO, boolean addMaterId, boolean isPrint) {
|
||||
public TbOrderInfo createOrder(CreateOrderDTO createOrderDTO, boolean addMaterId, boolean isPrint) {
|
||||
return Utils.runFunAndCheckKey(() -> {
|
||||
TbShopTable tbShopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
|
||||
|
|
@ -1029,6 +1029,10 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
||||
|
||||
Integer mealNum = null;
|
||||
|
||||
if (cashierCarts.stream().noneMatch(item -> item.getPlaceNum() == null)) {
|
||||
throw new BadRequestException("此次未添加新商品,清先添加商品");
|
||||
}
|
||||
for (TbCashierCart cashierCart : cashierCarts) {
|
||||
if ("-999".equals(cashierCart.getProductId())) {
|
||||
mealNum = cashierCart.getNumber();
|
||||
|
|
@ -1155,7 +1159,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
cashierCart.setOrderId(orderId);
|
||||
cashierCart.setUpdatedAt(System.currentTimeMillis());
|
||||
cashierCart.setStatus("pending".equals(orderInfo.getStatus()) ? "refund" : cashierCart.getStatus());
|
||||
cashierCart.setPlaceNum(placeNum);
|
||||
if (cashierCart.getPlaceNum() == null) {
|
||||
cashierCart.setPlaceNum(placeNum);
|
||||
}
|
||||
cashierCartMapper.updateById(cashierCart);
|
||||
}
|
||||
if (isFirst) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue