From 6a9a7a8ec19e967ca521af5e6f0d8f4f59cc48a2 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期二, 10 十二月 2024 10:05:08 +0800 Subject: [PATCH] 合并代码 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java | 29 ++++++++++++++++++----------- 1 files changed, 18 insertions(+), 11 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..e8fd731 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 @@ -412,6 +412,7 @@ confirmOrderVo.setResidualPoint(appUser.getLavePoint().intValue()); //获取默认收货地址 UserAddress userAddress = userAddressClient.getDefaultUserAddress(userid).getData(); + userAddress.setIdStr(userAddress.getId().toString()); confirmOrderVo.setUserAddress(userAddress); confirmOrderVo.setPaymentType(confirmOrder.getPaymentType()); //获取用户优惠券,用户全部优惠券,不能使用的需要标识出来置灰展示 @@ -530,7 +531,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 +630,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 +857,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()); @@ -1033,7 +1040,7 @@ this.removeBatchByIds(ids); } } - return R.ok(); + return R.ok(order.getId().toString()); } -- Gitblit v1.7.1