|
@@ -16,7 +16,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
-import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -43,8 +42,8 @@ public class AlgorithmGoodsServiceImpl extends ServiceImpl<AlgorithmGoodsMapper,
|
|
|
@Override
|
|
|
public R<PageBean<AlgorithmGoodsDto.Vo>> page(@RequestBody AlgorithmGoodsDto.Page page) {
|
|
|
//获取算法平台列表
|
|
|
- List<AlgorithmDto.ListNameId> listAlgorithm = algorithmService.ListNameId().getData();
|
|
|
- Map<Long, AlgorithmDto.ListNameId> algorithmMap = CollStreamUtil.toIdentityMap(listAlgorithm, AlgorithmDto.ListNameId::getId);
|
|
|
+ Map<Long, String> algorithmMap = CollStreamUtil.toMap(algorithmService.ListNameId().getData(),
|
|
|
+ AlgorithmDto.ListNameId::getId,AlgorithmDto.ListNameId::getName);
|
|
|
//查询商品分页
|
|
|
PageBean pageBean = page.getPage();
|
|
|
LambdaQueryWrapper<AlgorithmGoods> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(page, AlgorithmGoods.class)
|
|
@@ -57,7 +56,7 @@ public class AlgorithmGoodsServiceImpl extends ServiceImpl<AlgorithmGoodsMapper,
|
|
|
//设置平台名称
|
|
|
dtoPageBean.setRecords(
|
|
|
dtoPageBean.getRecords().stream().map(
|
|
|
- item -> item.setAlgorithmName(algorithmMap.get(item.getAlgorithmId()).getName())
|
|
|
+ item -> item.setAlgorithmName(algorithmMap.get(item.getAlgorithmId()))
|
|
|
).collect(Collectors.toList())
|
|
|
);
|
|
|
return R.ok(dtoPageBean);
|