fix: 修复回调地址 修复切换台桌取餐码未更新问题

This commit is contained in:
2024-10-25 15:02:33 +08:00
parent b49b7ef8af
commit f0632942d5
3 changed files with 9 additions and 6 deletions

View File

@@ -49,7 +49,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -632,7 +631,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (cashierCart.getTableId() != null && removeCartDTO.getTableId() != null) {
// 清空购物车 出票
long carCount = countCar(Long.valueOf(cashierCart.getTableId()), cashierCart.getShopId(), cashierCart.getMasterId());
long carCount = countCar(Long.valueOf(cashierCart.getTableId()), cashierCart.getShopId());
log.info("购物车数量: {}", carCount);
setRedisTableCartInfo(removeCartDTO.getTableId(), removeCartDTO.getShopId().toString(), Collections.singletonList(cashierCart), false);
}
@@ -768,7 +767,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
cashierCartMapper.delete(query);
}
private long countCar(Long tableId, String shopId, String masterId) {
private long countCar(Long tableId, String shopId) {
String orderId = redisTemplate.opsForValue().get(RedisConstant.getCurrentOrderKey(tableId.toString(), shopId));
return tbOrderDetailMapper.selectCount(new LambdaQueryWrapper<TbOrderDetail>()
.eq(TbOrderDetail::getShopId, shopId)
@@ -1791,11 +1790,14 @@ public class TbShopTableServiceImpl implements TbShopTableService {
mpCashierCartService.clearCartByTableIdAndUseType(choseTableDTO.getTableId(), shopEatTypeInfoDTO.getUseType(), choseTableDTO.getShopId());
}
String masterId = getMasterId(choseTableDTO.getShopId(), choseTableDTO.getTableId(), shopEatTypeInfoDTO.getUseType(), null).getString("masterId");
ArrayList<Integer> cartIds = new ArrayList<>();
Integer orderId = null;
for (TbCashierCart item : tbCashierCarts) {
item.setTableId(choseTableDTO.getTableId());
item.setUseType(shopEatTypeInfoDTO.getUseType());
item.setMasterId(masterId);
cartIds.add(item.getId());
if (item.getOrderId() != null) {
orderId = item.getOrderId();