Commit 41c52dad by 陈健智

舆情列表新增关联标注标签展示调整

parent 30b37f4f
...@@ -3,6 +3,7 @@ package com.zhiwei.brandkbs2.service; ...@@ -3,6 +3,7 @@ package com.zhiwei.brandkbs2.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zhiwei.base.entity.subclass.mark.MarkInfo; import com.zhiwei.base.entity.subclass.mark.MarkInfo;
import com.zhiwei.brandkbs2.pojo.MarkFlowEntity; import com.zhiwei.brandkbs2.pojo.MarkFlowEntity;
import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -83,10 +84,13 @@ public interface MarkFlowService { ...@@ -83,10 +84,13 @@ public interface MarkFlowService {
private String planId; private String planId;
private Long gid; private Long gid;
public MarkInfoSource(JSONObject json, String projectId, String contendId) { private List<TagFilterDTO> tagFilters;
public MarkInfoSource(JSONObject json, String projectId, String contendId, List<TagFilterDTO> tagFilters) {
this.json = json; this.json = json;
this.projectId = projectId; this.projectId = projectId;
this.contendId = contendId; this.contendId = contendId;
this.tagFilters = tagFilters;
} }
public MarkInfoSource(JSONObject json, String linkedGroupId) { public MarkInfoSource(JSONObject json, String linkedGroupId) {
......
...@@ -3293,6 +3293,7 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -3293,6 +3293,7 @@ public class MarkDataServiceImpl implements MarkDataService {
private List<MarkFlowEntity> getMarkFlowEntity(MarkSearchDTO markSearchDTO, SearchHits searchHits) { private List<MarkFlowEntity> getMarkFlowEntity(MarkSearchDTO markSearchDTO, SearchHits searchHits) {
String projectId = markSearchDTO.getProjectId(); String projectId = markSearchDTO.getProjectId();
String contendId = markSearchDTO.getContendId(); String contendId = markSearchDTO.getContendId();
List<TagFilterDTO> tagFilters = tagFilterService.getTagFilter();
// 重复消息折叠 // 重复消息折叠
if (markSearchDTO.isFold()) { if (markSearchDTO.isFold()) {
// 根据旧顺序排序 // 根据旧顺序排序
...@@ -3306,17 +3307,17 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -3306,17 +3307,17 @@ public class MarkDataServiceImpl implements MarkDataService {
return sortList.stream().map(id -> { return sortList.stream().map(id -> {
List<Map<String, Object>> maps = collect.get(id); List<Map<String, Object>> maps = collect.get(id);
if (null != maps) { if (null != maps) {
return MarkFlowEntity.getFoldInstance(maps.stream().map(map -> getMarkFlowEntity(map, projectId, contendId)).collect(Collectors.toList())); return MarkFlowEntity.getFoldInstance(maps.stream().map(map -> getMarkFlowEntity(map, projectId, contendId, tagFilters)).collect(Collectors.toList()));
} }
return null; return null;
}).filter(Objects::nonNull).collect(Collectors.toList()); }).filter(Objects::nonNull).collect(Collectors.toList());
} }
return Arrays.stream(searchHits.getHits()).map(hit -> getMarkFlowEntity(hit.getSourceAsMap(), projectId, contendId)).collect(Collectors.toList()); return Arrays.stream(searchHits.getHits()).map(hit -> getMarkFlowEntity(hit.getSourceAsMap(), projectId, contendId, tagFilters)).collect(Collectors.toList());
} }
private MarkFlowEntity getMarkFlowEntity(Map<String, Object> map, String projectId, String contendId) { private MarkFlowEntity getMarkFlowEntity(Map<String, Object> map, String projectId, String contendId, List<TagFilterDTO> tagFilters) {
MarkFlowEntity instance = new MarkFlowEntity(new JSONObject(map)); MarkFlowEntity instance = new MarkFlowEntity(new JSONObject(map));
instance.setInfo(markFlowService.createMarkFlowInfo(new MarkFlowService.MarkInfoSource(new JSONObject(map), projectId, contendId))); instance.setInfo(markFlowService.createMarkFlowInfo(new MarkFlowService.MarkInfoSource(new JSONObject(map), projectId, contendId, tagFilters)));
return instance; return instance;
} }
...@@ -3386,6 +3387,7 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -3386,6 +3387,7 @@ public class MarkDataServiceImpl implements MarkDataService {
if (null == dto.getAggreeId()) { if (null == dto.getAggreeId()) {
ExceptionCast.cast(CommonCodeEnum.INVALID_PARAM); ExceptionCast.cast(CommonCodeEnum.INVALID_PARAM);
} }
List<TagFilterDTO> tagFilter = tagFilterService.getTagFilter();
dto.setProjectId(UserThreadLocal.getProjectId()); dto.setProjectId(UserThreadLocal.getProjectId());
Query query = assembleAggreeQuery(dto); Query query = assembleAggreeQuery(dto);
// 量查询 // 量查询
...@@ -3401,7 +3403,7 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -3401,7 +3403,7 @@ public class MarkDataServiceImpl implements MarkDataService {
List<MarkFlowEntity> markFlowEntities = new ArrayList<>(); List<MarkFlowEntity> markFlowEntities = new ArrayList<>();
MarkFlowEntity instance = new MarkFlowEntity(aggreeResult.getData(), dto.getLinkedGroupId()); MarkFlowEntity instance = new MarkFlowEntity(aggreeResult.getData(), dto.getLinkedGroupId());
instance.setInfo(createMarkFlowInfo.create(new MarkFlowService.MarkInfoSource(aggreeResult.getData(), dto.getProjectId(), dto.getContendId(), instance.setInfo(createMarkFlowInfo.create(new MarkFlowService.MarkInfoSource(aggreeResult.getData(), dto.getProjectId(), dto.getContendId(),
dto.getLinkedGroupId(), dto.getPlanId(), dto.getGid()))); dto.getLinkedGroupId(), dto.getPlanId(), dto.getGid(), tagFilter)));
markFlowEntities.add(instance); markFlowEntities.add(instance);
// 添加父标题集下的子标题集 // 添加父标题集下的子标题集
resList.add(MarkFlowEntity.getAggreeInstance(markFlowEntities, aggreeResult, sonDetails)); resList.add(MarkFlowEntity.getAggreeInstance(markFlowEntities, aggreeResult, sonDetails));
......
...@@ -62,12 +62,6 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -62,12 +62,6 @@ public class MarkFlowServiceImpl implements MarkFlowService {
@Resource(name = "filterClient") @Resource(name = "filterClient")
UnifiedFilterClient filterClient; UnifiedFilterClient filterClient;
@Resource(name = "highlightWordDao")
HighlightWordDao highlightWordDao;
@Resource(name = "tagFilterServiceImpl")
TagFilterService tagFilterService;
@Override @Override
public JSONObject createMarkFlowInfo(MarkInfoSource markInfoSource) { public JSONObject createMarkFlowInfo(MarkInfoSource markInfoSource) {
JSONObject resultInfo = createInfoWithEmotion(markInfoSource.getJson()); JSONObject resultInfo = createInfoWithEmotion(markInfoSource.getJson());
...@@ -92,7 +86,6 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -92,7 +86,6 @@ public class MarkFlowServiceImpl implements MarkFlowService {
JSONObject json = markInfoSource.getJson(); JSONObject json = markInfoSource.getJson();
JSONObject resultInfo = createInfoWithEmotion(json); JSONObject resultInfo = createInfoWithEmotion(json);
resultInfo.put("sourceDetails", getSourceDetails(markInfoSource)); resultInfo.put("sourceDetails", getSourceDetails(markInfoSource));
resultInfo.put("customTags", getCustomTagsInfo(markInfoSource));
String zip = Tools.gzip(JSON.toJSONString(json)); String zip = Tools.gzip(JSON.toJSONString(json));
resultInfo.put("zip", zip); resultInfo.put("zip", zip);
// 每条数据高亮词 // 每条数据高亮词
...@@ -217,8 +210,8 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -217,8 +210,8 @@ public class MarkFlowServiceImpl implements MarkFlowService {
return null; return null;
} }
// 已配置的标签筛选 // 已配置的标签筛选
List<TagFilterDTO> tagFilter = tagFilterService.getTagFilter(); List<TagFilterDTO> tagFilters = markInfoSource.getTagFilters();
List<String> groupNames = tagFilter.stream().map(TagFilterDTO::getGroupName).collect(Collectors.toList()); List<String> groupNames = tagFilters.stream().map(TagFilterDTO::getGroupName).collect(Collectors.toList());
for (JSONObject markCacheMap : markCacheMaps) { for (JSONObject markCacheMap : markCacheMaps) {
String groupName = markCacheMap.getString("group_name"); String groupName = markCacheMap.getString("group_name");
if (!groupNames.contains(groupName) || Objects.equals(Constant.EMOTION_LABEL_KEY, groupName)){ if (!groupNames.contains(groupName) || Objects.equals(Constant.EMOTION_LABEL_KEY, groupName)){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment