提交 f21e14c9 作者: 925993793@qq.com

【央企舆情重大舆情】逻辑bug修改

上级 26915460
...@@ -854,15 +854,18 @@ public class InformationServiceImpl implements InformationService { ...@@ -854,15 +854,18 @@ public class InformationServiceImpl implements InformationService {
try { try {
if (checkStatus == 1) { if (checkStatus == 1) {
List<Label> labels = subjectdatabase.getLabels(); List<Label> labels = subjectdatabase.getLabels();
Optional<Label> important = labels.stream().filter(label -> label.getLabelMark().equals("important")).findAny(); if (CollectionUtils.isEmpty(labels)) {
Optional<Label> important = labels.stream().filter(label -> StringUtils.isNotEmpty(label.getLabelMark()))
.filter(label -> label.getLabelMark().equals("important")).findAny();
if (important.isPresent()) { if (important.isPresent()) {
String articleId = subjectdatabase.getId(); String articleId = subjectdatabase.getId();
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("articleId", articleId); params.put("articleId", articleId);
HttpUtil.doGet("http://1.95.72.34:7051/yqyq/majorPublicOpinionSync", params,null, "utf-8"); HttpUtil.doGet("http://1.95.72.34:7051/yqyq/majorPublicOpinionSync", params, null, "utf-8");
log.info("央企舆情-重大舆情推送接口调用成功,{}", articleId); log.info("央企舆情-重大舆情推送接口调用成功,{}", articleId);
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -1506,14 +1509,14 @@ public class InformationServiceImpl implements InformationService { ...@@ -1506,14 +1509,14 @@ public class InformationServiceImpl implements InformationService {
public void batchTop(String subjectId, String index, List<String> ids) { public void batchTop(String subjectId, String index, List<String> ids) {
//先查询出库里面最大的置顶id //先查询出库里面最大的置顶id
int topNum = esService.getTopNum(index, subjectId); int topNum = esService.getTopNum(index, subjectId);
Map<String,Map<String,Object>> updateMap = new HashMap<>(); Map<String, Map<String, Object>> updateMap = new HashMap<>();
for (int i = 0; i < ids.size(); i++) { for (int i = 0; i < ids.size(); i++) {
String id = ids.get(i); String id = ids.get(i);
Map<String, Object> updateFields = new HashMap<>(); Map<String, Object> updateFields = new HashMap<>();
updateFields.put("topNum", topNum + (ids.size() - i)); updateFields.put("topNum", topNum + (ids.size() - i));
updateMap.put(id, updateFields); updateMap.put(id, updateFields);
} }
esOpUtil.bulkUpdateFields(index,updateMap); esOpUtil.bulkUpdateFields(index, updateMap);
} }
private void formatLabel(List<LabelModelVo> labelModelVos, DisplayInfo info) { private void formatLabel(List<LabelModelVo> labelModelVos, DisplayInfo info) {
...@@ -1539,8 +1542,8 @@ public class InformationServiceImpl implements InformationService { ...@@ -1539,8 +1542,8 @@ public class InformationServiceImpl implements InformationService {
} }
labelInfo.setLabelList(labelList); labelInfo.setLabelList(labelList);
labelInfos.add(labelInfo); labelInfos.add(labelInfo);
}catch (Exception e){ } catch (Exception e) {
log.error("标签格式化异常:{}",labelModelVo); log.error("标签格式化异常:{}", labelModelVo);
} }
} }
info.setLabelInfos(labelInfos); info.setLabelInfos(labelInfos);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论