提交 07631f3f 作者: 925993793@qq.com

【定制专题】新增时增加通用打分配置逻辑

上级 4af8252c
......@@ -113,7 +113,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
String defaultConfig = "[{\"id\": \"1-1\", \"name\": \"信息源组\", \"children\": [], \"indexWeight\": 10}, {\"id\": \"1-2\", \"name\": \"文章长度\", \"indexWeight\": 15, \"keyWordsTopLimit\": 2500, \"keyWordsLowerLimit\": 500}, {\"id\": \"1-3\", \"name\": \"内容\", \"children\": [{\"id\": \"1-3-1\", \"name\": \"内容-关键词\", \"keyWords\": \"KEY_WORD\", \"indexWeight\": 75, \"titleWeight\": 10, \"keyWordsTopLimit\": 15, \"keyWordsLowerLimit\": 3}]}]";
List<SearchWordVO> collect = keywords.stream().filter(searchWordVO -> !"NOT".equalsIgnoreCase(searchWordVO.getSearchLogicRelationship())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
defaultConfig = defaultConfig.replace("KEY_WORD", String.join("|", collect.stream().map(SearchWordVO::getSearchInfo).collect(Collectors.toList())));
defaultConfig = defaultConfig.replace("KEY_WORD", collect.stream().map(SearchWordVO::getSearchInfo).collect(Collectors.joining("|")));
}
ScoreModel scoreModel = new ScoreModel();
scoreModel.setSubjectId(subjectId);
......@@ -150,8 +150,17 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
List<SearchWordVO> keywords = subjectSimpleVO.getKeywords();
if (CollectionUtils.isNotEmpty(keywords)) {
modifyKeyword(subjectId, subject.getSubjectName(), keywords);
//同步配置到采集
//configurationMessageService.bindKeyWordsSend(subjectId,1);
//默认通用打分配置
String defaultConfig = "[{\"id\": \"1-1\", \"name\": \"信息源组\", \"children\": [], \"indexWeight\": 10}, {\"id\": \"1-2\", \"name\": \"文章长度\", \"indexWeight\": 15, \"keyWordsTopLimit\": 2500, \"keyWordsLowerLimit\": 500}, {\"id\": \"1-3\", \"name\": \"内容\", \"children\": [{\"id\": \"1-3-1\", \"name\": \"内容-关键词\", \"keyWords\": \"KEY_WORD\", \"indexWeight\": 75, \"titleWeight\": 10, \"keyWordsTopLimit\": 15, \"keyWordsLowerLimit\": 3}]}]";
List<SearchWordVO> collect = keywords.stream().filter(searchWordVO -> !"NOT".equalsIgnoreCase(searchWordVO.getSearchLogicRelationship())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
defaultConfig = defaultConfig.replace("KEY_WORD", collect.stream().map(SearchWordVO::getSearchInfo).collect(Collectors.joining("|")));
}
ScoreModel scoreModel = new ScoreModel();
scoreModel.setSubjectId(subjectId);
scoreModel.setType("1");
scoreModel.setData(defaultConfig);
scoreModelService.save(scoreModel);
//默认绑定tpu流程
ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap();
tpu.setSubjectId(subject.getId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论