From c542c56572ea8936301a6bdc736e23b846c8c006 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期六, 04 一月 2025 18:01:58 +0800 Subject: [PATCH] 修改保级功能bug --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 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 55f9cef..3c5614f 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 @@ -379,7 +379,7 @@ confirmOrderVo.setDiscountAmount(orderMoney.subtract(paymentMoney).setScale(2, RoundingMode.HALF_EVEN)); } BaseSetting baseSetting = baseSettingClient.getBaseSetting(4).getData(); - confirmOrderVo.setUseSimultaneously(baseSetting.getContent().equals("1")); + confirmOrderVo.setUseSimultaneously(JSON.parseObject(baseSetting.getContent()).getInteger("status") == 1); int earnPoint = goodsList.stream().mapToInt(MyShoppingCartVo::getEarnSpendingPoints).sum(); confirmOrderVo.setEarnPoint(earnPoint); //支付金额,订单金额-订单优惠 @@ -522,6 +522,7 @@ sum = orderGoodList.stream().mapToInt(OrderGood::getNum).sum(); } vo.setPurchaseLimit((num + sum) > goods.getPurchaseLimit()); + vo.setPurchaseLimitNum(goods.getPurchaseLimit() - sum); } vo.setDistributionMode(goods.getDistributionMode()); vo.setEarnSpendingPoints(price.getEarnSpendingPoints()); @@ -609,7 +610,7 @@ String goodsName = ""; for (Integer goodsId : goodsIds) { Goods goods = goodsClient.getGoodsById(goodsId).getData(); - if(1 == goods.getAppointStore() && !collect.contains(goodsId)){ + if(goods.getType() == 1 && 1 == goods.getAppointStore() && !collect.contains(goodsId)){ goodsName = goods.getName(); break; } @@ -936,6 +937,7 @@ appUser.setLavePoint(appUser.getLavePoint() + earnPoint); appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); + appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + earnPoint1); if(null != pointSetting && 1 == pointSetting.getBuyPointGift()){ appUser.setTransferablePoint(appUser.getTransferablePoint() + earnPoint1); } @@ -1008,6 +1010,7 @@ appUser.setShopPoint(appUser.getShopPoint() + earnPoint); appUser.setLavePoint(appUser.getLavePoint() + earnPoint); appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); + appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + earnPoint1); if(null != pointSetting && 1 == pointSetting.getBuyPointGift()){ appUser.setTransferablePoint(appUser.getTransferablePoint() + earnPoint1); } @@ -1140,6 +1143,7 @@ appUser.setLavePoint(appUser.getLavePoint() + earnPoint); appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); + appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + earnPoint1); UserPoint userPoint = new UserPoint(); userPoint.setType(1); @@ -1202,6 +1206,7 @@ appUser.setShopPoint(appUser.getShopPoint() + earnPoint); appUser.setLavePoint(appUser.getLavePoint() + earnPoint); appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); + appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + earnPoint1); appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); appUser.setLastShopTime(LocalDateTime.now()); appUserClient.editAppUserById(appUser); -- Gitblit v1.7.1