产品列表查询补充字段;类目查询level为1的一级不带"全部"
This commit is contained in:
parent
de181ff5d7
commit
f9d49aea4a
|
|
@ -98,13 +98,22 @@ public class GoodsController extends BaseController {
|
|||
}
|
||||
List<Goods> list = goodsService.selectGoodsList(goods);
|
||||
list.forEach(one -> {
|
||||
// 补全商品
|
||||
// 补全商品服务区域
|
||||
List<GoodsArea> goodsAreas = goodsAreaService.selectByGoodsId(one.getGoodsId());
|
||||
one.setGoodsAreaList(goodsAreas);
|
||||
|
||||
// 补全商品类别
|
||||
// 补全商品规格
|
||||
List<GoodsStandard> goodsStandards = goodsStandardService.selectByGoodsId(one.getGoodsId());
|
||||
one.setGoodsStandardList(goodsStandards);
|
||||
|
||||
// 补全商品类目及父级类目信息
|
||||
GoodsCategory goodsCategory = goodsCategoryService.selectById(one.getDeptGoodsCategoryId());
|
||||
one.setDeptGoodsCategoryName(goodsCategory.getGoodsCategoryName());
|
||||
if (goodsCategory.getParentCategoryId() != null) {
|
||||
GoodsCategory parGoodsCategory = goodsCategoryService.selectById(goodsCategory.getParentCategoryId());
|
||||
one.setParGoodsCategoryId(parGoodsCategory.getGoodsCategoryId());
|
||||
one.setParGoodsCategoryName(parGoodsCategory.getGoodsCategoryName());
|
||||
}
|
||||
});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,13 +87,13 @@ public class GoodsDeptCategoryController extends BaseController {
|
|||
try {
|
||||
if (deptGoodsCategory.getIsAllNode() == null || !deptGoodsCategory.getIsAllNode()) {
|
||||
List<DeptGoodsCategory> list = deptGoodsCategoryService.listByStep(deptGoodsCategory);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
if (!CollectionUtils.isEmpty(list) && list.get(0).getLevel() > 1) {
|
||||
DeptGoodsCategory allGoodsNode = new DeptGoodsCategory();
|
||||
allGoodsNode.setGoodsCategoryName("全部");
|
||||
allGoodsNode.setIsAllNode(true);
|
||||
resList.add(allGoodsNode);
|
||||
resList.addAll(list);
|
||||
}
|
||||
resList.addAll(list);
|
||||
}
|
||||
return AjaxResult.success(resList);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -43,8 +43,14 @@ public class Goods extends BaseEntity {
|
|||
@Excel(name = "类别id,必须是关联到系统的第三级目录")
|
||||
private Long deptGoodsCategoryId;
|
||||
|
||||
private String deptGoodsCategoryName;
|
||||
|
||||
private List<Long> deptGoodsCategoryIds;
|
||||
|
||||
private Long parGoodsCategoryId;
|
||||
|
||||
private String parGoodsCategoryName;
|
||||
|
||||
@Excel(name = "商品图片", cellType = Excel.ColumnType.IMAGE)
|
||||
private String goodsImgUrl;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
FROM goods
|
||||
</sql>
|
||||
<sql id="selectGoodsWithArea">
|
||||
SELECT DISTINCT g.goods_id, goods_code, dept_id, goods_name, goods_desc, goods_sort, worker_id,
|
||||
SELECT DISTINCT g.goods_id, goods_code, dept_id, goods_name, goods_desc, goods_sort, worker_id, goods_unit,
|
||||
dept_goods_category_id, goods_img_url, goods_video_url, status, create_by, create_time, remark
|
||||
FROM goods g
|
||||
LEFT JOIN goods_area ga ON g.goods_id = ga.goods_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue