diff --git a/NOTE.md b/NOTE.md new file mode 100644 index 00000000..f6f503ce --- /dev/null +++ b/NOTE.md @@ -0,0 +1,23 @@ +### 标签管理: + +#### 1.标签项管理: + +laws_area表:显示的区域。 + +laws_tag表:表中的字段。 + +#### 2.标签内容管理: + +1. 下拉选择的选择项存在原框架的字典表sys_dict_item里面。 +2. 树型结构的选项存在了sys_category里面。 + +注:返回给前端的查询条件和表单模型时,需要将树型结构的选项一起返回,下拉框则不需要,前端自己调用数据字典的接口。 + +#### 3.获取树型结构集合: + +```java +List list = new ArrayList<>(); +List tree = TreeUtils.getSysCategoryTree(list, cut); +``` + +蔚来的树型结构的查询是勾选父级会自动勾选全部子节点,所以可以将这个ids字符串切割后用来做查询判断,拼接成查询条件。 \ No newline at end of file diff --git a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java index 58180264..141f038a 100644 --- a/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java +++ b/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java @@ -281,7 +281,7 @@ public class SysCategoryServiceImpl extends ServiceImpl tree = new ArrayList<>(); if(CollectionUtils.isNotEmpty(list)){ - tree = TreeUtils.getSysCategoryTree(list,cut); + tree = TreeUtils.getSysCategoryTree(list, cut); } Collections.sort(tree, Comparator.comparing(SysCategoryTreeVO::getTitle)); return tree; diff --git a/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/controller/LawsBasicInfoController.java b/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/controller/LawsBasicInfoController.java index 7752574c..6d25918c 100644 --- a/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/controller/LawsBasicInfoController.java +++ b/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/controller/LawsBasicInfoController.java @@ -59,4 +59,12 @@ public class LawsBasicInfoController extends JeroController>> getQueryCondition(@RequestParam(name="flag") String flag) { + List> list = lawsBasicInfoService.getQueryCondition(flag); + return Result.OK(list); + } + } diff --git a/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/ILawsBasicInfoService.java b/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/ILawsBasicInfoService.java index 8e6684cb..8549cc8f 100644 --- a/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/ILawsBasicInfoService.java +++ b/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/ILawsBasicInfoService.java @@ -41,4 +41,11 @@ public interface ILawsBasicInfoService extends IService { * @Description: 获取表单模型 **/ List> getFormModel(String flag); + + /** + * @Author: liao + * @Date: 2023/8/23 14:54 + * @Description: 获取查询条件 + **/ + List> getQueryCondition(String flag); } diff --git a/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/impl/LawsBasicInfoServiceImpl.java b/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/impl/LawsBasicInfoServiceImpl.java index 49776547..ef9c8a90 100644 --- a/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/impl/LawsBasicInfoServiceImpl.java +++ b/jero-boot-modules/src/main/java/com/jero/modules/laws/regulation/service/impl/LawsBasicInfoServiceImpl.java @@ -399,12 +399,11 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl parameter) { - String cut = MessageUtils.getLanguage().getValue(); //查询条件 StringBuilder conditionSb = new StringBuilder("where 1 = 1"); //过滤查询条件字段类型使用 - List> mapList = queryCondition(FileTableIdEnum.DOMESTIC_REGULATIONS.getValue(), cut, null); + List> mapList = getQueryCondition(FileTableIdEnum.DOMESTIC_REGULATIONS.getValue()); //查询条件处理 for (Map.Entry entry : parameter.entrySet()) { @@ -474,12 +473,21 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl> queryCondition(String flag, String cut, String searchFlag) { + /** + * @Author: liao + * @Date: 2023/8/23 14:55 + * @Description: 获取查询条件 + **/ + @Override + public List> getQueryCondition(String flag) { + String cut = MessageUtils.getLanguage().getValue(); List fieldList = getFieldList(flag); - fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(MyStringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList()); + fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue() + .equals(MyStringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList()); //树形数据字典 Map params = new HashedMap(); params.put("cut",cut); + //List sysCategoryTree = sysCategoryService.getSysCategoryTree(null,params); List> list = new java.util.ArrayList<>(); for (LawsTag lawsTag : fieldList) { Map map = new HashMap<>(); @@ -491,6 +499,15 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl sysCategoryTreeVOList = sysCategoryTree.stream() + .filter(sysCategoryTreeVO -> lawsTag.getDictId() + .equals(sysCategoryTreeVO.getDictId())).collect(Collectors.toList()); + map.put("tree", sysCategoryTreeVOList); + } else { + map.put("tree", new java.util.ArrayList<>()); + }*/ list.add(map); } return list;