|
@@ -873,7 +873,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String selfSubmit(TrialSelfInspectionRecordDTO dto) {
|
|
|
+ public String selfSubmit(TrialSelfInspectionRecordDTO dto) throws FileNotFoundException {
|
|
|
//------初始当前填报的表pKeyIds------
|
|
|
this.initTrialTabIds(dto);
|
|
|
|
|
@@ -886,29 +886,21 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
|
|
//------获取最新试验记录------
|
|
|
TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
|
- try {
|
|
|
- //------编辑时记录表编号或报告单编号为Null的重新生成------
|
|
|
- this.reBuildNumber(obj, dto);
|
|
|
|
|
|
- //------保存实体表数据、试验记录信息、生成PDF------
|
|
|
- this.submitTrialData(obj, dto);
|
|
|
+ //------编辑时记录表编号或报告单编号为Null的重新生成------
|
|
|
+ this.reBuildNumber(obj, dto);
|
|
|
|
|
|
- //------关联原材料检测报告------
|
|
|
- this.rawMaterialSubmitRelation(dto, obj);
|
|
|
+ //------保存实体表数据、试验记录信息、生成PDF------
|
|
|
+ this.submitTrialData(obj, dto);
|
|
|
|
|
|
- //------关联取样信息------
|
|
|
- this.recordSampleSubmit(dto, obj);
|
|
|
+ //------关联原材料检测报告------
|
|
|
+ this.rawMaterialSubmitRelation(dto, obj);
|
|
|
|
|
|
- //------关联新增设备使用记录信息------
|
|
|
- this.trialDeviceUseService.addDeviceUseInfo(dto);
|
|
|
+ //------关联取样信息------
|
|
|
+ this.recordSampleSubmit(dto, obj);
|
|
|
|
|
|
- } catch (RuntimeException e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException("保存实体表数据、试验记录信息、生成PDF失败:" + e.getMessage());
|
|
|
- } catch (FileNotFoundException e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException("关联原材料检测报告失败:" + e.getMessage());
|
|
|
- }
|
|
|
+ //------关联新增设备使用记录信息------
|
|
|
+ this.trialDeviceUseService.addDeviceUseInfo(dto);
|
|
|
}
|
|
|
return dto.getId().toString();
|
|
|
}
|
|
@@ -944,17 +936,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
}
|
|
|
|
|
|
public void submitTrialData(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) throws RuntimeException {
|
|
|
- try {
|
|
|
- String pdfURL = excelTabClient.saveTabData(dto, dto.getIsBatchSave(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
|
|
|
- if (StringUtils.isNotEmpty(pdfURL)) {
|
|
|
- this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
|
- }
|
|
|
- } catch (RuntimeException e) {
|
|
|
- if (e.getMessage().contains("字段过长")) {
|
|
|
- //字段过长,新增失败的异常处理
|
|
|
- jdbcTemplate.execute("delete from u_trial_self_inspection_record where id = " + dto.getId());
|
|
|
- }
|
|
|
- throw new RuntimeException("原因:" + e.getMessage());
|
|
|
+ String pdfURL = excelTabClient.saveTabData(dto, dto.getIsBatchSave(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
|
|
|
+ if (StringUtils.isNotEmpty(pdfURL)) {
|
|
|
+ this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
|
}
|
|
|
}
|
|
|
|