搜索中心-全部索引,增加问题知识库检索加权限。与问题知识库权限一样。
This commit is contained in:
+36
-4
@@ -25,6 +25,7 @@ import com.jero.modules.oss.service.IOSSFileService;
|
|||||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseUserEO;
|
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseUserEO;
|
||||||
import com.jero.modules.problemKnowledgeBase.enums.ShowPermissionsEnum;
|
import com.jero.modules.problemKnowledgeBase.enums.ShowPermissionsEnum;
|
||||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseUserEOService;
|
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseUserEOService;
|
||||||
|
import com.jero.modules.searchcenter.enums.ModuleTypeFlagEnum;
|
||||||
import com.jero.modules.searchcenter.vo.SearchVO;
|
import com.jero.modules.searchcenter.vo.SearchVO;
|
||||||
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
||||||
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
||||||
@@ -434,6 +435,16 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
JSONArray queryMapJsonThree = new JSONArray();
|
JSONArray queryMapJsonThree = new JSONArray();
|
||||||
JSONArray queryMapJsonAll = new JSONArray();
|
JSONArray queryMapJsonAll = new JSONArray();
|
||||||
|
|
||||||
|
//基础查询权限,展示权限为公开的,所有人都能查看,展示权限为私密的,只有配置了权限的用户可以查看。
|
||||||
|
if("base".equals("base")){
|
||||||
|
JSONArray queryMapJsonBase = new JSONArray();
|
||||||
|
|
||||||
|
this.createQueryWhere(ShowPermissionsEnum.OPEN.getValue(),"show_permissions",queryMapJsonBase,SearchEnum.FULL_TEXT_SEARCH.getValue());
|
||||||
|
|
||||||
|
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonBase);
|
||||||
|
queryMapJsonAll.add(jsonObject);
|
||||||
|
}
|
||||||
|
|
||||||
Map<String,Object> mapHighlight = new HashMap<>();
|
Map<String,Object> mapHighlight = new HashMap<>();
|
||||||
Map<String,Object> mapHighlight1 = new HashMap<>();
|
Map<String,Object> mapHighlight1 = new HashMap<>();
|
||||||
//封装首次的条件
|
//封装首次的条件
|
||||||
@@ -1125,7 +1136,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
if("base".equals("base")){
|
if("base".equals("base")){
|
||||||
JSONArray queryMapJsonBase = new JSONArray();
|
JSONArray queryMapJsonBase = new JSONArray();
|
||||||
|
|
||||||
this.createQueryWhere(ShowPermissionsEnum.OPEN.getValue(),"show_permissions",queryMapJsonBase);
|
this.createQueryWhere(ShowPermissionsEnum.OPEN.getValue(),"show_permissions",queryMapJsonBase,SearchEnum.INDEX_PROBLEM_KNOWLEDGE_BASE.getValue());
|
||||||
|
|
||||||
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonBase);
|
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonBase);
|
||||||
queryMapJsonAll.add(jsonObject);
|
queryMapJsonAll.add(jsonObject);
|
||||||
@@ -1169,12 +1180,12 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
|
|
||||||
//封装问题类型选择框查询条件。
|
//封装问题类型选择框查询条件。
|
||||||
if (StringUtils.isNotBlank(problem_type)) {
|
if (StringUtils.isNotBlank(problem_type)) {
|
||||||
this.createQueryWhere(problem_type,"problem_type",queryMapJson);
|
this.createQueryWhere(problem_type,"problem_type",queryMapJson,SearchEnum.INDEX_PROBLEM_KNOWLEDGE_BASE.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
//封装市场选择框查询条件。
|
//封装市场选择框查询条件。
|
||||||
if (StringUtils.isNotBlank(target_market)) {
|
if (StringUtils.isNotBlank(target_market)) {
|
||||||
this.createQueryWhere(target_market,"target_market",queryMapJson);
|
this.createQueryWhere(target_market,"target_market",queryMapJson,SearchEnum.INDEX_PROBLEM_KNOWLEDGE_BASE.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CollectionUtils.isNotEmpty(queryMapJson)){
|
if(CollectionUtils.isNotEmpty(queryMapJson)){
|
||||||
@@ -1324,7 +1335,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
* @param fieldKey 查询的字段
|
* @param fieldKey 查询的字段
|
||||||
* @param jsonArray
|
* @param jsonArray
|
||||||
*/
|
*/
|
||||||
public void createQueryWhere (String queryValue,String fieldKey,JSONArray jsonArray){
|
public void createQueryWhere (String queryValue,String fieldKey,JSONArray jsonArray,String indexName){
|
||||||
/**
|
/**
|
||||||
* fieldKeyMap:字段keyMap,用于存 需要查询的字段 以及字段中的条件 "queryMap"
|
* fieldKeyMap:字段keyMap,用于存 需要查询的字段 以及字段中的条件 "queryMap"
|
||||||
* queryMap:存放查询条件map
|
* queryMap:存放查询条件map
|
||||||
@@ -1368,6 +1379,27 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsonArray.add(matchMap);
|
jsonArray.add(matchMap);
|
||||||
|
|
||||||
|
//筛选出 文档库、法规月报在搜索中心 全部索引的数据。
|
||||||
|
if(StringUtils.equals(indexName,SearchEnum.FULL_TEXT_SEARCH.getValue())){
|
||||||
|
Map<String, Object> fieldKeyMapWdk = new HashMap<>();
|
||||||
|
Map<String, Object> queryMapWdk = new HashMap<>();
|
||||||
|
Map<String, Object> matchMapWdk = new HashMap<>();
|
||||||
|
|
||||||
|
queryMapWdk.put("query", ModuleTypeFlagEnum.DOCUMENT_LIBRARY.getValue());
|
||||||
|
fieldKeyMapWdk.put("module_type_flag", queryMapWdk);
|
||||||
|
matchMapWdk.put("match",fieldKeyMapWdk);
|
||||||
|
jsonArray.add(matchMapWdk);
|
||||||
|
|
||||||
|
Map<String, Object> fieldKeyMapFgyb = new HashMap<>();
|
||||||
|
Map<String, Object> queryMapFgyb = new HashMap<>();
|
||||||
|
Map<String, Object> matchMapFgyb = new HashMap<>();
|
||||||
|
|
||||||
|
queryMapFgyb.put("query", ModuleTypeFlagEnum.LAWS_MONTHLY_REPORT.getValue());
|
||||||
|
fieldKeyMapFgyb.put("module_type_flag", queryMapFgyb);
|
||||||
|
matchMapFgyb.put("match",fieldKeyMapFgyb);
|
||||||
|
jsonArray.add(matchMapFgyb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user