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

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,19 +1309,32 @@ public class TbShopTableServiceImpl implements TbShopTableService {
pushConsMsg(orderInfo, cashierCarts); pushConsMsg(orderInfo, cashierCarts);
if (!shopEatTypeInfoDTO.isTakeout()) { if (!shopEatTypeInfoDTO.isTakeout()) {
LambdaUpdateWrapper<TbShopTable> wrapper = new LambdaUpdateWrapper<TbShopTable>() // 清空台桌信息
.eq(TbShopTable::getShopId, createOrderDTO.getShopId()) if (shopEatTypeInfoDTO.isDineInBefore()) {
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId()) mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
.set(TbShopTable::getProductNum, cashierCarts.size()) .eq(TbShopTable::getShopId, createOrderDTO.getShopId())
.set(TbShopTable::getTotalAmount, orderInfo.getOrderAmount()) .eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
.set(TbShopTable::getRealAmount, orderInfo.getOrderAmount()) .set(TbShopTable::getProductNum, 0)
.set(TbShopTable::getUseNum, mealNum) .set(TbShopTable::getTotalAmount, 0)
.set(TbShopTable::getStatus, TableStateEnum.USING.getState()); .set(TbShopTable::getRealAmount, 0)
if (isFirst) { .set(TbShopTable::getUseNum, 0)
wrapper.set(TbShopTable::getUseTime, DateUtil.date()); .set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
// 设置台桌信息
}else {
LambdaUpdateWrapper<TbShopTable> wrapper = new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getShopId, createOrderDTO.getShopId())
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
.set(TbShopTable::getProductNum, cashierCarts.size())
.set(TbShopTable::getTotalAmount, orderInfo.getOrderAmount())
.set(TbShopTable::getRealAmount, orderInfo.getOrderAmount())
.set(TbShopTable::getUseNum, mealNum)
.set(TbShopTable::getStatus, TableStateEnum.USING.getState());
if (isFirst) {
wrapper.set(TbShopTable::getUseTime, DateUtil.date());
}
mpShopTableMapper.update(null, wrapper);
} }
// 设置台桌信息
mpShopTableMapper.update(null, wrapper);
} }