Pārlūkot izejas kodu

更新获取商品排序返回

Yangzw 1 mēnesi atpakaļ
vecāks
revīzija
6da5ef3c5c

+ 13 - 6
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/ProductSpuController.java

@@ -24,10 +24,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 import static cn.newfeifan.mall.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
@@ -115,8 +112,18 @@ public class ProductSpuController {
     @Parameter(name = "spuIds", description = "spu 编号列表", required = true, example = "[1,2,3]")
     @PreAuthorize("@ss.hasPermission('product:spu:query')")
     public CommonResult<List<ProductSpuRespVO>> getSpuList(@RequestParam("spuIds") Collection<Long> spuIds) {
-        return success(ProductSpuConvert.INSTANCE.convertForSpuDetailRespListVO(
-                productSpuService.getSpuList(spuIds), productSkuService.getSkuListBySpuId(spuIds)));
+        List<ProductSpuRespVO> data = ProductSpuConvert.INSTANCE.convertForSpuDetailRespListVO(
+                productSpuService.getSpuList(spuIds), productSkuService.getSkuListBySpuId(spuIds));
+
+        List<ProductSpuRespVO> list = new ArrayList<>();
+        for (Long spuId : spuIds) {
+            for (ProductSpuRespVO vo : data) {
+                if(spuId.equals(vo.getId())){
+                    list.add(vo);
+                }
+            }
+        }
+        return success(list);
     }
 
     @GetMapping("/page")

+ 4 - 1
sql/mysql/建空库SQL/25_20241011.sql

@@ -31,4 +31,7 @@ ALTER TABLE member_user
     ADD COLUMN `visitor` bit(1) DEFAULT b'0' COMMENT '是否是游客 0:否 1:是';
 
 ALTER TABLE trade_order
-    ADD COLUMN `user_deleted` bit(1) DEFAULT b'0' COMMENT '用户是否删除';
+    ADD COLUMN `user_deleted` bit(1) DEFAULT b'0' COMMENT '用户是否删除';
+
+ALTER TABLE distri_pt_profit
+    ADD COLUMN `visitor_earnings` bigint NOT NULL DEFAULT '0' COMMENT '游客收益';