Browse Source

用户更多服务的出参修改

wangyu 6 years ago
parent
commit
7df75fb349

+ 49 - 0
diagbotman-service/src/main/java/com/diagbot/dto/ProductLineDTO.java

@@ -1,8 +1,13 @@
 package com.diagbot.dto;
 
+import com.diagbot.enums.AccessTypeEnum;
+import com.diagbot.enums.ChargeTypeEnum;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @Description: 用户更多服务出参类
  * @author: wangyu
@@ -29,4 +34,48 @@ public class ProductLineDTO {
      */
     private String accessType;
 
+
+    public String[] getAccessType() {
+        String[] strs =accessType.split(",");
+        List<String> list =new ArrayList();
+        for (int i =0;i<strs.length;i++){
+            if(Integer.parseInt(strs[i])==AccessTypeEnum.Online.getKey()){
+                list.add(AccessTypeEnum.Online.getName());
+            }
+            if(Integer.parseInt(strs[i])==AccessTypeEnum.InterfaceType.getKey()){
+                list.add(AccessTypeEnum.InterfaceType.getName());
+            }
+            if(Integer.parseInt(strs[i])==AccessTypeEnum.Embedded.getKey()){
+                list.add(AccessTypeEnum.Embedded.getName());
+            }
+        }
+        String[] strs1 =new String[list.size()];
+        return list.toArray(strs1);
+    }
+
+    public void setAccessType(String accessType) {
+        this.accessType = accessType;
+    }
+
+    public String[] getChargeType() {
+        String[] strs =chargeType.split(",");
+        List<String> list =new ArrayList();
+        for (int i =0;i<strs.length;i++){
+            if(Integer.parseInt(strs[i]) == ChargeTypeEnum.ByFlow.getKey()){
+                list.add(ChargeTypeEnum.ByFlow.getName());
+            }
+            if(Integer.parseInt(strs[i]) == ChargeTypeEnum.ByOrginations.getKey()){
+                list.add(ChargeTypeEnum.ByOrginations.getName());
+            }
+            if(Integer.parseInt(strs[i]) == ChargeTypeEnum.ByUser.getKey()){
+                list.add(ChargeTypeEnum.ByUser.getName());
+            }
+        }
+        String[] strs1 =new String[list.size()];
+        return list.toArray(strs1);
+    }
+
+    public void setChargeType(String chargeType) {
+        this.chargeType = chargeType;
+    }
 }

+ 3 - 3
diagbotman-service/src/main/java/com/diagbot/enums/AccessTypeEnum.java

@@ -9,9 +9,9 @@ import lombok.Setter;
  * @time: 11:06 2018/9/27
  */
 public enum AccessTypeEnum implements KeyedNamed {
-    Embedded(1, "嵌入式"),
-    InterfaceType(2, "接口方式"),
-    Online(3,"线上模式");
+    Online(1,"线上模式"),
+    Embedded(3, "嵌入式"),
+    InterfaceType(2, "接口方式");
 
     @Setter
     private Integer key;