|
@@ -9,6 +9,7 @@ import io.swagger.annotations.*;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.SneakyThrows;
|
|
|
import org.springblade.business.dto.*;
|
|
|
+import org.springblade.business.entity.EntrustInfo;
|
|
|
import org.springblade.business.entity.TrialDetectionData;
|
|
|
import org.springblade.business.entity.TrialSelfInspectionRecord;
|
|
|
import org.springblade.business.service.ITrialDetectionDataService;
|
|
@@ -300,34 +301,47 @@ public class TrialDetectionController extends BladeController {
|
|
|
//优先使用电签的pdf
|
|
|
pdfUrl = stringObjectMap.get("e_visa_pdf_url");
|
|
|
}
|
|
|
+ List<String> pdfList = new ArrayList<>();
|
|
|
+
|
|
|
+ //试验原始pdf
|
|
|
+ pdfList.add(pdfUrl.toString());
|
|
|
|
|
|
//关联原材料检测报告的pdf(合并后的dpf都一样,取其一)
|
|
|
String sqlRecord = "select old_pdf_url from u_trial_raw_material_self_record where self_record_id =" + nodeId;
|
|
|
TrialRawMaterialSelfRecord recordObj = jdbcTemplate.query(sqlRecord, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class)).stream().findAny().orElse(null);
|
|
|
- if (pdfUrl != null && recordObj != null && recordObj.getOldPdfUrl() != null) {
|
|
|
+ if (recordObj != null && recordObj.getOldPdfUrl() != null) {
|
|
|
String pdfUrlTrialRawMaterial = recordObj.getOldPdfUrl();
|
|
|
- List<String> pdfList = new ArrayList<>();
|
|
|
- //试验原始pdf
|
|
|
- pdfList.add(pdfUrl.toString());
|
|
|
//材料检测报告pdf
|
|
|
pdfList.add(pdfUrlTrialRawMaterial);
|
|
|
- //合并
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 委托单的信息
|
|
|
+ String sqlEntrust = "SELECT IFNULL(a.entrust_e_pdf,a.entrust_pdf) as entrust_pdf from u_entrust_info a ,u_trial_self_inspection_record b where a.id=b.entrust_id and b.id=" + nodeId;
|
|
|
+ EntrustInfo entrustInfo = jdbcTemplate.query(sqlEntrust, new BeanPropertyRowMapper<>(EntrustInfo.class)).stream().findAny().orElse(null);
|
|
|
+
|
|
|
+ if (entrustInfo != null ) {
|
|
|
+ String entrustPdf = entrustInfo.getEntrustPdf();
|
|
|
+ //材料检测报告pdf
|
|
|
+ pdfList.add(entrustPdf);
|
|
|
+ }
|
|
|
+
|
|
|
+ //合并
|
|
|
+ if (pdfList.size() > 0) {
|
|
|
+ String file_path = FileUtils.getSysLocalFileUrl();
|
|
|
Long id = SnowFlakeUtil.getId();
|
|
|
String trialPdf = file_path + "/pdf/" + id + ".pdf";
|
|
|
File trialPdf2 = ResourceUtil.getFile(trialPdf);
|
|
|
if (trialPdf2.exists()) {
|
|
|
trialPdf2.delete();
|
|
|
}
|
|
|
- if (pdfList.size() > 0) {
|
|
|
- //合并当前所有选择的试验pdf
|
|
|
- FileUtils.mergePdfPublicMethods(pdfList, trialPdf);
|
|
|
- BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", trialPdf);
|
|
|
- if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
|
|
|
- pdfUrl = bladeFile.getLink();
|
|
|
- }
|
|
|
+ //合并当前所有选择的试验pdf
|
|
|
+ FileUtils.mergePdfPublicMethods(pdfList, trialPdf);
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", trialPdf);
|
|
|
+ if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
|
|
|
+ pdfUrl = bladeFile.getLink();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return R.data(pdfUrl);
|
|
|
} else {
|
|
|
return R.fail("无历史数据预览,请保存数据");
|