先付费模式创建订单之后清空台桌状态

This commit is contained in:
SongZhang 2024-10-11 17:09:04 +08:00
parent 6f50e1e134
commit d335268a84
1 changed files with 25 additions and 12 deletions

View File

@ -1309,6 +1309,18 @@ public class TbShopTableServiceImpl implements TbShopTableService {
pushConsMsg(orderInfo, cashierCarts); pushConsMsg(orderInfo, cashierCarts);
if (!shopEatTypeInfoDTO.isTakeout()) { if (!shopEatTypeInfoDTO.isTakeout()) {
// 清空台桌信息
if (shopEatTypeInfoDTO.isDineInBefore()) {
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getShopId, createOrderDTO.getShopId())
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
.set(TbShopTable::getProductNum, 0)
.set(TbShopTable::getTotalAmount, 0)
.set(TbShopTable::getRealAmount, 0)
.set(TbShopTable::getUseNum, 0)
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
// 设置台桌信息
}else {
LambdaUpdateWrapper<TbShopTable> wrapper = new LambdaUpdateWrapper<TbShopTable>() LambdaUpdateWrapper<TbShopTable> wrapper = new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getShopId, createOrderDTO.getShopId()) .eq(TbShopTable::getShopId, createOrderDTO.getShopId())
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId()) .eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
@ -1320,8 +1332,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (isFirst) { if (isFirst) {
wrapper.set(TbShopTable::getUseTime, DateUtil.date()); wrapper.set(TbShopTable::getUseTime, DateUtil.date());
} }
// 设置台桌信息
mpShopTableMapper.update(null, wrapper); mpShopTableMapper.update(null, wrapper);
}
} }