From eef1bac64a0080f8f609312e31f63280b85e62d6 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期五, 26 一月 2024 20:26:12 +0800
Subject: [PATCH] 2024-01-26 朱宝民 添加获取卡列表接口,应用程序使用

---
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java
index f841907..4e210ff 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java
@@ -1,7 +1,13 @@
 package com.dy.pipIrrGlobal.util;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.annotation.EnumValue;
 import com.dy.common.mybatis.envm.IEnum;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 琛屾斂鍖哄垝绾у埆
@@ -12,8 +18,7 @@
     City((byte)1, "甯�"),
     County((byte)2, "鍘�"),
     Town((byte)3,  "闀�"),
-    Village((byte)4,  "鏉�"),
-    Group((byte)5,  "缁�");
+    Village((byte)4,  "鏉�") ;
 
     @EnumValue
     public Byte code ;
@@ -24,6 +29,18 @@
         this.name = name ;
     }
 
+    //鐢ㄦ潵杞琷son
+    public static List<Map> LevelList = new ArrayList<>();
+    static {
+        DistrictLevel[] all = DistrictLevel.values();
+        for (DistrictLevel one : all) {
+            Map<String, Object> objMap = new HashMap<>();
+            objMap.put("code", one.code);
+            objMap.put("name", one.name);
+            LevelList.add(objMap) ;
+        }
+    }
+
     @Override
     public Byte getCode() {
         return this.code ;
@@ -33,4 +50,17 @@
     public String getName() {
         return this.name ;
     }
+
+    public static DistrictLevel get(Byte code){
+        if(code.byteValue() == City.code.byteValue()){
+            return City ;
+        }else if(code.byteValue() == County.code.byteValue()){
+            return County ;
+        }else if(code.byteValue() == Town.code.byteValue()){
+            return Town ;
+        }else if(code.byteValue() == Village.code.byteValue()){
+            return Village ;
+        }
+        return null ;
+    }
 }

--
Gitblit v1.8.0