From 1f09f6daaf73bc83cceb4ae22b862b7b365635cf Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 03 四月 2025 19:59:17 +0800 Subject: [PATCH] 修改反馈文档bug --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java | 38 ++++++-------------------------------- 1 files changed, 6 insertions(+), 32 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java index 3f4c1a0..7abd8c9 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java @@ -1,6 +1,7 @@ package com.ruoyi.order.controller; import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; @@ -42,11 +43,7 @@ @Resource private TokenService tokenService; - - @Resource - private GoodsShopClient goodsShopClient; - @Resource - private ShopClient shopClient; + @Resource private AppUserClient appUserClient; @@ -122,6 +119,9 @@ @ResponseBody @GetMapping("/shoppingCartPaymentCallback") public void shoppingCartPaymentCallback(UniPayCallbackResult uniPayCallbackResult, HttpServletResponse response){ + String jsonString = JSONObject.toJSONString(uniPayCallbackResult); + System.out.println("1111111111111111111111"); + System.out.println(jsonString); R callback = shoppingCartService.shoppingCartPaymentCallback(uniPayCallbackResult); if(callback.getCode() == 200){ response.setStatus(200); @@ -163,39 +163,13 @@ - @ResponseBody - @GetMapping("/getVerifiableShop") - @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"}) - public R<List<VerifiableShopVo>> getVerifiableShop(){ - LoginUser loginUser = tokenService.getLoginUserApplet(); - List<ShoppingCart> shoppingCarts = shoppingCartService.list(new LambdaQueryWrapper<ShoppingCart>() - .eq(ShoppingCart::getAppUserId, loginUser.getUserid())); - List<Integer> goodsIds = shoppingCarts.stream().map(ShoppingCart::getGoodsId).collect(Collectors.toList()); - GetGoodsShopByGoodsIds goodsShopByGoodsIds = new GetGoodsShopByGoodsIds(); - goodsShopByGoodsIds.setGoodsIds(goodsIds); - R<List<GoodsShop>> r = goodsShopClient.getGoodsShopByGoodsIds(goodsShopByGoodsIds); - List<GoodsShop> goodsShops = r.getData(); - List<VerifiableShopVo> verifiableShopVoList = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(goodsShops)){ - for (GoodsShop goodsShop : goodsShops) { - R<Shop> shopR = shopClient.getShopById(goodsShop.getShopId()); - if (R.isSuccess(shopR) && null != shopR.getData()){ - VerifiableShopVo verifiableShopVo = new VerifiableShopVo(); - verifiableShopVo.setId(shopR.getData().getId()); - verifiableShopVo.setName(shopR.getData().getName()); - verifiableShopVoList.add(verifiableShopVo); - } - } - } - return R.ok(verifiableShopVoList); - } @GetMapping("/getGoodsPrice") public R<Price> getGoodsPrice(Long appUserId, Integer goodsId, Integer shopId){ AppUser appUser = appUserClient.getAppUserById(appUserId); - Price price = shoppingCartService.getPrice(appUser, goodsId, shopId); + Price price = shoppingCartService.getPrice(appUser, goodsId, 1, shopId); return R.ok(price); } -- Gitblit v1.7.1