From a0bd5dccb930db4d1f6f6a70e3034a12661a7fb5 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Wed, 25 Sep 2024 14:26:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B0=B1=E9=A4=90=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/service/CartService.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) 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 e636c95..809c773 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -216,9 +216,6 @@ public class CartService { return Result.fail("参数缺失"); } - // 校验就餐模式 - ShopEatTypeInfoDTO shopEatTypeInfoDTO = shopUtils.checkEatModel(tableId, shopId); - String key = tableId + "-" + shopId; TbProduct tbProduct = productMapper.selectById(Integer.valueOf(productId)); if (tbProduct == null) { @@ -270,7 +267,7 @@ public class CartService { if (Objects.isNull(array) || array.isEmpty()) { if (type == 1) { TbCashierCart cashierCart = addCart(productId, skuId, - jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip, note, shopEatTypeInfoDTO); + jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip, note); jsonArray.add(cashierCart); cashierCart.setPlaceNum(cashierCart.getPlaceNum() == null ? 0 : cashierCart.getPlaceNum()); cashierCartArrayList.add(cashierCart); @@ -315,7 +312,7 @@ public class CartService { } if (flag && type == 1) { TbCashierCart cashierCart = addCart(productId, skuId, - jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip, note, shopEatTypeInfoDTO); + jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip, note); jsonArray.add(cashierCart); amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); } @@ -323,7 +320,7 @@ public class CartService { } else { if (type == 1) { TbCashierCart cashierCart = addCart(productId, skuId, - jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip, note, shopEatTypeInfoDTO); + jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip, note); jsonArray.add(cashierCart); cashierCart.setPlaceNum(cashierCart.getPlaceNum() == null ? 0 : cashierCart.getPlaceNum()); cashierCartArrayList.add(cashierCart); @@ -487,7 +484,7 @@ public class CartService { } private TbCashierCart addCart(String productId, String skuId, Integer userId, Integer num, - String tableId, String shopId,Integer isVip, String note, ShopEatTypeInfoDTO shopEatTypeInfoDTO) throws Exception{ + String tableId, String shopId,Integer isVip, String note) throws Exception{ try { TbProduct product = productMapper.selectById(Integer.valueOf(productId)); String key = tableId + "-" + shopId; @@ -553,7 +550,6 @@ public class CartService { cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(productSku.getSalePrice().add(cashierCart.getPackFee()))); } cashierCart.setPlatformType(PlatformTypeEnum.MINI_APP.getValue()); - cashierCart.setUseType(shopEatTypeInfoDTO.getUseType()); mpCashierCartMapper.insert(cashierCart); //修改耗材数据 @@ -923,10 +919,7 @@ public class CartService { jsonObject1.put("type", jsonObject.getString("type")); jsonObject1.put("data", orderInfo); - // 购物车缓存, 后付款订单不删除 - if (!OrderUseTypeEnum.DINE_IN_AFTER.getValue().equals(shopEatTypeInfoDTO.getUseType())) { - redisUtil.deleteByKey(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId")).concat("-").concat(shopId)); - } + redisUtil.deleteByKey(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId")).concat("-").concat(shopId)); PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, jsonObject.getString("userId"), true); JSONObject jsonObject12 = new JSONObject(); jsonObject12.put("status", "success");