add 获取查询条件
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
### 标签管理:
|
||||||
|
|
||||||
|
#### 1.标签项管理:
|
||||||
|
|
||||||
|
laws_area表:显示的区域。
|
||||||
|
|
||||||
|
laws_tag表:表中的字段。
|
||||||
|
|
||||||
|
#### 2.标签内容管理:
|
||||||
|
|
||||||
|
1. 下拉选择的选择项存在原框架的字典表sys_dict_item里面。
|
||||||
|
2. 树型结构的选项存在了sys_category里面。
|
||||||
|
|
||||||
|
注:返回给前端的查询条件和表单模型时,需要将树型结构的选项一起返回,下拉框则不需要,前端自己调用数据字典的接口。
|
||||||
|
|
||||||
|
#### 3.获取树型结构集合:
|
||||||
|
|
||||||
|
```java
|
||||||
|
List<SysCategory> list = new ArrayList<>();
|
||||||
|
List<SysCategoryTreeVO> tree = TreeUtils.getSysCategoryTree(list, cut);
|
||||||
|
```
|
||||||
|
|
||||||
|
蔚来的树型结构的查询是勾选父级会自动勾选全部子节点,所以可以将这个ids字符串切割后用来做查询判断,拼接成查询条件。
|
||||||
+1
-1
@@ -281,7 +281,7 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
|||||||
}
|
}
|
||||||
List<SysCategoryTreeVO> tree = new ArrayList<>();
|
List<SysCategoryTreeVO> tree = new ArrayList<>();
|
||||||
if(CollectionUtils.isNotEmpty(list)){
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
tree = TreeUtils.getSysCategoryTree(list,cut);
|
tree = TreeUtils.getSysCategoryTree(list, cut);
|
||||||
}
|
}
|
||||||
Collections.sort(tree, Comparator.comparing(SysCategoryTreeVO::getTitle));
|
Collections.sort(tree, Comparator.comparing(SysCategoryTreeVO::getTitle));
|
||||||
return tree;
|
return tree;
|
||||||
|
|||||||
+8
@@ -59,4 +59,12 @@ public class LawsBasicInfoController extends JeroController<LawsBasicInfo, ILaws
|
|||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "获取查询条件")
|
||||||
|
@ApiOperation(value="获取查询条件", notes="获取查询条件")
|
||||||
|
@GetMapping(value = "getQueryCondition")
|
||||||
|
public Result<List<Map<String,Object>>> getQueryCondition(@RequestParam(name="flag") String flag) {
|
||||||
|
List<Map<String,Object>> list = lawsBasicInfoService.getQueryCondition(flag);
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -41,4 +41,11 @@ public interface ILawsBasicInfoService extends IService<LawsBasicInfo> {
|
|||||||
* @Description: 获取表单模型
|
* @Description: 获取表单模型
|
||||||
**/
|
**/
|
||||||
List<Map<String, Object>> getFormModel(String flag);
|
List<Map<String, Object>> getFormModel(String flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/8/23 14:54
|
||||||
|
* @Description: 获取查询条件
|
||||||
|
**/
|
||||||
|
List<Map<String, Object>> getQueryCondition(String flag);
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-4
@@ -399,12 +399,11 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, L
|
|||||||
* @Description: 组装查询条件
|
* @Description: 组装查询条件
|
||||||
**/
|
**/
|
||||||
private String getConditionStr(Map<String, Object> parameter) {
|
private String getConditionStr(Map<String, Object> parameter) {
|
||||||
String cut = MessageUtils.getLanguage().getValue();
|
|
||||||
//查询条件
|
//查询条件
|
||||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||||
|
|
||||||
//过滤查询条件字段类型使用
|
//过滤查询条件字段类型使用
|
||||||
List<Map<String, Object>> mapList = queryCondition(FileTableIdEnum.DOMESTIC_REGULATIONS.getValue(), cut, null);
|
List<Map<String, Object>> mapList = getQueryCondition(FileTableIdEnum.DOMESTIC_REGULATIONS.getValue());
|
||||||
|
|
||||||
//查询条件处理
|
//查询条件处理
|
||||||
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
|
||||||
@@ -474,12 +473,21 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, L
|
|||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Map<String, Object>> queryCondition(String flag, String cut, String searchFlag) {
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/8/23 14:55
|
||||||
|
* @Description: 获取查询条件
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getQueryCondition(String flag) {
|
||||||
|
String cut = MessageUtils.getLanguage().getValue();
|
||||||
List<LawsTag> fieldList = getFieldList(flag);
|
List<LawsTag> 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<String,Object> params = new HashedMap();
|
Map<String,Object> params = new HashedMap();
|
||||||
params.put("cut",cut);
|
params.put("cut",cut);
|
||||||
|
//List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(null,params);
|
||||||
List<Map<String, Object>> list = new java.util.ArrayList<>();
|
List<Map<String, Object>> list = new java.util.ArrayList<>();
|
||||||
for (LawsTag lawsTag : fieldList) {
|
for (LawsTag lawsTag : fieldList) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
@@ -491,6 +499,15 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, L
|
|||||||
} else {
|
} else {
|
||||||
map.put("db_field_txt", lawsTag.getDbFieldEnName());//字段英文名
|
map.put("db_field_txt", lawsTag.getDbFieldEnName());//字段英文名
|
||||||
}
|
}
|
||||||
|
// 树型结构的集合(后面写个通用的)
|
||||||
|
/*if ("technology_territory".equals(lawsTag.getDbFieldName())) {
|
||||||
|
List<SysCategoryTreeVO> 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);
|
list.add(map);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
Reference in New Issue
Block a user