Commit bae1b43a by shenjunjie

Merge branch 'feature' into 'release'

Feature

See merge request !136
parents 5aaf4b71 ca7f7752
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<dubbo.version>2.7.4.1</dubbo.version> <dubbo.version>2.7.4.1</dubbo.version>
<curator.version>2.12.0</curator.version> <curator.version>2.12.0</curator.version>
<push.log.version>2.17.0-SNAPSHOT</push.log.version> <push.log.version>2.17.0-SNAPSHOT</push.log.version>
<event-client.version>1.0.1-SNAPSHOT</event-client.version> <event-client.version>1.0.2-SNAPSHOT</event-client.version>
</properties> </properties>
<dependencies> <dependencies>
......
...@@ -14,7 +14,7 @@ public class GenericAttribute { ...@@ -14,7 +14,7 @@ public class GenericAttribute {
/** /**
* es index * es index
*/ */
public static final String ES_INDEX_PRE = "brandkbs2"; public static final String ES_INDEX_PRE = "brandkbs2_";
// public static final String ES_INDEX_TEST = "brandkbs2_test"; // public static final String ES_INDEX_TEST = "brandkbs2_test";
public static final String ES_INDEX_TEST = "brandkbs2_2022"; public static final String ES_INDEX_TEST = "brandkbs2_2022";
public static final String ES_CHANNEL_INDEX_TEST = "brandkbs2_channel_record_test"; public static final String ES_CHANNEL_INDEX_TEST = "brandkbs2_channel_record_test";
......
...@@ -44,11 +44,6 @@ public class ChannelDaoImpl extends BaseMongoDaoImpl<Channel> implements Channel ...@@ -44,11 +44,6 @@ public class ChannelDaoImpl extends BaseMongoDaoImpl<Channel> implements Channel
if (null == channelIndex) { if (null == channelIndex) {
return null; return null;
} }
// Query query = Query.query(Criteria.where("linkedGroupId").is(channelIndex.getLinkedGroupId()).
// and("projectId").is(channelIndex.getProjectId()).
// and("platform").is(channelIndex.getPlatform()).
// and("realSource").is(channelIndex.getRealSource()).
// and("source").is(channelIndex.getSource()));
return queryUnique(channelIndex.getFid()); return queryUnique(channelIndex.getFid());
} }
......
...@@ -116,7 +116,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -116,7 +116,8 @@ public class ChannelServiceImpl implements ChannelService {
ThreadPoolTaskExecutor esSearchExecutor; ThreadPoolTaskExecutor esSearchExecutor;
@Override @Override
public PageVO<JSONObject> findChannelList(int page, int size, String contendId, String emotion, String platform, Boolean show, String keyword, String sorter) { public PageVO<JSONObject> findChannelList(int page, int size, String contendId, String emotion, String platform,
Boolean show, String keyword, String sorter) {
Query query = channelListQuery(contendId, show, emotion, platform, keyword, sorter); Query query = channelListQuery(contendId, show, emotion, platform, keyword, sorter);
long total = channelDao.count(query); long total = channelDao.count(query);
// 开启分页 // 开启分页
...@@ -144,13 +145,15 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -144,13 +145,15 @@ public class ChannelServiceImpl implements ChannelService {
} }
@Override @Override
public PageVO<JSONObject> findChannelListNew(int page, int size, String contendId, String emotion, String platform, Boolean show, String keyword, public PageVO<JSONObject> findChannelListNew(int page, int size, String contendId, String emotion, String platform,
String sorter) { Boolean show, String keyword, String sorter) {
try { try {
EsClientDao.SearchHelper searchHelper = EsClientDao.createSearchHelper(); EsClientDao.SearchHelper searchHelper = EsClientDao.createSearchHelper();
List<Integer> emotions = null == emotion ? null : Collections.singletonList(EmotionEnum.parseFromName(emotion).getState()); List<Integer> emotions = null == emotion ? null
: Collections.singletonList(EmotionEnum.parseFromName(emotion).getState());
List<String> platforms = null == platform ? null : Collections.singletonList(platform); List<String> platforms = null == platform ? null : Collections.singletonList(platform);
BoolQueryBuilder postFilter = getChannelListQuery(UserThreadLocal.getProjectId(), contendId, keyword, platforms, emotions, null, null); BoolQueryBuilder postFilter = getChannelListQuery(UserThreadLocal.getProjectId(), contendId, keyword,
platforms, emotions, null, null);
// show // show
if (null != show) { if (null != show) {
postFilter.must(QueryBuilders.termQuery("show", show)); postFilter.must(QueryBuilders.termQuery("show", show));
...@@ -167,7 +170,7 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -167,7 +170,7 @@ public class ChannelServiceImpl implements ChannelService {
} }
searchHelper.setFrom((page - 1) * size); searchHelper.setFrom((page - 1) * size);
searchHelper.setSize(size); searchHelper.setSize(size);
searchHelper.setIndexes(new String[]{ChannelEsDao.CHANNEL_COPY_ES_INDEX_NAME}); searchHelper.setIndexes(new String[] { ChannelEsDao.CHANNEL_COPY_ES_INDEX_NAME });
SearchHits searchHits = channelEsDao.searchHits(searchHelper); SearchHits searchHits = channelEsDao.searchHits(searchHelper);
long value = searchHits.getTotalHits().value; long value = searchHits.getTotalHits().value;
List<JSONObject> resList = Arrays.stream(searchHits.getHits()).map(hit -> { List<JSONObject> resList = Arrays.stream(searchHits.getHits()).map(hit -> {
...@@ -181,7 +184,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -181,7 +184,8 @@ public class ChannelServiceImpl implements ChannelService {
result.put("eventCount", json.getLong("event_count")); result.put("eventCount", json.getLong("event_count"));
result.put("emotion", EmotionEnum.state2Name(json.getInteger("emotion"))); result.put("emotion", EmotionEnum.state2Name(json.getInteger("emotion")));
result.put("emotionIndex", json.getDouble("emotion_index")); result.put("emotionIndex", json.getDouble("emotion_index"));
result.put("experienceLevel", ExperienceEnum.getValueFromDataBaseName(json.getString("experience_level"))); result.put("experienceLevel",
ExperienceEnum.getValueFromDataBaseName(json.getString("experience_level")));
result.put("lastTime", json.getLong("last_time")); result.put("lastTime", json.getLong("last_time"));
result.put("show", json.getBoolean("show")); result.put("show", json.getBoolean("show"));
result.put("imgUrl", json.getString("avatar_url")); result.put("imgUrl", json.getString("avatar_url"));
...@@ -269,7 +273,7 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -269,7 +273,7 @@ public class ChannelServiceImpl implements ChannelService {
public JSONObject getChannel(String channelId) { public JSONObject getChannel(String channelId) {
Channel channel = channelDao.findOneById(channelId); Channel channel = channelDao.findOneById(channelId);
if (Objects.isNull(channel)) { if (Objects.isNull(channel)) {
//抛出未查询到相关ID的渠道信息异常 // 抛出未查询到相关ID的渠道信息异常
ExceptionCast.cast(CommonCodeEnum.FAIL, "渠道不存在"); ExceptionCast.cast(CommonCodeEnum.FAIL, "渠道不存在");
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
...@@ -292,7 +296,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -292,7 +296,8 @@ public class ChannelServiceImpl implements ChannelService {
} }
@Override @Override
public List<ExportChannelDTO> findDownloadChannelList(String contendId, String emotion, String platform, Boolean show, String keyword) { public List<ExportChannelDTO> findDownloadChannelList(String contendId, String emotion, String platform,
Boolean show, String keyword) {
Query query = channelListQuery(contendId, show, emotion, platform, keyword, null); Query query = channelListQuery(contendId, show, emotion, platform, keyword, null);
List<Channel> list = channelDao.findList(query); List<Channel> list = channelDao.findList(query);
return list.stream().map(ExportChannelDTO::createFromChannel).collect(Collectors.toList()); return list.stream().map(ExportChannelDTO::createFromChannel).collect(Collectors.toList());
...@@ -337,7 +342,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -337,7 +342,8 @@ public class ChannelServiceImpl implements ChannelService {
dto.setFirstSource(firstData.getSource()); dto.setFirstSource(firstData.getSource());
} }
dto.setEventArticleCount(eventDataDao.getEventArticleCount(event)); dto.setEventArticleCount(eventDataDao.getEventArticleCount(event));
dto.setChannelArticleCount(eventDataDao.getEventArticleWithChannelCount(event, Tools.convertMap(channel, ChannelIndex.class))); dto.setChannelArticleCount(
eventDataDao.getEventArticleWithChannelCount(event, Tools.convertMap(channel, ChannelIndex.class)));
dto.setEventType(event.getEventTag().getString(EventTagEnum.EVENT_TYPE.getName())); dto.setEventType(event.getEventTag().getString(EventTagEnum.EVENT_TYPE.getName()));
return dto; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -350,20 +356,25 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -350,20 +356,25 @@ public class ChannelServiceImpl implements ChannelService {
@Override @Override
public List<String> getChannelLabels(String type) { public List<String> getChannelLabels(String type) {
return channelLabelDao.findList(Query.query(Criteria.where("type").is(type))).stream().map(ChannelLabel::getLabel).collect(Collectors.toList()); return channelLabelDao.findList(Query.query(Criteria.where("type").is(type))).stream()
.map(ChannelLabel::getLabel).collect(Collectors.toList());
} }
@Override @Override
public List<ChannelListVO> getActiveChannelList(String contendId, String platform, String keyword, Long startTime, Long endTime, int size, boolean cache) { public List<ChannelListVO> getActiveChannelList(String contendId, String platform, String keyword, Long startTime,
return getEmotionList(contendId, platform, keyword, null, startTime, endTime, size, EmotionEnum.ALL.getState(), cache); Long endTime, int size, boolean cache) {
return getEmotionList(contendId, platform, keyword, null, startTime, endTime, size, EmotionEnum.ALL.getState(),
cache);
} }
@Deprecated @Deprecated
public List<ChannelListVO> getActiveChannelList2(String contendId, String platform, String keyword, Long startTime, Long endTime, int size) { public List<ChannelListVO> getActiveChannelList2(String contendId, String platform, String keyword, Long startTime,
Long endTime, int size) {
List<ChannelListVO> resList = new ArrayList<>(); List<ChannelListVO> resList = new ArrayList<>();
try { try {
String projectId = UserThreadLocal.getProjectId(); String projectId = UserThreadLocal.getProjectId();
EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(projectId, null, Collections.singleton(contendId), platform, keyword, startTime, endTime); EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(projectId, null,
Collections.singleton(contendId), platform, keyword, startTime, endTime);
// 只需要聚合结果,不需返回hit // 只需要聚合结果,不需返回hit
searchHelper.setSize(0); searchHelper.setSize(0);
// aggregation // aggregation
...@@ -405,18 +416,21 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -405,18 +416,21 @@ public class ChannelServiceImpl implements ChannelService {
} }
@Override @Override
public List<ChannelListVO> getPositiveList(String contendId, String platform, String keyword, String sorter, Long startTime, Long endTime, int size, boolean cache) { public List<ChannelListVO> getPositiveList(String contendId, String platform, String keyword, String sorter,
return getEmotionList(contendId, platform, keyword, sorter, startTime, endTime, size, EmotionEnum.POSITIVE.getState(), cache); Long startTime, Long endTime, int size, boolean cache) {
return getEmotionList(contendId, platform, keyword, sorter, startTime, endTime, size,
EmotionEnum.POSITIVE.getState(), cache);
} }
@Override @Override
public List<ChannelListVO> getNegativeList(String contendId, String platform, String keyword, String sorter, Long startTime, Long endTime, int size, public List<ChannelListVO> getNegativeList(String contendId, String platform, String keyword, String sorter,
boolean cache) { Long startTime, Long endTime, int size, boolean cache) {
return getEmotionList(contendId, platform, keyword, sorter, startTime, endTime, size, EmotionEnum.NEGATIVE.getState(), cache); return getEmotionList(contendId, platform, keyword, sorter, startTime, endTime, size,
EmotionEnum.NEGATIVE.getState(), cache);
} }
private List<ChannelListVO> getEmotionList(String contendId, String platform, String keyword, String sorter, Long startTime, Long endTime, int size, private List<ChannelListVO> getEmotionList(String contendId, String platform, String keyword, String sorter,
int emotion, boolean cache) { Long startTime, Long endTime, int size, int emotion, boolean cache) {
List<ChannelListVO> resList = new ArrayList<>(); List<ChannelListVO> resList = new ArrayList<>();
try { try {
String projectId = UserThreadLocal.getProjectId(); String projectId = UserThreadLocal.getProjectId();
...@@ -427,7 +441,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -427,7 +441,8 @@ public class ChannelServiceImpl implements ChannelService {
return JSON.parseArray(resultStr, ChannelListVO.class); return JSON.parseArray(resultStr, ChannelListVO.class);
} }
Map<String, Pair<Long, ChannelRecord>> keyMap = new HashMap<>(); Map<String, Pair<Long, ChannelRecord>> keyMap = new HashMap<>();
EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(projectId, null, Collections.singleton(contendId), platform, keyword, startTime, endTime); EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(projectId, null,
Collections.singleton(contendId), platform, keyword, startTime, endTime);
// 分页查询所有结果 // 分页查询所有结果
List<SearchResponse> searchResponses = channelEsDao.searchScrollResponse(searchHelper); List<SearchResponse> searchResponses = channelEsDao.searchScrollResponse(searchHelper);
for (SearchResponse searchResponse : searchResponses) { for (SearchResponse searchResponse : searchResponses) {
...@@ -453,7 +468,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -453,7 +468,8 @@ public class ChannelServiceImpl implements ChannelService {
ChannelRecord channelRecord = pair.getRight(); ChannelRecord channelRecord = pair.getRight();
// 情感过滤 // 情感过滤
if (emotion == EmotionEnum.ALL.getState() || emotion == channelRecord.getEmotion()) { if (emotion == EmotionEnum.ALL.getState() || emotion == channelRecord.getEmotion()) {
List<ChannelIndex.Article> articles = ChannelIndex.Record.filterArticles(startTime, endTime, channelRecord.getRecord().getArticles()); List<ChannelIndex.Article> articles = ChannelIndex.Record.filterArticles(startTime, endTime,
channelRecord.getRecord().getArticles());
articles.sort(Comparator.comparingLong(ChannelIndex.Article::getTime).reversed()); articles.sort(Comparator.comparingLong(ChannelIndex.Article::getTime).reversed());
channelRecord.getRecord().setArticles(articles); channelRecord.getRecord().setArticles(articles);
return channelRecord; return channelRecord;
...@@ -531,7 +547,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -531,7 +547,8 @@ public class ChannelServiceImpl implements ChannelService {
public List<JSONObject> getCollectList(String contendId) { public List<JSONObject> getCollectList(String contendId) {
String projectId = UserThreadLocal.getProjectId(); String projectId = UserThreadLocal.getProjectId();
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("projectId").is(projectId).and("contendId").is(contendId).and("isCollect").is(true)); query.addCriteria(
Criteria.where("projectId").is(projectId).and("contendId").is(contendId).and("isCollect").is(true));
channelDao.addSort(query, "{\"collectTime\":\"descend\"}"); channelDao.addSort(query, "{\"collectTime\":\"descend\"}");
return channelDao.findList(query).stream().map(channel -> { return channelDao.findList(query).stream().map(channel -> {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
...@@ -600,7 +617,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -600,7 +617,8 @@ public class ChannelServiceImpl implements ChannelService {
spreadDatas.add(json); spreadDatas.add(json);
} }
} else { } else {
for (Map.Entry<String, List<ChannelIndex.Article>> entry : getSourceContendMap(channelId, contendSet, startTime, endTime).entrySet()) { for (Map.Entry<String, List<ChannelIndex.Article>> entry : getSourceContendMap(channelId, contendSet,
startTime, endTime).entrySet()) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
String timePattern = Constant.DAY_PATTERN; String timePattern = Constant.DAY_PATTERN;
json.put("spreadType", "day"); json.put("spreadType", "day");
...@@ -632,7 +650,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -632,7 +650,8 @@ public class ChannelServiceImpl implements ChannelService {
} }
// 根据品牌分类 // 根据品牌分类
List<String> contendList = Arrays.asList(contends.split(",")); List<String> contendList = Arrays.asList(contends.split(","));
Map<String, List<ChannelIndex.Article>> contendMap = getSourceContendMap(channelId, contendList, startTime, endTime); Map<String, List<ChannelIndex.Article>> contendMap = getSourceContendMap(channelId, contendList, startTime,
endTime);
Channel channel = channelDao.findOneById(channelId); Channel channel = channelDao.findOneById(channelId);
long articleTotal = 0; long articleTotal = 0;
long eventTotal = 0; long eventTotal = 0;
...@@ -661,7 +680,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -661,7 +680,8 @@ public class ChannelServiceImpl implements ChannelService {
} }
@Override @Override
public JSONObject getArticlesByTime(Long startTime, Long endTime, Integer dayLimit, int page, int pageSize, String channelId, String contendId) { public JSONObject getArticlesByTime(Long startTime, Long endTime, Integer dayLimit, int page, int pageSize,
String channelId, String contendId) {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
List<JSONObject> dayList = new ArrayList<>(); List<JSONObject> dayList = new ArrayList<>();
if (0 == startTime) { if (0 == startTime) {
...@@ -669,7 +689,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -669,7 +689,8 @@ public class ChannelServiceImpl implements ChannelService {
// 限制起始时间并单天查询 // 限制起始时间并单天查询
List<Long> cutTimes = Tools.parseToDayList(startTime, endTime); List<Long> cutTimes = Tools.parseToDayList(startTime, endTime);
for (Long cutTime : cutTimes) { for (Long cutTime : cutTimes) {
List<ChannelIndex.Article> articles = getSourceContendMap(channelId, Collections.singleton(contendId), cutTime, cutTime + Constant.ONE_DAY).get(contendId); List<ChannelIndex.Article> articles = getSourceContendMap(channelId, Collections.singleton(contendId),
cutTime, cutTime + Constant.ONE_DAY).get(contendId);
if (!articles.isEmpty()) { if (!articles.isEmpty()) {
dayList.add(getDayResult(articles, page, pageSize, cutTime)); dayList.add(getDayResult(articles, page, pageSize, cutTime));
} }
...@@ -678,8 +699,10 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -678,8 +699,10 @@ public class ChannelServiceImpl implements ChannelService {
} }
} }
} else { } else {
Map<String, List<ChannelIndex.Article>> sourceContendMap = getSourceContendMap(channelId, Collections.singleton(contendId), startTime, endTime); Map<String, List<ChannelIndex.Article>> sourceContendMap = getSourceContendMap(channelId,
Map<Long, List<ChannelIndex.Article>> timeRangeList = partition(startTime, endTime, Constant.DAY_PATTERN, sourceContendMap.get(contendId)); Collections.singleton(contendId), startTime, endTime);
Map<Long, List<ChannelIndex.Article>> timeRangeList = partition(startTime, endTime, Constant.DAY_PATTERN,
sourceContendMap.get(contendId));
for (Map.Entry<Long, List<ChannelIndex.Article>> longListEntry : timeRangeList.entrySet()) { for (Map.Entry<Long, List<ChannelIndex.Article>> longListEntry : timeRangeList.entrySet()) {
Long time = longListEntry.getKey(); Long time = longListEntry.getKey();
List<ChannelIndex.Article> list = longListEntry.getValue(); List<ChannelIndex.Article> list = longListEntry.getValue();
...@@ -698,13 +721,16 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -698,13 +721,16 @@ public class ChannelServiceImpl implements ChannelService {
@Deprecated @Deprecated
private Long getStartTime(String contendId, String channelId, Long endTime) { private Long getStartTime(String contendId, String channelId, Long endTime) {
try { try {
EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(UserThreadLocal.getProjectId(), channelId, Collections.singleton(contendId), null, null, null, endTime, false); EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(UserThreadLocal.getProjectId(),
channelId, Collections.singleton(contendId), null, null, null, endTime, false);
searchHelper.setSort(SortBuilders.fieldSort("record.articles.time").order(SortOrder.ASC)); searchHelper.setSort(SortBuilders.fieldSort("record.articles.time").order(SortOrder.ASC));
searchHelper.setSize(1); searchHelper.setSize(1);
SearchResponse searchResponse = esClientDao.searchResponse(searchHelper); SearchResponse searchResponse = esClientDao.searchResponse(searchHelper);
if (0 != searchResponse.getHits().getTotalHits().value) { if (0 != searchResponse.getHits().getTotalHits().value) {
ChannelRecord channelRecord = new ChannelRecord(searchResponse.getHits().getAt(0).getSourceAsMap()); ChannelRecord channelRecord = new ChannelRecord(searchResponse.getHits().getAt(0).getSourceAsMap());
return channelRecord.getRecord().getArticles().stream().sorted(Comparator.comparingLong(ChannelIndex.Article::getTime)).limit(1).collect(Collectors.toList()).get(0).getTime(); return channelRecord.getRecord().getArticles().stream()
.sorted(Comparator.comparingLong(ChannelIndex.Article::getTime)).limit(1)
.collect(Collectors.toList()).get(0).getTime();
} }
} catch (IOException e) { } catch (IOException e) {
ExceptionCast.cast(CommonCodeEnum.FAIL, "es查询异常"); ExceptionCast.cast(CommonCodeEnum.FAIL, "es查询异常");
...@@ -714,7 +740,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -714,7 +740,8 @@ public class ChannelServiceImpl implements ChannelService {
private JSONObject getDayResult(List<ChannelIndex.Article> list, int page, int pageSize, Long time) { private JSONObject getDayResult(List<ChannelIndex.Article> list, int page, int pageSize, Long time) {
JSONObject dayResult = new JSONObject(); JSONObject dayResult = new JSONObject();
List<CompletableFuture<JSONObject>> futureList = list.stream().skip((long) (page - 1) * pageSize).limit(pageSize).map(article -> CompletableFuture.supplyAsync(() -> { List<CompletableFuture<JSONObject>> futureList = list.stream().skip((long) (page - 1) * pageSize)
.limit(pageSize).map(article -> CompletableFuture.supplyAsync(() -> {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("emotion", EmotionEnum.state2Name(article.getEmotion())); json.put("emotion", EmotionEnum.state2Name(article.getEmotion()));
json.put("time", article.getTime()); json.put("time", article.getTime());
...@@ -747,22 +774,28 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -747,22 +774,28 @@ public class ChannelServiceImpl implements ChannelService {
} }
@Override @Override
public List<ExportAppChannelArticleDTO> downloadArticlesByTime(Long startTime, Long endTime, String channelId, String contendId) { public List<ExportAppChannelArticleDTO> downloadArticlesByTime(Long startTime, Long endTime, String channelId,
Map<String, List<ChannelIndex.Article>> sourceContendMap = getSourceContendMap(channelId, Collections.singleton(contendId), startTime, endTime); String contendId) {
List<CompletableFuture<ExportAppChannelArticleDTO>> futureList = sourceContendMap.get(contendId).stream().map(article -> CompletableFuture.supplyAsync(() -> { Map<String, List<ChannelIndex.Article>> sourceContendMap = getSourceContendMap(channelId,
Collections.singleton(contendId), startTime, endTime);
List<CompletableFuture<ExportAppChannelArticleDTO>> futureList = sourceContendMap.get(contendId).stream()
.map(article -> CompletableFuture.supplyAsync(() -> {
String[] titleContentUrl = getTitleContentUrlById(article.getId()); String[] titleContentUrl = getTitleContentUrlById(article.getId());
return ExportAppChannelArticleDTO.createFromArticle(article, titleContentUrl[0], titleContentUrl[1], titleContentUrl[2]); return ExportAppChannelArticleDTO.createFromArticle(article, titleContentUrl[0], titleContentUrl[1],
titleContentUrl[2]);
}, esSearchExecutor)).collect(Collectors.toList()); }, esSearchExecutor)).collect(Collectors.toList());
CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])).join(); CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])).join();
return futureList.stream().map(CompletableFuture::join).collect(Collectors.toList()); return futureList.stream().map(CompletableFuture::join).collect(Collectors.toList());
} }
@Override @Override
public JSONObject getEventsByTime(Long startTime, Long endTime, int page, int pageSize, String channelId, String contendId) { public JSONObject getEventsByTime(Long startTime, Long endTime, int page, int pageSize, String channelId,
String contendId) {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
List<JSONObject> dayList = new ArrayList<>(); List<JSONObject> dayList = new ArrayList<>();
Channel channel = channelDao.findOneById(channelId); Channel channel = channelDao.findOneById(channelId);
Map<Long, List<Event>> eventDay = eventDao.getEventDay(new ChannelIndex(channel, contendId), startTime, endTime); Map<Long, List<Event>> eventDay = eventDao.getEventDay(new ChannelIndex(channel, contendId), startTime,
endTime);
eventDay = Tools.sortTimeKeyMap(eventDay, true); eventDay = Tools.sortTimeKeyMap(eventDay, true);
eventDay.forEach((time, list) -> dayList.add(getDayResultWithEvent(list, page, pageSize, time))); eventDay.forEach((time, list) -> dayList.add(getDayResultWithEvent(list, page, pageSize, time)));
res.put("list", dayList); res.put("list", dayList);
...@@ -770,10 +803,12 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -770,10 +803,12 @@ public class ChannelServiceImpl implements ChannelService {
} }
@Override @Override
public List<ExportAppChannelEventDTO> downloadEventsByTime(Long startTime, Long endTime, String channelId, String contendId) { public List<ExportAppChannelEventDTO> downloadEventsByTime(Long startTime, Long endTime, String channelId,
String contendId) {
List<ExportAppChannelEventDTO> res = new ArrayList<>(); List<ExportAppChannelEventDTO> res = new ArrayList<>();
Channel channel = channelDao.findOneById(channelId); Channel channel = channelDao.findOneById(channelId);
Map<Long, List<Event>> eventDay = eventDao.getEventDay(new ChannelIndex(channel, contendId), startTime, endTime); Map<Long, List<Event>> eventDay = eventDao.getEventDay(new ChannelIndex(channel, contendId), startTime,
endTime);
Tools.sortTimeKeyMap(eventDay, true).values().forEach(events -> { Tools.sortTimeKeyMap(eventDay, true).values().forEach(events -> {
events.forEach(event -> { events.forEach(event -> {
res.add(ExportAppChannelEventDTO.createFromEvent(event)); res.add(ExportAppChannelEventDTO.createFromEvent(event));
...@@ -794,23 +829,26 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -794,23 +829,26 @@ public class ChannelServiceImpl implements ChannelService {
if (!hasEmotion(channel)) { if (!hasEmotion(channel)) {
return channel; return channel;
} }
//该渠道发布正面稿件 // 该渠道发布正面稿件
Long positiveCount = markCountByEmotion(channel, EmotionEnum.POSITIVE.getName()); Long positiveCount = markCountByEmotion(channel, EmotionEnum.POSITIVE.getName());
//该渠道发布中性稿件 // 该渠道发布中性稿件
Long neutralCount = markCountByEmotion(channel, EmotionEnum.NEUTRAL.getName()); Long neutralCount = markCountByEmotion(channel, EmotionEnum.NEUTRAL.getName());
//该渠道发布负面稿件 // 该渠道发布负面稿件
Long negativeCount = markCountByEmotion(channel, EmotionEnum.NEGATIVE.getName()); Long negativeCount = markCountByEmotion(channel, EmotionEnum.NEGATIVE.getName());
//是否友好渠道 // 是否友好渠道
boolean isPositive = false; boolean isPositive = false;
boolean isNegative = false; boolean isNegative = false;
long specNegativeCount = eventDao.getEventCount(new ChannelIndex(channel), Arrays.asList(EmotionEnum.POSITIVE.getName(), EmotionEnum.NEUTRAL.getName()), EmotionEnum.NEGATIVE.getName()); long specNegativeCount = eventDao.getEventCount(new ChannelIndex(channel),
long specPositiveCount = eventDao.getEventCount(new ChannelIndex(channel), Collections.singletonList(EmotionEnum.NEGATIVE.getName()), EmotionEnum.POSITIVE.getName()); Arrays.asList(EmotionEnum.POSITIVE.getName(), EmotionEnum.NEUTRAL.getName()),
EmotionEnum.NEGATIVE.getName());
long specPositiveCount = eventDao.getEventCount(new ChannelIndex(channel),
Collections.singletonList(EmotionEnum.NEGATIVE.getName()), EmotionEnum.POSITIVE.getName());
// 特殊情况:若皆有发布过反常稿件 // 特殊情况:若皆有发布过反常稿件
if (specNegativeCount > 0 && specPositiveCount > 0) { if (specNegativeCount > 0 && specPositiveCount > 0) {
//正面稿件数>负面稿件数,为正面 // 正面稿件数>负面稿件数,为正面
if (positiveCount > negativeCount) { if (positiveCount > negativeCount) {
isPositive = true; isPositive = true;
//正面稿件数<负面稿件数,为负面 // 正面稿件数<负面稿件数,为负面
} else if (positiveCount < negativeCount) { } else if (positiveCount < negativeCount) {
isNegative = true; isNegative = true;
} }
...@@ -818,10 +856,11 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -818,10 +856,11 @@ public class ChannelServiceImpl implements ChannelService {
// 在正/中性事件中发布负面稿件||负面报道数>正面报道数(满足任一条件) // 在正/中性事件中发布负面稿件||负面报道数>正面报道数(满足任一条件)
if (negativeCount > positiveCount) { if (negativeCount > positiveCount) {
isNegative = true; isNegative = true;
//如果有在正面事件中发布负面稿件 // 如果有在正面事件中发布负面稿件
} else if (specNegativeCount > 0) { } else if (specNegativeCount > 0) {
// 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64 // 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64
if (positiveCount > negativeCount && positiveCount >= neutralCount && (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) { if (positiveCount > negativeCount && positiveCount >= neutralCount
&& (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) {
isPositive = true; isPositive = true;
} else { } else {
isNegative = true; isNegative = true;
...@@ -831,13 +870,15 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -831,13 +870,15 @@ public class ChannelServiceImpl implements ChannelService {
if (specPositiveCount > 0) { if (specPositiveCount > 0) {
isPositive = true; isPositive = true;
// 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64 // 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64
} else if (positiveCount > negativeCount && positiveCount >= neutralCount && (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) { } else if (positiveCount > negativeCount && positiveCount >= neutralCount
&& (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) {
isPositive = true; isPositive = true;
} }
} }
} }
//更新渠道指数,渠道等级,情感倾向并记录变化 // 更新渠道指数,渠道等级,情感倾向并记录变化
this.updateChannel(channel, project, positiveCount, neutralCount, negativeCount, isPositive, isNegative, specPositiveCount, specNegativeCount); this.updateChannel(channel, project, positiveCount, neutralCount, negativeCount, isPositive, isNegative,
specPositiveCount, specNegativeCount);
} catch (Exception e) { } catch (Exception e) {
log.error("calculateChannelEmotionIndex-", e); log.error("calculateChannelEmotionIndex-", e);
} }
...@@ -849,8 +890,9 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -849,8 +890,9 @@ public class ChannelServiceImpl implements ChannelService {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
// 平台 // 平台
result.put("platformList", commonService.getQbjcPlatform("id", "name")); result.put("platformList", commonService.getQbjcPlatform("id", "name"));
//渠道倾向 // 渠道倾向
List<ChannelEmotion> emotionList = Arrays.asList(ChannelEmotion.POSITIVE, ChannelEmotion.NEUTRAL, ChannelEmotion.NEGATIVE); List<ChannelEmotion> emotionList = Arrays.asList(ChannelEmotion.POSITIVE, ChannelEmotion.NEUTRAL,
ChannelEmotion.NEGATIVE);
List<JSONObject> collect = emotionList.stream().map(emotion -> { List<JSONObject> collect = emotionList.stream().map(emotion -> {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("id", emotion.getState()); json.put("id", emotion.getState());
...@@ -862,18 +904,18 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -862,18 +904,18 @@ public class ChannelServiceImpl implements ChannelService {
allEmotion.put("name", "全部"); allEmotion.put("name", "全部");
collect.add(0, allEmotion); collect.add(0, allEmotion);
result.put("emotionList", collect); result.put("emotionList", collect);
//渠道级别 // 渠道级别
List<String> mediaTypeList = ImportantChannelEnum.getAllTagExceptSpec(); List<String> mediaTypeList = ImportantChannelEnum.getAllTagExceptSpec();
mediaTypeList.add(0, "全部"); mediaTypeList.add(0, "全部");
result.put("mediaTypeList", mediaTypeList); result.put("mediaTypeList", mediaTypeList);
//发文数量 // 发文数量
result.put("articleList", getArticleList()); result.put("articleList", getArticleList());
return result; return result;
} }
@Override @Override
public PageVO<ChannelVO> getChannelList(int page, int pageSize, String keyword, List<String> platforms, List<Integer> emotions, List<String> mediaTypes, public PageVO<ChannelVO> getChannelList(int page, int pageSize, String keyword, List<String> platforms,
Integer[] articlesCount, String sorter) { List<Integer> emotions, List<String> mediaTypes, Integer[] articlesCount, String sorter) {
long s0 = System.currentTimeMillis(); long s0 = System.currentTimeMillis();
String projectId = UserThreadLocal.getProjectId(); String projectId = UserThreadLocal.getProjectId();
String contendId = "0"; String contendId = "0";
...@@ -881,7 +923,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -881,7 +923,8 @@ public class ChannelServiceImpl implements ChannelService {
Query query = new Query(Criteria.where("projectId").is(projectId).and("contendId").is(contendId)); Query query = new Query(Criteria.where("projectId").is(projectId).and("contendId").is(contendId));
channelDao.addKeywordFuzz(query, keyword, "source"); channelDao.addKeywordFuzz(query, keyword, "source");
if (!(null == platforms || platforms.contains("全部"))) { if (!(null == platforms || platforms.contains("全部"))) {
query.addCriteria(Criteria.where("platform").in(platforms.stream().map(GlobalPojo::getPlatformNameById).collect(Collectors.toList()))); query.addCriteria(Criteria.where("platform")
.in(platforms.stream().map(GlobalPojo::getPlatformNameById).collect(Collectors.toList())));
} }
if (!(null == emotions || emotions.contains(-1))) { if (!(null == emotions || emotions.contains(-1))) {
query.addCriteria(Criteria.where("emotion").in(emotions)); query.addCriteria(Criteria.where("emotion").in(emotions));
...@@ -900,16 +943,18 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -900,16 +943,18 @@ public class ChannelServiceImpl implements ChannelService {
List<Channel> channelList = channelDao.findList(query); List<Channel> channelList = channelDao.findList(query);
long s2 = System.currentTimeMillis(); long s2 = System.currentTimeMillis();
log.info("渠道查询耗时:" + (s2 - s1)); log.info("渠道查询耗时:" + (s2 - s1));
List<CompletableFuture<JSONObject>> futureList = channelList.stream().map(channel -> CompletableFuture.supplyAsync(() -> { List<CompletableFuture<JSONObject>> futureList = channelList.stream()
.map(channel -> CompletableFuture.supplyAsync(() -> {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("id", channel.getId()); result.put("id", channel.getId());
result.put("channel", channel); result.put("channel", channel);
result.put("lastArticle", markDataService.getLastMarkData(projectId, linkedGroupId, contendId, channel.getPlatform(), channel.getRealSource(), result.put("lastArticle", markDataService.getLastMarkData(projectId, linkedGroupId, contendId,
channel.getSource())); channel.getPlatform(), channel.getRealSource(), channel.getSource()));
return result; return result;
}, esSearchExecutor)).collect(Collectors.toList()); }, esSearchExecutor)).collect(Collectors.toList());
CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])).join(); CompletableFuture.allOf(futureList.toArray(new CompletableFuture[0])).join();
Map<String, JSONObject> idMap = futureList.stream().map(CompletableFuture::join).collect(Collectors.toMap(json -> json.getString("id"), a -> a)); Map<String, JSONObject> idMap = futureList.stream().map(CompletableFuture::join)
.collect(Collectors.toMap(json -> json.getString("id"), a -> a));
// List<JSONObject> resultList = channelList.stream().map(channel -> { // List<JSONObject> resultList = channelList.stream().map(channel -> {
// JSONObject result = new JSONObject(); // JSONObject result = new JSONObject();
// result.put("channelInfo", channel); // result.put("channelInfo", channel);
...@@ -919,25 +964,29 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -919,25 +964,29 @@ public class ChannelServiceImpl implements ChannelService {
long s3 = System.currentTimeMillis(); long s3 = System.currentTimeMillis();
log.info("渠道发文查询耗时:" + (s3 - s2)); log.info("渠道发文查询耗时:" + (s3 - s2));
return PageVO.createPageVo(total, page, pageSize, return PageVO.createPageVo(total, page, pageSize,
channelList.stream().map(channel -> ChannelVO.createFromChannelInfo(idMap.get(channel.getId()), projectId)).collect(Collectors.toList())); channelList.stream()
.map(channel -> ChannelVO.createFromChannelInfo(idMap.get(channel.getId()), projectId))
.collect(Collectors.toList()));
} }
@Override @Override
public PageVO<ChannelVO> getChannelListNew(int page, int pageSize, String keyword, List<String> platforms, List<Integer> emotions, List<String> mediaTypes, public PageVO<ChannelVO> getChannelListNew(int page, int pageSize, String keyword, List<String> platforms,
Integer[] articlesCount, String sorter) { List<Integer> emotions, List<String> mediaTypes, Integer[] articlesCount, String sorter) {
try { try {
String projectId = UserThreadLocal.getProjectId(); String projectId = UserThreadLocal.getProjectId();
String contendId = "0"; String contendId = "0";
EsClientDao.SearchHelper searchHelper = EsClientDao.createSearchHelper(); EsClientDao.SearchHelper searchHelper = EsClientDao.createSearchHelper();
BoolQueryBuilder postFilter = getChannelListQuery(projectId, contendId, keyword, platforms, emotions, mediaTypes, articlesCount); BoolQueryBuilder postFilter = getChannelListQuery(projectId, contendId, keyword, platforms, emotions,
mediaTypes, articlesCount);
searchHelper.setPostFilter(postFilter); searchHelper.setPostFilter(postFilter);
searchHelper.setSort(SortBuilders.fieldSort("influence").order(SortOrder.DESC)); searchHelper.setSort(SortBuilders.fieldSort("influence").order(SortOrder.DESC));
searchHelper.setFrom((page - 1) * pageSize); searchHelper.setFrom((page - 1) * pageSize);
searchHelper.setSize(pageSize); searchHelper.setSize(pageSize);
searchHelper.setIndexes(new String[]{ChannelEsDao.CHANNEL_COPY_ES_INDEX_NAME}); searchHelper.setIndexes(new String[] { ChannelEsDao.CHANNEL_COPY_ES_INDEX_NAME });
SearchHits searchHits = channelEsDao.searchHits(searchHelper); SearchHits searchHits = channelEsDao.searchHits(searchHelper);
long value = searchHits.getTotalHits().value; long value = searchHits.getTotalHits().value;
List<ChannelVO> collect = Arrays.stream(searchHits.getHits()).map(hit -> ChannelVO.createFromChannelCopyMap(hit.getSourceAsMap())).collect(Collectors.toList()); List<ChannelVO> collect = Arrays.stream(searchHits.getHits())
.map(hit -> ChannelVO.createFromChannelCopyMap(hit.getSourceAsMap())).collect(Collectors.toList());
return PageVO.createPageVo(value, page, pageSize, collect); return PageVO.createPageVo(value, page, pageSize, collect);
} catch (Exception e) { } catch (Exception e) {
log.error("getChannelListNew-", e); log.error("getChannelListNew-", e);
...@@ -945,8 +994,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -945,8 +994,8 @@ public class ChannelServiceImpl implements ChannelService {
return null; return null;
} }
private BoolQueryBuilder getChannelListQuery(String projectId, String contendId, String keyword, List<String> platforms, List<Integer> emotions, List<String> mediaTypes, private BoolQueryBuilder getChannelListQuery(String projectId, String contendId, String keyword,
Integer[] articlesCount) { List<String> platforms, List<Integer> emotions, List<String> mediaTypes, Integer[] articlesCount) {
BoolQueryBuilder postFilter = QueryBuilders.boolQuery(); BoolQueryBuilder postFilter = QueryBuilders.boolQuery();
postFilter.must(QueryBuilders.termQuery("project_id.keyword", projectId)); postFilter.must(QueryBuilders.termQuery("project_id.keyword", projectId));
postFilter.must(QueryBuilders.termQuery("contend_id.keyword", contendId)); postFilter.must(QueryBuilders.termQuery("contend_id.keyword", contendId));
...@@ -957,7 +1006,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -957,7 +1006,8 @@ public class ChannelServiceImpl implements ChannelService {
// platform限制 // platform限制
if (!(Tools.isEmpty(platforms) || platforms.contains("全部"))) { if (!(Tools.isEmpty(platforms) || platforms.contains("全部"))) {
BoolQueryBuilder platformBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder platformBuilder = QueryBuilders.boolQuery();
List<String> collect = platforms.stream().map(GlobalPojo::getPlatformNameById).filter(Objects::nonNull).collect(Collectors.toList()); List<String> collect = platforms.stream().map(GlobalPojo::getPlatformNameById).filter(Objects::nonNull)
.collect(Collectors.toList());
if (!Tools.isEmpty(collect)) { if (!Tools.isEmpty(collect)) {
platforms = collect; platforms = collect;
} }
...@@ -999,7 +1049,7 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -999,7 +1049,7 @@ public class ChannelServiceImpl implements ChannelService {
json.put("value", null); json.put("value", null);
} else { } else {
String[] split = name.substring(0, name.length() - 1).split("-"); String[] split = name.substring(0, name.length() - 1).split("-");
json.put("value", new Long[]{Long.parseLong(split[0]), Long.parseLong(split[1])}); json.put("value", new Long[] { Long.parseLong(split[0]), Long.parseLong(split[1]) });
} }
res.add(json); res.add(json);
} }
...@@ -1015,26 +1065,30 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1015,26 +1065,30 @@ public class ChannelServiceImpl implements ChannelService {
* @param neutralCount 中性稿件数 * @param neutralCount 中性稿件数
* @param negativeCount 负面稿件数 * @param negativeCount 负面稿件数
*/ */
private void updateChannel(Channel channel, Project project, long positiveCount, long neutralCount, long negativeCount, boolean isPositive, boolean isNegative, long specPositiveCount, long specNegativeCount) { private void updateChannel(Channel channel, Project project, long positiveCount, long neutralCount,
long negativeCount, boolean isPositive, boolean isNegative, long specPositiveCount,
long specNegativeCount) {
double index; double index;
int emotion; int emotion;
// 负面渠道走负面渠道指数计算规则并更新 // 负面渠道走负面渠道指数计算规则并更新
if (isNegative) { if (isNegative) {
//根据各指数计算最终渠道指数 // 根据各指数计算最终渠道指数
index = this.negativeChannelIndexRule(channel, positiveCount, negativeCount, specNegativeCount, project.getNegativeChannelParams()); index = this.negativeChannelIndexRule(channel, positiveCount, negativeCount, specNegativeCount,
project.getNegativeChannelParams());
// TODO 添加或记录变化情况 // TODO 添加或记录变化情况
// this.recordChannelChange(channel, rank, EmotionEnum.NEGATIVE.getState()); // this.recordChannelChange(channel, rank, EmotionEnum.NEGATIVE.getState());
emotion = EmotionEnum.NEGATIVE.getState(); emotion = EmotionEnum.NEGATIVE.getState();
//正面渠道走正面渠道指数计算规则并更新 // 正面渠道走正面渠道指数计算规则并更新
} else if (isPositive) { } else if (isPositive) {
//根据各指数计算最终渠道指数 // 根据各指数计算最终渠道指数
index = this.positiveChannelIndexRule(channel, positiveCount, neutralCount, negativeCount, specPositiveCount, project.getPositiveChannelParams()); index = this.positiveChannelIndexRule(channel, positiveCount, neutralCount, negativeCount,
specPositiveCount, project.getPositiveChannelParams());
// TODO 添加或记录变化情况 // TODO 添加或记录变化情况
// this.recordChannelChange(channel, rank, EmotionEnum.POSITIVE.getState()); // this.recordChannelChange(channel, rank, EmotionEnum.POSITIVE.getState());
emotion = EmotionEnum.POSITIVE.getState(); emotion = EmotionEnum.POSITIVE.getState();
} else { } else {
index = 0d; index = 0d;
//TODO 添加或记录变化情况 // TODO 添加或记录变化情况
emotion = EmotionEnum.NEUTRAL.getState(); emotion = EmotionEnum.NEUTRAL.getState();
} }
channel.setEmotionIndex(index); channel.setEmotionIndex(index);
...@@ -1052,33 +1106,36 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1052,33 +1106,36 @@ public class ChannelServiceImpl implements ChannelService {
* @param positiveChannelMap 模块配置的正面渠道指数计算比例 * @param positiveChannelMap 模块配置的正面渠道指数计算比例
* @return 计算指数 * @return 计算指数
*/ */
private double positiveChannelIndexRule(Channel channel, long positiveCount, long neutralCount, long negativeCount, long specPositiveCount, Map<String, Double> positiveChannelMap) { private double positiveChannelIndexRule(Channel channel, long positiveCount, long neutralCount, long negativeCount,
//正面稿件数-中性稿件数 long specPositiveCount, Map<String, Double> positiveChannelMap) {
// 正面稿件数-中性稿件数
long value = positiveCount - neutralCount; long value = positiveCount - neutralCount;
//正面-中性得分 // 正面-中性得分
double neutralScore = this.getNeutralScore(value); double neutralScore = this.getNeutralScore(value);
//正面稿件数-负面稿件数 // 正面稿件数-负面稿件数
value = positiveCount - negativeCount; value = positiveCount - negativeCount;
//正面-负面得分 // 正面-负面得分
double negativeScore = this.getNegativeScore(value); double negativeScore = this.getNegativeScore(value);
//正面事件 // 正面事件
value = eventDao.getEventCount(new ChannelIndex(channel), Collections.singletonList(EmotionEnum.POSITIVE.getName()), null); value = eventDao.getEventCount(new ChannelIndex(channel),
//正面事件得分 Collections.singletonList(EmotionEnum.POSITIVE.getName()), null);
// 正面事件得分
double positiveEventScore = this.getPositiveEventScore(value); double positiveEventScore = this.getPositiveEventScore(value);
//特殊稿件 // 特殊稿件
value = specPositiveCount; value = specPositiveCount;
//特殊稿件得分 // 特殊稿件得分
double specialArticlesScore = this.getPositiveSpecialArticlesScore(value); double specialArticlesScore = this.getPositiveSpecialArticlesScore(value);
//经验评级 // 经验评级
String experienceStr = channel.getExperienceLevel(); String experienceStr = channel.getExperienceLevel();
//经验评级得分 // 经验评级得分
double experienceScore = this.getPositiveExperienceScore(experienceStr); double experienceScore = this.getPositiveExperienceScore(experienceStr);
Double neutral = positiveChannelMap.get("neutral"); Double neutral = positiveChannelMap.get("neutral");
Double negative = positiveChannelMap.get("negative"); Double negative = positiveChannelMap.get("negative");
Double positiveEvent = positiveChannelMap.get("positiveEvent"); Double positiveEvent = positiveChannelMap.get("positiveEvent");
Double specialArticles = positiveChannelMap.get("specialArticles"); Double specialArticles = positiveChannelMap.get("specialArticles");
Double experience = positiveChannelMap.get("experience"); Double experience = positiveChannelMap.get("experience");
return neutralScore * neutral + negativeScore * negative + positiveEventScore * positiveEvent + specialArticlesScore * specialArticles + experienceScore * experience; return neutralScore * neutral + negativeScore * negative + positiveEventScore * positiveEvent
+ specialArticlesScore * specialArticles + experienceScore * experience;
} }
/** /**
...@@ -1230,27 +1287,29 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1230,27 +1287,29 @@ public class ChannelServiceImpl implements ChannelService {
* @param negativeChannelMap 项目模块配置的负面渠道指数计算比例 * @param negativeChannelMap 项目模块配置的负面渠道指数计算比例
* @return 不友好渠道计算指数 * @return 不友好渠道计算指数
*/ */
private double negativeChannelIndexRule(Channel channel, long positiveCount, long negativeCount, long specNegativeCount, Map<String, Double> negativeChannelMap) { private double negativeChannelIndexRule(Channel channel, long positiveCount, long negativeCount,
//负面稿件-正面稿件 long specNegativeCount, Map<String, Double> negativeChannelMap) {
// 负面稿件-正面稿件
long value = negativeCount - positiveCount; long value = negativeCount - positiveCount;
//负面稿件数得分 // 负面稿件数得分
double negativeArticlesScore = this.getNegativeArticlesScore(value); double negativeArticlesScore = this.getNegativeArticlesScore(value);
//参与负面事件 // 参与负面事件
value = eventDao.getEventCount(channel, Collections.singletonList(EmotionEnum.NEGATIVE.getName()), null); value = eventDao.getEventCount(channel, Collections.singletonList(EmotionEnum.NEGATIVE.getName()), null);
//参与负面事件得分 // 参与负面事件得分
double negativeEventScore = this.getNegativeEventScore(value); double negativeEventScore = this.getNegativeEventScore(value);
//特殊稿件 // 特殊稿件
value = specNegativeCount; value = specNegativeCount;
//特殊稿件得分 // 特殊稿件得分
double specialArticlesScore = this.getNegativeSpecialArticlesScore(value); double specialArticlesScore = this.getNegativeSpecialArticlesScore(value);
String experienceStr = channel.getExperienceLevel(); String experienceStr = channel.getExperienceLevel();
//经验评级得分 // 经验评级得分
double experienceScore = this.getNegativeExperienceScore(experienceStr); double experienceScore = this.getNegativeExperienceScore(experienceStr);
Double negativeArticles = negativeChannelMap.get("negativeArticles"); Double negativeArticles = negativeChannelMap.get("negativeArticles");
Double negativeEvent = negativeChannelMap.get("negativeEvent"); Double negativeEvent = negativeChannelMap.get("negativeEvent");
Double specialArticles = negativeChannelMap.get("specialArticles"); Double specialArticles = negativeChannelMap.get("specialArticles");
Double experience = negativeChannelMap.get("experience"); Double experience = negativeChannelMap.get("experience");
return negativeArticlesScore * negativeArticles + negativeEventScore * negativeEvent + specialArticlesScore * specialArticles + experienceScore * experience; return negativeArticlesScore * negativeArticles + negativeEventScore * negativeEvent
+ specialArticlesScore * specialArticles + experienceScore * experience;
} }
/** /**
...@@ -1315,7 +1374,6 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1315,7 +1374,6 @@ public class ChannelServiceImpl implements ChannelService {
return negativeEventScore; return negativeEventScore;
} }
/** /**
* 渠道计算占比公式 * 渠道计算占比公式
* *
...@@ -1357,22 +1415,25 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1357,22 +1415,25 @@ public class ChannelServiceImpl implements ChannelService {
} }
private double inEventCountMonthAverage(Channel channel, String eventEmotion) { private double inEventCountMonthAverage(Channel channel, String eventEmotion) {
long eventCount = eventDao.getEventCount(new ChannelIndex(channel), Collections.singletonList(eventEmotion), null); long eventCount = eventDao.getEventCount(new ChannelIndex(channel), Collections.singletonList(eventEmotion),
null);
Period periodDays = new Period(channel.getCTime(), System.currentTimeMillis(), PeriodType.months()); Period periodDays = new Period(channel.getCTime(), System.currentTimeMillis(), PeriodType.months());
return (double) eventCount / periodDays.getMonths(); return (double) eventCount / periodDays.getMonths();
} }
private Long markCountByEmotion(Channel channel, String emotion) throws IOException { private Long markCountByEmotion(Channel channel, String emotion) throws IOException {
BoolQueryBuilder postFilter = markDataService.projectLinkedGroupContendIdQuery(channel.getProjectId(), channel.getLinkedGroupId(), BoolQueryBuilder postFilter = markDataService.projectLinkedGroupContendIdQuery(channel.getProjectId(),
channel.getContendId()); channel.getLinkedGroupId(), channel.getContendId());
postFilter.must(QueryBuilders.termQuery("brandkbs_mark_cache_maps.name.keyword", emotion)); postFilter.must(QueryBuilders.termQuery("brandkbs_mark_cache_maps.name.keyword", emotion));
return esClientDao.count(postFilter); return esClientDao.count(postFilter);
} }
private Map<String, List<ChannelIndex.Article>> getSourceContendMap(String channelId, Collection<String> contendIds, String platform, String keyword, Long startTime, Long endTime) { private Map<String, List<ChannelIndex.Article>> getSourceContendMap(String channelId, Collection<String> contendIds,
String platform, String keyword, Long startTime, Long endTime) {
try { try {
String projectId = UserThreadLocal.getProjectId(); String projectId = UserThreadLocal.getProjectId();
EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(projectId, channelId, contendIds, platform, keyword, startTime, endTime); EsClientDao.SearchHelper searchHelper = createSearchHelperByChannelCriteria(projectId, channelId,
contendIds, platform, keyword, startTime, endTime);
// 分页查询所有结果 // 分页查询所有结果
List<SearchResponse> searchResponses = channelEsDao.searchScrollResponse(searchHelper); List<SearchResponse> searchResponses = channelEsDao.searchScrollResponse(searchHelper);
// 根据品牌分类 // 根据品牌分类
...@@ -1383,7 +1444,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1383,7 +1444,8 @@ public class ChannelServiceImpl implements ChannelService {
return Collections.emptyMap(); return Collections.emptyMap();
} }
private Map<String, List<ChannelIndex.Article>> getSourceContendMap(String channelId, Collection<String> contendIds, Long startTime, Long endTime) { private Map<String, List<ChannelIndex.Article>> getSourceContendMap(String channelId, Collection<String> contendIds,
Long startTime, Long endTime) {
return getSourceContendMap(channelId, contendIds, null, null, startTime, endTime); return getSourceContendMap(channelId, contendIds, null, null, startTime, endTime);
} }
...@@ -1405,8 +1467,10 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1405,8 +1467,10 @@ public class ChannelServiceImpl implements ChannelService {
res.put("negativeCount", negativeCount); res.put("negativeCount", negativeCount);
res.put("articleTotal", total); res.put("articleTotal", total);
// 做分母时不能为0 // 做分母时不能为0
res.put("positivePercent", BigDecimal.valueOf((double) positiveCount * 100 / (0 == total ? 1 : total)).setScale(1, RoundingMode.UP)); res.put("positivePercent", BigDecimal.valueOf((double) positiveCount * 100 / (0 == total ? 1 : total))
res.put("negativePercent", BigDecimal.valueOf((double) negativeCount * 100 / (0 == total ? 1 : total)).setScale(1, RoundingMode.UP)); .setScale(1, RoundingMode.UP));
res.put("negativePercent", BigDecimal.valueOf((double) negativeCount * 100 / (0 == total ? 1 : total))
.setScale(1, RoundingMode.UP));
return Pair.of(total, res); return Pair.of(total, res);
} }
...@@ -1439,7 +1503,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1439,7 +1503,8 @@ public class ChannelServiceImpl implements ChannelService {
return Pair.of(totalEvent, res); return Pair.of(totalEvent, res);
} }
private List<JSONObject> spreadingTendData(Long startTime, Long endTime, List<ChannelIndex.Article> articleList, String timePattern) { private List<JSONObject> spreadingTendData(Long startTime, Long endTime, List<ChannelIndex.Article> articleList,
String timePattern) {
// 按日分组并根据id去重保留最近标注时间 // 按日分组并根据id去重保留最近标注时间
Map<Long, List<ChannelIndex.Article>> dateListMap = partition(startTime, endTime, timePattern, articleList); Map<Long, List<ChannelIndex.Article>> dateListMap = partition(startTime, endTime, timePattern, articleList);
return dateListMap.entrySet().stream().sorted(Comparator.comparingLong(Map.Entry::getKey)).map(e -> { return dateListMap.entrySet().stream().sorted(Comparator.comparingLong(Map.Entry::getKey)).map(e -> {
...@@ -1450,7 +1515,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1450,7 +1515,8 @@ public class ChannelServiceImpl implements ChannelService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
private List<JSONObject> spreadingTendEvent(Long startTime, Long endTime, Channel channel, String contendId, String timePattern) { private List<JSONObject> spreadingTendEvent(Long startTime, Long endTime, Channel channel, String contendId,
String timePattern) {
Map<Long, List<Event>> eventCount = completeTimes(startTime, endTime, timePattern); Map<Long, List<Event>> eventCount = completeTimes(startTime, endTime, timePattern);
if (Constant.MONTH_PATTERN.equals(timePattern)) { if (Constant.MONTH_PATTERN.equals(timePattern)) {
eventCount.putAll(eventDao.getEventMonth(new ChannelIndex(channel, contendId), startTime, endTime)); eventCount.putAll(eventDao.getEventMonth(new ChannelIndex(channel, contendId), startTime, endTime));
...@@ -1465,7 +1531,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1465,7 +1531,8 @@ public class ChannelServiceImpl implements ChannelService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
private Map<String, List<ChannelIndex.Article>> convert2ContendMap(List<SearchResponse> searchResponses, Long startTime, Long endTime, Collection<String> contendIds) { private Map<String, List<ChannelIndex.Article>> convert2ContendMap(List<SearchResponse> searchResponses,
Long startTime, Long endTime, Collection<String> contendIds) {
Map<String, List<ChannelIndex.Article>> contendMap = new HashMap<>(); Map<String, List<ChannelIndex.Article>> contendMap = new HashMap<>();
for (SearchResponse searchResponse : searchResponses) { for (SearchResponse searchResponse : searchResponses) {
for (SearchHit hit : searchResponse.getHits().getHits()) { for (SearchHit hit : searchResponse.getHits().getHits()) {
...@@ -1499,7 +1566,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1499,7 +1566,8 @@ public class ChannelServiceImpl implements ChannelService {
* *
* @return * @return
*/ */
private Map<Long, List<ChannelIndex.Article>> partition(Long startTime, Long endTime, String timePattern, List<ChannelIndex.Article> articles) { private Map<Long, List<ChannelIndex.Article>> partition(Long startTime, Long endTime, String timePattern,
List<ChannelIndex.Article> articles) {
Map<Long, List<ChannelIndex.Article>> res = completeTimes(startTime, endTime, timePattern); Map<Long, List<ChannelIndex.Article>> res = completeTimes(startTime, endTime, timePattern);
for (ChannelIndex.Article article : articles) { for (ChannelIndex.Article article : articles) {
// 按日分组 // 按日分组
...@@ -1515,12 +1583,15 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1515,12 +1583,15 @@ public class ChannelServiceImpl implements ChannelService {
return res; return res;
} }
private EsClientDao.SearchHelper createSearchHelperByChannelCriteria(String projectId, String channelId,
private EsClientDao.SearchHelper createSearchHelperByChannelCriteria(String projectId, String channelId, Collection<String> contendIds, String platform, String keyword, Long startTime, Long endTime) { Collection<String> contendIds, String platform, String keyword, Long startTime, Long endTime) {
return createSearchHelperByChannelCriteria(projectId, channelId, contendIds, platform, keyword, startTime, endTime, true); return createSearchHelperByChannelCriteria(projectId, channelId, contendIds, platform, keyword, startTime,
endTime, true);
} }
private EsClientDao.SearchHelper createSearchHelperByChannelCriteria(String projectId, String channelId, Collection<String> contendIds, String platform, String keyword, Long startTime, Long endTime, boolean defaultTime) { private EsClientDao.SearchHelper createSearchHelperByChannelCriteria(String projectId, String channelId,
Collection<String> contendIds, String platform, String keyword, Long startTime, Long endTime,
boolean defaultTime) {
EsClientDao.SearchHelper helper = EsClientDao.createSearchHelper(); EsClientDao.SearchHelper helper = EsClientDao.createSearchHelper();
// query // query
BoolQueryBuilder query = QueryBuilders.boolQuery(); BoolQueryBuilder query = QueryBuilders.boolQuery();
...@@ -1563,7 +1634,8 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1563,7 +1634,8 @@ public class ChannelServiceImpl implements ChannelService {
return helper; return helper;
} }
private Query channelListQuery(String contendId, Boolean show, String emotion, String platform, String keyword, String sorter) { private Query channelListQuery(String contendId, Boolean show, String emotion, String platform, String keyword,
String sorter) {
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("projectId").is(UserThreadLocal.getProjectId())); query.addCriteria(Criteria.where("projectId").is(UserThreadLocal.getProjectId()));
query.addCriteria(Criteria.where("contendId").is(contendId)); query.addCriteria(Criteria.where("contendId").is(contendId));
...@@ -1586,19 +1658,19 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1586,19 +1658,19 @@ public class ChannelServiceImpl implements ChannelService {
private String[] getTitleAndUrlById(String id) { private String[] getTitleAndUrlById(String id) {
try { try {
BaseMap baseMap = Tools.getBaseFromEsMap(esClientDao.searchById(id)); BaseMap baseMap = Tools.getBaseFromEsMap(esClientDao.searchById(id));
return new String[]{baseMap.getTitleNullOptionalContent(), baseMap.getUrl()}; return new String[] { baseMap.getTitleNullOptionalContent(), baseMap.getUrl() };
} catch (IOException ignored) { } catch (IOException ignored) {
} }
return new String[]{null, null}; return new String[] { null, null };
} }
private String[] getTitleContentUrlById(String id) { private String[] getTitleContentUrlById(String id) {
try { try {
BaseMap baseMap = Tools.getBaseFromEsMap(esClientDao.searchById(id)); BaseMap baseMap = Tools.getBaseFromEsMap(esClientDao.searchById(id));
return new String[]{baseMap.getTitle(), baseMap.getContent(), baseMap.getUrl()}; return new String[] { baseMap.getTitle(), baseMap.getContent(), baseMap.getUrl() };
} catch (IOException ignored) { } catch (IOException ignored) {
} }
return new String[]{null, null, null}; return new String[] { null, null, null };
} }
private boolean hasEmotion(Channel channel) { private boolean hasEmotion(Channel channel) {
...@@ -1607,7 +1679,7 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -1607,7 +1679,7 @@ public class ChannelServiceImpl implements ChannelService {
} }
AbstractProject project = projectService.getProjectByContendId(channel.getProjectId(), channel.getContendId()); AbstractProject project = projectService.getProjectByContendId(channel.getProjectId(), channel.getContendId());
if (project instanceof Contend) { if (project instanceof Contend) {
//有情感倾向更新渠道指数 // 有情感倾向更新渠道指数
return ((Contend) project).isHasEmotion(); return ((Contend) project).isHasEmotion();
} }
return project instanceof Project; return project instanceof Project;
......
...@@ -855,7 +855,7 @@ public class EventServiceImpl implements EventService { ...@@ -855,7 +855,7 @@ public class EventServiceImpl implements EventService {
@Override @Override
public PageData<JSONObject> eventChannelVoices(String eventId, String type, int page, int pageSize, String sorter) { public PageData<JSONObject> eventChannelVoices(String eventId, String type, int page, int pageSize, String sorter) {
return eventClient.eventChannelVoices(eventId, type, page, pageSize, sorter); return eventClient.eventChannelVoices(eventId, type, page, pageSize, sorter, UserThreadLocal.getProjectId());
} }
@Override @Override
......
...@@ -36,7 +36,7 @@ es.httpClusterNodes=192.168.0.130:9200:qbjc-back:yuqing.zhiweidata.com,192.168.0 ...@@ -36,7 +36,7 @@ es.httpClusterNodes=192.168.0.130:9200:qbjc-back:yuqing.zhiweidata.com,192.168.0
#es.password=3vh65l$i6qQA #es.password=3vh65l$i6qQA
es.username=joker es.username=joker
es.password=jokerdevops es.password=jokerdevops
es.index.test = true es.index.test = false
#channel-index #channel-index
channel.index.registry=zookeeper://192.168.0.104:2182?backup=192.168.0.105:2182,192.168.0.203:2182 channel.index.registry=zookeeper://192.168.0.104:2182?backup=192.168.0.105:2182,192.168.0.203:2182
...@@ -62,6 +62,8 @@ qbjc.project.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/project ...@@ -62,6 +62,8 @@ qbjc.project.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/project
qbjc.event.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/aplan/event qbjc.event.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/aplan/event
qbjc.event.tag.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/tag/event?project={1} qbjc.event.tag.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/tag/event?project={1}
qbjc.platform.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platform/resource qbjc.platform.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platform/resource
qbjc.userCenter.url=https://login.zhiweidata.com/plogin/center
qbjc.userCenter.token=AoJ0ooy3HV1EElWnvQw9YTS9b5Y+fmtkbM6DdpPgDO6D/OhNqH4qrJKarzMr
#\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3 #\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3
crisis.search.url=https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3} crisis.search.url=https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3}
crisis.searchTags.url=https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4} crisis.searchTags.url=https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4}
......
...@@ -36,7 +36,7 @@ es.httpClusterNodes=192.168.0.130:9200:qbjc-back:yuqing.zhiweidata.com,192.168.0 ...@@ -36,7 +36,7 @@ es.httpClusterNodes=192.168.0.130:9200:qbjc-back:yuqing.zhiweidata.com,192.168.0
#es.password=3vh65l$i6qQA #es.password=3vh65l$i6qQA
es.username=joker es.username=joker
es.password=jokerdevops es.password=jokerdevops
es.index.test = true es.index.test = false
#channel-index #channel-index
channel.index.registry=zookeeper://192.168.0.104:2182?backup=192.168.0.105:2182,192.168.0.203:2182 channel.index.registry=zookeeper://192.168.0.104:2182?backup=192.168.0.105:2182,192.168.0.203:2182
...@@ -62,6 +62,8 @@ qbjc.project.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/project ...@@ -62,6 +62,8 @@ qbjc.project.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/project
qbjc.event.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/aplan/event qbjc.event.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/aplan/event
qbjc.event.tag.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/tag/event?project={1} qbjc.event.tag.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/tag/event?project={1}
qbjc.platform.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platform/resource qbjc.platform.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platform/resource
qbjc.userCenter.url=https://login.zhiweidata.com/plogin/center
qbjc.userCenter.token=AoJ0ooy3HV1EElWnvQw9YTS9b5Y+fmtkbM6DdpPgDO6D/OhNqH4qrJKarzMr
#\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3 #\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3
crisis.search.url=https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3} crisis.search.url=https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3}
crisis.searchTags.url=https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4} crisis.searchTags.url=https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4}
......
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