Commit 4e81d981 by shenjunjie

Merge branch 'release' into 'master'

Release

See merge request !525
parents d2b24741 0347b2cb
......@@ -555,6 +555,7 @@ public class AppArticleController extends BaseController {
@ApiOperation("原发溯源-首发信息")
@PostMapping("/search-whole/origin/first-article")
@LogRecord(description = "原发溯源")
public ResponseResult getWholeSearchFirstArticle(@RequestBody MarkSearchDTO dto) {
return ResponseResult.success(markDataService.getWholeSearchFirstArticle(dto));
}
......
......@@ -3332,6 +3332,9 @@ public class MarkDataServiceImpl implements MarkDataService {
SearchResponse searchResponse = esClientDao.searchResponse(indexes, null, query, provinceAggregationBuilder, null, sort, 0, 1000, null);
// hits
SearchHits hits = searchResponse.getHits();
if (0 == hits.getHits().length){
return null;
}
JSONObject firstJson = new JSONObject(hits.getAt(0).getSourceAsMap());
Map<String, Integer> platformCount = new HashMap<>();
Map<String, Integer> fieldCount = new HashMap<>();
......@@ -3529,18 +3532,13 @@ public class MarkDataServiceImpl implements MarkDataService {
SearchHits hits = esClientDao.searchHits(indexes, query, null, null, sort, (page - 1) * pageSize, pageSize, null);
List<JSONObject> list = new ArrayList<>();
for (SearchHit hit : hits) {
JSONObject hitJson = new JSONObject(hit.getSourceAsMap());
JSONObject data = JSONObject.parseObject(JSONObject.toJSONString(new MarkFlowEntity(hitJson).getData()));
BaseMap baseMap = Tools.getBaseFromEsMap(hit.getSourceAsMap());
JSONObject jsonObject = new JSONObject();
jsonObject.put("platform", BeanTools.filterPlatform(GlobalPojo.PLATFORMS, hitJson.getIntValue(GenericAttribute.ES_C5), hitJson.getIntValue(GenericAttribute.ES_FOREIGN)).getName());
jsonObject.put("source", hitJson.getString(GenericAttribute.ES_SOURCE));
jsonObject.put("realSource", hitJson.getString(GenericAttribute.ES_REAL_SOURCE));
jsonObject.put("time", hitJson.getLongValue("time"));
String title = StringUtils.isNotBlank(Tools.getTitleWithContent(data.getString("title"), data.getString("content")))
? Tools.getTitleWithContent(data.getString("title"), data.getString("content"))
: Tools.getTitleWithContent(data.getString("questionTitle"), data.getString("questionContent"));
jsonObject.put("title", title);
jsonObject.put("url", data.getString("url"));
jsonObject.put("platform", baseMap.getPlatform());
jsonObject.put("source", baseMap.getSource());
jsonObject.put("realSource", baseMap.getRealSource());
jsonObject.put("title", baseMap.getTitle());
jsonObject.put("url", baseMap.getUrl());
list.add(jsonObject);
}
return PageVO.createPageVo(total, page, pageSize, list);
......@@ -3551,6 +3549,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
private BoolQueryBuilder getAllIndexSearchOriginQuery(MarkSearchDTO dto) {
dto.setEndTime(System.currentTimeMillis());
dto.setStartTime(dto.getEndTime() - Constant.ONE_MONTH);
// keyword
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
......
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