提交 d5b41811 作者: 925993793@qq.com

[定制自定义专题]逻辑调整,默认tpu流程修改

上级 e5d31d95
...@@ -22,6 +22,7 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService; ...@@ -22,6 +22,7 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
...@@ -53,6 +54,8 @@ public class ExternalController { ...@@ -53,6 +54,8 @@ public class ExternalController {
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
@Value("${caiji.keywordCrawler.url:}")
private String keywordCrawlerUrl;
/** /**
* 创建专题 * 创建专题
...@@ -66,7 +69,7 @@ public class ExternalController { ...@@ -66,7 +69,7 @@ public class ExternalController {
subjectVO.setDataScope("1"); subjectVO.setDataScope("1");
SubjectSimpleVO subjectSimpleVO = new SubjectSimpleVO(); SubjectSimpleVO subjectSimpleVO = new SubjectSimpleVO();
BeanUtils.copyProperties(subjectVO, subjectSimpleVO); BeanUtils.copyProperties(subjectVO, subjectSimpleVO);
Subject subject = subjectSimpleService.createSubject(subjectSimpleVO); Subject subject = subjectSimpleService.createExternalSubject(subjectSimpleVO);
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
//插入xxlJob //插入xxlJob
xxlJobInfoService.subjectInsert(subject); xxlJobInfoService.subjectInsert(subject);
...@@ -83,10 +86,9 @@ public class ExternalController { ...@@ -83,10 +86,9 @@ public class ExternalController {
*/ */
@PostMapping("/updateSubject") @PostMapping("/updateSubject")
public Result<?> updateSubject(@RequestBody SubjectVO subjectVO) { public Result<?> updateSubject(@RequestBody SubjectVO subjectVO) {
subjectVO.setDataScope("1");
SubjectSimpleVO subjectSimpleVO = new SubjectSimpleVO(); SubjectSimpleVO subjectSimpleVO = new SubjectSimpleVO();
BeanUtils.copyProperties(subjectVO, subjectSimpleVO); BeanUtils.copyProperties(subjectVO, subjectSimpleVO);
subjectSimpleService.editSubject(subjectSimpleVO); subjectSimpleService.editExternalSubject(subjectSimpleVO);
return Result.OK(); return Result.OK();
} }
...@@ -243,7 +245,7 @@ public class ExternalController { ...@@ -243,7 +245,7 @@ public class ExternalController {
.eq(ExternalSubjectInfoSourceMap::getType, 1); .eq(ExternalSubjectInfoSourceMap::getType, 1);
subjectInfoVO.setInfoSourceList(externalSubjectInfoSourceMapService.list(queryWrapper)); subjectInfoVO.setInfoSourceList(externalSubjectInfoSourceMapService.list(queryWrapper));
try { try {
HttpUtil.doPost("http://192.168.1.135:9000/put_keyword", JSONObject.from(subjectInfoVO), 30000); HttpUtil.doPost(keywordCrawlerUrl, JSONObject.from(subjectInfoVO), 30000);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -23,6 +23,15 @@ public interface SubjectSimpleService { ...@@ -23,6 +23,15 @@ public interface SubjectSimpleService {
Subject createSubject(SubjectSimpleVO subjectSimpleVO); Subject createSubject(SubjectSimpleVO subjectSimpleVO);
/** /**
* 新增专题-对外【自定义专题地址】
*
* @param subjectSimpleVO 参数
* @author lkg
* @date 2025/1/14
*/
Subject createExternalSubject(SubjectSimpleVO subjectSimpleVO);
/**
* 专题配置校验 * 专题配置校验
* *
* @param subjectParamsCheckVO 参数 * @param subjectParamsCheckVO 参数
...@@ -41,6 +50,15 @@ public interface SubjectSimpleService { ...@@ -41,6 +50,15 @@ public interface SubjectSimpleService {
void editSubject(SubjectSimpleVO subjectSimpleVO); void editSubject(SubjectSimpleVO subjectSimpleVO);
/** /**
* 编辑专题
*
* @param subjectSimpleVO 参数
* @author lkg
* @date 2025/1/14
*/
void editExternalSubject(SubjectSimpleVO subjectSimpleVO);
/**
* 专题绑定关键词信息 * 专题绑定关键词信息
* *
* @param subjectId 专题id * @param subjectId 专题id
......
...@@ -139,6 +139,29 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -139,6 +139,29 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
return subject; return subject;
} }
@Override
public Subject createExternalSubject(SubjectSimpleVO subjectSimpleVO) {
SubjectPage subjectPage = new SubjectPage();
BeanUtils.copyProperties(subjectSimpleVO, subjectPage);
subjectPage.setProjectId("1955112691539480577");
Subject subject = saveMain(subjectPage);
String subjectId = subject.getId();
//关键词绑定
List<SearchWordVO> keywords = subjectSimpleVO.getKeywords();
if (CollectionUtils.isNotEmpty(keywords)) {
modifyKeyword(subjectId, subject.getSubjectName(), keywords);
//同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectId);
//默认绑定tpu流程
ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap();
tpu.setSubjectId(subject.getId());
tpu.setArrangeId("1955564099203072002");
tpu.setType("baseDateToSubject");
clbModelArrangeSubjectMapService.save(tpu);
}
return subject;
}
public Subject saveMain(SubjectPage subjectPage) { public Subject saveMain(SubjectPage subjectPage) {
Subject subject = new Subject(); Subject subject = new Subject();
//事件专题的默认分析规则参数-必填 //事件专题的默认分析规则参数-必填
...@@ -358,6 +381,21 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -358,6 +381,21 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
} }
@Override @Override
public void editExternalSubject(SubjectSimpleVO subjectSimpleVO) {
SubjectPage subjectPage = new SubjectPage();
BeanUtils.copyProperties(subjectSimpleVO, subjectPage);
subjectPage.setProjectId("1955112691539480577");
subjectService.updateMain(subjectPage);
//关键词绑定
List<SearchWordVO> keywords = subjectSimpleVO.getKeywords();
if (CollectionUtils.isNotEmpty(keywords)) {
modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords);
//同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectSimpleVO.getId());
}
}
@Override
public List<SearchWordVO> subjectBindWordInfo(String subjectId) { public List<SearchWordVO> subjectBindWordInfo(String subjectId) {
List<SearchWordVO> wordInfoList = subjectKeywordsMapService.subjectBindWordInfo(subjectId); List<SearchWordVO> wordInfoList = subjectKeywordsMapService.subjectBindWordInfo(subjectId);
Map<String, SearchWordVO> map = wordInfoList.stream().collect(Collectors.toMap(SearchWordVO::getId, item -> item)); Map<String, SearchWordVO> map = wordInfoList.stream().collect(Collectors.toMap(SearchWordVO::getId, item -> item));
......
...@@ -173,6 +173,8 @@ caiji: ...@@ -173,6 +173,8 @@ caiji:
url: http://1.95.133.166:8823/baseSourceInfo/api/subject/infoSourceSave url: http://1.95.133.166:8823/baseSourceInfo/api/subject/infoSourceSave
allKeyWordsBind: allKeyWordsBind:
url: http://1.95.133.166:8823/baseSourceInfo/api/subject/keywordSave url: http://1.95.133.166:8823/baseSourceInfo/api/subject/keywordSave
keywordCrawler:
url: http://1.95.136.108:9010/put_keyword
projectCode: zzsn_prod projectCode: zzsn_prod
projectName: 克虏宝正式 projectName: 克虏宝正式
......
...@@ -179,3 +179,6 @@ infoSource: ...@@ -179,3 +179,6 @@ infoSource:
columnDetail: http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnDetail columnDetail: http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnDetail
ai-article: ai-article:
thematicColumnConfig-url: http://1.95.77.159:10089/reportManage/thematicInformationColumn/column/getThematicColumnConfig thematicColumnConfig-url: http://1.95.77.159:10089/reportManage/thematicInformationColumn/column/getThematicColumnConfig
caiji:
keywordCrawler:
url: http://1.95.136.108:9010/put_keyword
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论