合并分支 'dev_20230216' 到 'master'
Dev 20230216 查看合并请求 laws-foton-slrs/foton-slrs-system-rest!96
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ public class SarBussStandFileController extends BaseController<SarBussStandFile>
|
|||||||
@ApiOperation(value = "|SarBussStandFileEO|批量修改加密文件不能打开问题")
|
@ApiOperation(value = "|SarBussStandFileEO|批量修改加密文件不能打开问题")
|
||||||
@GetMapping("/batchUpdateSarBussFile")
|
@GetMapping("/batchUpdateSarBussFile")
|
||||||
/*@RequiresPermissions("lawss:sarLawsFile:list")*/
|
/*@RequiresPermissions("lawss:sarLawsFile:list")*/
|
||||||
public ResponseMessage<SarBussStandFile> batchUpdateSarBussFile() throws Exception {
|
public ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFile() throws Exception {
|
||||||
return sarBussStandFileEOService.batchUpdateSarBussFile();
|
return sarBussStandFileEOService.batchUpdateSarBussFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -18,5 +18,5 @@ public interface ISarBussStandFileService extends IService<SarBussStandFile> {
|
|||||||
|
|
||||||
List<SarBussStandFile> selectFileByAttId(String attId) throws Exception;
|
List<SarBussStandFile> selectFileByAttId(String attId) throws Exception;
|
||||||
|
|
||||||
ResponseMessage<SarBussStandFile> batchUpdateSarBussFile();
|
ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFile();
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-14
@@ -49,30 +49,25 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseMessage<SarBussStandFile> batchUpdateSarBussFile() {
|
public ResponseMessage<List<SarBussStandFile>> batchUpdateSarBussFile() {
|
||||||
List<SarBussStandFile> objects = new ArrayList<>();
|
List<SarBussStandFile> objects = new ArrayList<>();
|
||||||
|
|
||||||
QueryWrapper<SarBussStandFile> objectQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<SarBussStandFile> objectQueryWrapper = new QueryWrapper<>();
|
||||||
objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
||||||
// objectQueryWrapper.eq("FILE_SUFFIX","docx");
|
|
||||||
objectQueryWrapper.ne("FILE_SUFFIX","pdf");
|
objectQueryWrapper.ne("FILE_SUFFIX","pdf");
|
||||||
objectQueryWrapper.ne("FILE_SUFFIX","PDF");
|
objectQueryWrapper.ne("FILE_SUFFIX","PDF");
|
||||||
|
objectQueryWrapper.ne("FILE_SUFFIX","xls");
|
||||||
|
objectQueryWrapper.ne("FILE_SUFFIX","XLS");
|
||||||
List<SarBussStandFile> sarBussStandFiles = sarStandFileEODao.selectList(objectQueryWrapper);
|
List<SarBussStandFile> sarBussStandFiles = sarStandFileEODao.selectList(objectQueryWrapper);
|
||||||
if(!sarBussStandFiles.isEmpty()){
|
if(!sarBussStandFiles.isEmpty()){
|
||||||
for (SarBussStandFile data: sarBussStandFiles){
|
for (SarBussStandFile data: sarBussStandFiles){
|
||||||
|
|
||||||
QueryWrapper<SarBussStandFile> objectQueryWrapperSarBussStandFile = new QueryWrapper<>();
|
QueryWrapper<SarBussStandFile> objectQueryWrapperSarBussStandFile = new QueryWrapper<>();
|
||||||
objectQueryWrapperSarBussStandFile.eq("USE_MODEL","SOURCE_FILE");
|
|
||||||
objectQueryWrapperSarBussStandFile.eq("ORI_ATT_ID",data.getOriAttId());
|
objectQueryWrapperSarBussStandFile.eq("ORI_ATT_ID",data.getOriAttId());
|
||||||
// objectQueryWrapper.eq("FILE_SUFFIX","docx");
|
objectQueryWrapperSarBussStandFile.eq("USE_MODEL","WEB_FILE");
|
||||||
objectQueryWrapperSarBussStandFile.ne("FILE_SUFFIX","pdf");
|
List<SarBussStandFile> sarBussStandFilesList = sarStandFileEODao.selectList(objectQueryWrapperSarBussStandFile);
|
||||||
objectQueryWrapperSarBussStandFile.ne("FILE_SUFFIX","PDF");
|
if(sarBussStandFilesList.isEmpty() && sarBussStandFilesList.size()==0){
|
||||||
List<SarBussStandFile> sarBussStandFilesList = sarStandFileEODao.selectList(objectQueryWrapper);
|
|
||||||
if(!sarBussStandFilesList.isEmpty() && sarBussStandFilesList.size()==1){
|
|
||||||
AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(data.getOriAttId());
|
AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(data.getOriAttId());
|
||||||
if(attFileVo!=null){
|
if(attFileVo!=null){
|
||||||
SarBussStandFile sarBussStandFile = new SarBussStandFile();
|
SarBussStandFile sarBussStandFile = new SarBussStandFile();
|
||||||
//sarBussStandFile.setId();
|
|
||||||
String uuId = com.adc.da.util.utils.UUID.randomUUID(20);
|
String uuId = com.adc.da.util.utils.UUID.randomUUID(20);
|
||||||
sarBussStandFile.setId(uuId);
|
sarBussStandFile.setId(uuId);
|
||||||
sarBussStandFile.setStandId(data.getStandId());
|
sarBussStandFile.setStandId(data.getStandId());
|
||||||
@@ -88,14 +83,14 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
|
|||||||
sarBussStandFile.setOriAttId(data.getOriAttId());
|
sarBussStandFile.setOriAttId(data.getOriAttId());
|
||||||
objects.add(sarBussStandFile);
|
objects.add(sarBussStandFile);
|
||||||
sarStandFileEODao.insert(sarBussStandFile);
|
sarStandFileEODao.insert(sarBussStandFile);
|
||||||
logger.info("======================================正在转换=================================");
|
logger.info("======================================文件正在转换=================================");
|
||||||
}else {
|
}else {
|
||||||
logger.info("======================================word.doc转换失败=================================");
|
logger.info("======================================word.doc文件转换失败 数据为空=================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("======================================转换完成================================="+objects.toString());
|
logger.info("======================================转换完成================================="+objects.toString());
|
||||||
return Result.success();
|
return Result.success(objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -4898,15 +4898,13 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
objectQueryWrapper.eq("ORI_ATT_ID",fileId);
|
objectQueryWrapper.eq("ORI_ATT_ID",fileId);
|
||||||
objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
objectQueryWrapper.eq("USE_MODEL","SOURCE_FILE");
|
||||||
objectQueryWrapper.eq("FILE_SUFFIX","docx");
|
objectQueryWrapper.eq("FILE_SUFFIX","docx");
|
||||||
// objectQueryWrapper.ne("FILE_SUFFIX","pdf");
|
|
||||||
// objectQueryWrapper.ne("FILE_SUFFIX","PDF");
|
|
||||||
List<SarBussStandFile> sarBussStandFiles = sarBussStandFileEODao.selectList(objectQueryWrapper);
|
List<SarBussStandFile> sarBussStandFiles = sarBussStandFileEODao.selectList(objectQueryWrapper);
|
||||||
// 为空暂不处理 不为空则意味pdf生成失败
|
|
||||||
if(!sarBussStandFiles.isEmpty()) {
|
if(!sarBussStandFiles.isEmpty()) {
|
||||||
QueryWrapper<SarBussStandFile> objectQueryWrapperSarBussStandFile = new QueryWrapper<>();
|
QueryWrapper<SarBussStandFile> objectQueryWrapperSarBussStandFile = new QueryWrapper<>();
|
||||||
objectQueryWrapperSarBussStandFile.eq("ORI_ATT_ID", sarBussStandFiles.get(0).getOriAttId());
|
objectQueryWrapperSarBussStandFile.eq("ORI_ATT_ID", sarBussStandFiles.get(0).getOriAttId());
|
||||||
|
objectQueryWrapperSarBussStandFile.eq("USE_MODEL", "WEB_FILE");
|
||||||
List<SarBussStandFile> sarBussStandFilesList = sarBussStandFileEODao.selectList(objectQueryWrapperSarBussStandFile);
|
List<SarBussStandFile> sarBussStandFilesList = sarBussStandFileEODao.selectList(objectQueryWrapperSarBussStandFile);
|
||||||
if(!sarBussStandFilesList.isEmpty() && sarBussStandFilesList.size()==1){
|
if(sarBussStandFilesList.isEmpty() && sarBussStandFilesList.size()==0){
|
||||||
AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId());
|
AttFileVo attFileVo = attFileEOService.wordConversionFilePdf(sarBussStandFiles.get(0).getOriAttId());
|
||||||
if(attFileVo!=null){
|
if(attFileVo!=null){
|
||||||
SarBussStandFile sarBussStandFile = new SarBussStandFile();
|
SarBussStandFile sarBussStandFile = new SarBussStandFile();
|
||||||
|
|||||||
@@ -601,15 +601,19 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
|||||||
AttFileVo attFileVoPdf = null;
|
AttFileVo attFileVoPdf = null;
|
||||||
if(fileInfo != null){
|
if(fileInfo != null){
|
||||||
File fileWord = new File(src+fileInfo.getFilePath()+fileInfo.getFileName());
|
File fileWord = new File(src+fileInfo.getFilePath()+fileInfo.getFileName());
|
||||||
|
logger.info("==================================fileWord文件路径========================"+src+fileInfo.getFilePath()+fileInfo.getFileName());
|
||||||
AttFileVo attFileVo = saveFileInfo(fileWord);
|
AttFileVo attFileVo = saveFileInfo(fileWord);
|
||||||
// 保存后 开始转换为 pdf版本
|
// 保存后 开始转换为 pdf版本
|
||||||
File inputWord = new File(src+attFileVo.getFilePath()+attFileVo.getFileName());
|
File inputWord = new File(src+attFileVo.getFilePath()+attFileVo.getFileName());
|
||||||
|
logger.info("==================================inputWord文件路径========================"+src+attFileVo.getFilePath()+attFileVo.getFileName());
|
||||||
String filePdfName = "";
|
String filePdfName = "";
|
||||||
if(StringUtils.isNotBlank(attFileVo.getFileName())){
|
if(StringUtils.isNotBlank(attFileVo.getFileName())){
|
||||||
String[] split = attFileVo.getFileName().split("\\.");
|
String[] split = attFileVo.getFileName().split("\\.");
|
||||||
filePdfName = split[0]+".pdf";
|
filePdfName = split[0]+".pdf";
|
||||||
}
|
}
|
||||||
File outputFile = new File(src+fileInfo.getFilePath(),filePdfName);
|
File outputFile = new File(src+fileInfo.getFilePath()+filePdfName);
|
||||||
|
logger.info("==================================outputFile文件路径========================"+src+fileInfo.getFilePath()+filePdfName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
InputStream docxInputStream = new FileInputStream(inputWord);
|
InputStream docxInputStream = new FileInputStream(inputWord);
|
||||||
OutputStream outputStream = new FileOutputStream(outputFile);
|
OutputStream outputStream = new FileOutputStream(outputFile);
|
||||||
@@ -627,6 +631,10 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
|||||||
deleteById(attFileVo.getId());
|
deleteById(attFileVo.getId());
|
||||||
logger.info("==================================word.docx删除成功========================");
|
logger.info("==================================word.docx删除成功========================");
|
||||||
}
|
}
|
||||||
|
if (outputFile.exists()) {
|
||||||
|
outputFile.delete();
|
||||||
|
logger.info("==================================word.pdf删除成功========================");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user