代客下单调整

This commit is contained in:
2024-09-26 16:16:50 +08:00
parent fbb586b3a4
commit a5c11fee41

View File

@@ -390,16 +390,16 @@ public class TbShopTableServiceImpl implements TbShopTableService {
return shopTable;
}
private int getCurrentPlaceNum(String tableId, String shopId, String useType) {
String currentOrderKey = RedisConstant.getCurrentOrderKey(tableId,
shopId);
String orderId = redisTemplate.opsForValue().get(currentOrderKey);
if (StrUtil.isBlank(orderId)) {
return 1;
}
TbOrderInfo orderInfo = orderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
.eq(TbOrderInfo::getUseType, useType)
.eq(TbOrderInfo::getId, orderId).select(TbOrderInfo::getPlaceNum));
/**
* 获取当前台桌当前下单次数
*
* @param tableId 台桌id
* @param shopId 店铺id
* @param shopEatTypeInfoDTO 用餐类型
* @return 对应的次数为order最后次数+1
*/
private int getCurrentPlaceNum(String tableId, Object shopId, ShopEatTypeInfoDTO shopEatTypeInfoDTO) {
TbOrderInfo orderInfo = getCurrentOrder(shopEatTypeInfoDTO, tableId, shopId);
return orderInfo == null ? 1 : orderInfo.getPlaceNum() + 1;
}