1.代客下单 创建订单保存台桌名称

This commit is contained in:
SongZhang 2024-08-30 17:27:55 +08:00
parent e9297f49a1
commit 7b62f75cca
1 changed files with 9 additions and 0 deletions

View File

@ -787,6 +787,14 @@ public class TbShopTableServiceImpl implements TbShopTableService {
throw new BadRequestException("购物车为空,请先添加商品");
}
TbShopTable tbShopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>()
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
.in(TbShopTable::getStatus, "idle", "using"));
if (tbShopTable == null) {
throw new BadRequestException("台桌未开台或不存在");
}
BigDecimal totalAmount = BigDecimal.ZERO;
BigDecimal packAMount = BigDecimal.ZERO;
BigDecimal feeAmount = BigDecimal.ZERO;
@ -868,6 +876,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
orderInfo.setRemark(createOrderDTO.getNote());
orderInfo.setUserId(createOrderDTO.getVipUserId() == null ? null : String.valueOf(createOrderDTO.getVipUserId()));
orderInfo.setCreatedAt(DateUtil.current());
orderInfo.setTableName(tbShopTable.getName());
TbMerchantAccount merchantAccount = merchantAccountMapper.selectOne(new LambdaQueryWrapper<TbMerchantAccount>()
.eq(TbMerchantAccount::getShopId, createOrderDTO.getShopId())
.eq(TbMerchantAccount::getStatus, 1));