Explorar el Código

静态知识类型移到字典

zhaops hace 4 años
padre
commit
cc8ba89778

+ 7 - 3
cdssman-service/src/main/java/com/diagbot/enums/StaticTypeEnum.java

@@ -1,13 +1,16 @@
+/*
 package com.diagbot.enums;
 
 import com.diagbot.core.KeyedNamed;
 import lombok.Setter;
 
+*/
 /**
  * @Description:
  * @Author:zhaops
  * @time: 2020/8/18 16:30
- */
+ *//*
+
 public enum StaticTypeEnum implements KeyedNamed {
     All(0, "全部"),
     Disease(1, "诊断"),
@@ -15,7 +18,8 @@ public enum StaticTypeEnum implements KeyedNamed {
     LisPack(3, "检验套餐"),
     Lis(4, "检验细项"),
     Pacs(5, "检查"),
-    Opeartion(6, "手术和操作");
+    PacsSubName(6, "检查子项"),
+    Opeartion(7, "手术和操作");
 
     @Setter
     private int key;
@@ -65,4 +69,4 @@ public enum StaticTypeEnum implements KeyedNamed {
     public String getName() {
         return name;
     }
-}
+}*/

+ 29 - 6
cdssman-service/src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -12,7 +12,6 @@ import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.entity.ConceptInfo;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.enums.StaticTypeEnum;
 import com.diagbot.enums.StatusEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -214,9 +213,15 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public IPage<ConceptInfoDTO> getPage(ConceptInfoPageVO conceptInfoPageVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         if (StringUtil.isNotBlank(conceptInfoPageVO.getType())) {
             String typeName
-                    = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoPageVO.getType())), 1, dicList);
+                    = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoPageVO.getType()), 1, dicList);
             conceptInfoPageVO.setTypeName(typeName);
         }
         IPage<ConceptInfoDTO> page = super.getPage(conceptInfoPageVO);
@@ -225,7 +230,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             records.forEach(record -> {
                 String typeName = convertTypeName(record.getType(), 2, dicList);
                 record.setTypeName(typeName);
-                record.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
+                record.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
             });
         }
         page.setRecords(records);
@@ -242,8 +247,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         String userId = UserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         //术语类型转换
-        String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoVO.getType()), 1, dicList);
         conceptInfoVO.setTypeName(typeName);
         ConceptInfo conceptInfo = new ConceptInfo();
 
@@ -360,8 +371,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public Boolean isExist(ConceptInfoVO conceptInfoVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         //术语类型转换
-        String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
         conceptInfoVO.setTypeName(typeName);
         QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
         conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -389,6 +406,12 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public ConceptInfoDTO getRecordById(IdVO idVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         ConceptInfoDTO conceptInfoDTO = new ConceptInfoDTO();
         ConceptInfo conceptInfo = this.getById(idVO.getId());
         if (conceptInfo == null) {
@@ -406,7 +429,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             //启用状态、修改人、修改时间为明细的内容
             String typeName = convertTypeName(conceptInfoDTO.getType(), 2, dicList);
             conceptInfoDTO.setTypeName(typeName);
-            conceptInfoDTO.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
+            conceptInfoDTO.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
             conceptInfoDTO.setModifier(conceptDetailList.get(0).getModifier());
             conceptInfoDTO.setGmtModified(conceptDetailList.get(0).getGmtModified());
         }