From fab506b80e84a969cf7defedaff18e264071f700 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 31 五月 2024 17:13:45 +0800
Subject: [PATCH] 田间灌溉项目管理 优化代码 修改轮罐组绑定的灌溉单元接口
---
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java | 15 +++++++++------
1 files changed, 9 insertions(+), 6 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 a4fd7e4..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,9 +1,12 @@
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,7 +15,6 @@
*/
public enum DistrictLevel implements IEnum {
- Province((byte)0, "鐪�"),
City((byte)1, "甯�"),
County((byte)2, "鍘�"),
Town((byte)3, "闀�"),
@@ -28,11 +30,14 @@
}
//鐢ㄦ潵杞琷son
- public static Map<Byte, DistrictLevel> ObjMap = new HashMap<Byte, DistrictLevel>();
+ public static List<Map> LevelList = new ArrayList<>();
static {
DistrictLevel[] all = DistrictLevel.values();
for (DistrictLevel one : all) {
- ObjMap.put(one.code, one);
+ Map<String, Object> objMap = new HashMap<>();
+ objMap.put("code", one.code);
+ objMap.put("name", one.name);
+ LevelList.add(objMap) ;
}
}
@@ -47,9 +52,7 @@
}
public static DistrictLevel get(Byte code){
- if(code.byteValue() == Province.code.byteValue()){
- return Province ;
- }if(code.byteValue() == City.code.byteValue()){
+ if(code.byteValue() == City.code.byteValue()){
return City ;
}else if(code.byteValue() == County.code.byteValue()){
return County ;
--
Gitblit v1.8.0