|
@@ -161,17 +161,16 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean selfUpdateAncillaryDocuments(List<SampleAncillaryDocumentsVO> vo) {
|
|
|
- for (SampleAncillaryDocumentsVO sampleAncillaryDocumentsVO : vo) {
|
|
|
- TrialMaterialMobilization trialMaterialMobilization = trialMaterialMobilizationMapper.selectById(sampleAncillaryDocumentsVO.getId());
|
|
|
- if (ObjectUtil.isEmpty(trialMaterialMobilization)) {
|
|
|
- throw new ServiceException("未获取到对应材料信息,修改失败");
|
|
|
- }
|
|
|
- trialMaterialMobilization.setQualityInspectionReport(sampleAncillaryDocumentsVO.getQualityInspectionReport());
|
|
|
- trialMaterialMobilization.setOtherAccessories(sampleAncillaryDocumentsVO.getOtherAccessories());
|
|
|
- trialMaterialMobilization.setProductionCertificate(sampleAncillaryDocumentsVO.getProductionCertificate());
|
|
|
- trialMaterialMobilizationMapper.updateById(trialMaterialMobilization);
|
|
|
+ public boolean selfUpdateAncillaryDocuments(SampleAncillaryDocumentsVO vo) {
|
|
|
+ TrialMaterialMobilization trialMaterialMobilization = trialMaterialMobilizationMapper.selectById(vo.getId());
|
|
|
+ if (ObjectUtil.isEmpty(trialMaterialMobilization)) {
|
|
|
+ throw new ServiceException("未获取到对应材料信息,修改失败");
|
|
|
}
|
|
|
+ trialMaterialMobilization.setQualityInspectionReport(vo.getQualityInspectionReport());
|
|
|
+ trialMaterialMobilization.setOtherAccessories(vo.getOtherAccessories());
|
|
|
+ trialMaterialMobilization.setProductionCertificate(vo.getProductionCertificate());
|
|
|
+ trialMaterialMobilizationMapper.updateById(trialMaterialMobilization);
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -536,70 +535,78 @@ public class TrialSelfInspectionRecordServiceImpl
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
|
|
//关联样品信息
|
|
|
- if (StringUtils.isNotEmpty(dto.getSampleIds())) {
|
|
|
- baseMapper.delSelfSample(dto.getId()); //删除关联信息
|
|
|
- List<String> ids = Func.toStrList(dto.getSampleIds());
|
|
|
- for (String id : ids) { //新增关联信息
|
|
|
- baseMapper.saveSelfSample(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
- }
|
|
|
- }
|
|
|
+ this.recordSample(dto);
|
|
|
|
|
|
//关联工程部位及用途信息
|
|
|
- if (StringUtils.isNotEmpty(dto.getProjectPosition())) {
|
|
|
- baseMapper.delSelfQuality(dto.getId()); //删除关联信息
|
|
|
- List<String> ids = Func.toStrList(dto.getProjectPosition());
|
|
|
- for (String id : ids) { //新增关联信息
|
|
|
- baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
- }
|
|
|
-
|
|
|
- //已审批填报记录
|
|
|
- if (("已审批").equals(dto.getTaskStatus())) {
|
|
|
- //把当前试验的PDF合并关联到质检树节点下
|
|
|
- List<String> contractNodePKeyIds = baseMapper.selectQualityNodeId(String.valueOf(dto.getId()));
|
|
|
-
|
|
|
- for (String id : contractNodePKeyIds) {
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(id);
|
|
|
- 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 pdfUrlAll = baseMapper.selectInformationQuery(id, wbsTreeContract.getContractId(), classify);
|
|
|
- //质检节点合并pdfUrl
|
|
|
- pdfUrlList.add(pdfUrlAll);
|
|
|
- //试验pdfUrl
|
|
|
- pdfUrlList.add(ObjectUtil.isNotEmpty(dto.getPdfUrl()) ? dto.getPdfUrl() : "");
|
|
|
-
|
|
|
- //合并PDF
|
|
|
- String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- String listPdf = filePath + "/pdf/" + id + ".pdf";
|
|
|
- File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
- if (tabPDF.exists()) {
|
|
|
- tabPDF.delete();
|
|
|
- }
|
|
|
- FileUtils.mergePdfPublicMethods(pdfUrlList, listPdf);
|
|
|
- BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", listPdf);
|
|
|
- if (bladeFile != null) {
|
|
|
- //修改质检合并pdfURL
|
|
|
- baseMapper.updateInformationQuery(id, wbsTreeContract.getContractId(), classify, bladeFile.getLink());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.recordProjectPosition(dto);
|
|
|
}
|
|
|
|
|
|
- //新增设备使用记录信息
|
|
|
if (StringUtils.isNotEmpty(dto.getDeviceUseIds())) {
|
|
|
+ //新增设备使用记录信息
|
|
|
trialDeviceUseService.addDeviceUseInfo(dto);
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ private void recordSample(TrialSelfInspectionRecordDTO dto) {
|
|
|
+ if (StringUtils.isNotEmpty(dto.getSampleIds())) {
|
|
|
+ baseMapper.delSelfSample(dto.getId()); //删除关联信息
|
|
|
+ List<String> ids = Func.toStrList(dto.getSampleIds());
|
|
|
+ for (String id : ids) { //新增关联信息
|
|
|
+ baseMapper.saveSelfSample(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void recordProjectPosition(TrialSelfInspectionRecordDTO dto) throws FileNotFoundException {
|
|
|
+ if (StringUtils.isNotEmpty(dto.getProjectPosition())) {
|
|
|
+ baseMapper.delSelfQuality(dto.getId()); //删除关联信息
|
|
|
+ List<String> ids = Func.toStrList(dto.getProjectPosition());
|
|
|
+ for (String id : ids) { //新增关联信息
|
|
|
+ baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), dto.getId(), id);
|
|
|
+ }
|
|
|
+
|
|
|
+ //已审批填报记录
|
|
|
+ if (("已审批").equals(dto.getTaskStatus())) {
|
|
|
+ //把当前试验的PDF合并关联到质检树节点下
|
|
|
+ List<String> contractNodePKeyIds = baseMapper.selectQualityNodeId(String.valueOf(dto.getId()));
|
|
|
+
|
|
|
+ for (String id : contractNodePKeyIds) {
|
|
|
+ WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(id);
|
|
|
+ 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 pdfUrlAll = baseMapper.selectInformationQuery(id, wbsTreeContract.getContractId(), classify);
|
|
|
+ //质检节点合并pdfUrl
|
|
|
+ pdfUrlList.add(pdfUrlAll);
|
|
|
+ //试验pdfUrl
|
|
|
+ pdfUrlList.add(ObjectUtil.isNotEmpty(dto.getPdfUrl()) ? dto.getPdfUrl() : "");
|
|
|
+
|
|
|
+ //合并PDF
|
|
|
+ String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String listPdf = filePath + "/pdf/" + id + ".pdf";
|
|
|
+ File tabPDF = ResourceUtil.getFile(listPdf);
|
|
|
+ if (tabPDF.exists()) {
|
|
|
+ tabPDF.delete();
|
|
|
+ }
|
|
|
+ FileUtils.mergePdfPublicMethods(pdfUrlList, listPdf);
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", listPdf);
|
|
|
+ if (bladeFile != null) {
|
|
|
+ //修改质检合并pdfURL
|
|
|
+ baseMapper.updateInformationQuery(id, wbsTreeContract.getContractId(), classify, bladeFile.getLink());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void buildNumber(TrialSelfInspectionRecordDTO dto) {
|
|
|
StringSPUtils spUtils = new StringSPUtils();
|
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectAll(dto.getNodeId());
|