打印逻辑修改

This commit is contained in:
2024-09-28 14:07:40 +08:00
parent d1a1cd6bb4
commit 4e8cbbc293

View File

@@ -1165,13 +1165,13 @@ public class CartService {
.set(TbCashierCart::getStatus, "closed")); .set(TbCashierCart::getStatus, "closed"));
} }
String tableCartKey = RedisCst.getTableCartKey(shopId, tableId, userId); String tableCartKey = RedisCst.getTableCartKey(shopId, tableId, userId);
String message = redisUtil.getMessage(tableCartKey); // String message = redisUtil.getMessage(tableCartKey);
if (StrUtil.isNotBlank(message)) { // if (StrUtil.isNotBlank(message)) {
JSONArray jsonArray = JSONObject.parseArray(message); // JSONArray jsonArray = JSONObject.parseArray(message);
List<Object> collect = jsonArray.stream().filter(info -> "-999".equals(((TbCashierCart) info).getProductId())).collect(Collectors.toList()); // List<Object> collect = jsonArray.stream().filter(info -> "-999".equals(((JSONObject) info).getString("productId"))).collect(Collectors.toList());
redisUtil.saveMessage(tableCartKey, JSONObject.toJSONString(collect)); // redisUtil.saveMessage(tableCartKey, new JSONArray().toJSONString());
} // }
// redisUtil.saveMessage(tableCartKey, new JSONArray().toJSONString()); redisUtil.saveMessage(tableCartKey, new JSONArray().toJSONString());
JSONObject jsonObject1 = new JSONObject(); JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("status", "success"); jsonObject1.put("status", "success");
jsonObject1.put("msg", "成功"); jsonObject1.put("msg", "成功");