wangyu пре 6 година
родитељ
комит
85b0698179

+ 1 - 1
icssman-service/src/main/java/com/diagbot/dto/DisDTO.java

@@ -12,7 +12,7 @@ import lombok.Setter;
 @Getter
 public class DisDTO {
     //id
-    private Long parentId;
+    private Long id;
     //名称
     private String name;
 

+ 8 - 3
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -423,7 +423,12 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         disTypeQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
                 .eq("type",1);
         List<DisType> disTypes = disTypeFacade.list(disTypeQueryWrapper);
-        List<DisDTO> disDTOS = BeanUtil.listCopyTo(disTypes,DisDTO.class);
+        List<DisDTO> disDTOS = new ArrayList<>();
+        for (DisType disType: disTypes) {
+            DisDTO disDTO = new DisDTO();
+            disDTO.setId(disType.getParentId());
+            disDTOS.add(disDTO);
+        }
         List<Long> questionIds = disTypes.stream().map(DisType::getParentId).collect(Collectors.toList());
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
         questionInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
@@ -432,8 +437,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .stream()
                 .collect(Collectors.toMap(QuestionInfo::getId,questionInfo -> questionInfo));
         for (DisDTO disDTO: disDTOS) {
-            if(questionInfoMap.get(disDTO.getParentId()) != null){
-                disDTO.setName(questionInfoMap.get(disDTO.getParentId()).getTagName());
+            if(questionInfoMap.get(disDTO.getId()) != null){
+                disDTO.setName(questionInfoMap.get(disDTO.getId()).getTagName());
             }
         }
         GetAllDeptAndDisInfoDTO getAllDeptAndDisInfoDTO = new GetAllDeptAndDisInfoDTO();