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 9358448d..487396f0 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 @@ -1151,8 +1151,8 @@ public class TbShopTableServiceImpl implements TbShopTableService { } } - if (allCashierCarts.isEmpty() || (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart != null && allCashierCarts.size() < 2) - || (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart == null)) { + if (StrUtil.isNotBlank(createOrderDTO.getTableId()) && (allCashierCarts.isEmpty() || (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart != null && allCashierCarts.size() < 2) + || (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart == null))) { throw new BadRequestException("购物车为空或未选择餐位费,请先添加商品或选择餐位费"); } @@ -1591,8 +1591,6 @@ public class TbShopTableServiceImpl implements TbShopTableService { throw new BadRequestException("订单非未支付状态"); } - ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(payDTO.getShopId(), orderInfo.getTableId()); - if (payDTO.getDiscount() == null) { payDTO.setDiscount((double) 1); } @@ -1660,7 +1658,7 @@ public class TbShopTableServiceImpl implements TbShopTableService { rabbitMsgUtils.sendOrderCollectMsg(jsonObject,3); // 打印消息 - if (!shopEatTypeInfoDTO.isDineInAfter()) { + if (!OrderUseTypeEnum.DINE_IN_AFTER.getValue().equals(orderInfo.getUseType())) { List detailList = orderDetailMapper.selectList(new LambdaQueryWrapper() .eq(TbOrderDetail::getOrderId, orderInfo.getId()) .eq(TbOrderDetail::getStatus, "closed")); @@ -1675,7 +1673,7 @@ public class TbShopTableServiceImpl implements TbShopTableService { rabbitTemplate.convertAndSend(RabbitConstants.EXCHANGE_STOCK_RECORD, RabbitConstants.ROUTING_STOCK_RECORD_SALE, mqData.toJSONString(), new CorrelationData(UUID.randomUUID().toString())); // 修改台桌状态 - if (!shopEatTypeInfoDTO.isTakeout()) { + if (!OrderUseTypeEnum.TAKEOUT.getValue().equals(orderInfo.getUseType()) && StrUtil.isNotBlank(orderInfo.getTableId())) { TbShopTable tbShopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper() .eq(TbShopTable::getShopId, payDTO.getShopId()) .eq(TbShopTable::getQrcode, orderInfo.getTableId())); @@ -1691,16 +1689,12 @@ public class TbShopTableServiceImpl implements TbShopTableService { .set(TbShopTable::getEndTime, DateUtil.date()) .set(TbShopTable::getStatus, TableStateEnum.CLEANING.getState())); } - } - - if (!shopEatTypeInfoDTO.isTakeout()) { String day = DateUtils.getDay(); String key = "SHOP:CODE:USER:pc" + ":" + payDTO.getShopId() + ":" + day + ":" + orderInfo.getTableId(); redisTemplate.delete(key); } - String currentOrderKey = RedisConstant.CURRENT_TABLE_ORDER + payDTO.getShopId() + ":" + orderInfo.getTableId(); redisTemplate.delete(currentOrderKey);