|
|
@@ -4856,31 +4856,32 @@ public class TaskController extends BladeController {
|
|
|
reportResults=formulaClient.formulaExecute4(report.getId(),report.getContractId(),report.getPeriodId(),report.getType(),report.getProjectId());
|
|
|
/*合并所有表*/
|
|
|
String file_path = CollectionUtils.getSysLocalFileUrl();
|
|
|
- Long dataId = SnowFlakeUtil.getId();
|
|
|
- String lasPdf = file_path + "/pdf//" + dataId + "_last.pdf";
|
|
|
- CollectionUtils.mergePdfPublicMethods(reportResults.stream().map(ReportResult::getPdfPath).collect(Collectors.toList()), lasPdf);
|
|
|
- BladeFile bladeFile = newIOSSClient.uploadFile(dataId + "_last.pdf", lasPdf);
|
|
|
- String rawPdfUrL = bladeFile.getLink();
|
|
|
- StringBuilder stringBuilder = new StringBuilder("{");
|
|
|
- for (ReportResult reportResult : reportResults) {
|
|
|
- String name = reportResult.getName();
|
|
|
- String pdfOssPath = reportResult.getOssPdfUrl();
|
|
|
- stringBuilder.append("\"");
|
|
|
- stringBuilder.append(name);
|
|
|
- stringBuilder.append("\":\"");
|
|
|
- stringBuilder.append(pdfOssPath);
|
|
|
- stringBuilder.append("\",");
|
|
|
- }
|
|
|
- stringBuilder.deleteCharAt(stringBuilder.length() - 1);
|
|
|
- stringBuilder.append("}");
|
|
|
- String string = stringBuilder.toString();
|
|
|
- String sqlUpdate = "update s_interim_pay_certificate set file_url_list = '"+string +"',raw_url = '"+rawPdfUrL+"',pre_pdf_url = '"+rawPdfUrL+"' where id = "+report.getId();
|
|
|
- jdbcTemplate.execute(sqlUpdate);
|
|
|
+// Long dataId = SnowFlakeUtil.getId();
|
|
|
+ //String lasPdf = file_path + "/pdf//" + dataId + "_last.pdf";
|
|
|
+// CollectionUtils.mergePdfPublicMethods(reportResults.stream().map(ReportResult::getPdfPath).collect(Collectors.toList()), lasPdf);
|
|
|
+// BladeFile bladeFile = newIOSSClient.uploadFile(dataId + "_last.pdf", lasPdf);
|
|
|
+// String rawPdfUrL = bladeFile.getLink();
|
|
|
+// StringBuilder stringBuilder = new StringBuilder("{");
|
|
|
+// for (ReportResult reportResult : reportResults) {
|
|
|
+// String name = reportResult.getName();
|
|
|
+// String pdfOssPath = reportResult.getOssPdfUrl();
|
|
|
+// stringBuilder.append("\"");
|
|
|
+// stringBuilder.append(name);
|
|
|
+// stringBuilder.append("\":\"");
|
|
|
+// stringBuilder.append(pdfOssPath);
|
|
|
+// stringBuilder.append("\",");
|
|
|
+// }
|
|
|
+// stringBuilder.deleteCharAt(stringBuilder.length() - 1);
|
|
|
+// stringBuilder.append("}");
|
|
|
+// String string = stringBuilder.toString();
|
|
|
+// String sqlUpdate = "update s_interim_pay_certificate set file_url_list = '"+string +"',raw_url = '"+rawPdfUrL+"',pre_pdf_url = '"+rawPdfUrL+"' where id = "+report.getId();
|
|
|
+// jdbcTemplate.execute(sqlUpdate);
|
|
|
+ String pdfUrl = report.getReportPdf(file_path, reportResults);
|
|
|
if (taskType != 10) {
|
|
|
addSignTaskBatch(report);
|
|
|
interimPayCertificateService.taskMeterPdfInfo2("",report.getPeriodId()+"",report.getType());
|
|
|
}
|
|
|
- return R.data(rawPdfUrL);
|
|
|
+ return R.data(pdfUrl);
|
|
|
}else{
|
|
|
reportResults = formulaClient.formulaExecute3(report.getContractId(), report.getId(), report.getType(),report.getPeriodId(),report.getProjectId());
|
|
|
executionTime.info("公式执行");
|
|
|
@@ -5519,14 +5520,25 @@ public class TaskController extends BladeController {
|
|
|
CollectionUtils.mergePdfPublicMethods(reportResults.stream().map(ReportResult::getPdfPath).collect(Collectors.toList()), lasPdf);
|
|
|
BladeFile bladeFile = newIOSSClient.uploadFile(dataId + "_last.pdf", lasPdf);
|
|
|
this.pdfUrl = bladeFile.getLink();
|
|
|
- Map<String, String> fileListMap = reportResults.stream().collect(Collectors.toMap(ReportResult::getName, rs -> {
|
|
|
- try {
|
|
|
- return rs.getPdfOssPath().get();
|
|
|
- } catch (InterruptedException | ExecutionException e) {
|
|
|
- e.printStackTrace();
|
|
|
- return "无效地址";
|
|
|
- }
|
|
|
- }, (v1, v2) -> v1, LinkedHashMap::new));
|
|
|
+ Map<String, String> fileListMap = reportResults.stream().collect(Collectors.toMap(
|
|
|
+ ReportResult::getName,
|
|
|
+ rs -> {
|
|
|
+ try {
|
|
|
+ if (rs.getPdfOssPath() != null) {
|
|
|
+ return rs.getPdfOssPath().get();
|
|
|
+ } else if (rs.getOssPdfUrl() != null) {
|
|
|
+ return rs.getOssPdfUrl();
|
|
|
+ } else {
|
|
|
+ return rs.getPdfPath();
|
|
|
+ }
|
|
|
+ } catch (InterruptedException | ExecutionException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return "无效地址";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (v1, v2) -> v1,
|
|
|
+ LinkedHashMap::new
|
|
|
+ ));
|
|
|
String upSql = "update " + REPORT_TYPE[this.type] + " set raw_url=?,file_url_list=? ,calculate_date=SYSDATE(),pre_pdf_url='' where id=" + this.id;
|
|
|
jdbcTemplate.update(upSql, this.pdfUrl, JSON.toJSONString(fileListMap));
|
|
|
|