文档库--组合搜索问题
This commit is contained in:
+2
-2
@@ -2159,11 +2159,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
StringBuilder condition = new StringBuilder();
|
StringBuilder condition = new StringBuilder();
|
||||||
for (String valueTemp : value.split(",")) {
|
for (String valueTemp : value.split(",")) {
|
||||||
valueSb.append("'" + valueTemp + "',");
|
valueSb.append("'" + valueTemp + "',");
|
||||||
condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%'))");
|
||||||
}
|
}
|
||||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||||
//下拉单选或下拉多选
|
//下拉单选或下拉多选
|
||||||
conditionSb.append(" and " + key + " in(" + substring + ")" + condition.toString());
|
conditionSb.append(" and (" + key + " in(" + substring + ")" + condition.toString());
|
||||||
|
|
||||||
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
|
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
|
||||||
//日期(区分单日期还时间范围)
|
//日期(区分单日期还时间范围)
|
||||||
|
|||||||
+5
-3
@@ -88,7 +88,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
.filter(e -> FieldTypeEnum.TEXT_STRING.getValue().equals(e.getFieldShowType())
|
.filter(e -> FieldTypeEnum.TEXT_STRING.getValue().equals(e.getFieldShowType())
|
||||||
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType()))
|
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<String> inputFieldList = inputOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList());
|
List<String> inputFieldList = inputOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||||
//下拉,树形,日期等字段
|
//下拉,树形,日期等字段
|
||||||
List<OnlCgformField> otherOnlCgformFieldList = fieldList.stream()
|
List<OnlCgformField> otherOnlCgformFieldList = fieldList.stream()
|
||||||
.filter(e -> FieldTypeEnum.PULL_SINGLE.getValue().equals(e.getFieldShowType())//下拉单选
|
.filter(e -> FieldTypeEnum.PULL_SINGLE.getValue().equals(e.getFieldShowType())//下拉单选
|
||||||
@@ -97,7 +97,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
|| FieldTypeEnum.DATE_MORE.getValue().equals(e.getFieldShowType())//日期多选
|
|| FieldTypeEnum.DATE_MORE.getValue().equals(e.getFieldShowType())//日期多选
|
||||||
|| FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))//树形
|
|| FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))//树形
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<String> otherFieldList = otherOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList());
|
List<String> otherFieldList = otherOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||||
|
|
||||||
//过滤出下拉选
|
//过滤出下拉选
|
||||||
List<OnlCgformField> onlCgformFieldList = fieldList.stream()
|
List<OnlCgformField> onlCgformFieldList = fieldList.stream()
|
||||||
@@ -136,6 +136,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONArray should = new JSONArray();
|
JSONArray should = new JSONArray();
|
||||||
|
JSONArray must = new JSONArray();
|
||||||
//封装输入框查询条件
|
//封装输入框查询条件
|
||||||
if (ObjectUtils.isNotEmpty(inputMap)) {
|
if (ObjectUtils.isNotEmpty(inputMap)) {
|
||||||
Map<String, Object> queryMap = new HashMap<>();
|
Map<String, Object> queryMap = new HashMap<>();
|
||||||
@@ -145,10 +146,11 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
Map<String, Object> queryMapTemp = new HashMap<>();
|
Map<String, Object> queryMapTemp = new HashMap<>();
|
||||||
queryMapTemp.put(key, value);
|
queryMapTemp.put(key, value);
|
||||||
queryMap.put("match", queryMapTemp);
|
queryMap.put("match", queryMapTemp);
|
||||||
|
must.add(queryMap);
|
||||||
}
|
}
|
||||||
|
int a=0;
|
||||||
}
|
}
|
||||||
//封装下拉,树形,日期查询条件
|
//封装下拉,树形,日期查询条件
|
||||||
JSONArray must = new JSONArray();
|
|
||||||
if (ObjectUtils.isNotEmpty(otherMap)) {
|
if (ObjectUtils.isNotEmpty(otherMap)) {
|
||||||
for (Map.Entry<String, Object> entry : otherMap.entrySet()) {
|
for (Map.Entry<String, Object> entry : otherMap.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
|
|||||||
Reference in New Issue
Block a user