From ac34819ca4dadb4dfc14215c31f76db6e3defdd1 Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期一, 27 十一月 2023 09:27:47 +0800 Subject: [PATCH] 提交了才能重新拉 --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java | 19 +++++++++++++++++-- 1 files changed, 17 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..6cd780d 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 @@ -9,11 +9,11 @@ */ public enum DistrictLevel implements IEnum { + Province((byte)0, "鐪�"), City((byte)1, "甯�"), County((byte)2, "鍘�"), Town((byte)3, "闀�"), - Village((byte)4, "鏉�"), - Group((byte)5, "缁�"); + Village((byte)4, "鏉�") ; @EnumValue public Byte code ; @@ -33,4 +33,19 @@ public String getName() { return this.name ; } + + public static DistrictLevel get(Byte code){ + if(code.byteValue() == Province.code.byteValue()){ + return Province ; + }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