|
@@ -1108,7 +1108,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
throw new ServiceException("请选择一个类型");
|
|
|
}
|
|
|
if (ObjectUtil.isEmpty(dto.getNodeId())) {
|
|
|
- throw new ServiceException("未获取到当前节点的pKeyId");
|
|
|
+ throw new ServiceException("未获取到当前节点信息");
|
|
|
}
|
|
|
|
|
|
//获取当前节点的合并的pdfURL
|
|
@@ -1123,23 +1123,31 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
List<String> pdfList = new ArrayList<>();
|
|
|
|
|
|
- if (StringUtils.isEmpty(informationQuery.getPdfTrialUrl())) {
|
|
|
- //如果PdfTrialUrl == null 说明是第一次关联
|
|
|
+ //TODO ------自检------
|
|
|
+ if (dto.getType().equals(1)) {
|
|
|
+ //当前施工pdf
|
|
|
pdfList.add(informationQuery.getPdfUrl());
|
|
|
- } else {
|
|
|
- //如果PdfTrialUrl != null 说明是第二次以上操作关联,那么就在之前的上面做增量,主要解决不同类型提交时的问题
|
|
|
- pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
- }
|
|
|
|
|
|
- if (dto.getType().equals(1)) { //自检
|
|
|
- //获取自检的对应的数据pdf
|
|
|
- List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().in(TrialSelfInspectionRecord::getId, dto.getIds()));
|
|
|
+ //自检pdf
|
|
|
+ List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
|
+ .select(TrialSelfInspectionRecord::getPdfUrl)
|
|
|
+ .in(TrialSelfInspectionRecord::getId, Func.toLongList(dto.getIds())));
|
|
|
List<String> pdfURLs = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
|
|
|
pdfList.addAll(pdfURLs);
|
|
|
|
|
|
- } else if (dto.getType().equals(2) || dto.getType().equals(3)) { //第三方、外委
|
|
|
- //获取第三方、外委的对应的数据pdf
|
|
|
- List<TrialDetectionData> trialDetectionData = trialDetectionDataService.getBaseMapper().selectList(Wrappers.<TrialDetectionData>lambdaQuery().in(TrialDetectionData::getId, dto.getIds()));
|
|
|
+ //TODO ------第三方、外委------
|
|
|
+ } else if (dto.getType().equals(2) || dto.getType().equals(3)) {
|
|
|
+
|
|
|
+ if (informationQuery.getPdfTrialUrl() != null) {
|
|
|
+ //如果当前存在自检pdf,那么拼接
|
|
|
+ pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
+ } else {
|
|
|
+ //当前施工pdf
|
|
|
+ pdfList.add(informationQuery.getPdfUrl());
|
|
|
+ }
|
|
|
+
|
|
|
+ //第三方、外委pdf
|
|
|
+ List<TrialDetectionData> trialDetectionData = trialDetectionDataService.getBaseMapper().selectList(Wrappers.<TrialDetectionData>lambdaQuery().in(TrialDetectionData::getId, Func.toLongList(dto.getIds())));
|
|
|
List<String> pdfURLs = new ArrayList<>();
|
|
|
for (TrialDetectionData trialDetectionDatum : trialDetectionData) {
|
|
|
if (StringUtils.isNotEmpty(trialDetectionDatum.getRecordTableUrl())) {
|
|
@@ -1168,9 +1176,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
//修改当前节点的pdfTrialURL地址
|
|
|
if (informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getPdfTrialUrl, bladeFile.getLink()).eq(InformationQuery::getId, informationQuery.getId()))) {
|
|
|
for (String recordId : Func.toStrList(dto.getIds())) {
|
|
|
- //修改选中状态记录信息(选中为勾选绿色)
|
|
|
baseMapper.deleteSeletedStatusByNodeId(dto.getNodeId(), dto.getType(), recordId); //先删除对应记录
|
|
|
-
|
|
|
baseMapper.insertSeletedStatus(SnowFlakeUtil.getId(), dto.getNodeId(), dto.getType(), recordId); //新增该类型选中的记录信息
|
|
|
}
|
|
|
return true;
|
|
@@ -1216,6 +1222,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
//合并pdf把试验自检记录、第三方、外委的pdf追加到当前质检合同段树节点下的pdf后显示
|
|
|
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()) {
|
|
@@ -1227,9 +1234,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
//修改当前节点的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); //先删除对应记录
|
|
|
-
|
|
|
baseMapper.insertSeletedStatus(SnowFlakeUtil.getId(), dto.getNodeId(), dto.getType(), recordId); //新增该类型选中的记录信息
|
|
|
}
|
|
|
return true;
|
|
@@ -1239,6 +1244,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
} else {
|
|
|
//修改pdfTrialUrl=null
|
|
|
+ assert informationQuery != null;
|
|
|
informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getPdfTrialUrl, null).eq(InformationQuery::getId, informationQuery.getId()));
|
|
|
}
|
|
|
//删除该类型的所有记录信息
|