|
@@ -2910,13 +2910,33 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
ProjectInfo project = projectClient.getById(dto.getProjectId() + "");
|
|
ProjectInfo project = projectClient.getById(dto.getProjectId() + "");
|
|
List<Long> longs = Func.toLongList(dto.getArchiveIds());
|
|
List<Long> longs = Func.toLongList(dto.getArchiveIds());
|
|
List<ArchivesAutoVO2> vo2s = baseMapper.getAllArchive(longs);
|
|
List<ArchivesAutoVO2> vo2s = baseMapper.getAllArchive(longs);
|
|
|
|
+ String pdfUrl = null;
|
|
try {
|
|
try {
|
|
- String pdfUrl = createAppPdf(project.getProjectName(),vo2s);
|
|
|
|
- task.setAttachmentPdfUrl(pdfUrl);
|
|
|
|
|
|
+ pdfUrl = createAppPdf(project.getProjectName(),vo2s);
|
|
|
|
+ if (StringUtils.isBlank(pdfUrl)){
|
|
|
|
+ throw new ServiceException("生成上报PDF失败");
|
|
|
|
+ }
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
throw new ServiceException(e.getMessage());
|
|
throw new ServiceException(e.getMessage());
|
|
}
|
|
}
|
|
//如果存在附件则拼接
|
|
//如果存在附件则拼接
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getAttachmentPdfUrl())){
|
|
|
|
+ String localFile = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveCheck/"+dto.getProjectId()+".pdf";
|
|
|
|
+ List<String> urlList = new ArrayList<>();
|
|
|
|
+ urlList.add(pdfUrl);
|
|
|
|
+ urlList.add(dto.getAttachmentPdfUrl());
|
|
|
|
+ FileUtils.mergePdfPublicMethods(urlList, localFile);
|
|
|
|
+ System.out.println("生成的pdf:"+pdfUrl);
|
|
|
|
+ System.out.println("附件的pdf:"+dto.getAttachmentPdfUrl());
|
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile( "123.pdf", localFile);
|
|
|
|
+ if (bladeFile == null || StringUtils.isBlank(bladeFile.getLink())){
|
|
|
|
+ throw new ServiceException("合并PDF失败");
|
|
|
|
+ }
|
|
|
|
+ System.out.println("合并的pdf:"+bladeFile.getLink());
|
|
|
|
+ task.setAttachmentPdfUrl(bladeFile.getLink());
|
|
|
|
+ }else {
|
|
|
|
+ task.setAttachmentPdfUrl(pdfUrl);
|
|
|
|
+ }
|
|
//保存任务
|
|
//保存任务
|
|
taskClient.saveTask(task);
|
|
taskClient.saveTask(task);
|
|
//根据任务人设置task_parallel
|
|
//根据任务人设置task_parallel
|