提交 6d6dff7d 作者: 925993793@qq.com

定制专题采集推送逻辑优化、导出pdf方法

上级 c01035b0
...@@ -10,6 +10,7 @@ import com.alibaba.fastjson2.JSONObject; ...@@ -10,6 +10,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.obs.services.model.PutObjectResult;
import com.zzsn.event.constant.Constants; import com.zzsn.event.constant.Constants;
import com.zzsn.event.constant.Result; import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.*; import com.zzsn.event.entity.*;
...@@ -17,28 +18,30 @@ import com.zzsn.event.enums.AnalysisColumnEnum; ...@@ -17,28 +18,30 @@ import com.zzsn.event.enums.AnalysisColumnEnum;
import com.zzsn.event.es.EsService; import com.zzsn.event.es.EsService;
import com.zzsn.event.service.*; import com.zzsn.event.service.*;
import com.zzsn.event.util.CalculateUtil; import com.zzsn.event.util.CalculateUtil;
import com.zzsn.event.util.DocUtil;
import com.zzsn.event.util.ObsUtil;
import com.zzsn.event.util.RedisUtil; import com.zzsn.event.util.RedisUtil;
import com.zzsn.event.util.user.UserUtil; import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo; import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.CoOccurrenceVO; import com.zzsn.event.vo.CoOccurrenceVO;
import com.zzsn.event.vo.CountVO; import com.zzsn.event.vo.CountVO;
import com.zzsn.event.vo.EventViewVO; import com.zzsn.event.vo.EventViewVO;
import com.zzsn.event.vo.es.Doc;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.*;
import java.io.PrintWriter;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -78,6 +81,8 @@ public class EventAnalysisController { ...@@ -78,6 +81,8 @@ public class EventAnalysisController {
private CommonService commonService; private CommonService commonService;
@Autowired @Autowired
private IEventService eventService; private IEventService eventService;
@Autowired
private ObsUtil obsUtil;
/** /**
...@@ -786,6 +791,52 @@ public class EventAnalysisController { ...@@ -786,6 +791,52 @@ public class EventAnalysisController {
/** /**
* 导出PDF
*
* @param request
* @param response
* @author lkg
* @date 2025/8/19
*/
@PostMapping(value = "/exportPDF", consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public void exportPdf(HttpServletRequest request,HttpServletResponse response) {
try {
InputStream inputStream = request.getInputStream();
String content = DocUtil.convertDocStream2Html(inputStream);
byte[] pdfBytes = DocUtil.convertDocHtml2Pdf(content);
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
ByteArrayInputStream byteInputStream = new ByteArrayInputStream(pdfBytes);
try {
OutputStream outs = response.getOutputStream();
bos = new BufferedOutputStream(outs);
bis = new BufferedInputStream(byteInputStream);
int i;
while ((i = bis.read(pdfBytes)) != -1) {
bos.write(pdfBytes, 0, i);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (bos != null) {
bos.flush();
bos.close();
}
if (bis != null) {
bis.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 导出ppt * 导出ppt
* *
* @param params 参数 * @param params 参数
......
...@@ -241,7 +241,7 @@ public class EventManageController { ...@@ -241,7 +241,7 @@ public class EventManageController {
} }
try { try {
configurationMessageService.bindInfoSourceSend(event.getId()); configurationMessageService.bindInfoSourceSend(event.getId());
configurationMessageService.bindKeyWordsSend(event.getId()); configurationMessageService.bindKeyWordsSend(event.getId(),null);
configurationMessageService.subjectEnterpriseSourceSync(event.getId()); configurationMessageService.subjectEnterpriseSourceSync(event.getId());
configurationMessageService.subjectPolicySourceSync(event.getId()); configurationMessageService.subjectPolicySourceSync(event.getId());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -438,7 +438,7 @@ public class SubjectManageController { ...@@ -438,7 +438,7 @@ public class SubjectManageController {
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.bindInfoSourceSend(subject.getId());
configurationMessageService.bindKeyWordsSend(subject.getId()); configurationMessageService.bindKeyWordsSend(subject.getId(),null);
configurationMessageService.subjectEnterpriseSourceSync(subject.getId()); configurationMessageService.subjectEnterpriseSourceSync(subject.getId());
configurationMessageService.subjectPolicySourceSync(subject.getId()); configurationMessageService.subjectPolicySourceSync(subject.getId());
} }
...@@ -472,7 +472,7 @@ public class SubjectManageController { ...@@ -472,7 +472,7 @@ public class SubjectManageController {
log.info("专题状态同步采集{},index:{},total:{}", subject.getSubjectName(), i, list.size()); log.info("专题状态同步采集{},index:{},total:{}", subject.getSubjectName(), i, list.size());
if (subject.getStatus() != null && subject.getStatus() == 1) { if (subject.getStatus() != null && subject.getStatus() == 1) {
configurationMessageService.bindInfoSourceSend(subject.getId()); configurationMessageService.bindInfoSourceSend(subject.getId());
configurationMessageService.bindKeyWordsSend(subject.getId()); configurationMessageService.bindKeyWordsSend(subject.getId(),null);
caiJiCenterHttpService.subjectStatusEdit(subject.getStatus(), subject.getId()); caiJiCenterHttpService.subjectStatusEdit(subject.getStatus(), subject.getId());
configurationMessageService.subjectEnterpriseSourceSync(subject.getId()); configurationMessageService.subjectEnterpriseSourceSync(subject.getId());
log.info("专题配置信息同步采集成功:{}", subject.getSubjectName()); log.info("专题配置信息同步采集成功:{}", subject.getSubjectName());
...@@ -669,7 +669,7 @@ public class SubjectManageController { ...@@ -669,7 +669,7 @@ public class SubjectManageController {
public Result<?> keyWordsBindScope(@RequestBody SubjectKeywordsMap subjectKeywordsMap) { public Result<?> keyWordsBindScope(@RequestBody SubjectKeywordsMap subjectKeywordsMap) {
subjectKeywordsMapService.updateById(subjectKeywordsMap); subjectKeywordsMapService.updateById(subjectKeywordsMap);
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectKeywordsMap.getSubjectId()); configurationMessageService.bindKeyWordsSend(subjectKeywordsMap.getSubjectId(),null);
return Result.OK(); return Result.OK();
} }
......
package com.zzsn.event.controller.common; package com.zzsn.event.controller.common;
import cn.hutool.core.bean.BeanException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.constant.Result; import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.Event; import com.zzsn.event.entity.Event;
import com.zzsn.event.entity.EventAnalysisVersion;
import com.zzsn.event.entity.EventAnalysisVersionRecord;
import com.zzsn.event.entity.EventLlmConfig; import com.zzsn.event.entity.EventLlmConfig;
import com.zzsn.event.enums.AnalysisColumnEnum; import com.zzsn.event.enums.AnalysisColumnEnum;
import com.zzsn.event.service.*; import com.zzsn.event.service.AnalysisService;
import com.zzsn.event.util.DateUtil; import com.zzsn.event.service.EventAnalysisVersionRecordService;
import com.zzsn.event.service.EventLlmConfigService;
import com.zzsn.event.service.IEventService;
import com.zzsn.event.vo.EventLlmConfigModifyVO; import com.zzsn.event.vo.EventLlmConfigModifyVO;
import com.zzsn.event.vo.EventVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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.BeansException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture;
/** /**
* 大模型配置 * 大模型配置
...@@ -40,8 +33,6 @@ public class LLmConfigController { ...@@ -40,8 +33,6 @@ public class LLmConfigController {
@Autowired @Autowired
private AnalysisService analysisService; private AnalysisService analysisService;
@Autowired @Autowired
private EventAnalysisVersionService eventAnalysisVersionService;
@Autowired
private EventAnalysisVersionRecordService eventAnalysisVersionRecordService; private EventAnalysisVersionRecordService eventAnalysisVersionRecordService;
@Autowired @Autowired
private IEventService eventService; private IEventService eventService;
...@@ -85,31 +76,23 @@ public class LLmConfigController { ...@@ -85,31 +76,23 @@ public class LLmConfigController {
if (StringUtils.isEmpty(versionId)) { if (StringUtils.isEmpty(versionId)) {
return Result.FAIL("请选择要修改的版本"); return Result.FAIL("请选择要修改的版本");
} }
try { EventLlmConfig eventLlmConfig = new EventLlmConfig();
EventLlmConfig eventLlmConfig = new EventLlmConfig(); BeanUtils.copyProperties(eventLlmConfigModifyVO, eventLlmConfig);
BeanUtils.copyProperties(eventLlmConfigModifyVO, eventLlmConfig); llmConfigService.modifySingle(eventLlmConfig);
llmConfigService.modifySingle(eventLlmConfig); AnalysisColumnEnum analysisColumnEnum = AnalysisColumnEnum.getByCode(eventLlmConfig.getColumnCode());
AnalysisColumnEnum analysisColumnEnum = AnalysisColumnEnum.getByCode(eventLlmConfig.getColumnCode()); if (analysisColumnEnum != null) {
if (analysisColumnEnum != null) { String eventId = eventLlmConfig.getEventId();
String eventId = eventLlmConfig.getEventId(); Event event = eventService.getById(eventId);
Event event = eventService.getById(eventId); String eventName = event.getEventName();
String eventName = event.getEventName(); String content = "事件标题;" + eventName + "\n事件摘要:" + event.getEventDescribe();
String content = "事件标题;" + eventName + "\n事件摘要:" + event.getEventDescribe(); //调用大模型更细结果
//调用大模型更细结果 llmResult = analysisService.llmResult(eventId,content, null, null, eventLlmConfig.getColumnCode());
llmResult = analysisService.llmResult(eventId,content, null, null, eventLlmConfig.getColumnCode()); log.info("{}-事件分析【{}】重新生成逻辑完成。", eventName, analysisColumnEnum.getName());
log.info("{}-事件分析【{}】重新生成逻辑完成。", eventName, analysisColumnEnum.getName()); } else {
} else { log.info("未找到对应的事件栏目【{}】", eventLlmConfig.getColumnCode());
log.info("未找到对应的事件栏目【{}】", eventLlmConfig.getColumnCode());
}
//更新返回结果
String finalLlmResult = llmResult;
CompletableFuture.runAsync(() ->{
eventAnalysisVersionRecordService.modify(versionId, analysisColumnEnum, finalLlmResult);
});
} catch (Exception e) {
log.info("事件栏目【{}】,结果更新失败", eventLlmConfigModifyVO.getColumnCode());
e.printStackTrace();
} }
//更新返回结果
eventAnalysisVersionRecordService.modify(versionId, analysisColumnEnum, llmResult);
return Result.OK(llmResult); return Result.OK(llmResult);
} }
} }
...@@ -272,7 +272,7 @@ public class ExternalController { ...@@ -272,7 +272,7 @@ public class ExternalController {
* @author lkg * @author lkg
* @date 2025/8/12 * @date 2025/8/12
*/ */
@GetMapping("/pushToCaiji") //@GetMapping("/pushToCaiji")
public Result<?> pushToCaiji(@RequestParam String subjectId) { public Result<?> pushToCaiji(@RequestParam String subjectId) {
SubjectInfoVO subjectInfoVO = new SubjectInfoVO(); SubjectInfoVO subjectInfoVO = new SubjectInfoVO();
SubjectDetailVO subjectDetailVO = subjectSimpleService.queryInfo(subjectId); SubjectDetailVO subjectDetailVO = subjectSimpleService.queryInfo(subjectId);
...@@ -336,7 +336,7 @@ public class ExternalController { ...@@ -336,7 +336,7 @@ public class ExternalController {
* @author lkg * @author lkg
* @date 2025/8/16 * @date 2025/8/16
*/ */
@GetMapping("/getGatherSummary") //@GetMapping("/getGatherSummary")
public Result<?> getGatherSummary(@RequestParam String subjectId) { public Result<?> getGatherSummary(@RequestParam String subjectId) {
return Result.OK(redisUtil.get("GATHER_SUMMARY::" + subjectId)); return Result.OK(redisUtil.get("GATHER_SUMMARY::" + subjectId));
} }
......
...@@ -9,9 +9,12 @@ import cn.hutool.http.HttpRequest; ...@@ -9,9 +9,12 @@ import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.entity.*; import com.zzsn.event.entity.*;
import com.zzsn.event.enums.BindTypeEnum; import com.zzsn.event.enums.BindTypeEnum;
import com.zzsn.event.external.entity.ExternalSubjectInfoSourceMap;
import com.zzsn.event.external.service.ExternalSubjectInfoSourceMapService;
import com.zzsn.event.feign.api.RemoteModelService; import com.zzsn.event.feign.api.RemoteModelService;
import com.zzsn.event.mapper.SubjectAdditionMapper; import com.zzsn.event.mapper.SubjectAdditionMapper;
import com.zzsn.event.service.*; import com.zzsn.event.service.*;
...@@ -127,7 +130,10 @@ public class ConfigurationMessageService { ...@@ -127,7 +130,10 @@ public class ConfigurationMessageService {
@Autowired(required = false) @Autowired(required = false)
private RemoteModelService remoteModelService; private RemoteModelService remoteModelService;
public void bindKeyWordsSend(String subjectId) { @Autowired
private ExternalSubjectInfoSourceMapService externalSubjectInfoSourceMapService;
public void bindKeyWordsSend(String subjectId,Integer type) {
try { try {
remoteModelService.delSubjectCache(subjectId); remoteModelService.delSubjectCache(subjectId);
} catch (Exception e) { } catch (Exception e) {
...@@ -144,10 +150,10 @@ public class ConfigurationMessageService { ...@@ -144,10 +150,10 @@ public class ConfigurationMessageService {
String keyWordsParam; String keyWordsParam;
if (CollectionUtil.isEmpty(keyWordsPages)) { if (CollectionUtil.isEmpty(keyWordsPages)) {
log.info("专题未绑定采集词组,通知采集清空"); log.info("专题未绑定采集词组,通知采集清空");
keyWordsParam = getKeyWordsParam(byId, null, new ArrayList<>()); keyWordsParam = getKeyWordsParam(byId, null, new ArrayList<>(),type);
}else { }else {
List<KeyWords> keyWords = keyWordsService.listByIds(keyWordsPages.stream().map(KeyWordsPage::getId).collect(Collectors.toList())); List<KeyWords> keyWords = keyWordsService.listByIds(keyWordsPages.stream().map(KeyWordsPage::getId).collect(Collectors.toList()));
keyWordsParam = getKeyWordsParam(byId, null, keyWords); keyWordsParam = getKeyWordsParam(byId, null, keyWords,type);
} }
String post = caiJiCenterHttpService.allKeyWordsBindUrl(keyWordsParam); String post = caiJiCenterHttpService.allKeyWordsBindUrl(keyWordsParam);
...@@ -415,7 +421,7 @@ public class ConfigurationMessageService { ...@@ -415,7 +421,7 @@ public class ConfigurationMessageService {
return param; return param;
} }
private String getKeyWordsParam(Subject subject ,Integer option,List<KeyWords> keyWords) { private String getKeyWordsParam(Subject subject ,Integer option,List<KeyWords> keyWords,Integer type) {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
List<Map<String,Object>> kw = new ArrayList<>(); List<Map<String,Object>> kw = new ArrayList<>();
param.put("subjectSign",subject.getId()); param.put("subjectSign",subject.getId());
...@@ -423,6 +429,7 @@ public class ConfigurationMessageService { ...@@ -423,6 +429,7 @@ public class ConfigurationMessageService {
param.put("customerSign",caiJiCenterHttpService.getProjectCode()); param.put("customerSign",caiJiCenterHttpService.getProjectCode());
param.put("customerName",caiJiCenterHttpService.getProjectName()); param.put("customerName",caiJiCenterHttpService.getProjectName());
param.put("mode",option); param.put("mode",option);
param.put("type",type);
if (ObjectUtil.isNotNull(subject.getTimeEnable())) { if (ObjectUtil.isNotNull(subject.getTimeEnable())) {
param.put("startTime", DateUtil.format(subject.getTimeEnable(),"yyyy-MM-dd HH:mm:ss")); param.put("startTime", DateUtil.format(subject.getTimeEnable(),"yyyy-MM-dd HH:mm:ss"));
}else { }else {
...@@ -446,6 +453,13 @@ public class ConfigurationMessageService { ...@@ -446,6 +453,13 @@ public class ConfigurationMessageService {
kw.add(map); kw.add(map);
}); });
param.put("keywordList",kw); param.put("keywordList",kw);
if (type != null && type == 1) {
LambdaQueryWrapper<ExternalSubjectInfoSourceMap> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(ExternalSubjectInfoSourceMap::getSubjectId, subject.getId())
.eq(ExternalSubjectInfoSourceMap::getType, 1);
List<ExternalSubjectInfoSourceMap> sourceList = externalSubjectInfoSourceMapService.list(queryWrapper);
param.put("sourceList",sourceList);
}
return JSONUtil.toJsonStr(param); return JSONUtil.toJsonStr(param);
} }
......
...@@ -588,7 +588,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -588,7 +588,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
subjectKeywordsMapService.saveBatch(mapList); subjectKeywordsMapService.saveBatch(mapList);
} }
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectPage.getId()); configurationMessageService.bindKeyWordsSend(subjectPage.getId(),null);
} }
@Override @Override
...@@ -609,7 +609,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -609,7 +609,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}*/ }*/
} }
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectPage.getId()); configurationMessageService.bindKeyWordsSend(subjectPage.getId(),null);
} }
@Override @Override
......
...@@ -121,7 +121,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -121,7 +121,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
scoreModel.setData(defaultConfig); scoreModel.setData(defaultConfig);
scoreModelService.save(scoreModel); scoreModelService.save(scoreModel);
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectId); configurationMessageService.bindKeyWordsSend(subjectId,null);
//默认绑定tpu流程 //默认绑定tpu流程
List<ClbModelArrangeSubjectMap> tpuList = new ArrayList<>(); List<ClbModelArrangeSubjectMap> tpuList = new ArrayList<>();
ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap(); ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap();
...@@ -151,7 +151,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -151,7 +151,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
if (CollectionUtils.isNotEmpty(keywords)) { if (CollectionUtils.isNotEmpty(keywords)) {
modifyKeyword(subjectId, subject.getSubjectName(), keywords); modifyKeyword(subjectId, subject.getSubjectName(), keywords);
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectId); configurationMessageService.bindKeyWordsSend(subjectId,1);
//默认绑定tpu流程 //默认绑定tpu流程
ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap(); ClbModelArrangeSubjectMap tpu = new ClbModelArrangeSubjectMap();
tpu.setSubjectId(subject.getId()); tpu.setSubjectId(subject.getId());
...@@ -376,7 +376,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -376,7 +376,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
if (CollectionUtils.isNotEmpty(keywords)) { if (CollectionUtils.isNotEmpty(keywords)) {
modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords); modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords);
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectSimpleVO.getId()); configurationMessageService.bindKeyWordsSend(subjectSimpleVO.getId(),null);
} }
} }
...@@ -391,7 +391,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService { ...@@ -391,7 +391,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
if (CollectionUtils.isNotEmpty(keywords)) { if (CollectionUtils.isNotEmpty(keywords)) {
modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords); modifyKeyword(subjectSimpleVO.getId(), subjectSimpleVO.getSubjectName(), keywords);
//同步配置到采集 //同步配置到采集
configurationMessageService.bindKeyWordsSend(subjectSimpleVO.getId()); configurationMessageService.bindKeyWordsSend(subjectSimpleVO.getId(),1);
} }
} }
......
...@@ -105,4 +105,19 @@ public class DocUtil { ...@@ -105,4 +105,19 @@ public class DocUtil {
doc.save(dataByteArrayOutputStream, SaveFormat.DOCX); doc.save(dataByteArrayOutputStream, SaveFormat.DOCX);
return dataByteArrayOutputStream.getData(); return dataByteArrayOutputStream.getData();
} }
public static byte[] convertDocHtml2Pdf(String content) throws Exception {
getLicense();
if (SystemUtils.IS_OS_LINUX) {
FontSettings fontSettings = new FontSettings();
//true 表示递归查询子文件夹
fontSettings.setFontsFolder(fontsPath, true);
}
Document doc = new Document();
DataByteArrayOutputStream dataByteArrayOutputStream = new DataByteArrayOutputStream();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertHtml(content);
doc.save(dataByteArrayOutputStream, SaveFormat.PDF);
return dataByteArrayOutputStream.getData();
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论