Ver Fonte

试验材料管理、试验检测优化

lvy há 1 mês atrás
pai
commit
26c92680c6

+ 6 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSampleInfo.java

@@ -69,6 +69,12 @@ public class TrialSampleInfo extends BaseEntity {
     @ApiModelProperty(value = "代表数量")
     private String representativeCount;
 
+    /**
+     * 代表单位
+     */
+    @ApiModelProperty(value = "代表单位")
+    private String representativeUnit;
+
     /**
      * 计算单位
      */

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java

@@ -558,12 +558,12 @@ public class TrialDetectionController extends BladeController {
         vo.setConstructionUnit(contractInfo.getConstructionUnitName());
         if (contractInfo.getContractType().equals(2)) {
             List<ContractInfo> query = jdbcTemplate.query("select contract_name from m_contract_info where is_deleted = 0 and p_id = " + projectId + " and contract_type = 1", new BeanPropertyRowMapper<>(ContractInfo.class));
-            vo.setConstructionUnit(org.apache.commons.lang.StringUtils.join(query.stream().map(ContractInfo::getContractName).collect(Collectors.toList()), ","));
+            vo.setConstructionUnit(org.apache.commons.lang.StringUtils.join(query.stream().map(ContractInfo::getContractName).collect(Collectors.toList()), ""));
         } else if (contractInfo.getContractType().equals(3)) {
             List<ContractInfo> query = jdbcTemplate.query("select contract_name from m_contract_info where is_deleted = 0 and p_id = " + projectId + " and contract_type = 1", new BeanPropertyRowMapper<>(ContractInfo.class));
-            vo.setConstructionUnit(org.apache.commons.lang.StringUtils.join(query.stream().map(ContractInfo::getContractName).collect(Collectors.toList()), ","));
+            vo.setConstructionUnit(org.apache.commons.lang.StringUtils.join(query.stream().map(ContractInfo::getContractName).collect(Collectors.toList()), ""));
             List<ContractInfo> query1 = jdbcTemplate.query("select contract_name from m_contract_info where is_deleted = 0 and p_id = " + projectId + " and contract_type = 2", new BeanPropertyRowMapper<>(ContractInfo.class));
-            vo.setSupervisionUnit(org.apache.commons.lang.StringUtils.join(query1.stream().map(ContractInfo::getContractName).collect(Collectors.toList()), ","));
+            vo.setSupervisionUnit(org.apache.commons.lang.StringUtils.join(query1.stream().map(ContractInfo::getContractName).collect(Collectors.toList()), ""));
         }
         vo.setSupervisionUnit(contractInfo.getSupervisionUnitName());
         vo.setLabName(contractInfo.getLaboratoryName());

+ 8 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java

@@ -403,12 +403,16 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
 
     @Override
     public List<TrialSamplingRecordVO> samplingRecordList(Long id) {
+        TrialMaterialMobilization trialMaterialMobilization = this.getById(id);
+        if (trialMaterialMobilization == null) {
+            return new ArrayList<>();
+        }
         //获取用户信息
         List<User> userList = iUserClient.selectUserAll();
         //获取关联信息
         List<TrialSamplingRecord> trialSamplingRecords = trialSamplingRecordMapper.selectListByMobilizationId(id);
         //获取样品信息
-        List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectList(Wrappers.<TrialSampleInfo>query().lambda());
+        List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectList(Wrappers.<TrialSampleInfo>query().lambda().eq(TrialSampleInfo::getContractId, trialMaterialMobilization.getContractId()));
         List<TrialSamplingRecordVO> list = new ArrayList<>();
         for (TrialSamplingRecord trialSamplingRecord : trialSamplingRecords) {
             for (TrialSampleInfo trialSampleInfo : trialSampleInfos) {
@@ -444,10 +448,12 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
             } else if (extension.equals("docx") || extension.equals("doc")) {
                 bladeFile = this.commonFileClient.wordToPdf(files);
             } else if (extension.equals("pdf")) {
-                pdfUrl = url;
+                bladeFile = null;
             }
             if (bladeFile != null) {
                 pdfUrl = bladeFile.getPdfUrl();
+            } else {
+                pdfUrl = url;
             }
         } catch (IOException e) {
             log.error("上传文件失败", e);

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -246,6 +246,10 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
             }
             trialSampleInfoDTO.setId(SnowFlakeUtil.getId());
             list.add(trialSampleInfoDTO);
+            if (trialSampleInfoDTO.getId() != null && trialSampleInfoDTO.getMobilizationId() != null && trialSampleInfoDTO.getMobilizationId() != -1) {
+                // todo 批量插入
+                this.trialSamplingRecordMapper.insertRecord(SnowFlakeUtil.getId(), trialSampleInfoDTO.getMobilizationId(), trialSampleInfoDTO.getId());
+            }
         }
         return this.saveBatch(list);
     }

+ 15 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -221,6 +221,21 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                          }
                      }
                 }
+                if (record.getBaseInfo() != null && !record.getBaseInfo().isEmpty()) {
+                    try {
+                        TrialSeleInspectionRecordBaseInfoDTO baseInfoDTO = JSON.parseObject(record.getBaseInfo(), TrialSeleInspectionRecordBaseInfoDTO.class);
+                        if (baseInfoDTO != null) {
+                            if (StringUtil.hasText(baseInfoDTO.getEntrustNo())) {
+                                record.setEntrustNo(baseInfoDTO.getEntrustNo());
+                            }
+                            if (StringUtil.hasText(baseInfoDTO.getProjectPosition())) {
+                                record.setProjectPositionName(baseInfoDTO.getProjectPosition());
+                            }
+                        }
+                    } catch (Exception e) {
+                        log.warn("JSON反序列化失败:" + record.getBaseInfo());
+                    }
+                }
                 //合并的pdfUrl
                 String pdf = this.getMergePdfToTrialNew(record.getContractId(), record.getId(), dto.getType());
                 record.setPdfUrl(pdf);