1.代客下单 创建订单更新台桌使用时间

This commit is contained in:
SongZhang 2024-09-11 14:59:57 +08:00
parent 2c99b8cd18
commit 2ef311f887
1 changed files with 7 additions and 4 deletions

View File

@ -1171,15 +1171,18 @@ public class TbShopTableServiceImpl implements TbShopTableService {
}
}
// 设置台桌信息
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
LambdaUpdateWrapper<TbShopTable> wrapper = new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getShopId, createOrderDTO.getShopId())
.eq(TbShopTable::getQrcode, createOrderDTO.getTableId())
.set(TbShopTable::getUseTime, DateUtil.date())
.set(TbShopTable::getProductNum, cashierCarts.size())
.set(TbShopTable::getTotalAmount, orderInfo.getOrderAmount())
.set(TbShopTable::getRealAmount, orderInfo.getOrderAmount())
.set(TbShopTable::getStatus, TableStateEnum.USING.getState()));
.set(TbShopTable::getStatus, TableStateEnum.USING.getState());
if (isFirst) {
wrapper.set(TbShopTable::getUseTime, DateUtil.date());
}
// 设置台桌信息
mpShopTableMapper.update(null, wrapper);
String tableCartKey = RedisConstant.getTableCartKey(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString());
redisTemplate.delete(tableCartKey);