From 4b983bf15cb03782bafe4a5a2a21794bce514365 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 25 Mar 2022 11:16:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=BA=93--=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DocumentSearchServiceImpl.java | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/DocumentSearchServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/DocumentSearchServiceImpl.java index 9e723c769..e8f381fcb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/DocumentSearchServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/DocumentSearchServiceImpl.java @@ -143,23 +143,26 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService { for (Map.Entry entry : inputMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); - Map queryMapTemp = new HashMap<>(); - queryMapTemp.put(key, value); - queryMap.put("match", queryMapTemp); - must.add(queryMap); + if(ObjectUtils.isNotEmpty(value)){ + Map queryMapTemp = new HashMap<>(); + queryMapTemp.put(key, value); + queryMap.put("match", queryMapTemp); + must.add(queryMap); + } } - int a=0; } //封装下拉,树形,日期查询条件 if (ObjectUtils.isNotEmpty(otherMap)) { for (Map.Entry entry : otherMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); - Map queryMap = new HashMap<>(); - Map queryMapTemp = new HashMap<>(); - queryMapTemp.put(key, value); - queryMap.put("match", queryMapTemp); - must.add(queryMap); + if(ObjectUtils.isNotEmpty(value)){ + Map queryMap = new HashMap<>(); + Map queryMapTemp = new HashMap<>(); + queryMapTemp.put(key, value); + queryMap.put("match", queryMapTemp); + must.add(queryMap); + } } } //列表 @@ -203,14 +206,6 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService { }); 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())); page.setTotal(Long.parseLong(String.valueOf(((Map) search.get("hits")).get("total"))));