文档库--添加判空

This commit is contained in:
zhn
2022-03-25 11:16:18 +08:00
parent 6b6bf0caac
commit 4b983bf15c
@@ -143,23 +143,26 @@ 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();
Map<String, Object> queryMapTemp = new HashMap<>(); if(ObjectUtils.isNotEmpty(value)){
queryMapTemp.put(key, value); Map<String, Object> queryMapTemp = new HashMap<>();
queryMap.put("match", queryMapTemp); queryMapTemp.put(key, value);
must.add(queryMap); queryMap.put("match", queryMapTemp);
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();
Map<String, Object> queryMap = new HashMap<>(); if(ObjectUtils.isNotEmpty(value)){
Map<String, Object> queryMapTemp = new HashMap<>(); Map<String, Object> queryMap = new HashMap<>();
queryMapTemp.put(key, value); Map<String, Object> queryMapTemp = new HashMap<>();
queryMap.put("match", queryMapTemp); queryMapTemp.put(key, value);
must.add(queryMap); queryMap.put("match", queryMapTemp);
must.add(queryMap);
}
} }
} }
//列表 //列表
@@ -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"))));