更换搞得KEy
This commit is contained in:
+21
-1
@@ -185,7 +185,27 @@ public class AddrSvcController {
|
||||
String msg = json.getString("msg");
|
||||
BasicModel basicModel = new BasicModel(code, msg);
|
||||
if (json.containsKey("result")) {
|
||||
basicModel.setResult(CommonDtoUtils.transformV(StructureAndCompleteDto.class, json.get("result")));
|
||||
StructureAndCompleteDto structureAndCompleteDto = CommonDtoUtils.transformV(StructureAndCompleteDto.class, json.get("result"));
|
||||
if("1".equals(model.getShowCode())){
|
||||
if(StringUtils.isNotBlank(structureAndCompleteDto.getProvinceCode())){
|
||||
structureAndCompleteDto.setProvinceCode(structureAndCompleteDto.getProvinceCode().substring(0, 6));
|
||||
}
|
||||
if(StringUtils.isNotBlank(structureAndCompleteDto.getCityCode())){
|
||||
structureAndCompleteDto.setCityCode(structureAndCompleteDto.getCityCode().substring(0, 6));
|
||||
}
|
||||
if(StringUtils.isNotBlank(structureAndCompleteDto.getDistrictCode())){
|
||||
structureAndCompleteDto.setDistrictCode(structureAndCompleteDto.getDistrictCode().substring(0, 6));
|
||||
}
|
||||
if(StringUtils.isNotBlank(structureAndCompleteDto.getTownshipCode())){
|
||||
structureAndCompleteDto.setTownshipCode(structureAndCompleteDto.getTownshipCode().substring(0, 9));
|
||||
}
|
||||
}else{
|
||||
structureAndCompleteDto.setProvinceCode(null);
|
||||
structureAndCompleteDto.setCityCode(null);
|
||||
structureAndCompleteDto.setDistrictCode(null);
|
||||
structureAndCompleteDto.setTownshipCode(null);
|
||||
}
|
||||
basicModel.setResult(structureAndCompleteDto);
|
||||
}
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
|
||||
+51
@@ -12,14 +12,26 @@ public class StructureAndCompleteDto {
|
||||
* 省份
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* city编码
|
||||
*/
|
||||
private String cityCode;
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String districtCode;
|
||||
/**
|
||||
* 开发区
|
||||
*/
|
||||
@@ -28,6 +40,11 @@ public class StructureAndCompleteDto {
|
||||
* 乡镇街道
|
||||
*/
|
||||
private String township;
|
||||
|
||||
/**
|
||||
* 乡镇街道编码
|
||||
*/
|
||||
private String townshipCode;
|
||||
/**
|
||||
* 道路
|
||||
*/
|
||||
@@ -200,4 +217,38 @@ public class StructureAndCompleteDto {
|
||||
public void setAddrVerify(String addrVerify) {
|
||||
this.addrVerify = addrVerify;
|
||||
}
|
||||
|
||||
public String getProvinceCode() {
|
||||
return provinceCode;
|
||||
}
|
||||
|
||||
public void setProvinceCode(String provinceCode) {
|
||||
this.provinceCode = provinceCode;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public String getDistrictCode() {
|
||||
return districtCode;
|
||||
}
|
||||
|
||||
public void setDistrictCode(String districtCode) {
|
||||
this.districtCode = districtCode;
|
||||
}
|
||||
|
||||
public String getTownshipCode() {
|
||||
return townshipCode;
|
||||
}
|
||||
|
||||
public void setTownshipCode(String townshipCode) {
|
||||
this.townshipCode = townshipCode;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user