|
@@ -10,10 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.spire.xls.*;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
-import org.springblade.business.dto.RawMaterialSubmitRelationDTO;
|
|
|
-import org.springblade.business.dto.TrialFileSubmitDTO;
|
|
|
-import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
|
|
|
-import org.springblade.business.dto.TrialSelfInspectionRecordPageDTO;
|
|
|
+import org.springblade.business.dto.*;
|
|
|
import org.springblade.business.entity.*;
|
|
|
import org.springblade.business.feign.InformationQueryClient;
|
|
|
import org.springblade.business.mapper.TrialMaterialMobilizationMapper;
|
|
@@ -125,8 +122,14 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
record.setProjectPositionName(name);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ //关联取样ids
|
|
|
+ String sql = "select sampling_id from u_trial_self_sample where self_id = " + record.getId();
|
|
|
+ List<Long> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialSelfSample.class)).stream().map(TrialSelfSample::getSamplingId).collect(Collectors.toList());
|
|
|
+ if (query.size() > 0) {
|
|
|
+ record.setSampleIds(org.apache.commons.lang.StringUtils.join(query, ","));
|
|
|
+ }
|
|
|
+ }
|
|
|
return trialSelfInspectionRecordVOIPage.setRecords(records);
|
|
|
}
|
|
|
|
|
@@ -211,40 +214,57 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<TrialSelfInspectionRecordVO2> getRawMaterialInfo(String nodeId, String contractId) {
|
|
|
- List<TrialSelfInspectionRecord> result = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().eq(TrialSelfInspectionRecord::getNodeId, nodeId).eq(TrialSelfInspectionRecord::getContractId, contractId).eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
- List<TrialSelfInspectionRecordVO2> recordVO2s = BeanUtil.copyProperties(result, TrialSelfInspectionRecordVO2.class);
|
|
|
- List<Long> collect = result.stream().map(TrialSelfInspectionRecord::getId).collect(Collectors.toList());
|
|
|
- String ids = org.apache.commons.lang.StringUtils.join(collect, ",");
|
|
|
- if (StringUtils.isNotEmpty(ids)) {
|
|
|
- String sql = "select raw_material_record_id from u_trial_raw_material_self_record where self_record_id in (" + ids + ")";
|
|
|
- List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
|
- List<Object> idsRecord = new ArrayList<>();
|
|
|
-
|
|
|
- for (Map<String, Object> map : maps) {
|
|
|
- for (Map.Entry<String, Object> obj : map.entrySet()) {
|
|
|
- idsRecord.add(obj.getValue());
|
|
|
- }
|
|
|
- }
|
|
|
- for (Object id : idsRecord) {
|
|
|
- for (TrialSelfInspectionRecordVO2 recordVO2 : recordVO2s) {
|
|
|
- if (id.equals(recordVO2.getId())) {
|
|
|
- recordVO2.setIsRawMaterialRelation(1);
|
|
|
+ public List<TrialSelfInspectionRecordVO2> getRawMaterialInfo(String nodeId, String contractId, String id) {
|
|
|
+ List<TrialSelfInspectionRecordVO2> recordVO2s;
|
|
|
+ //编辑
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
+ //获取nodeId节点下的记录信息(排除当前id记录)
|
|
|
+ List<TrialSelfInspectionRecord> result = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
|
+ .eq(TrialSelfInspectionRecord::getNodeId, nodeId)
|
|
|
+ .eq(TrialSelfInspectionRecord::getContractId, contractId)
|
|
|
+ .ne(TrialSelfInspectionRecord::getId, id)
|
|
|
+ .eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
+
|
|
|
+ recordVO2s = BeanUtil.copyProperties(result, TrialSelfInspectionRecordVO2.class);
|
|
|
+
|
|
|
+ if (recordVO2s.size() > 0) {
|
|
|
+ //获取当前记录所关联的记录raw_material_record_id
|
|
|
+ String sql = "select raw_material_record_id from u_trial_raw_material_self_record where self_record_id = " + id;
|
|
|
+ List<TrialRawMaterialSelfRecord> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class));
|
|
|
+
|
|
|
+ //是否关联过
|
|
|
+ for (TrialRawMaterialSelfRecord record : list) {
|
|
|
+ for (TrialSelfInspectionRecordVO2 recordVO2 : recordVO2s) {
|
|
|
+ if (record.getRawMaterialRecordId().equals(recordVO2.getId())) {
|
|
|
+ recordVO2.setIsRawMaterialRelation(1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //新增
|
|
|
+ List<TrialSelfInspectionRecord> result = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
|
+ .eq(TrialSelfInspectionRecord::getNodeId, nodeId)
|
|
|
+ .eq(TrialSelfInspectionRecord::getContractId, contractId)
|
|
|
+ .eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
+
|
|
|
+ recordVO2s = BeanUtil.copyProperties(result, TrialSelfInspectionRecordVO2.class);
|
|
|
}
|
|
|
|
|
|
- for (TrialSelfInspectionRecordVO2 recordVO2 : recordVO2s) {
|
|
|
- if (StringUtils.isNotEmpty(recordVO2.getProjectPosition())) {
|
|
|
- List<String> idsP = Func.toStrList(recordVO2.getProjectPosition()); //关联的工程部位ids
|
|
|
- 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() >= 2) {
|
|
|
- recordVO2.setProjectPositionName(name + "等" + projectPositionNames.size() + "个工程部位信息");
|
|
|
- } else {
|
|
|
- recordVO2.setProjectPositionName(name);
|
|
|
+ //工程部位信息
|
|
|
+ if (recordVO2s.size() > 0) {
|
|
|
+ for (TrialSelfInspectionRecordVO2 recordVO2 : recordVO2s) {
|
|
|
+ if (StringUtils.isNotEmpty(recordVO2.getProjectPosition())) {
|
|
|
+ List<String> idsP = Func.toStrList(recordVO2.getProjectPosition()); //关联的工程部位ids
|
|
|
+ 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() >= 2) {
|
|
|
+ recordVO2.setProjectPositionName(name + "等" + projectPositionNames.size() + "个工程部位信息");
|
|
|
+ } else {
|
|
|
+ recordVO2.setProjectPositionName(name);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -255,60 +275,108 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
@Override
|
|
|
public boolean rawMaterialSubmitRelation(RawMaterialSubmitRelationDTO dto) throws FileNotFoundException {
|
|
|
if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
- throw new ServiceException("请先保存填报数据后再关联原材检测报告");
|
|
|
+ throw new ServiceException("请先保存填报数据后,再关联原材检测报告信息");
|
|
|
}
|
|
|
- //删除关系
|
|
|
- String sql1 = "delete from u_trial_raw_material_self_record where self_record_id ='" + dto.getId() + "'";
|
|
|
- jdbcTemplate.execute(sql1);
|
|
|
+ if (StringUtils.isNotEmpty(dto.getIds())) { //新增关系,合并pdf
|
|
|
+ List<String> idsList = Func.toStrList(dto.getIds());
|
|
|
+ //获取ids、id下的pdfUrl
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
+ ids.add(dto.getId());
|
|
|
+ ids.addAll(idsList);
|
|
|
+ List<TrialSelfInspectionRecord> recordList = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().in(TrialSelfInspectionRecord::getId, ids).eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
+ TrialSelfInspectionRecord oldObj = recordList.stream().filter(f -> f.getId().equals(Long.parseLong(dto.getId()))).findAny().orElse(null);
|
|
|
+ List<TrialSelfInspectionRecord> oldOther = recordList.stream().filter(f -> !f.getId().equals(Long.parseLong(dto.getId()))).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //获取原始pdfUrl
|
|
|
+ String sql = "select * from u_trial_raw_material_self_record where self_record_id =" + dto.getId();
|
|
|
+ TrialRawMaterialSelfRecord recordOld = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class)).stream().findAny().orElse(null);
|
|
|
+ if (recordOld != null) {
|
|
|
+ assert oldObj != null;
|
|
|
+ oldObj.setPdfUrl(recordOld.getOldPdfUrl());
|
|
|
+ }
|
|
|
|
|
|
- List<String> strings = Func.toStrList(dto.getIds());
|
|
|
- //新增关系
|
|
|
- for (String s : strings) {
|
|
|
- String sql2 = "insert into u_trial_raw_material_self_record(id,self_record_id,raw_material_record_id) values(" + SnowFlakeUtil.getId() + "," + dto.getId() + "," + s + ")";
|
|
|
- jdbcTemplate.execute(sql2);
|
|
|
- }
|
|
|
+ //当前记录pdfUrl置顶
|
|
|
+ List<TrialSelfInspectionRecord> recordList2 = new ArrayList<>();
|
|
|
+ recordList2.add(oldObj);
|
|
|
+ recordList2.addAll(oldOther);
|
|
|
+ List<String> listPdfUrl = recordList2.stream().map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (listPdfUrl.size() > 0) {
|
|
|
+ //合并PDF
|
|
|
+ String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String listPdf = filePath + "/pdf/" + dto.getNodeId() + ".pdf";
|
|
|
+ File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
+ if (tabPDF.exists()) {
|
|
|
+ tabPDF.delete();
|
|
|
+ }
|
|
|
+ FileUtils.mergePdfPublicMethods(listPdfUrl, listPdf);
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(dto.getNodeId() + ".pdf", listPdf);
|
|
|
+
|
|
|
+ //获取试验记录id的试验项目名称
|
|
|
+ List<String> collect = recordList.stream().map(TrialSelfInspectionRecord::getTrialProjectName).collect(Collectors.toList());
|
|
|
+ String name = collect.stream().findAny().orElse(null);
|
|
|
+ String trialProjectName;
|
|
|
+ if (collect.size() > 1) {
|
|
|
+ trialProjectName = name + "等" + collect.size() + "个文件";
|
|
|
+ } else {
|
|
|
+ trialProjectName = name;
|
|
|
+ }
|
|
|
|
|
|
- //获取ids、id下的PDF
|
|
|
- List<String> ids = new ArrayList<>(strings);
|
|
|
- ids.add(dto.getId());
|
|
|
- List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().in(TrialSelfInspectionRecord::getId, ids).eq(TrialSelfInspectionRecord::getStatus, 1));
|
|
|
- List<String> listPDFURL = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
|
|
|
+ //删除当前记录关系信息
|
|
|
+ String sql1 = "delete from u_trial_raw_material_self_record where self_record_id ='" + dto.getId() + "'";
|
|
|
+ jdbcTemplate.execute(sql1);
|
|
|
+ //新增当前记录关系信息
|
|
|
+ for (String s : idsList) {
|
|
|
+ assert oldObj != null;
|
|
|
+ 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() + "," + s + ",'" + oldObj.getPdfUrl() + "')";
|
|
|
+ jdbcTemplate.execute(sql2);
|
|
|
+ }
|
|
|
|
|
|
- if (listPDFURL.size() > 0) {
|
|
|
- //合并PDF
|
|
|
- String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- String listPdf = filePath + "/pdf/" + dto.getNodeId() + ".pdf";
|
|
|
- File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
- if (tabPDF.exists()) {
|
|
|
- tabPDF.delete();
|
|
|
- }
|
|
|
- FileUtils.mergePdfPublicMethods(listPDFURL, listPdf);
|
|
|
- BladeFile bladeFile = this.newIOSSClient.uploadFile(dto.getNodeId() + ".pdf", listPdf);
|
|
|
-
|
|
|
- //获取试验记录id的试验项目名称
|
|
|
- List<String> collect = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getTrialProjectName).collect(Collectors.toList());
|
|
|
- String oneName = collect.stream().findAny().orElse(null);
|
|
|
- String trialProjectName = "";
|
|
|
- if (StringUtils.isNotEmpty(oneName)) {
|
|
|
- trialProjectName = oneName + "等" + collect.size() + "个文件";
|
|
|
- }
|
|
|
+ if (ObjectUtil.isNotEmpty(bladeFile)) {
|
|
|
+ //修改pdfURL
|
|
|
+ String querySql = "select * from u_information_query where classify='" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "'";
|
|
|
+ List<Map<String, Object>> resultSQL = jdbcTemplate.queryForList(querySql);
|
|
|
+ if (resultSQL.size() > 0) {
|
|
|
+ String sql3 = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name = '" + trialProjectName + "' where classify= '" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "'";
|
|
|
+ jdbcTemplate.execute(sql3);
|
|
|
+ } else {
|
|
|
+ informationQueryClient.saveData(dto.getId(), dto.getProjectId(), dto.getContractId(), String.valueOf(dto.getType()), bladeFile.getLink(), trialProjectName);
|
|
|
+ }
|
|
|
+
|
|
|
+ //修改当前记录pdfUrl
|
|
|
+ this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, bladeFile.getLink()).eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
|
|
|
|
- if (ObjectUtil.isNotEmpty(bladeFile)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ //删除关系
|
|
|
+ jdbcTemplate.execute(sql1);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //删除关系,恢复当前记录的原始pdfUrl
|
|
|
+ TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
|
+ String sql = "select * from u_trial_raw_material_self_record where self_record_id =" + dto.getId();
|
|
|
+ TrialRawMaterialSelfRecord record = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class)).stream().findAny().orElse(null);
|
|
|
+ if (record != null) {
|
|
|
//修改pdfURL
|
|
|
String querySql = "select * from u_information_query where classify='" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "'";
|
|
|
List<Map<String, Object>> resultSQL = jdbcTemplate.queryForList(querySql);
|
|
|
if (resultSQL.size() > 0) {
|
|
|
- String sql3 = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name = '" + trialProjectName + "' where classify= '" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "'";
|
|
|
+ String sql3 = "update u_information_query set pdf_url ='" + record.getOldPdfUrl() + "', name = '" + obj.getTrialProjectName() + "' where classify= '" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "'";
|
|
|
jdbcTemplate.execute(sql3);
|
|
|
} else {
|
|
|
- informationQueryClient.saveData(dto.getId(), dto.getProjectId(), dto.getContractId(), String.valueOf(dto.getType()), bladeFile.getLink(), trialProjectName);
|
|
|
+ informationQueryClient.saveData(dto.getId(), dto.getProjectId(), dto.getContractId(), String.valueOf(dto.getType()), record.getOldPdfUrl(), obj.getTrialProjectName());
|
|
|
}
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- //删除关系
|
|
|
+
|
|
|
+ //修改当前记录pdfUrl
|
|
|
+ this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, record.getOldPdfUrl()).eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
|
+
|
|
|
+ //删除当前记录关系信息
|
|
|
+ String sql1 = "delete from u_trial_raw_material_self_record where self_record_id ='" + dto.getId() + "'";
|
|
|
jdbcTemplate.execute(sql1);
|
|
|
- return false;
|
|
|
}
|
|
|
+ return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
@@ -569,7 +637,6 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean selfSubmit(TrialSelfInspectionRecordDTO dto) throws Exception {
|
|
|
if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
//构建记录表编号、报告单编号
|
|
@@ -589,18 +656,15 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
dto.setTableIds(join);
|
|
|
}
|
|
|
|
|
|
- //关联新增或修改了表信息
|
|
|
this.saveOrUpdate(dto);
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
|
|
- //获取当前试验记录信息
|
|
|
+ //获取当前最新的试验记录信息
|
|
|
TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
|
|
|
|
- //已审批任务,关联到工程部位及用途信息
|
|
|
- this.recordProjectPosition(dto, obj);
|
|
|
-
|
|
|
try {
|
|
|
//保存实体表数据、记录信息、生成pdf
|
|
|
+ assert obj != null;
|
|
|
String pdfURL = excelTabClient.saveTabData(dto.getIsBatchSave(), dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
|
|
|
if (StringUtils.isNotEmpty(pdfURL)) {
|
|
|
//修改合并pdf
|
|
@@ -612,9 +676,6 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
throw new ServiceException("保存实体表数据生成pdf时发生异常 " + e.getMessage());
|
|
|
}
|
|
|
|
|
|
- //关联样品信息
|
|
|
- this.recordSample(dto);
|
|
|
-
|
|
|
//新增设备使用记录信息
|
|
|
this.trialDeviceUseService.addDeviceUseInfo(dto);
|
|
|
}
|
|
@@ -622,30 +683,43 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private void recordSample(TrialSelfInspectionRecordDTO dto) {
|
|
|
+ @Override
|
|
|
+ public boolean recordSampleSubmit(RecordSampleSubmitDTO dto) {
|
|
|
+ if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
+ throw new ServiceException("请先保存填报数据后,再关联取样信息");
|
|
|
+ }
|
|
|
+ //删除关联信息
|
|
|
+ baseMapper.delSelfSample(dto.getId());
|
|
|
if (StringUtils.isNotEmpty(dto.getSampleIds())) {
|
|
|
- baseMapper.delSelfSample(dto.getId()); //删除关联信息
|
|
|
List<String> ids = Func.toStrList(dto.getSampleIds());
|
|
|
- for (String id : ids) { //新增关联信息
|
|
|
+ for (String id : ids) {
|
|
|
+ //新增关联信息
|
|
|
baseMapper.saveSelfSample(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
- private void recordProjectPosition(TrialSelfInspectionRecordDTO dto, TrialSelfInspectionRecord obj) throws FileNotFoundException {
|
|
|
+ @Override
|
|
|
+ public boolean recordProjectPosition(SelfProjectPositionSubmitDTO dto) throws FileNotFoundException {
|
|
|
+ if (ObjectUtil.isEmpty(dto.getId())) {
|
|
|
+ throw new ServiceException("请先保存填报数据后,再关联工程部位及用途信息");
|
|
|
+ }
|
|
|
+ //已审批记录关联
|
|
|
if (StringUtils.isNotEmpty(dto.getProjectPosition())) {
|
|
|
- dto.setTaskStatus(obj.getTaskStatus());
|
|
|
- //已审批填报记录
|
|
|
- if (("已审批").equals(dto.getTaskStatus())) {
|
|
|
- baseMapper.delSelfQuality(dto.getId()); //删除关联信息
|
|
|
+ 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) { //新增关联信息
|
|
|
+ //新增关联信息
|
|
|
+ for (String id : ids) {
|
|
|
baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
}
|
|
|
|
|
|
//把当前试验的PDF合并关联到质检树节点下
|
|
|
- List<String> contractNodePKeyIds = baseMapper.selectQualityNodeId(String.valueOf(dto.getId()));
|
|
|
-
|
|
|
+ List<String> contractNodePKeyIds = baseMapper.selectQualityNodeId(String.valueOf(dto.getId())); //获取合同段质检树的节点PkeyId
|
|
|
for (String pKeyId : contractNodePKeyIds) {
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(pKeyId);
|
|
|
if (wbsTreeContract != null) {
|
|
@@ -685,7 +759,11 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
} else {
|
|
|
throw new ServiceException("当前试验记录任务未上报审批,关联工程部位及用途信息失败");
|
|
|
}
|
|
|
+ } else {
|
|
|
+ //删除关联信息
|
|
|
+ baseMapper.delSelfQuality(dto.getId());
|
|
|
}
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
private void buildNumber(TrialSelfInspectionRecordDTO dto) {
|
|
@@ -967,5 +1045,4 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|