商品模块代码提交
This commit is contained in:
@@ -121,7 +121,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void buildProductExtInfo(List<ProductDTO> records) {
|
private void buildProductExtInfo(List<ProductDTO> records) {
|
||||||
records.forEach(record -> {
|
records.parallelStream().forEach(record -> {
|
||||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().eq(ProdSku::getProductId, record.getId()).eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
|
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().eq(ProdSku::getProductId, record.getId()).eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
|
||||||
if (CollUtil.isNotEmpty(skuList)) {
|
if (CollUtil.isNotEmpty(skuList)) {
|
||||||
Optional<BigDecimal> lowPriceIsPresent = skuList.stream().map(obj -> NumberUtil.nullToZero(obj.getSalePrice())).min(BigDecimal::compareTo);
|
Optional<BigDecimal> lowPriceIsPresent = skuList.stream().map(obj -> NumberUtil.nullToZero(obj.getSalePrice())).min(BigDecimal::compareTo);
|
||||||
@@ -135,7 +135,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|||||||
record.setConsList(consList);
|
record.setConsList(consList);
|
||||||
if (CollUtil.isNotEmpty(consList)) {
|
if (CollUtil.isNotEmpty(consList)) {
|
||||||
List<Long> consIds = consList.stream().map(ProdConsRelationDTO::getConsInfoId).distinct().toList();
|
List<Long> consIds = consList.stream().map(ProdConsRelationDTO::getConsInfoId).distinct().toList();
|
||||||
String consName = consInfoMapper.selectOneByQueryAs(query().select("GROUP_CONCAT(con_name SEPARATOR '、')").eq(ConsInfo::getId, consIds), String.class);
|
String consName = consInfoMapper.selectOneByQueryAs(query().select("GROUP_CONCAT(con_name SEPARATOR '、')").in(ConsInfo::getId, consIds), String.class);
|
||||||
record.setConsName(consName);
|
record.setConsName(consName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -146,7 +146,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|||||||
QueryWrapper queryWrapper = buildFullQueryWrapper(param);
|
QueryWrapper queryWrapper = buildFullQueryWrapper(param);
|
||||||
Page<ProductDTO> page = super.pageAs(PageUtil.buildPage(), queryWrapper, ProductDTO.class);
|
Page<ProductDTO> page = super.pageAs(PageUtil.buildPage(), queryWrapper, ProductDTO.class);
|
||||||
List<ProductDTO> records = page.getRecords();
|
List<ProductDTO> records = page.getRecords();
|
||||||
//buildProductExtInfo(records);
|
buildProductExtInfo(records);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user