文档库--添加判空

This commit is contained in:
zhn
2022-03-25 11:16:18 +08:00
parent 6b6bf0caac
commit 4b983bf15c
@@ -143,18 +143,20 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
for (Map.Entry<String, Object> entry : inputMap.entrySet()) { for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
if(ObjectUtils.isNotEmpty(value)){
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); must.add(queryMap);
} }
int a=0; }
} }
//封装下拉,树形,日期查询条件 //封装下拉,树形,日期查询条件
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();
Object value = entry.getValue(); Object value = entry.getValue();
if(ObjectUtils.isNotEmpty(value)){
Map<String, Object> queryMap = new HashMap<>(); Map<String, Object> queryMap = new HashMap<>();
Map<String, Object> queryMapTemp = new HashMap<>(); Map<String, Object> queryMapTemp = new HashMap<>();
queryMapTemp.put(key, value); queryMapTemp.put(key, value);
@@ -162,6 +164,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
must.add(queryMap); must.add(queryMap);
} }
} }
}
//列表 //列表
//封装查询条件 //封装查询条件
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(must, null, null); JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(must, null, null);
@@ -203,14 +206,6 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
}); });
mapTemp.put("file_name", fileList); mapTemp.put("file_name", fileList);
//下拉单选和下拉多选数据字典处理
// mapTemp.entrySet().forEach(entry -> {
// if (fieldPullList.contains(entry.getKey())) {
// //下拉选处理数据字典
// bussDocumentLibraryEOService.dictItem(sysDictItems, entry, onlCgformFieldList, (String) map.get("cut"));
// }
// });
} }
IPage page = new Page(Integer.parseInt(map.get("pageNo").toString()), Integer.parseInt(map.get("pageSize").toString())); IPage page = new Page(Integer.parseInt(map.get("pageNo").toString()), Integer.parseInt(map.get("pageSize").toString()));
page.setTotal(Long.parseLong(String.valueOf(((Map) search.get("hits")).get("total")))); page.setTotal(Long.parseLong(String.valueOf(((Map) search.get("hits")).get("total"))));