餐位费信息多次加入缓存修复

This commit is contained in:
2024-09-28 16:12:11 +08:00
parent 07f31ebf50
commit eb5964d903

View File

@@ -945,8 +945,12 @@ public class ProductService {
}else {
jsonArray = new JSONArray();
}
jsonArray.add(tbCashierCart);
redisUtil.saveMessage(tableCartKey, jsonArray.toJSONString());
long count = jsonArray.stream().filter(item -> "-999".equals(((JSONObject) item).getString("productId"))).count();
if (count < 1) {
jsonArray.add(tbCashierCart);
redisUtil.saveMessage(tableCartKey, jsonArray.toJSONString());
}
// 保存就餐人数信息
redisUtil.saveMessage(RedisCst.getCurrentTableSeatCount(choseCountDTO.getShopId(), choseCountDTO.getTableId()),