From 16a96f990b1c2ae06f56a8ebac44e911b9d8ef32 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 23 十一月 2023 14:20:03 +0800 Subject: [PATCH] 行政区划编码最大值改为999,农户编码改为字符串型 --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java | 16 ++++++++++++++-- 1 files changed, 14 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..edc4a10 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 @@ -12,8 +12,7 @@ City((byte)1, "甯�"), County((byte)2, "鍘�"), Town((byte)3, "闀�"), - Village((byte)4, "鏉�"), - Group((byte)5, "缁�"); + Village((byte)4, "鏉�") ; @EnumValue public Byte code ; @@ -33,4 +32,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