在线编辑pdf版本

This commit is contained in:
gaojiabao
2023-06-01 15:30:20 +08:00
parent b97a30b2c2
commit fb92e09a5e
5 changed files with 89 additions and 23 deletions
@@ -4895,28 +4895,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转换失败=================================");
}
}
}