소스 검색

修改分隔符

zhoutg 4 년 전
부모
커밋
e3770c45cc

+ 49 - 0
cdssman-service/src/main/java/com/diagbot/enums/CommonEnum.java

@@ -0,0 +1,49 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum CommonEnum implements KeyedNamed {
+    splitSymbol(1, "#");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    CommonEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static CommonEnum getEnum(int key) {
+        for (CommonEnum item : CommonEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        CommonEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 2 - 1
cdssman-service/src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -22,6 +22,7 @@ import com.diagbot.entity.KlLibraryInfo;
 import com.diagbot.entity.KlRelation;
 import com.diagbot.entity.KlRule;
 import com.diagbot.entity.KlRuleBase;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.enums.RelationLibTypeEnum;
@@ -155,7 +156,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
                 i.setSynonymName(libMap.get(i.getConceptId())
                         .stream()
                         .map(KlLibraryInfo::getName)
-                        .collect(Collectors.joining("、")));
+                        .collect(Collectors.joining(CommonEnum.splitSymbol.getName())));
                 i.setModifierName(respDTO.data.get(i.getModifierId()));
             });
         }