kaiyu
2021-07-01 5b8a81b9e7bb05f4692e4fa930bb9119c6711dad
screen-manage
添加根据组织id和地区码获取设备接口
1 files added
31 ■■■■■ changed files
screen-common/src/main/java/com/moral/util/RegionCodeUtils.java 31 ●●●●● patch | view | raw | blame | history
screen-common/src/main/java/com/moral/util/RegionCodeUtils.java
New file
@@ -0,0 +1,31 @@
package com.moral.util;
/**
 * @ClassName RegionCodeUtils
 * @Description 地区码工具类
 * @Author 陈凯裕
 * @Date 2021/7/1 16:19
 * @Version TODO
 **/
public class RegionCodeUtils {
    /**
    * @Description: 将地区码转换为对应的定位级别
            * @Param: [RegionCode]
            * @return: java.lang.String
            * @Author: 陈凯裕
            * @Date: 2021/7/1
            */
    public static String regionCodeConvertToName(Integer RegionCode ) {
        String RegionCodeStr = String.valueOf(RegionCode);
        char third = RegionCodeStr.charAt(2);
        char fourth = RegionCodeStr.charAt(3);
        char fifth = RegionCodeStr.charAt(4);
        char sixth = RegionCodeStr.charAt(5);
        if(sixth=='0'&&fifth=='0'&&fourth=='0'&&third=='0')
            return "province_code";
        if(sixth=='0'&&fifth=='0')
            return "city_code";
        return "area_code";
    }
}