Browse Source

模板维护——获取模板列表信息(加入模板归属名称)

wangyu 6 years ago
parent
commit
f3108e4f1d

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

@@ -12,6 +12,9 @@ import lombok.Setter;
 @Getter
 @Setter
 public class ModuleInfoListDTO extends ModuleInfo {
-
+    //操作人名称
     private String userName;
+    //归属名称
+    private String ascriptionName;
+
 }

+ 10 - 0
icssman-service/src/main/java/com/diagbot/entity/ModuleInfo.java

@@ -60,6 +60,16 @@ public class ModuleInfo implements Serializable {
      */
     private String name;
 
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 慢病
+     */
+    private Long disease;
+
     /**
      * 备注
      */

+ 15 - 0
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -8,6 +8,7 @@ import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DictionaryInfo;
 import com.diagbot.entity.ModuleDetail;
 import com.diagbot.entity.ModuleInfo;
 import com.diagbot.enums.IsDeleteEnum;
@@ -47,6 +48,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     QuestionInfoFacade questionInfoFacade;
     @Autowired
     UserServiceClient userServiceClient;
+    @Autowired
+    DictionaryFacade dictionaryFacade;
 
     /**
      * 根据id删除标签模板
@@ -193,6 +196,17 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
             ids.add(moduleInfoListDTO.getModifier());
         }
+        //获取模板类型名称
+        QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
+        dictionaryInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
+            .eq("group_type",4)
+            .eq("return_type",1)
+            .orderByDesc("order_no");
+        List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
+        Map<String,DictionaryInfo> dictionaryInfoMap = new HashMap<>();
+        for (DictionaryInfo dictionaryInfo:dictionaryInfoList) {
+            dictionaryInfoMap.put(dictionaryInfo.getVal(),dictionaryInfo);
+        }
         //获取用户信息
         RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
         if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
@@ -202,6 +216,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         //将用户信息放入实体
         for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
             moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
+            moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfoListDTO.getType().intValue())).getName());
         }
         return moduleInfoDTOIPage;
     }