From 4fa8b47fe5e653404da248149f8ec54eb1282599 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 14 一月 2026 09:02:10 +0800
Subject: [PATCH] 修改商品

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpGoodsShopController.java |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpGoodsShopController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpGoodsShopController.java
index 007c25a..8a255ab 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpGoodsShopController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpGoodsShopController.java
@@ -173,21 +173,21 @@
         if (goodsIds.isEmpty()){
             ShopCarVO shopCarVO = new ShopCarVO();
             shopCarVO.setTotalPrice(BigDecimal.ZERO);
-            shopCarVO.setList(new PageInfo<>());
+            shopCarVO.setList(new ArrayList<>());
             return R.ok(shopCarVO);
         }
         TErpGoodsShopQuery tErpGoodsShopQuery = new TErpGoodsShopQuery();
         tErpGoodsShopQuery.setGoodsIds(goodsIds);
-        PageInfo<TErpGoodsVO> tErpGoodsVOPageInfo = erpGoodsService.pageShopList(tErpGoodsShopQuery);
-        List<TErpGoodsVO> records = tErpGoodsVOPageInfo.getRecords();
-        for (TErpGoodsVO record : records) {
-            for (ShoppingCartItem cartItem : cacheList) {
-                if (cartItem.getId().equals(record.getId())) {
-                    record.setNumber(cartItem.getNum());
-                    record.setPrice(record.getSalesAmount().multiply(new BigDecimal(record.getNumber())).setScale(2, RoundingMode.HALF_UP));
-                }
-            }
-        }
+//        PageInfo<TErpGoodsVO> tErpGoodsVOPageInfo = erpGoodsService.pageShopList(tErpGoodsShopQuery);
+//        List<TErpGoodsVO> records = tErpGoodsVOPageInfo.getRecords();
+//        for (TErpGoodsVO record : records) {
+//            for (ShoppingCartItem cartItem : cacheList) {
+//                if (cartItem.getId().equals(record.getId())) {
+//                    record.setNumber(cartItem.getNum());
+//                    record.setPrice(record.getSalesAmount().multiply(new BigDecimal(record.getNumber())).setScale(2, RoundingMode.HALF_UP));
+//                }
+//            }
+//        }
         List<TErpGoodsVO> listAll = erpGoodsService.pageShopListAll(tErpGoodsShopQuery);
         for (TErpGoodsVO record : listAll) {
             for (ShoppingCartItem cartItem : cacheList) {
@@ -197,8 +197,8 @@
                 }
             }
         }
-        BigDecimal totalPrice = records.stream().map(TErpGoodsVO::getPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-        res.setList(tErpGoodsVOPageInfo);
+        BigDecimal totalPrice = listAll.stream().map(TErpGoodsVO::getPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+        res.setList(listAll);
         res.setTotalPrice(totalPrice);
         return R.ok(res);
     }

--
Gitblit v1.7.1