From c963605163f4fbf91565fa5e319a17fe2545fdb4 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 06 十二月 2024 19:32:09 +0800 Subject: [PATCH] 合并代码 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java index 23e1522..36745b4 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java @@ -530,7 +530,7 @@ goodsShop.setGoodsId(shoppingCart.getGoodsId()); goodsShop.setShopId(shopId); GoodsShop goodsShop1 = goodsShopClient.getGoodsShop(goodsShop).getData(); - vo.setVerifiable(null == goodsShop1 ? false : true); + vo.setVerifiable(goods.getAppointStore() == 1 && null == goodsShop1 ? false : true); //判断当前数量是否已经超出限购数量(需要计算已经购买的数量) if(null == goods.getPurchaseLimit() || -1 == goods.getPurchaseLimit()){ vo.setPurchaseLimit(false); @@ -629,12 +629,15 @@ if(data.size() != goodsList.size()){ String goodsName = ""; for (Integer goodsId : goodsIds) { - if(!collect.contains(goodsId)){ - goodsName = goodsClient.getGoodsById(goodsId).getData().getName(); + Goods goods = goodsClient.getGoodsById(goodsId).getData(); + if(1 == goods.getAppointStore() && !collect.contains(goodsId)){ + goodsName = goods.getName(); break; } } - return R.fail(goodsName + "不能在该门店核销"); + if(StringUtils.isNotEmpty(goodsName)){ + return R.fail(goodsName + "不能在该门店核销"); + } } //开始构建支付信息 //现金支付的订单金额 @@ -853,12 +856,15 @@ orderGood.setSeckillJson(JSON.toJSONString(goodsSeckill)); } for (int i = 0; i < objects.size(); i++) { - Integer id = objects.getJSONObject(i).getInteger("id"); - Integer num1 = objects.getJSONObject(i).getInteger("num"); - orderGood.setNum(num1); - Goods goods1 = goodsClient.getGoodsById(id).getData(); - orderGood.setGoodJson(JSON.toJSONString(goods1)); - break; + Long id = objects.getJSONObject(i).getLong("id"); + if(myShoppingCartVo.getId().equals(id.toString())){ + ShoppingCart shoppingCart = this.getById(id); + Integer num1 = objects.getJSONObject(i).getInteger("num"); + orderGood.setNum(num1); + Goods goods1 = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); + orderGood.setGoodJson(JSON.toJSONString(goods1)); + break; + } } orderGood.setDelFlag(0); orderGood.setCreateTime(LocalDateTime.now()); -- Gitblit v1.7.1