liurunyu
2023-11-27 8a9a931d5f8ca0e235e0d263032e386038f917fa
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 ;
    }
}