diff --git a/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java b/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java index a4b8232f..88669ec3 100644 --- a/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java +++ b/ghy-goods/src/main/java/com/ghy/goods/domain/DeptGoodsCategory.java @@ -106,4 +106,6 @@ public class DeptGoodsCategory extends GoodsCategory { private String shopInsuranceIds; private Long customerId; + + private Integer isSetting; } diff --git a/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java b/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java index 74a31b3c..b47cc155 100644 --- a/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java +++ b/ghy-goods/src/main/java/com/ghy/goods/service/impl/DeptGoodsCategoryServiceImpl.java @@ -105,10 +105,14 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService { List goodsCategoryList =new ArrayList<>(); log.info("用户id{}获取到的类目列表{}",customerId,customerSelections); // 第一层 - for (CustomerSelection customerSelection1 : customerSelections) { - DeptGoodsCategory deptGoodsCategory1=deptGoodsCategoryMapper.selectOneByGoodsCategoryId(customerSelection1.getDeptCategoryId()); - if (customerSelection1.getSelectionType()==1&& Objects.equals(deptGoodsCategory.getType(), deptGoodsCategory1.getType())){ - goodsCategoryList.add(deptGoodsCategory1); + if (deptGoodsCategory.getIsSetting()==1){ + goodsCategoryList = deptGoodsCategoryMapper.appList(deptGoodsCategory); + }else{ + for (CustomerSelection customerSelection1 : customerSelections) { + DeptGoodsCategory deptGoodsCategory1=deptGoodsCategoryMapper.selectOneByGoodsCategoryId(customerSelection1.getDeptCategoryId()); + if (customerSelection1.getSelectionType()==1&& Objects.equals(deptGoodsCategory.getType(), deptGoodsCategory1.getType())){ + goodsCategoryList.add(deptGoodsCategory1); + } } } log.info("筛选完的类目列表{}",goodsCategoryList);