|
@@ -68,12 +68,10 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
private final IUserClient iUserClient;
|
|
|
private final ContractClient contractClient;
|
|
|
private final WbsTreePrivateClient wbsTreePrivateClient;
|
|
|
- private final WbsTreeContractClient wbsTreeContractClient;
|
|
|
private final ExcelTabClient excelTabClient;
|
|
|
private final IDictClient iDictClient;
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
private final NewIOSSClient newIOSSClient;
|
|
|
- private final InformationQueryClient informationQueryClient;
|
|
|
private final IOSSClient iossClient;
|
|
|
private final CommonFileClient commonFileClient;
|
|
|
private final TableFileClient tableFileClient;
|
|
@@ -82,7 +80,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
private final TrialDetectionDataServiceImpl trialDetectionDataService;
|
|
|
|
|
|
@Override
|
|
|
- public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) {
|
|
|
+ public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException {
|
|
|
QueryWrapper<TrialSelfInspectionRecord> queryWrapper = Condition.getQueryWrapper(dto);
|
|
|
if (StringUtils.isNotEmpty(dto.getQueryValue())) {
|
|
|
queryWrapper.lambda().like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue());
|
|
@@ -142,13 +140,58 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
record.setRawMaterialIds(org.apache.commons.lang.StringUtils.join(ids, ","));
|
|
|
|
|
|
//pdfUrl
|
|
|
- record.setPdfUrl(Objects.requireNonNull(query1.stream().findAny().orElse(null)).getOldPdfUrl());
|
|
|
+ String pdf = this.getMergePdfToTrial(record.getContractId(), record.getId());
|
|
|
+ record.setPdfUrl(pdf);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return trialSelfInspectionRecordVOIPage.setRecords(records);
|
|
|
}
|
|
|
|
|
|
+ private String getMergePdfToTrial(Long contractId, Long nodeId) throws FileNotFoundException {
|
|
|
+ String sql = "select pdf_url,e_visa_pdf_url from u_information_query where wbs_id='" + nodeId + "' and contract_id ='" + contractId + "'";
|
|
|
+ List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
|
+ if (maps.size() >= 1) {
|
|
|
+ Map<String, Object> stringObjectMap = maps.get(0);
|
|
|
+ Object pdfUrl = stringObjectMap.get("pdf_url");
|
|
|
+
|
|
|
+ if (stringObjectMap.get("e_visa_pdf_url") != null) {
|
|
|
+ //优先使用电签的pdf
|
|
|
+ pdfUrl = stringObjectMap.get("e_visa_pdf_url");
|
|
|
+ }
|
|
|
+
|
|
|
+ //关联原材料检测报告的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) {
|
|
|
+ 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);
|
|
|
+ Long id = SnowFlakeUtil.getId();
|
|
|
+ String trialPdf = file_path + "/pdf/" + id + ".pdf";
|
|
|
+ File trialPdf2 = ResourceUtil.getFile(trialPdf);
|
|
|
+ if (trialPdf2.exists()) {
|
|
|
+ trialPdf2.delete();
|
|
|
+ }
|
|
|
+ //合并当前所有选择的试验pdf
|
|
|
+ FileUtils.mergePdfPublicMethods(pdfList, trialPdf);
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", trialPdf);
|
|
|
+ if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
|
|
|
+ pdfUrl = bladeFile.getLink();
|
|
|
+ return pdfUrl.toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ assert pdfUrl != null;
|
|
|
+ return pdfUrl.toString();
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<SampleAncillaryDocumentsVO> selfAncillaryDocumentsList(String id) {
|
|
|
//获取材料附件信息
|
|
@@ -306,7 +349,8 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
@Override
|
|
|
@Async
|
|
|
- public boolean rawMaterialSubmitRelation(RawMaterialSubmitRelationDTO dto, TrialSelfInspectionRecord obj) throws FileNotFoundException {
|
|
|
+ public boolean rawMaterialSubmitRelation(RawMaterialSubmitRelationDTO dto, TrialSelfInspectionRecord obj) throws
|
|
|
+ FileNotFoundException {
|
|
|
if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
throw new ServiceException("请先保存填报数据后,再关联原材检测报告信息");
|
|
|
} else {
|
|
@@ -317,24 +361,15 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
//新增或编辑
|
|
|
if (StringUtils.isNotEmpty(dto.getIds())) {
|
|
|
//当前关联的原材料记录id
|
|
|
- List<String> idsNew = new ArrayList<>(Func.toStrList(dto.getIds()));
|
|
|
- //当前记录id
|
|
|
- idsNew.add(dto.getId());
|
|
|
- //获取原材料的pdfUrl
|
|
|
+ List<String> ids = Func.toStrList(dto.getIds());
|
|
|
+
|
|
|
+ //获取原材料的pdf
|
|
|
List<TrialSelfInspectionRecord> recordList = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
|
.select(TrialSelfInspectionRecord::getPdfUrl, TrialSelfInspectionRecord::getId)
|
|
|
- .in(TrialSelfInspectionRecord::getId, idsNew).eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
-
|
|
|
- //当前记录的pdf
|
|
|
- TrialSelfInspectionRecord nowObj = recordList.stream().filter(f -> f.getId().equals(Long.parseLong(dto.getId()))).findAny().orElse(null);
|
|
|
-
|
|
|
- //关联的原材料pdf
|
|
|
+ .in(TrialSelfInspectionRecord::getId, ids).eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
List<TrialSelfInspectionRecord> recordObjList = recordList.stream().filter(f -> !f.getId().equals(Long.parseLong(dto.getId()))).collect(Collectors.toList());
|
|
|
-
|
|
|
- //合并pdf,切当前记录pdfUrl置顶,关联原材料pdfUrl文件置尾
|
|
|
List<String> pdfUrlAll = new ArrayList<>();
|
|
|
- if (StringUtils.isNotEmpty(Objects.requireNonNull(nowObj).getPdfUrl()) && recordObjList.size() > 0) {
|
|
|
- pdfUrlAll.add(nowObj.getPdfUrl());
|
|
|
+ if (recordObjList.size() > 0) {
|
|
|
pdfUrlAll.addAll(recordObjList.stream().filter(f -> StringUtils.isNotEmpty(f.getPdfUrl())).map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList()));
|
|
|
}
|
|
|
|
|
@@ -352,7 +387,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
String sql1 = "delete from u_trial_raw_material_self_record where self_record_id ='" + dto.getId() + "'";
|
|
|
jdbcTemplate.execute(sql1);
|
|
|
//新增记录关系
|
|
|
- for (String recordId : idsNew) {
|
|
|
+ for (String recordId : ids) {
|
|
|
if (!recordId.equals(dto.getId())) {
|
|
|
String sql2 = "insert into u_trial_raw_material_self_record(id,self_record_id,raw_material_record_id,old_pdf_url) values(" + SnowFlakeUtil.getId() + "," + dto.getId() + "," + recordId + ",'" + bladeFile.getLink() + "')";
|
|
|
jdbcTemplate.execute(sql2);
|
|
@@ -449,41 +484,35 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
.eq(TrialSelfInspectionRecord::getId, trialSelfInspectionRecordId)
|
|
|
);
|
|
|
|
|
|
- //TODO ------审批通过且合格的自检记录信息,关联到工程部位信息的施工质检节点上去------
|
|
|
TrialSelfInspectionRecord record = baseMapper.selectById(trialSelfInspectionRecordId);
|
|
|
if (("已审批").equals(record.getTaskStatus()) && (new Integer(1)).equals(record.getDetectionResult()) && (new Integer(1)).equals(record.getDetectionCategory())) {
|
|
|
+ /**
|
|
|
+ * 在资料填报工序-预览全部pdf时再拼接合并显示,当前只做储存(如果当前资料填报工序节点有其他多个试验记录pdf关联信息,那么合并存储,否则直接存储)
|
|
|
+ */
|
|
|
if (StringUtils.isNotEmpty(record.getProjectPosition())) {
|
|
|
- List<String> ids = Func.toStrList(record.getProjectPosition());
|
|
|
-
|
|
|
- //删除当前试验记录关联信息
|
|
|
- baseMapper.delSelfQuality(record.getId());
|
|
|
-
|
|
|
- for (String pKeyId : ids) {
|
|
|
- //新增关联信息
|
|
|
- baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), record.getId(), pKeyId);
|
|
|
-
|
|
|
- //合并pdf到质检树节点
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(pKeyId);
|
|
|
- if (wbsTreeContract != null) {
|
|
|
- List<String> pdfUrlList = new ArrayList<>();
|
|
|
- String classify;
|
|
|
-
|
|
|
- if (wbsTreeContract.getTableOwner().contains("1") || wbsTreeContract.getTableOwner().contains("2") || wbsTreeContract.getTableOwner().contains("3")) {
|
|
|
- classify = "1";
|
|
|
- } else {
|
|
|
- classify = "2";
|
|
|
- }
|
|
|
-
|
|
|
- String pdfUrlNodeAll = baseMapper.selectInformationQuery(pKeyId, wbsTreeContract.getContractId(), classify);
|
|
|
-
|
|
|
- if (StringUtils.isEmpty(pdfUrlNodeAll) || StringUtils.isEmpty(record.getPdfUrl())) {
|
|
|
+ //有pdf的节点
|
|
|
+ String sqlNodeAll = "select wbs_id from u_information_query where wbs_id in(" + record.getProjectPosition() + ") and contract_id = " + record.getContractId();
|
|
|
+ List<Long> collect = jdbcTemplate.query(sqlNodeAll, new BeanPropertyRowMapper<>(InformationQuery.class)).stream().map(InformationQuery::getWbsId).collect(Collectors.toList());
|
|
|
+ if (collect.size() > 0) {
|
|
|
+ //删除当前记录关联记录
|
|
|
+ baseMapper.delSelfQuality(record.getId());
|
|
|
+ for (Long pKeyId : collect) {
|
|
|
+ //新增当前记录关联信息
|
|
|
+ baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), record.getId(), pKeyId);
|
|
|
+
|
|
|
+ //获取当前工程部位节点最新的关联试验记录ids
|
|
|
+ List<String> trialRecordIds = baseMapper.selectTrialIdByNodeId(pKeyId);
|
|
|
+
|
|
|
+ //如果当前工程部位节点的关联试验记录id只有一条,且等于当前关联试验记录id,那么不合并,直接存储该条试验记录的pdf
|
|
|
+ if (trialRecordIds.size() == 1 && trialRecordIds.get(0).equals(record.getId().toString())) {
|
|
|
+ //修改当前试验pdf到质检树节点的pdf_trial_url_position上存储
|
|
|
+ baseMapper.updateInformationQuery(pKeyId, record.getContractId(), record.getPdfUrl());
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- //质检节点pdfUrl
|
|
|
- pdfUrlList.add(pdfUrlNodeAll);
|
|
|
- //试验记录pdfUrl
|
|
|
- pdfUrlList.add(record.getPdfUrl());
|
|
|
+ //如果当前工程部位节点的关联试验记录id有多条,那么合并
|
|
|
+ List<TrialSelfInspectionRecord> pdfUrlList = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().select(TrialSelfInspectionRecord::getPdfUrl).in(TrialSelfInspectionRecord::getId, trialRecordIds));
|
|
|
+ List<String> pdfS = pdfUrlList.stream().filter(f -> StringUtils.isNotEmpty(f.getPdfUrl())).map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
|
|
|
|
|
|
String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String listPdf = filePath + "/pdf/" + pKeyId + ".pdf";
|
|
@@ -491,12 +520,14 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
if (tabPDF.exists()) {
|
|
|
tabPDF.delete();
|
|
|
}
|
|
|
- FileUtils.mergePdfPublicMethods(pdfUrlList, listPdf);
|
|
|
+
|
|
|
+ FileUtils.mergePdfPublicMethods(pdfS, listPdf);
|
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(pKeyId + ".pdf", listPdf);
|
|
|
if (bladeFile != null) {
|
|
|
- //修改质检树合并后的pdfUrl
|
|
|
- baseMapper.updateInformationQuery(pKeyId, wbsTreeContract.getContractId(), classify, bladeFile.getLink());
|
|
|
+ //修改合并的试验pdf到质检树节点的pdf_trial_url_position上存储
|
|
|
+ baseMapper.updateInformationQuery(pKeyId, record.getContractId(), bladeFile.getLink());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -508,7 +539,8 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception {
|
|
|
+ public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String
|
|
|
+ projectId, String classify, String id, String tableType) throws Exception {
|
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(file);
|
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
|
TableFile tableFile = new TableFile();
|
|
@@ -685,8 +717,8 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
throw new ServiceException("保存实体表数据生成pdf时发生异常" + e.getMessage());
|
|
|
}
|
|
|
|
|
|
- //------关联工程及用途关系新增或删除------
|
|
|
- if (StringUtils.isEmpty(obj.getProjectPosition())) {
|
|
|
+ //------关联工程及用途关系新增或删除------(已做修改,在审批修改状态时,再建立关联关系)
|
|
|
+ /*if (StringUtils.isEmpty(obj.getProjectPosition())) {
|
|
|
String delSql = "delete from u_trial_self_quality_project where self_id = " + obj.getId();
|
|
|
jdbcTemplate.execute(delSql);
|
|
|
} else {
|
|
@@ -699,7 +731,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
String insertSql = "insert into u_trial_self_quality_project(id,self_id,quality_node_id) values (" + SnowFlakeUtil.getId() + "," + obj.getId() + "," + recordNodeId + ")";
|
|
|
jdbcTemplate.execute(insertSql);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
//------关联原材料检测报告------
|
|
|
RawMaterialSubmitRelationDTO relationDTO = new RawMaterialSubmitRelationDTO();
|
|
@@ -786,72 +818,6 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean recordProjectPosition(SelfProjectPositionSubmitDTO dto) throws FileNotFoundException {
|
|
|
- if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
- throw new ServiceException("请先保存填报数据后,再关联工程部位及用途信息");
|
|
|
- }
|
|
|
- //已审批记录关联
|
|
|
- if (StringUtils.isNotEmpty(dto.getProjectPosition())) {
|
|
|
- TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
|
- if (("已审批").equals(obj.getTaskStatus())) {
|
|
|
- //删除关联信息
|
|
|
- baseMapper.delSelfQuality(dto.getId());
|
|
|
-
|
|
|
- List<String> ids = Func.toStrList(dto.getProjectPosition());
|
|
|
- //新增关联信息
|
|
|
- for (String id : ids) {
|
|
|
- baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
- }
|
|
|
-
|
|
|
- //把当前试验的PDF合并关联到质检树节点下
|
|
|
- List<String> contractNodePKeyIds = baseMapper.selectQualityNodeId(String.valueOf(dto.getId())); //获取合同段质检树的节点PkeyId
|
|
|
- for (String pKeyId : contractNodePKeyIds) {
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(pKeyId);
|
|
|
- if (wbsTreeContract != null) {
|
|
|
- List<String> pdfUrlList = new ArrayList<>();
|
|
|
- String classify;
|
|
|
- if (wbsTreeContract.getTableOwner().contains("1") || wbsTreeContract.getTableOwner().contains("2") || wbsTreeContract.getTableOwner().contains("3")) {
|
|
|
- classify = "1";
|
|
|
- } else {
|
|
|
- classify = "2";
|
|
|
- }
|
|
|
- String pdfUrlNodeAll = baseMapper.selectInformationQuery(pKeyId, wbsTreeContract.getContractId(), classify);
|
|
|
-
|
|
|
- if (StringUtils.isEmpty(pdfUrlNodeAll) || StringUtils.isEmpty(obj.getPdfUrl())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- //质检节点合并pdfUrl
|
|
|
- pdfUrlList.add(pdfUrlNodeAll);
|
|
|
- //试验pdfUrl
|
|
|
- pdfUrlList.add(obj.getPdfUrl());
|
|
|
-
|
|
|
- //合并PDF
|
|
|
- String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- String listPdf = filePath + "/pdf/" + pKeyId + ".pdf";
|
|
|
- File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
- if (tabPDF.exists()) {
|
|
|
- tabPDF.delete();
|
|
|
- }
|
|
|
- FileUtils.mergePdfPublicMethods(pdfUrlList, listPdf);
|
|
|
- BladeFile bladeFile = this.newIOSSClient.uploadFile(pKeyId + ".pdf", listPdf);
|
|
|
- if (bladeFile != null) {
|
|
|
- //修改质检树合并后的pdfURL
|
|
|
- baseMapper.updateInformationQuery(pKeyId, wbsTreeContract.getContractId(), classify, bladeFile.getLink());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- throw new ServiceException("当前试验记录任务未上报审批,关联工程部位及用途信息失败");
|
|
|
- }
|
|
|
- } else {
|
|
|
- //删除关联信息
|
|
|
- baseMapper.delSelfQuality(dto.getId());
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
private void buildNumber(TrialSelfInspectionRecordDTO dto) {
|
|
|
StringSPUtils spUtils = new StringSPUtils();
|
|
|
List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
|
|
@@ -1011,7 +977,8 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public IPage<TrialSelfInspectionRecordVO> trialDataPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) {
|
|
|
+ public IPage<TrialSelfInspectionRecordVO> trialDataPage
|
|
|
+ (IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) {
|
|
|
QueryWrapper<TrialSelfInspectionRecord> queryWrapper = Condition.getQueryWrapper(dto);
|
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getStartTime()) && org.apache.commons.lang.StringUtils.isNotEmpty(dto.getEndTime())) {
|
|
|
String endTime = dto.getEndTime();
|
|
@@ -1070,10 +1037,12 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
@Override
|
|
|
public boolean fileSubmit(TrialFileSubmitDTO dto) throws FileNotFoundException {
|
|
|
+ /**
|
|
|
+ * 在资料填报工序-预览全部pdf时再拼接合并显示,当前只做储存
|
|
|
+ */
|
|
|
if (ObjectUtil.isEmpty(dto.getType())) {
|
|
|
throw new ServiceException("请选择一个类型");
|
|
|
- }
|
|
|
- if (ObjectUtil.isEmpty(dto.getNodeId())) {
|
|
|
+ } else if (ObjectUtil.isEmpty(dto.getNodeId())) {
|
|
|
throw new ServiceException("未获取到当前节点信息");
|
|
|
}
|
|
|
|
|
@@ -1085,14 +1054,14 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
.eq(InformationQuery::getType, 1)).stream().findAny().orElse(null);
|
|
|
|
|
|
if (StringUtils.isNotEmpty(dto.getIds())) {
|
|
|
- if (informationQuery != null && StringUtils.isNotEmpty(informationQuery.getPdfUrl())) {
|
|
|
-
|
|
|
+ if (informationQuery != null) {
|
|
|
List<String> pdfList = new ArrayList<>();
|
|
|
-
|
|
|
//------自检------
|
|
|
if (dto.getType().equals(1)) {
|
|
|
- //当前施工pdf
|
|
|
- pdfList.add(informationQuery.getPdfUrl());
|
|
|
+ if (informationQuery.getPdfTrialUrl() != null) {
|
|
|
+ //如果当前存在第三方、外委的pdf,那么拼接
|
|
|
+ pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
+ }
|
|
|
|
|
|
//自检pdf
|
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
@@ -1103,13 +1072,9 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
//------第三方、外委------
|
|
|
} else if (dto.getType().equals(2) || dto.getType().equals(3)) {
|
|
|
-
|
|
|
if (informationQuery.getPdfTrialUrl() != null) {
|
|
|
- //如果当前存在自检pdf,那么拼接
|
|
|
+ //如果当前存在试验自检的pdf,那么拼接
|
|
|
pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
- } else {
|
|
|
- //当前施工pdf
|
|
|
- pdfList.add(informationQuery.getPdfUrl());
|
|
|
}
|
|
|
|
|
|
//第三方、外委pdf
|
|
@@ -1124,11 +1089,10 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
}
|
|
|
pdfList.addAll(pdfURLs);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (pdfList.size() > 0) {
|
|
|
- //合并pdf把试验自检记录、第三方、外委的pdf追加到当前质检合同段树节点下的pdf后显示
|
|
|
+ //合并试验自检、第三方、外委的pdf
|
|
|
List<String> collect = pdfList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String listPdf = filePath + "/pdf/" + informationQuery.getId() + ".pdf";
|
|
@@ -1181,14 +1145,12 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().in(TrialSelfInspectionRecord::getId, ids));
|
|
|
List<String> pdfURLs = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
|
|
|
pdfList.addAll(pdfURLs);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- if (pdfList.size() > 0) {
|
|
|
- //合并pdf把试验自检记录、第三方、外委的pdf追加到当前质检合同段树节点下的pdf后显示
|
|
|
+ if (pdfList.size() > 0 && informationQuery != null) {
|
|
|
+ //重新合并
|
|
|
List<String> collect = pdfList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- assert informationQuery != null;
|
|
|
String listPdf = filePath + "/pdf/" + informationQuery.getId() + ".pdf";
|
|
|
File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
if (tabPDF.exists()) {
|
|
@@ -1197,7 +1159,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
FileUtils.mergePdfPublicMethods(collect, listPdf);
|
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(informationQuery.getId() + ".pdf", listPdf);
|
|
|
if (bladeFile != null) {
|
|
|
- //修改当前节点的pdfTrialURL地址
|
|
|
+ //修改当前节点最新的pdfTrialURL地址
|
|
|
if (informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getPdfTrialUrl, bladeFile.getLink()).eq(InformationQuery::getId, informationQuery.getId()))) {
|
|
|
for (String recordId : recordIds) {
|
|
|
baseMapper.deleteSeletedStatusByNodeId(dto.getNodeId(), dto.getType(), recordId); //先删除对应记录
|
|
@@ -1210,16 +1172,16 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
} else {
|
|
|
//修改pdfTrialUrl=null
|
|
|
- assert informationQuery != null;
|
|
|
- informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getPdfTrialUrl, null).eq(InformationQuery::getId, informationQuery.getId()));
|
|
|
+ if (informationQuery != null) {
|
|
|
+ informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getPdfTrialUrl, null).eq(InformationQuery::getId, informationQuery.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
//删除该类型的所有记录信息
|
|
|
baseMapper.deleteSeletedStatusByNodeId(dto.getNodeId(), dto.getType(), null);
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|