lvy 1 сар өмнө
parent
commit
c623c88a1e

+ 11 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSeleInspectionRecordInfoDTO.java

@@ -37,6 +37,9 @@ public class TrialSeleInspectionRecordInfoDTO extends TrialSeleInspectionRecordB
 	@ApiModelProperty(value = "节点ID")
 	private Long nodeId;
 
+	@ApiModelProperty(value = "项目IDid")
+	private Long projectId;
+
 	@ApiModelProperty(value = "合同段id")
 	private Long contractId;
 
@@ -72,12 +75,20 @@ public class TrialSeleInspectionRecordInfoDTO extends TrialSeleInspectionRecordB
 	@ApiModelProperty("样品信息")
 	private List<TrialSampleInfo> trialSampleInfoList;
 
+
+	private String oldRecordNumber;
+
+
+	private String oldReportNumber;
+
 	@Data
 	public static class StandardVo {
 		@ApiModelProperty("id")
 		private Long id;
 		@ApiModelProperty("name")
 		private String name;
+		@ApiModelProperty("value")
+		private String value;
 		private List<StandardVo> info;
 	}
 }

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

@@ -613,39 +613,40 @@ public class TrialDetectionController extends BladeController {
                 }
                 vo.setStandardId(record.getStandardId());
                 vo.setStandardInfoIds(record.getStandardInfoIds());
-                if (record.getStandardInfoIds() != null && !record.getStandardInfoIds().isEmpty()) {
-                    List<StandardInfo> standardInfoList = jdbcTemplate.query("select id,parent_id,name from u_standard_info where id in (" + record.getStandardInfoIds() + ")", new BeanPropertyRowMapper<>(StandardInfo.class));
-                    if (!standardInfoList.isEmpty()) {
-                        String ids = standardInfoList.stream().map(info -> info.getParentId() + "").distinct().collect(Collectors.joining(","));
-                        List<StandardInfo> allStandardInfoList = jdbcTemplate.query("select id,parent_id,name from u_standard_info where id in (" + ids + ") UNION select id,parent_id,name from u_standard_info where parent_id in ( " + ids + " )", new BeanPropertyRowMapper<>(StandardInfo.class));
-                        Map<Long, List<StandardInfo>> map = standardInfoList.stream().collect(Collectors.groupingBy(StandardInfo::getParentId));
-                        Map<Long, List<StandardInfo>> allStandardInfoMap = allStandardInfoList.stream().peek(standardInfo -> {
+                if (record.getStandardId() != null && record.getStandardInfoIds() != null && !record.getStandardInfoIds().isEmpty()) {
+                    List<StandardInfo> list = uStandardInfoService.list(Wrappers.<StandardInfo>lambdaQuery().eq(StandardInfo::getStandardId, record.getStandardId()).eq(StandardInfo::getType, 1).eq(StandardInfo::getIsDeleted, 0));
+                    List<TrialSeleInspectionRecordInfoDTO.StandardVo> standardVos = new ArrayList<>();
+                    if (list != null && !list.isEmpty()) {
+                        Map<Long, List<StandardInfo>> map = list.stream().peek(standardInfo -> {
                             if (standardInfo.getParentId() == null) {
                                 standardInfo.setParentId(0L);
                             }
                         }).collect(Collectors.groupingBy(StandardInfo::getParentId));
-                        List<TrialSeleInspectionRecordInfoDTO.StandardVo> standardVos = new ArrayList<>();
-                        List<StandardInfo> parentStandardInfos = allStandardInfoMap.get(0L);
-                        if (parentStandardInfos != null && !parentStandardInfos.isEmpty()) {
-                            parentStandardInfos.forEach(standardInfo -> {
-                                TrialSeleInspectionRecordInfoDTO.StandardVo standardVo = new TrialSeleInspectionRecordInfoDTO.StandardVo();
-                                List<StandardInfo> list = map.get(standardInfo.getId());
-                                if (list != null && !list.isEmpty()) {
-                                    standardVo.setId(list.get(0).getId());
-                                    standardVo.setName(standardInfo.getName());
-                                    List<StandardInfo> standardInfos = allStandardInfoMap.get(standardInfo.getId());
-                                    standardVo.setInfo(standardInfos.stream().map(info -> {
-                                        TrialSeleInspectionRecordInfoDTO.StandardVo standardVo1 = new TrialSeleInspectionRecordInfoDTO.StandardVo();
-                                        standardVo1.setId(info.getId());
-                                        standardVo1.setName(info.getName());
-                                        return standardVo1;
-                                    }).collect(Collectors.toList()));
-                                    standardVos.add(standardVo);
-                                }
-                            });
-                        }
-                        vo.setStandardInfos(standardVos);
+                        List<StandardInfo> parentStandardInfos = map.get(0L);
+                        parentStandardInfos.forEach(standardInfo -> {
+                            TrialSeleInspectionRecordInfoDTO.StandardVo standardVo = new TrialSeleInspectionRecordInfoDTO.StandardVo();
+                            List<StandardInfo> standardInfos = map.get(standardInfo.getId());
+                            List<TrialSeleInspectionRecordInfoDTO.StandardVo> standardVoList = standardInfos.stream().map(item -> {
+                                TrialSeleInspectionRecordInfoDTO.StandardVo standardVo1 = new TrialSeleInspectionRecordInfoDTO.StandardVo();
+                                standardVo1.setId(item.getId());
+                                standardVo1.setName(item.getName());
+                                standardVo1.setValue("");
+                                return standardVo1;
+                            }).collect(Collectors.toList());
+                            TrialSeleInspectionRecordInfoDTO.StandardVo standardVo1 = standardVoList.stream().filter(item -> record.getStandardInfoIds().contains(item.getId() + "")).findFirst().orElse(null);
+                            if (standardVo1 != null) {
+                                standardVo.setValue(standardVo1.getId() + "");
+                            } else {
+                                standardVo.setValue("");
+                            }
+                            standardVo.setId(standardInfo.getId());
+                            standardVo.setName(standardInfo.getName());
+                            standardVo.setInfo(standardVoList);
+                            standardVos.add(standardVo);
+                        });
+
                     }
+                    vo.setStandardInfos(standardVos);
                 }
                 vo.setReportNo(record.getReportNo());
                 vo.setRecordNo(record.getRecordNo());

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -896,7 +896,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
             Document doc = Jsoup.parse(htmlString);
             for (Element element : doc.getElementsByAttributeValueStarting("id", "key_")) {
                 String id = element.attr("id");
-                if("key".equals( id)) {
+                if(id == null || id.startsWith("key__")) {
                     continue;
                 }
                 String text = jsonObject.getString(id);