提交 bf2f1136 作者: xiaowang

新增查询二级分类,商品列表描述返回

上级 26b0de6b
...@@ -95,6 +95,15 @@ public class BackstageCategoriesController { ...@@ -95,6 +95,15 @@ public class BackstageCategoriesController {
return categoriesService.getClassifyDetails(id); return categoriesService.getClassifyDetails(id);
} }
@ApiOperation(value = "获取二级分类")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ClassifyDetailsDTO.class)})
@GetMapping("getSubClassifyList")
public ResultBody<List<ClassifyDetailsDTO>> getSubClassifyList(
@ApiParam(value = "父分类id", required = true) @RequestParam(value = "id") Integer id) {
return categoriesService.getSubClassifyList(id);
}
@ApiOperation(value = "分类详情下关联业务列表") @ApiOperation(value = "分类详情下关联业务列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = RelevantBusinessVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = RelevantBusinessVO.class)})
@GetMapping("queryRelevantBusiness") @GetMapping("queryRelevantBusiness")
......
...@@ -64,4 +64,6 @@ public interface CategoriesDao { ...@@ -64,4 +64,6 @@ public interface CategoriesDao {
List<Categories> getCategoriesListByDirectoryIds(List<Integer> directoryIds); List<Categories> getCategoriesListByDirectoryIds(List<Integer> directoryIds);
int countChildById(Integer id); int countChildById(Integer id);
List<Categories> getSubClassifyList(Integer id);
} }
...@@ -60,6 +60,8 @@ public class GoodsInfo implements Serializable { ...@@ -60,6 +60,8 @@ public class GoodsInfo implements Serializable {
private String directoryName; private String directoryName;
private String goodsDesc;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public GoodsInfo(GoodsAddVO goodsAddVO) { public GoodsInfo(GoodsAddVO goodsAddVO) {
...@@ -87,7 +89,7 @@ public class GoodsInfo implements Serializable { ...@@ -87,7 +89,7 @@ public class GoodsInfo implements Serializable {
} }
public LeaseGoodsInfoDTO buildLeaseGoodsInfoDTO() { public LeaseGoodsInfoDTO buildLeaseGoodsInfoDTO() {
return LeaseGoodsInfoDTO.builder().id(id).goodsName(goodsName).images(mainImg).build(); return LeaseGoodsInfoDTO.builder().id(id).goodsName(goodsName).description(goodsDesc).images(mainImg).build();
} }
public GoodsInfoListDTO buildGoodsInfoListDTO() { public GoodsInfoListDTO buildGoodsInfoListDTO() {
......
...@@ -24,6 +24,8 @@ public class LeaseGoodsInfoDTO implements Serializable { ...@@ -24,6 +24,8 @@ public class LeaseGoodsInfoDTO implements Serializable {
private String goodsName; private String goodsName;
@ApiModelProperty(value = "商品图片") @ApiModelProperty(value = "商品图片")
private String images; private String images;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "价格") @ApiModelProperty(value = "价格")
private BigDecimal price; private BigDecimal price;
} }
...@@ -3,6 +3,7 @@ package com.mmc.pms.service; ...@@ -3,6 +3,7 @@ package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.Categories; import com.mmc.pms.entity.Categories;
import com.mmc.pms.model.categories.dto.AllCategoryDTO; import com.mmc.pms.model.categories.dto.AllCategoryDTO;
import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO; import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO; import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
import com.mmc.pms.model.sale.vo.QueryClassifyVO; import com.mmc.pms.model.sale.vo.QueryClassifyVO;
...@@ -49,4 +50,6 @@ public interface CategoriesService { ...@@ -49,4 +50,6 @@ public interface CategoriesService {
List<Categories> getCategoriesListByIds(Set<Integer> ids); List<Categories> getCategoriesListByIds(Set<Integer> ids);
List<AllCategoryDTO> feigQqueryCategoryInfoByType(Integer type); List<AllCategoryDTO> feigQqueryCategoryInfoByType(Integer type);
ResultBody<List<ClassifyDetailsDTO>> getSubClassifyList(Integer id);
} }
...@@ -12,10 +12,7 @@ import com.mmc.pms.entity.DirectoryDO; ...@@ -12,10 +12,7 @@ import com.mmc.pms.entity.DirectoryDO;
import com.mmc.pms.entity.GoodsInfo; import com.mmc.pms.entity.GoodsInfo;
import com.mmc.pms.entity.ServiceDO; import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.feign.ImsAppApi; import com.mmc.pms.feign.ImsAppApi;
import com.mmc.pms.model.categories.dto.AllCategoryDTO; import com.mmc.pms.model.categories.dto.*;
import com.mmc.pms.model.categories.dto.CategoriesDTO;
import com.mmc.pms.model.categories.dto.CategoriesInfoListDTO;
import com.mmc.pms.model.categories.dto.ClassifyInfoDTO;
import com.mmc.pms.model.categories.vo.ClassifyInfoVO; import com.mmc.pms.model.categories.vo.ClassifyInfoVO;
import com.mmc.pms.model.categories.vo.CurriculumInfoVO; import com.mmc.pms.model.categories.vo.CurriculumInfoVO;
import com.mmc.pms.model.categories.vo.DirectoryInfoVO; import com.mmc.pms.model.categories.vo.DirectoryInfoVO;
...@@ -374,4 +371,14 @@ public class CategoriesServiceImpl implements CategoriesService { ...@@ -374,4 +371,14 @@ public class CategoriesServiceImpl implements CategoriesService {
.ifPresent(allCategoryDTO::setCategoriesInfoListDTO); .ifPresent(allCategoryDTO::setCategoriesInfoListDTO);
} }
} }
@Override
public ResultBody<List<ClassifyDetailsDTO>> getSubClassifyList(Integer id) {
List<Categories> categoriesList = categoriesDao.getSubClassifyList(id);
if (CollectionUtils.isNotEmpty(categoriesList)){
List<ClassifyDetailsDTO> list = categoriesList.stream().map(Categories::buildClassifyDetailsDTO).collect(Collectors.toList());
return ResultBody.success(list);
}
return ResultBody.success();
}
} }
...@@ -223,6 +223,18 @@ ...@@ -223,6 +223,18 @@
AND c2.is_deleted = 0 AND c2.is_deleted = 0
WHERE c1.id = #{id} WHERE c1.id = #{id}
</select> </select>
<select id="getSubClassifyList" resultType="com.mmc.pms.entity.Categories">
select id,
parent_id,
directory_id,
`name`,
icon,
description,
remark,
create_time
from categories
where parent_id = #{id}
</select>
<update id="deleteById"> <update id="deleteById">
UPDATE `categories` UPDATE `categories`
......
...@@ -177,10 +177,11 @@ ...@@ -177,10 +177,11 @@
<select id="listWareInfoPage" resultType="com.mmc.pms.entity.GoodsInfo"> <select id="listWareInfoPage" resultType="com.mmc.pms.entity.GoodsInfo">
SELECT SELECT
gi.id,gi.goods_name,img.img_url mainImg gi.id,gi.goods_name,img.img_url mainImg,gd.goods_desc
FROM FROM
goods_info gi goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id and img.img_type = 0 AND img.is_deleted = 0 INNER JOIN goods_img img ON gi.id = img.goods_info_id and img.img_type = 0 AND img.is_deleted = 0
INNER JOIN goods_detail gd ON gd.goods_info_id = gi.id
<where> <where>
gi.is_deleted = 0 and gi.shelf_status = 1 and gi.goods_type = #{type} gi.is_deleted = 0 and gi.shelf_status = 1 and gi.goods_type = #{type}
<if test="param.categoryId != null"> <if test="param.categoryId != null">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论