商品模块代码提交
This commit is contained in:
@@ -21,6 +21,10 @@ public class ProductBriefDTO implements Serializable {
|
|||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 商品分类
|
||||||
|
*/
|
||||||
|
private Long categoryId;
|
||||||
/**
|
/**
|
||||||
* 商品名称
|
* 商品名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
|||||||
ProdGroupDTO dto = super.getOneAs(query().eq(ProdGroup::getId, id).eq(ProdGroup::getShopId, shopId), ProdGroupDTO.class);
|
ProdGroupDTO dto = super.getOneAs(query().eq(ProdGroup::getId, id).eq(ProdGroup::getShopId, shopId), ProdGroupDTO.class);
|
||||||
List<Long> productIdList = prodGroupRelationMapper.selectObjectListByQueryAs(query().select(ProdGroupRelation::getProductId).eq(ProdGroupRelation::getProdGroupId, id), Long.class);
|
List<Long> productIdList = prodGroupRelationMapper.selectObjectListByQueryAs(query().select(ProdGroupRelation::getProductId).eq(ProdGroupRelation::getProdGroupId, id), Long.class);
|
||||||
if (CollUtil.isNotEmpty(productIdList)) {
|
if (CollUtil.isNotEmpty(productIdList)) {
|
||||||
List<ProductBriefDTO> productList = productMapper.selectListByQueryAs(query().select(Product::getId, Product::getName, Product::getCoverImg).in(Product::getId, productIdList), ProductBriefDTO.class);
|
List<ProductBriefDTO> productList = productMapper.selectListByQueryAs(query().select(Product::getId, Product::getCategoryId, Product::getName, Product::getCoverImg).in(Product::getId, productIdList), ProductBriefDTO.class);
|
||||||
dto.setProductList(productList);
|
dto.setProductList(productList);
|
||||||
} else {
|
} else {
|
||||||
dto.setProductList(new ArrayList<>());
|
dto.setProductList(new ArrayList<>());
|
||||||
|
|||||||
Reference in New Issue
Block a user