|
@@ -241,7 +241,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
List<WbsTreeContract> resultNode = baseMapper.selectWbsTreeContractListByPKeyIds(idsP); //查询工程部位节点名称信息
|
|
|
List<String> projectPositionNames = resultNode.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
|
|
|
String name = projectPositionNames.stream().findAny().orElse(null);
|
|
|
- if (projectPositionNames.size() > 1) {
|
|
|
+ if (projectPositionNames.size() >= 2) {
|
|
|
recordVO2.setProjectPositionName(name + "等" + projectPositionNames.size() + "个工程部位信息");
|
|
|
} else {
|
|
|
recordVO2.setProjectPositionName(name);
|
|
@@ -569,6 +569,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean selfSubmit(TrialSelfInspectionRecordDTO dto) throws Exception {
|
|
|
if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
//构建记录表编号、报告单编号
|
|
@@ -592,18 +593,20 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
this.saveOrUpdate(dto);
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
|
|
- //获取obj
|
|
|
+ //获取当前试验记录信息
|
|
|
TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
|
|
|
|
+ //已审批任务,关联到工程部位及用途信息
|
|
|
+ this.recordProjectPosition(dto, obj);
|
|
|
+
|
|
|
try {
|
|
|
//保存实体表数据、记录信息、生成pdf
|
|
|
String pdfURL = excelTabClient.saveTabData(dto.getIsBatchSave(), dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
|
|
|
- //返回合并pdfURL
|
|
|
if (StringUtils.isNotEmpty(pdfURL)) {
|
|
|
- LambdaUpdateWrapper<TrialSelfInspectionRecord> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.set(TrialSelfInspectionRecord::getPdfUrl, pdfURL);
|
|
|
- updateWrapper.eq(TrialSelfInspectionRecord::getId, dto.getId());
|
|
|
- this.update(null, updateWrapper);
|
|
|
+ //修改合并pdf
|
|
|
+ this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
|
|
|
+ .set(TrialSelfInspectionRecord::getPdfUrl, pdfURL)
|
|
|
+ .eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new ServiceException("保存实体表数据生成pdf时发生异常 " + e.getMessage());
|
|
@@ -612,11 +615,8 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
//关联样品信息
|
|
|
this.recordSample(dto);
|
|
|
|
|
|
- //已审批任务,关联到工程部位及用途信息
|
|
|
- this.recordProjectPosition(dto, obj);
|
|
|
-
|
|
|
//新增设备使用记录信息
|
|
|
- trialDeviceUseService.addDeviceUseInfo(dto);
|
|
|
+ this.trialDeviceUseService.addDeviceUseInfo(dto);
|
|
|
}
|
|
|
|
|
|
return true;
|
|
@@ -683,7 +683,7 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- throw new ServiceException("当前试验记录任务未审批,关联工程部位及用途信息失败");
|
|
|
+ throw new ServiceException("当前试验记录任务未上报审批,关联工程部位及用途信息失败");
|
|
|
}
|
|
|
}
|
|
|
}
|