From a5c11fee411c2616c14b885b142cfd4b8770ec5a Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Thu, 26 Sep 2024 16:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/shopimpl/TbShopTableServiceImpl.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java index 1b84d9f6..8a16701e 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java @@ -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() - .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; }