合并分支 'dev_20230216' 到 'master'
Dev 20230216 查看合并请求 laws-foton-slrs/foton-slrs-system-rest!94
This commit is contained in:
+3
@@ -133,5 +133,8 @@ public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
|
||||
String selectByStandCode(String standCode);
|
||||
|
||||
SarBussionessStand selectByReplaceStandNum(String standCode);
|
||||
|
||||
@Select("select * from sar_bussioness_stand where TEXT_STATUS_BUSS is not null")
|
||||
List<SarBussionessStand> selectAllStandStatus();
|
||||
}
|
||||
|
||||
|
||||
+23
-19
@@ -4897,28 +4897,32 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
QueryWrapper<SarBussStandFile> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.eq("ORI_ATT_ID",fileId);
|
||||
objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
||||
objectQueryWrapper.ne("FILE_SUFFIX","pdf");
|
||||
objectQueryWrapper.ne("FILE_SUFFIX","PDF");
|
||||
objectQueryWrapper.eq("FILE_SUFFIX","docx");
|
||||
// objectQueryWrapper.ne("FILE_SUFFIX","pdf");
|
||||
// objectQueryWrapper.ne("FILE_SUFFIX","PDF");
|
||||
List<SarBussStandFile> sarBussStandFiles = sarBussStandFileEODao.selectList(objectQueryWrapper);
|
||||
// 为空暂不处理 不为空则意味pdf生成失败
|
||||
if(!sarBussStandFiles.isEmpty() && sarBussStandFiles.size()==1){
|
||||
// createStandFileAppend(\);
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(sarBussStandFiles.get(0).getOriAttId());
|
||||
String filePath = fileInfo.getFilePath() + fileInfo.getFileName();
|
||||
OtConvertMq convert = new OtConvertMq();
|
||||
convert.setLawsId(sarBussStandFiles.get(0).getStandId());
|
||||
convert.setAttId(fileInfo.getId());
|
||||
convert.setFilePath(filePath);
|
||||
convert.setAddOrUp("0");
|
||||
convert.setFileSuffix(fileInfo.getFileSuffix());
|
||||
convert.setStandFileClassify(sarBussStandFiles.get(0).getStandFileClassify());
|
||||
convert.setConvertType(SarTypeEnum.BUSINESS.getValue());
|
||||
if(elasflag) {
|
||||
try {
|
||||
convertMq.sendMQ(convert);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId());
|
||||
if(attFileVo!=null){
|
||||
SarBussStandFile sarBussStandFile = new SarBussStandFile();
|
||||
//sarBussStandFile.setId();
|
||||
String uuId = com.adc.da.util.utils.UUID.randomUUID(20);
|
||||
sarBussStandFile.setId(uuId);
|
||||
sarBussStandFile.setStandId(sarBussStandFiles.get(0).getStandId());
|
||||
sarBussStandFile.setStandFileClassify(sarBussStandFiles.get(0).getStandFileClassify());
|
||||
sarBussStandFile.setAttId(attFileVo.getId());
|
||||
sarBussStandFile.setFileName(filePath+attFileVo.getFilePath()+attFileVo.getFileName());
|
||||
sarBussStandFile.setFileSuffix(attFileVo.getFileSuffix());
|
||||
sarBussStandFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
sarBussStandFile.setPassword(sarBussStandFiles.get(0).getPassword());
|
||||
sarBussStandFile.setValidFlag(0);
|
||||
sarBussStandFile.setCreationTime(new Date());
|
||||
sarBussStandFile.setModifyTime(new Date());
|
||||
sarBussStandFile.setOriAttId(sarBussStandFiles.get(0).getOriAttId());
|
||||
sarBussStandFileEODao.insert(sarBussStandFile);
|
||||
}else {
|
||||
logger.info("======================================word.doc转换失败=================================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+112
@@ -4,10 +4,17 @@ import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandState;
|
||||
import com.adc.da.slrs.sarBussionessStandState.service.ISarBussionessStandStateService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.util.DateUtils;
|
||||
import com.adc.da.utils.util.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -37,6 +44,15 @@ public class StateSync {
|
||||
@Autowired
|
||||
private ISarBussionessStandStateService bussionessStandStateService;
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao sarStandardsInfoDao;
|
||||
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private ISarUpdLogService sarUpdLogEOService;
|
||||
|
||||
/**
|
||||
* 根据配置文件设置是否开启定时器
|
||||
*/
|
||||
@@ -270,4 +286,100 @@ public class StateSync {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 企业标准更新文本状态定时器
|
||||
*/
|
||||
@Scheduled(cron = "0 0 5 * * ?") //每天早晨五点执行
|
||||
public void timeSarBussionessStand(){
|
||||
if (isNotScheduled){
|
||||
logger.info("开始执行企业标准更新文本状态定时器");
|
||||
List<SarBussionessStand> list = sarBussionessStandDao.selectAllStandStatus();
|
||||
if (ObjectUtils.isNotEmpty(list) && list != null){
|
||||
for (SarBussionessStand sarBussionessStand : list){
|
||||
if (StringUtils.isNotBlank(sarBussionessStand.getReplaceStandNum()) && sarBussionessStand != null){
|
||||
SarBussionessStand sarBussionessStand2 = sarBussionessStandDao.selectByReplaceStandNum(sarBussionessStand.getReplaceStandNum());
|
||||
//9z741h2m3j 有效,3lqnlgmgcn 作废
|
||||
if (sarBussionessStand2 != null && (sarBussionessStand.getTextStatusBuss().equals("9z741h2m3j")|| sarBussionessStand.getTextStatusBuss().equals("3lqnlgmgcn"))){
|
||||
sarBussionessStand2.setTextStatusBuss("3lqnlgmgcn");
|
||||
sarBussionessStandDao.updateById(sarBussionessStand2);
|
||||
logger.info("修改企业标准文本状态完成,修改的企业标准id为:" + sarBussionessStand2.getId() + ",企标名称为:" + sarBussionessStand2.getStandName() + ",企标编号为:" + sarBussionessStand2.getStandCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 国内外标准更新文本状态定时器
|
||||
*/
|
||||
@Scheduled(cron = "0 0 5 * * ?") //每天早晨五点执行
|
||||
public void timeSarStandardsInfo()throws Exception{
|
||||
if (isNotScheduled){
|
||||
logger.info("开始执行国内外标准更新文本状态定时器");
|
||||
List<SarStandardsInfo> sarStandardsInfoEOs = sarStandardsInfoDao.getSarStandardsInfo();
|
||||
if (ObjectUtils.isNotEmpty(sarStandardsInfoEOs) && sarStandardsInfoEOs != null) {
|
||||
for (SarStandardsInfo sarStandardsInfoEO : sarStandardsInfoEOs) {
|
||||
if (sarStandardsInfoEO != null && ObjectUtils.isNotEmpty(sarStandardsInfoEO)) {
|
||||
SarStandAttrInfo sarStandAttrInfo = sarStandAttrInfoEODao.getSarStandAttrInfo(sarStandardsInfoEO.getId());
|
||||
if (sarStandAttrInfo != null && ObjectUtils.isNotEmpty(sarStandAttrInfo)){
|
||||
sarStandardsInfoEO.setReplacedStandNum(sarStandAttrInfo.getDtbjh());
|
||||
}
|
||||
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(sarStandardsInfoEO.getReplaceStandNum())){
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfoEO);
|
||||
String id = sarStandardsInfoEO.getId();
|
||||
List<SarStandardsInfo> sarStandardsInfos = sarStandardsInfoDao.selectBy(id);
|
||||
if (ObjectUtils.isNotEmpty(sarStandardsInfos) && sarStandardsInfos != null){
|
||||
for (SarStandardsInfo sarStandardsInfo:sarStandardsInfos){
|
||||
if (sarStandardsInfo != null && sarStandardsInfo.getStandSort().equals("GB") && (sarStandardsInfoEO.getTextStatus().equals("vsaga7nwub") || sarStandardsInfoEO.getTextStatus().equals("chblaarg77") || sarStandardsInfoEO.getTextStatus().equals("qke0ckro2p"))){
|
||||
String textStatus = "chblaarg77";
|
||||
sarStandardsInfo.setTextStatus(textStatus);
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||
logger.info("原标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成废止状态");
|
||||
|
||||
String content = "标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成废止状态";
|
||||
sarUpdLogEOService.createBaseLog(sarStandardsInfo.getId(), sarStandardsInfo.getStandType() + "_STAND", content);
|
||||
}else if (sarStandardsInfo != null && (sarStandardsInfoEO.getTextStatus().equals("vsaga7nwub") || sarStandardsInfoEO.getTextStatus().equals("chblaarg77") || sarStandardsInfoEO.getTextStatus().equals("qke0ckro2p"))){
|
||||
String textStatus = "qke0ckro2p";
|
||||
sarStandardsInfo.setTextStatus(textStatus);
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||
logger.info("原标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成被代替状态");
|
||||
|
||||
String content = "标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成被代替状态";
|
||||
sarUpdLogEOService.createBaseLog(sarStandardsInfo.getId(), sarStandardsInfo.getStandType() + "_STAND", content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<SarStandardsInfo> sarStandardsInfo1s = sarStandardsInfoDao.selectBy1(id);
|
||||
if (ObjectUtils.isNotEmpty(sarStandardsInfo1s) && sarStandardsInfo1s != null){
|
||||
for (SarStandardsInfo sarStandardsInfo1 : sarStandardsInfo1s){
|
||||
if (sarStandardsInfo1 != null && sarStandardsInfo1.getStandSort().equals("GB") && (sarStandardsInfoEO.getTextStatus().equals("vsaga7nwub") || sarStandardsInfoEO.getTextStatus().equals("chblaarg77") || sarStandardsInfoEO.getTextStatus().equals("qke0ckro2p"))){
|
||||
String textStatus = "chblaarg77";
|
||||
sarStandardsInfo1.setTextStatus(textStatus);
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo1);
|
||||
logger.info("原标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成废止状态");
|
||||
|
||||
String content = "标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成废止状态";
|
||||
sarUpdLogEOService.createBaseLog(sarStandardsInfo1.getId(), sarStandardsInfo1.getStandType() + "_STAND", content);
|
||||
}else if (sarStandardsInfo1 != null && (sarStandardsInfoEO.getTextStatus().equals("vsaga7nwub") || sarStandardsInfoEO.getTextStatus().equals("chblaarg77") || sarStandardsInfoEO.getTextStatus().equals("qke0ckro2p"))){
|
||||
String textStatus = "qke0ckro2p";
|
||||
sarStandardsInfo1.setTextStatus(textStatus);
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo1);
|
||||
logger.info("原标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成被代替状态");
|
||||
|
||||
String content = "标准号:"+ sarStandardsInfoEO.getReplaceStandNum() +"被代替标准号变更成被代替状态";
|
||||
sarUpdLogEOService.createBaseLog(sarStandardsInfo1.getId(), sarStandardsInfo1.getStandType() + "_STAND", content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -102,4 +102,10 @@ public class QualityEvaluationController extends BaseController<QualityEvaluatio
|
||||
|
||||
return Result.success(score);
|
||||
}
|
||||
|
||||
@ApiOperation("存在重新技术委员会评审、评审意见修改时将技术委员会评审、评审意见修改的评分更新成0")
|
||||
@PostMapping("/updateQualityEvaluation")
|
||||
public ResponseMessage<QualityEvaluation> updateQualityEvaluation(){
|
||||
return iQualityEvaluationService.updateQualityEvaluation();
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,4 +38,7 @@ public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
||||
List<Integer> selectBZSH(@Param("node") String node,@Param("lawId") String lawId);
|
||||
|
||||
void updateByProcessNode(@Param("lawId") String lawId);
|
||||
|
||||
@Select("select * from quality_evaluation")
|
||||
List<QualityEvaluation> selectAll();
|
||||
}
|
||||
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -27,4 +28,6 @@ public interface IQualityEvaluationService extends IService<QualityEvaluation> {
|
||||
|
||||
|
||||
Map<String, Double> getScore(String lawId);
|
||||
|
||||
ResponseMessage<QualityEvaluation> updateQualityEvaluation();
|
||||
}
|
||||
|
||||
+31
@@ -1,5 +1,7 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
@@ -12,6 +14,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections.IterableMap;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -279,6 +282,34 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 存在重新技术委员会评审、评审意见修改时将技术委员会评审、评审意见修改的评分更新成0
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<QualityEvaluation> updateQualityEvaluation() {
|
||||
QualityEvaluation qualityEvaluation = new QualityEvaluation();
|
||||
//先查询数据库取出所有数据
|
||||
List<QualityEvaluation> list = qualityEvaluationDao.selectAll();
|
||||
Integer count = 0;
|
||||
//校验list不为空时将获取到的数据进行循环遍历
|
||||
if (ObjectUtils.isNotEmpty(list) && list != null){
|
||||
for (QualityEvaluation qualityEvaluation1 : list){
|
||||
if (qualityEvaluation1.getLawId() != null && !qualityEvaluation1.getLawId().equals("") && qualityEvaluation1.getProcessNode() != null && !qualityEvaluation1.getProcessNode().equals("")){
|
||||
qualityEvaluation.setLawId(qualityEvaluation1.getLawId());
|
||||
qualityEvaluation.setProcessNode(qualityEvaluation1.getProcessNode());
|
||||
if (qualityEvaluation.getProcessNode().equals("重新技术委员会评审、评审意见修改")){
|
||||
qualityEvaluationDao.updateByProcessNode(qualityEvaluation.getLawId());
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return Result.error("list集合为空");
|
||||
}
|
||||
return Result.success("0","更新技术委员会评审、评审意见修改为空已完成,共修改" + count + "条数据");
|
||||
}
|
||||
|
||||
|
||||
// private Double getScoreSingle(QualityEvaluation item){
|
||||
//
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
-- 福田 需要通过第三方调用的接口
|
||||
|
||||
--2023-06-01 09:41
|
||||
--名称 存在重新技术委员会评审、评审意见修改时将技术委员会评审、评审意见修改的评分更新成0
|
||||
--详情
|
||||
--路径 http://localhost:9090/api//sarEnterpriseStandardEvaluation/quality-evaluation/updateQualityEvaluation
|
||||
--参数
|
||||
--类型 post
|
||||
|
||||
|
||||
--2023-05-05 10:18
|
||||
--名称 海外标准文件名称 包含 中,CN/cn 译 的放置译文处
|
||||
--详情
|
||||
|
||||
@@ -22,6 +22,17 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.documents4j</groupId>
|
||||
<artifactId>documents4j-local</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.documents4j</groupId>
|
||||
<artifactId>documents4j-transformer-msoffice-word</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
|
||||
@@ -761,4 +761,11 @@ public class AttFileEOController {
|
||||
return Result.success(attFileEO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "word转换pdf")
|
||||
@GetMapping("/wordConversionFilePdf")
|
||||
public ResponseMessage<AttFileVo> wordConversionFilePdf(@Param("fileId") String fileId) {
|
||||
AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(fileId);
|
||||
return Result.success(attFileVo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,4 +34,6 @@ public interface IAttFileEOService extends IService<AttFileEO> {
|
||||
void downLoadFileList(List<AttFileEO> multiFileInfos, String fileNowPath) throws IOException;
|
||||
|
||||
void deleteById(String id);
|
||||
|
||||
AttFileVo wordConversionFilePdf(String fileId);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import com.adc.da.sys.constant.ValidFlagEnum;
|
||||
import com.adc.da.util.FileUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.documents4j.api.DocumentType;
|
||||
import com.documents4j.api.IConverter;
|
||||
import com.documents4j.job.LocalConverter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -19,10 +22,7 @@ import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
@Service("attFileEOService")
|
||||
@@ -594,5 +594,47 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
||||
return attFileVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttFileVo wordConversionFilePdf(String fileId) {
|
||||
String src = "/data/slrs/file";
|
||||
AttFileEO fileInfo = getFileInfo(fileId);
|
||||
AttFileVo attFileVoPdf = null;
|
||||
if(fileInfo != null){
|
||||
File fileWord = new File(src+fileInfo.getFilePath()+fileInfo.getFileName());
|
||||
AttFileVo attFileVo = saveFileInfo(fileWord);
|
||||
// 保存后 开始转换为 pdf版本
|
||||
File inputWord = new File(src+attFileVo.getFilePath()+attFileVo.getFileName());
|
||||
String filePdfName = "";
|
||||
if(StringUtils.isNotBlank(attFileVo.getFileName())){
|
||||
String[] split = attFileVo.getFileName().split("\\.");
|
||||
filePdfName = split[0]+".pdf";
|
||||
}
|
||||
File outputFile = new File(src+fileInfo.getFilePath(),filePdfName);
|
||||
try {
|
||||
InputStream docxInputStream = new FileInputStream(inputWord);
|
||||
OutputStream outputStream = new FileOutputStream(outputFile);
|
||||
IConverter converter = LocalConverter.builder().build();
|
||||
converter.convert(docxInputStream).as(DocumentType.DOCX).to(outputStream).as(DocumentType.PDF).execute();
|
||||
outputStream.close();
|
||||
// 合法存入当前文件
|
||||
if(outputFile.exists()){
|
||||
logger.info("==================================word.docx转换成功========================");
|
||||
attFileVoPdf = saveFileInfo(outputFile);
|
||||
//存入成功以后 删除word 版本
|
||||
if(attFileVoPdf != null) {
|
||||
if (inputWord.exists()) {
|
||||
inputWord.delete();
|
||||
deleteById(attFileVo.getId());
|
||||
logger.info("==================================word.docx删除成功========================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return attFileVoPdf;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user