From c9096d6dfa5925d0f3c76e598549059ed47529d5 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Wed, 25 Sep 2024 17:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/CartService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java index 5c0b705..7268225 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -641,6 +641,15 @@ public class CartService { cashierIds.add(cashierCart.getId()); }); + if (cashierIds.isEmpty()) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "购物车为空"); + jsonObject1.put("data", new ArrayList<>()); + PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), tableCartKey, jsonObject.getString("userId"), true); + return; + } + TbShopUser tbShopUser = shopUserMapper.selectByUserIdAndShopId(userId, shopId); boolean isVip= tbShopUser != null && tbShopUser.getIsVip().equals((byte) 1);