提交 8c6cc457 作者: obcy

【修改配置通知采集】

上级 34747ca4
...@@ -118,6 +118,10 @@ public class ConfigurationMessageService { ...@@ -118,6 +118,10 @@ public class ConfigurationMessageService {
private String keyWordsbindUrl; private String keyWordsbindUrl;
@Value("${caiji.keyWordsEdit.url:http://1.95.79.85:8823/baseSourceInfo/api/keyword/edit}") @Value("${caiji.keyWordsEdit.url:http://1.95.79.85:8823/baseSourceInfo/api/keyword/edit}")
private String keyWordsEditUrl; private String keyWordsEditUrl;
@Value("${caiji.allInfosourcebind.url:http://1.95.79.85:8823/baseSourceInfo/api/subject/infoSourceSave}")
private String allInfosourcebindUrl;
@Value("${caiji.allKeyWordsBind.url:http://1.95.79.85:8823/baseSourceInfo/api/subject/keywordSave}")
private String allKeyWordsBindUrl;
@Value("${caiji.projectCode:zzsn}") @Value("${caiji.projectCode:zzsn}")
private String projectCode; private String projectCode;
@Value("${caiji.projectName:克虏宝}") @Value("${caiji.projectName:克虏宝}")
...@@ -324,7 +328,7 @@ public class ConfigurationMessageService { ...@@ -324,7 +328,7 @@ public class ConfigurationMessageService {
log.info("专题关键词配置通知采集{}",keyWordsParam); log.info("专题关键词配置通知采集{}",keyWordsParam);
String post = HttpUtil.post(keyWordsbindUrl, keyWordsParam); String post = HttpUtil.post(allKeyWordsBindUrl, keyWordsParam);
JSONObject entries = JSONUtil.parseObj(post); JSONObject entries = JSONUtil.parseObj(post);
//获取code状态码 //获取code状态码
Integer code = entries.getInt("code"); Integer code = entries.getInt("code");
...@@ -354,7 +358,7 @@ public class ConfigurationMessageService { ...@@ -354,7 +358,7 @@ public class ConfigurationMessageService {
} }
log.info("专题信息源配置通知采集{}",getparam); log.info("专题信息源配置通知采集{}",getparam);
String post = HttpUtil.post(infosourcebindUrl, getparam); String post = HttpUtil.post(allInfosourcebindUrl, getparam);
JSONObject entries = JSONUtil.parseObj(post); JSONObject entries = JSONUtil.parseObj(post);
//获取code状态码 //获取code状态码
Integer code = entries.getInt("code"); Integer code = entries.getInt("code");
......
...@@ -58,6 +58,9 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i ...@@ -58,6 +58,9 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
private CodeGenerateUtil codeGenerateUtil; private CodeGenerateUtil codeGenerateUtil;
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired
private ConfigurationMessageService configurationMessageService;
@Resource @Resource
private KafkaTemplate<String,String> kafkaTemplate; private KafkaTemplate<String,String> kafkaTemplate;
...@@ -168,6 +171,10 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i ...@@ -168,6 +171,10 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
if (StringUtils.isNotEmpty(keyWordsTypeId)) { if (StringUtils.isNotEmpty(keyWordsTypeId)) {
addMapMain(keyWords, keyWordsTypeId); addMapMain(keyWords, keyWordsTypeId);
} }
//通知采集更新配置
//同步配置到采集
configurationMessageService.sendEditKeyWordsConfigurationMessage(keyWords.getId());
} }
@Override @Override
......
...@@ -46,6 +46,9 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour ...@@ -46,6 +46,9 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
private InfoSourceGroupService infoSourceGroupService; private InfoSourceGroupService infoSourceGroupService;
@Autowired @Autowired
private ScoreModelService scoreModelService; private ScoreModelService scoreModelService;
@Autowired
private ConfigurationMessageService configurationMessageService;
@Override @Override
@Transactional @Transactional
...@@ -200,6 +203,9 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour ...@@ -200,6 +203,9 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
} }
this.saveBatch(mapList); this.saveBatch(mapList);
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectPage.getId());
} }
@Override @Override
...@@ -246,6 +252,8 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour ...@@ -246,6 +252,8 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
if (directionIds != null && directionIds.size() > 0) { if (directionIds != null && directionIds.size() > 0) {
baseMapper.deleteInfoSourceIds(subjectPage.getId(), directionIds, BindTypeEnum.DIRECTIONA_INFO_SOURCE_GROUP.getvalue()); baseMapper.deleteInfoSourceIds(subjectPage.getId(), directionIds, BindTypeEnum.DIRECTIONA_INFO_SOURCE_GROUP.getvalue());
} }
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectPage.getId());
} }
@Override @Override
......
...@@ -94,6 +94,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -94,6 +94,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
private IKeyWordsService iKeyWordsService; private IKeyWordsService iKeyWordsService;
@Autowired @Autowired
private IClbModelArrangeService clbModelArrangeService; private IClbModelArrangeService clbModelArrangeService;
@Autowired
private ConfigurationMessageService configurationMessageService;
@Value("${python.subjectProcessorUrl}") @Value("${python.subjectProcessorUrl}")
private String subjectProcessorUrl; private String subjectProcessorUrl;
...@@ -303,6 +305,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -303,6 +305,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
subjectInfoSourceMapService.save(subjectInfoSourceMap); subjectInfoSourceMapService.save(subjectInfoSourceMap);
} }
} }
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectId);
} }
@Override @Override
...@@ -327,6 +331,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -327,6 +331,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
subjectInfoSourceMapService.save(subjectInfoSourceMap); subjectInfoSourceMapService.save(subjectInfoSourceMap);
} }
} }
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectId);
} }
@Override @Override
...@@ -345,6 +351,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -345,6 +351,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
.eq(SubjectInfoSourceMap::getType, 3); .eq(SubjectInfoSourceMap::getType, 3);
subjectInfoSourceMapService.remove(queryWrapper); subjectInfoSourceMapService.remove(queryWrapper);
} }
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectId);
} }
@Override @Override
...@@ -362,6 +370,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -362,6 +370,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
} }
subjectKeywordsMapService.saveBatch(mapList); subjectKeywordsMapService.saveBatch(mapList);
} }
//同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectPage.getId());
} }
@Override @Override
...@@ -378,6 +388,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -378,6 +388,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
redisUtil.del(Constants.KEY_WORDS_TO_REDIS_PREFIX + keyWordsPage.getWordsCode()); redisUtil.del(Constants.KEY_WORDS_TO_REDIS_PREFIX + keyWordsPage.getWordsCode());
} }
} }
//同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectPage.getId());
} }
@Override @Override
......
...@@ -63,6 +63,8 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -63,6 +63,8 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
private ISubjectModelMapService subjectModelMapService; private ISubjectModelMapService subjectModelMapService;
@Autowired @Autowired
private ScoreModelService scoreModelService; private ScoreModelService scoreModelService;
@Autowired
private ConfigurationMessageService configurationMessageService;
@Autowired @Autowired
private EsService esService; private EsService esService;
...@@ -117,6 +119,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -117,6 +119,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
scoreModel.setType("1"); scoreModel.setType("1");
scoreModel.setData(defaultConfig); scoreModel.setData(defaultConfig);
scoreModelService.save(scoreModel); scoreModelService.save(scoreModel);
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectId);
configurationMessageService.bindKeyWordsSend(subjectId);
return subject; return subject;
} }
...@@ -252,6 +257,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -252,6 +257,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
//关键词绑定 //关键词绑定
List<SearchWordVO> keywords = subjectSimpleVO.getKeywords(); List<SearchWordVO> keywords = subjectSimpleVO.getKeywords();
modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords); modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords);
//同步配置到采集
configurationMessageService.bindInfoSourceSend(subjectSimpleVO.getId());
configurationMessageService.bindKeyWordsSend(subjectSimpleVO.getId());
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论