|
@@ -475,6 +475,15 @@ public class ChenYuTestScheduled {
|
|
|
|
|
|
List<TrialCyThirdReport> reports = data.toJavaList(TrialCyThirdReport.class);
|
|
|
for (TrialCyThirdReport report : reports) {
|
|
|
+
|
|
|
+ List<String> urls = new ArrayList<>();
|
|
|
+ if (StringUtil.isNotBlank(report.getReportDocFilePath())) {
|
|
|
+ urls.add(report.getReportDocFilePath());
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(report.getRecordDocFilePath())) {
|
|
|
+ urls.add(report.getRecordDocFilePath());
|
|
|
+ }
|
|
|
+
|
|
|
Long id = SnowFlakeUtil.getId();
|
|
|
report.setPKeyId(id);
|
|
|
report.setContractId(contractId);
|
|
@@ -490,6 +499,10 @@ public class ChenYuTestScheduled {
|
|
|
accessories.forEach(f -> {
|
|
|
f.setId(SnowFlakeUtil.getId());
|
|
|
f.setReportId(id);
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(f.getFilePath())) {
|
|
|
+ urls.add(f.getFilePath());
|
|
|
+ }
|
|
|
});
|
|
|
//删除旧数据
|
|
|
if (CollectionUtil.isNotEmpty(ids)) {
|
|
@@ -499,10 +512,34 @@ public class ChenYuTestScheduled {
|
|
|
//添加新数据
|
|
|
trialCyAccessoriesService.saveBatch(accessories);
|
|
|
}
|
|
|
+
|
|
|
+ //组合文件
|
|
|
+ if (urls.size() > 0) {
|
|
|
+ //重新合并
|
|
|
+ String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String listPdf = filePath + "/pdf/" + id + ".pdf";
|
|
|
+ File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
+ if (tabPDF.exists()) {
|
|
|
+ tabPDF.delete();
|
|
|
+ }
|
|
|
+ FileUtils.mergePdfPublicMethods(urls, listPdf);
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", listPdf);
|
|
|
+ if (bladeFile != null) {
|
|
|
+ report.setAssembleFile(bladeFile.getLink());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
//删除旧数据
|
|
|
if (CollectionUtil.isNotEmpty(ids)) {
|
|
|
trialCyThirdReportService.removeBatchByIds(ids);
|
|
|
+ List<String> fileUrls = list.stream().map(TrialCyThirdReport::getAssembleFile).filter(StringUtil::isNotBlank).collect(Collectors.toList());
|
|
|
+ if(CollectionUtil.isNotEmpty(fileUrls)){
|
|
|
+ //删除组合文件
|
|
|
+ fileUrls.forEach(f -> {
|
|
|
+ String pdfName = f.split("upload")[1];
|
|
|
+ this.newIOSSClient.removeFile("upload" + pdfName);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//添加新数据
|