fix:79203
This commit is contained in:
+21
-6
@@ -571,9 +571,10 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
|||||||
objVO.setItemText(dict.getText());
|
objVO.setItemText(dict.getText());
|
||||||
objVO.setItemValue(dict.getValue());
|
objVO.setItemValue(dict.getValue());
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
Optional<LawsHomeNormalSearchCountVO> op = list.stream().filter(o -> !StringUtils.isBlank(o.getDict()) && Arrays.asList(o.getDict().split(",")).contains(dict.getValue()) && Objects.equals(o.getFieldName(),data)).findFirst();
|
List<LawsHomeNormalSearchCountVO> opList = list.stream().filter(o -> !StringUtils.isBlank(o.getDict()) && Arrays.asList(o.getDict().split(",")).contains(dict.getValue()) && Objects.equals(o.getFieldName(),data)).collect(Collectors.toList());
|
||||||
if(op.isPresent()){
|
if(!CollectionUtils.isEmpty(opList)){
|
||||||
objVO.setStatisticsCount(op.get().getCount());
|
Integer str = opList.stream().map(o->Integer.parseInt(o.getCount())).reduce((x,y) ->x+y).get();
|
||||||
|
objVO.setStatisticsCount(String.valueOf(str));
|
||||||
}else{
|
}else{
|
||||||
objVO.setStatisticsCount("0");
|
objVO.setStatisticsCount("0");
|
||||||
}
|
}
|
||||||
@@ -610,9 +611,6 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String,String> mapDict = new HashMap<>();
|
Map<String,String> mapDict = new HashMap<>();
|
||||||
if(!StringUtils.isBlank(homeNormalSearchDTO.getResourceType())){
|
|
||||||
mapDict.put(RESOURCE_TYPE,homeNormalSearchDTO.getResourceType());
|
|
||||||
}
|
|
||||||
if(!StringUtils.isBlank(homeNormalSearchDTO.getStandardClass())){
|
if(!StringUtils.isBlank(homeNormalSearchDTO.getStandardClass())){
|
||||||
mapDict.put(STANDARD_CLASS,homeNormalSearchDTO.getStandardClass());
|
mapDict.put(STANDARD_CLASS,homeNormalSearchDTO.getStandardClass());
|
||||||
}
|
}
|
||||||
@@ -640,6 +638,13 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
|||||||
JSONObject jsonAll = new JSONObject();
|
JSONObject jsonAll = new JSONObject();
|
||||||
JSONArray queryMapJsonAll = new JSONArray();
|
JSONArray queryMapJsonAll = new JSONArray();
|
||||||
JSONArray queryMapJsonDict = new JSONArray();
|
JSONArray queryMapJsonDict = new JSONArray();
|
||||||
|
if(!StringUtils.isBlank(homeNormalSearchDTO.getResourceType())){
|
||||||
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
|
map2.put(RESOURCE_TYPE,homeNormalSearchDTO.getResourceType());
|
||||||
|
map1.put("match_phrase",map2);
|
||||||
|
queryMapJsonDict.add(map1);
|
||||||
|
}
|
||||||
mapDict.forEach((k,v)->{
|
mapDict.forEach((k,v)->{
|
||||||
Map<String, Object> map1 = new HashMap<>();
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
Map<String, Object> map2 = new HashMap<>();
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
@@ -891,6 +896,16 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
|||||||
if (StringUtils.isNotBlank(searchContent)) {
|
if (StringUtils.isNotBlank(searchContent)) {
|
||||||
getQueryMapJson(queryMapJson, searchContent, CONTENT);
|
getQueryMapJson(queryMapJson, searchContent, CONTENT);
|
||||||
}
|
}
|
||||||
|
if(!StringUtils.isBlank(homeNormalSearchDTO.getResourceType())){
|
||||||
|
JSONArray queryResourceType = new JSONArray();
|
||||||
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
|
map1.put(RESOURCE_TYPE,homeNormalSearchDTO.getResourceType());
|
||||||
|
map2.put("match_phrase",map1);
|
||||||
|
queryResourceType.add(map2);
|
||||||
|
JSONObject object = jeroElasticsearchTemplate.buildBoolQuery(queryResourceType,null,null);
|
||||||
|
queryAll.add(object);
|
||||||
|
}
|
||||||
if(CollectionUtils.isNotEmpty(queryMapJson)){
|
if(CollectionUtils.isNotEmpty(queryMapJson)){
|
||||||
JSONObject object = jeroElasticsearchTemplate.buildBoolQuery(null,null,queryMapJson);
|
JSONObject object = jeroElasticsearchTemplate.buildBoolQuery(null,null,queryMapJson);
|
||||||
queryAll.add(object);
|
queryAll.add(object);
|
||||||
|
|||||||
Reference in New Issue
Block a user