|
@@ -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")
|