浏览代码

Merge remote-tracking branch 'origin/dev/tran' into dev/tran

wangyu 6 年之前
父节点
当前提交
9671db217e

+ 8 - 0
icssman-service/src/main/java/com/diagbot/dto/QuestionPageDTO.java

@@ -2,6 +2,7 @@ package com.diagbot.dto;
 
 import com.diagbot.entity.QuestionDetail;
 import com.diagbot.entity.QuestionMapping;
+import com.diagbot.enums.ControlTypeEnum;
 import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.enums.TagTypeEnum;
 import lombok.Getter;
@@ -97,6 +98,10 @@ public class QuestionPageDTO implements Serializable {
      * 控件类型(0:无类型,默认值 1:下拉单选 2:下拉多选 3:纯文本 4:待定 5:待定 6:文本框 7:数字键盘文本框 99:联合推送)
      */
     private Integer controlType;
+    /**
+     * 控件类型(中文)
+     */
+    private String controlTypeCn;
 
     /**
      * 类型
@@ -172,5 +177,8 @@ public class QuestionPageDTO implements Serializable {
     public String getTagTypeCn() {
         return this.tagType == null ? "" : TagTypeEnum.getName(this.tagType);
     }
+    public String getControlTypeCn() {
+        return this.controlType == null ? "" : ControlTypeEnum.getName(this.controlType);
+    }
     /**********************************************************************/
 }

+ 56 - 0
icssman-service/src/main/java/com/diagbot/enums/ControlTypeEnum.java

@@ -0,0 +1,56 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:检索显示类型枚举类
+ * @author: zhoutg
+ * @Date: 2018/10/26 10:35
+ */
+public enum ControlTypeEnum implements KeyedNamed {
+
+    CONTROLTYPE_0(0, "默认值"),
+    CONTROLTYPE_1(1, "下拉单选"),
+    CONTROLTYPE_2(2, "下拉多选"),
+    CONTROLTYPE_3(3, "纯文本"),
+    CONTROLTYPE_5(5, "数字键盘带单位"),
+    CONTROLTYPE_6(6, "文本框"),
+    CONTROLTYPE_7(7, "数字键盘文本框"),
+    CONTROLTYPE_99(99, "联合推送");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    ControlTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ControlTypeEnum getEnum(Integer key) {
+        for (ControlTypeEnum item : ControlTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        ControlTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}