fix: 无台桌提示需要餐位费修复
This commit is contained in:
parent
42563c3ce0
commit
e9956b5336
|
|
@ -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<TbOrderDetail> detailList = orderDetailMapper.selectList(new LambdaQueryWrapper<TbOrderDetail>()
|
||||
.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<TbShopTable>()
|
||||
.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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue