沈斌
2018-06-09 6e9c3733135fa96360c8c76e76b431efa5d7f52d
src/main/java/com/moral/service/impl/AreaServiceImpl.java
@@ -58,17 +58,20 @@
            String cityCode = codeStr.substring(0,4)+"00";
            City city = cityMapper.selectByPrimaryKey(Integer.valueOf(cityCode));
            Area area = areaMapper.selectByPrimaryKey(code);
            fullName = province.getProvinceName()+city.getCityName()+area.getAreaName();
            fullName = province.getProvinceName().replaceAll(" ", "")
                    +" "+city.getCityName().replaceAll(" ", "")
                    +" "+area.getAreaName().replaceAll(" ", "");
        }  else if(!codeStr.endsWith("0000")){
            // 此时为 地级市code
            String provinceCode = codeStr.substring(0,2)+"0000";
            Province province = provinceMapper.selectByPrimaryKey(Integer.valueOf(provinceCode));
            City city = cityMapper.selectByPrimaryKey(code);
            fullName = province.getProvinceName()+city.getCityName();
            fullName = province.getProvinceName().replaceAll(" ", "")
                    +" "+city.getCityName().replaceAll(" ", "");
        } else {
            // 此时为 省code
            Province province = provinceMapper.selectByPrimaryKey(code);
            fullName = province.getProvinceName();
            fullName = province.getProvinceName().replaceAll(" ", "");
        }
        return fullName;
    }