提交 2305cc83 作者: yanxin

专题修改状态通知采集问题修改

上级 5e8d1b75
...@@ -407,6 +407,8 @@ public class SubjectManageController { ...@@ -407,6 +407,8 @@ public class SubjectManageController {
.set(XxlJobInfo::getTriggerStatus, byId.getStatus())); .set(XxlJobInfo::getTriggerStatus, byId.getStatus()));
if (subject.getStatus() == 1) { if (subject.getStatus() == 1) {
kafkaTemplate.send(SUBJECT_MODEL_KAFKA_CHANNEL, byId.getSubjectCode()); kafkaTemplate.send(SUBJECT_MODEL_KAFKA_CHANNEL, byId.getSubjectCode());
configurationMessageService.bindInfoSourceSend(subject.getId());
configurationMessageService.bindKeyWordsSend(subject.getId());
} }
try { try {
String res = caiJiCenterHttpService.subjectStatusEdit(subject.getStatus(), subject.getId()); String res = caiJiCenterHttpService.subjectStatusEdit(subject.getStatus(), subject.getId());
......
...@@ -299,9 +299,14 @@ public class ConfigurationMessageService { ...@@ -299,9 +299,14 @@ public class ConfigurationMessageService {
} }
public void bindKeyWordsSend(String subjectId) { public void bindKeyWordsSend(String subjectId) {
try {
remoteModelService.delSubjectCache(subjectId);
} catch (Exception e) {
log.error("删除专题缓存失败{}",e.getMessage(),e);
}
Subject byId = subjectService.getById(subjectId); Subject byId = subjectService.getById(subjectId);
if (byId == null) { if (byId == null || byId.getStatus() == null || byId.getStatus() != 1) {
log.info("未查询到专题"); log.info("未查询到专题或专题未启用");
return; return;
} }
List<String> subjectIdList = new ArrayList<>(); List<String> subjectIdList = new ArrayList<>();
...@@ -325,16 +330,11 @@ public class ConfigurationMessageService { ...@@ -325,16 +330,11 @@ public class ConfigurationMessageService {
throw new RuntimeException("专题关键词配置通知采集失败"); throw new RuntimeException("专题关键词配置通知采集失败");
} }
log.info("{}专题关键词配置通知采集结束",byId.getSubjectName()); log.info("{}专题关键词配置通知采集结束",byId.getSubjectName());
try {
remoteModelService.delSubjectCache(subjectId);
} catch (Exception e) {
log.error("删除专题缓存失败{}",e.getMessage(),e);
}
} }
public void bindKeyWordsEventSend(String eventId) { public void bindKeyWordsEventSend(String eventId) {
Event byId = eventService.getById(eventId); Event byId = eventService.getById(eventId);
if (byId == null) { if (byId == null || byId.getStatus() == null || byId.getStatus() != 1) {
log.info("未查询到事件"); log.info("未查询到事件或事件未启用");
return; return;
} }
List<String> subjectIdList = new ArrayList<>(); List<String> subjectIdList = new ArrayList<>();
...@@ -362,13 +362,18 @@ public class ConfigurationMessageService { ...@@ -362,13 +362,18 @@ public class ConfigurationMessageService {
public void bindInfoSourceSend(String subjectId){ public void bindInfoSourceSend(String subjectId){
try {
remoteModelService.delSubjectCache(subjectId);
} catch (Exception e) {
log.error("删除专题缓存失败{}",e.getMessage(),e);
}
Subject byId = subjectService.getById(subjectId); Subject byId = subjectService.getById(subjectId);
if (byId == null) { if (byId == null || byId.getStatus() == null || byId.getStatus() != 1) {
log.info("未查询到专题或专题未启用");
return; return;
} }
//只有启用状态的专题才需要通知采集更新绑定数据
List<String> bindIds = getAllInfoSourceIds(subjectId); List<String> bindIds = getAllInfoSourceIds(subjectId);
String getparam ; String getparam ;
if (CollectionUtil.isNotEmpty(bindIds)) { if (CollectionUtil.isNotEmpty(bindIds)) {
getparam = getparam(byId, null, bindIds); getparam = getparam(byId, null, bindIds);
...@@ -386,11 +391,6 @@ public class ConfigurationMessageService { ...@@ -386,11 +391,6 @@ public class ConfigurationMessageService {
throw new RuntimeException("专题信息源配置通知采集失败"); throw new RuntimeException("专题信息源配置通知采集失败");
} }
log.info("{}专题信息源配置通知采集结束",byId.getSubjectName()); log.info("{}专题信息源配置通知采集结束",byId.getSubjectName());
try {
remoteModelService.delSubjectCache(subjectId);
} catch (Exception e) {
log.error("删除专题缓存失败{}",e.getMessage(),e);
}
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论