+261
@@ -0,0 +1,261 @@
|
|||||||
|
package com.fangjia.open.controllers;
|
||||||
|
|
||||||
|
import com.fangjia.core.util.HttpRequest;
|
||||||
|
import com.fangjia.open.dto.addressGovernance.*;
|
||||||
|
import com.fangjia.open.interceptors.Authority;
|
||||||
|
import com.fangjia.open.interceptors.Role;
|
||||||
|
import com.fangjia.open.model.AddesssMatchModel;
|
||||||
|
import com.fangjia.open.model.AddressModel;
|
||||||
|
import com.fangjia.open.model.BasicModel;
|
||||||
|
import com.fangjia.open.model.RestfulModelAndView;
|
||||||
|
import com.fangjia.open.util.CommonDtoUtils;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址治理
|
||||||
|
*
|
||||||
|
* @author shenjian
|
||||||
|
* @since 2023/5/25
|
||||||
|
*/
|
||||||
|
@Authority(role = Role.USER)
|
||||||
|
public class AddressGovernanceController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址结构化
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object structureAction(AddesssMatchModel model) {
|
||||||
|
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", model.getCity());
|
||||||
|
params.put("address", model.getAddress());
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure/v2", params, "UTF-8");
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(CommonDtoUtils.transformV(StructureDto.class, json.get("result")));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区划识别接口
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object fiveDivisionStructureAction(AddesssMatchModel model) {
|
||||||
|
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", model.getCity());
|
||||||
|
params.put("address", model.getAddress());
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8");
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(CommonDtoUtils.transformV(DistrictIdentifyDto.class, json.get("result")));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址补全
|
||||||
|
*/
|
||||||
|
public Object structureAndCompleteAction(AddesssMatchModel model) {
|
||||||
|
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", model.getCity());
|
||||||
|
params.put("address", model.getAddress());
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(CommonDtoUtils.transformV(StructureAndCompleteDto.class, json.get("result")));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址验证
|
||||||
|
*/
|
||||||
|
public Object addrVerifyAction(AddesssMatchModel model) {
|
||||||
|
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", model.getCity());
|
||||||
|
params.put("address", model.getAddress());
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addrVerify", params, "UTF-8");
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(json.get("result"));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址匹配
|
||||||
|
*/
|
||||||
|
public Object matchAction(AddesssMatchModel model) {
|
||||||
|
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", model.getCity());
|
||||||
|
params.put("address", model.getAddress());
|
||||||
|
params.put("category", model.getCategory());
|
||||||
|
params.put("district", model.getSuggestDistrict());
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/match", params, "UTF-8");
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(CommonDtoUtils.transformV(MatchedBuildingDto.class, json.get("result")));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址联想
|
||||||
|
*/
|
||||||
|
public Object addressAssociationAction(AddressModel model) {
|
||||||
|
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
if (StringUtils.isBlank(model.getCity())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("城市不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(model.getKeyword())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("关键字不能为空"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest();
|
||||||
|
JSONObject json = null;
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("city", model.getCity());
|
||||||
|
params.put("region", model.getRegion());
|
||||||
|
params.put("keywords", model.getKeyword());
|
||||||
|
params.put("page", "0");
|
||||||
|
params.put("size", String.valueOf(model.getMax() == 0 ? 20 : (model.getMax() > 100 ? 100 : model.getMax()) ));
|
||||||
|
try{
|
||||||
|
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addressAssociation2", params, "UTF-8");
|
||||||
|
if (json != null) {
|
||||||
|
int code = json.getInt("status");
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
|
if(json.containsKey("result")){
|
||||||
|
basicModel.setResult(CommonDtoUtils.transformListV(DistrictDto.class, (JSONObject.fromObject(json.get("result"))).getJSONArray("content")));
|
||||||
|
}
|
||||||
|
mav.setModel(basicModel);
|
||||||
|
} else {
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
|
||||||
|
}
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package com.fangjia.open.dto.addressGovernance;
|
||||||
|
|
||||||
|
public class DistrictDto {
|
||||||
|
|
||||||
|
private String province;
|
||||||
|
private String city;
|
||||||
|
private String region;
|
||||||
|
private String name;
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
}
|
||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
package com.fangjia.open.dto.addressGovernance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Çø»®Ê¶±ðDTO
|
||||||
|
*
|
||||||
|
* @author shenjian
|
||||||
|
* @since 2023/5/25
|
||||||
|
*/
|
||||||
|
public class DistrictIdentifyDto {
|
||||||
|
|
||||||
|
private String province;
|
||||||
|
private String provinceCode;
|
||||||
|
private String city;
|
||||||
|
private String cityCode;
|
||||||
|
private String district;
|
||||||
|
private String districtCode;
|
||||||
|
private String township;
|
||||||
|
private String townshipCode;
|
||||||
|
private String community;
|
||||||
|
private String communityCode;
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProvinceCode() {
|
||||||
|
return provinceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvinceCode(String provinceCode) {
|
||||||
|
this.provinceCode = provinceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCityCode() {
|
||||||
|
return cityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCityCode(String cityCode) {
|
||||||
|
this.cityCode = cityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrictCode() {
|
||||||
|
return districtCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrictCode(String districtCode) {
|
||||||
|
this.districtCode = districtCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTownship() {
|
||||||
|
return township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTownship(String township) {
|
||||||
|
this.township = township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTownshipCode() {
|
||||||
|
return townshipCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTownshipCode(String townshipCode) {
|
||||||
|
this.townshipCode = townshipCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommunity() {
|
||||||
|
return community;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommunity(String community) {
|
||||||
|
this.community = community;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommunityCode() {
|
||||||
|
return communityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommunityCode(String communityCode) {
|
||||||
|
this.communityCode = communityCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
+128
@@ -0,0 +1,128 @@
|
|||||||
|
package com.fangjia.open.dto.addressGovernance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址匹配DTO
|
||||||
|
*/
|
||||||
|
public class MatchedBuildingDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 置信度
|
||||||
|
*/
|
||||||
|
private Double credit;
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区域
|
||||||
|
*/
|
||||||
|
private String district;
|
||||||
|
/**
|
||||||
|
* 乡镇街道
|
||||||
|
*/
|
||||||
|
private String township;
|
||||||
|
/**
|
||||||
|
* 建筑物名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 建筑物地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 经度(高德)
|
||||||
|
*/
|
||||||
|
private Double lng;
|
||||||
|
/**
|
||||||
|
* 纬度(高德)
|
||||||
|
*/
|
||||||
|
private Double lat;
|
||||||
|
/**
|
||||||
|
* 物业类型
|
||||||
|
*/
|
||||||
|
private String propertyType;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getCredit() {
|
||||||
|
return credit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCredit(Double credit) {
|
||||||
|
this.credit = credit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTownship() {
|
||||||
|
return township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTownship(String township) {
|
||||||
|
this.township = township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getLng() {
|
||||||
|
return lng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLng(Double lng) {
|
||||||
|
this.lng = lng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getLat() {
|
||||||
|
return lat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLat(Double lat) {
|
||||||
|
this.lat = lat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPropertyType() {
|
||||||
|
return propertyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPropertyType(String propertyType) {
|
||||||
|
this.propertyType = propertyType;
|
||||||
|
}
|
||||||
|
}
|
||||||
+203
@@ -0,0 +1,203 @@
|
|||||||
|
package com.fangjia.open.dto.addressGovernance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址补全DTO
|
||||||
|
*
|
||||||
|
* @author shenjian
|
||||||
|
* @since 2023/5/25
|
||||||
|
*/
|
||||||
|
public class StructureAndCompleteDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省份
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区域
|
||||||
|
*/
|
||||||
|
private String district;
|
||||||
|
/**
|
||||||
|
* 开发区
|
||||||
|
*/
|
||||||
|
private String dev;
|
||||||
|
/**
|
||||||
|
* 乡镇街道
|
||||||
|
*/
|
||||||
|
private String township;
|
||||||
|
/**
|
||||||
|
* 道路
|
||||||
|
*/
|
||||||
|
private String street;
|
||||||
|
/**
|
||||||
|
* 路号
|
||||||
|
*/
|
||||||
|
private String streetNumber;
|
||||||
|
/**
|
||||||
|
* 居委村委
|
||||||
|
*/
|
||||||
|
private String community;
|
||||||
|
/**
|
||||||
|
* 村组
|
||||||
|
*/
|
||||||
|
private String group;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 楼栋
|
||||||
|
*/
|
||||||
|
private String buildingNumber;
|
||||||
|
/**
|
||||||
|
* 单元
|
||||||
|
*/
|
||||||
|
private String unitNumber;
|
||||||
|
/**
|
||||||
|
* 楼层
|
||||||
|
*/
|
||||||
|
private String floor;
|
||||||
|
/**
|
||||||
|
* 室号
|
||||||
|
*/
|
||||||
|
private String roomNumber;
|
||||||
|
/**
|
||||||
|
* 格式化地址
|
||||||
|
*/
|
||||||
|
private String formatAddress;
|
||||||
|
/**
|
||||||
|
* 地址验证
|
||||||
|
*/
|
||||||
|
private String addrVerify;
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDev() {
|
||||||
|
return dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDev(String dev) {
|
||||||
|
this.dev = dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTownship() {
|
||||||
|
return township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTownship(String township) {
|
||||||
|
this.township = township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreet() {
|
||||||
|
return street;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreet(String street) {
|
||||||
|
this.street = street;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreetNumber() {
|
||||||
|
return streetNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreetNumber(String streetNumber) {
|
||||||
|
this.streetNumber = streetNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommunity() {
|
||||||
|
return community;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommunity(String community) {
|
||||||
|
this.community = community;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroup() {
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroup(String group) {
|
||||||
|
this.group = group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuildingNumber() {
|
||||||
|
return buildingNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildingNumber(String buildingNumber) {
|
||||||
|
this.buildingNumber = buildingNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnitNumber() {
|
||||||
|
return unitNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnitNumber(String unitNumber) {
|
||||||
|
this.unitNumber = unitNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFloor() {
|
||||||
|
return floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFloor(String floor) {
|
||||||
|
this.floor = floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoomNumber() {
|
||||||
|
return roomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomNumber(String roomNumber) {
|
||||||
|
this.roomNumber = roomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFormatAddress() {
|
||||||
|
return formatAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormatAddress(String formatAddress) {
|
||||||
|
this.formatAddress = formatAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddrVerify() {
|
||||||
|
return addrVerify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddrVerify(String addrVerify) {
|
||||||
|
this.addrVerify = addrVerify;
|
||||||
|
}
|
||||||
|
}
|
||||||
+191
@@ -0,0 +1,191 @@
|
|||||||
|
package com.fangjia.open.dto.addressGovernance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址结构化,请不要增加其他字段,与文档及地数输出一致
|
||||||
|
*
|
||||||
|
* @author shenjian
|
||||||
|
* @since 2023/5/25
|
||||||
|
*/
|
||||||
|
public class StructureDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省份
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区域
|
||||||
|
*/
|
||||||
|
private String district;
|
||||||
|
/**
|
||||||
|
* 开发区
|
||||||
|
*/
|
||||||
|
private String dev;
|
||||||
|
/**
|
||||||
|
* 乡镇街道
|
||||||
|
*/
|
||||||
|
private String township;
|
||||||
|
/**
|
||||||
|
* 道路
|
||||||
|
*/
|
||||||
|
private String street;
|
||||||
|
/**
|
||||||
|
* 路号
|
||||||
|
*/
|
||||||
|
private String streetNumber;
|
||||||
|
/**
|
||||||
|
* 居委村委
|
||||||
|
*/
|
||||||
|
private String community;
|
||||||
|
/**
|
||||||
|
* 村组
|
||||||
|
*/
|
||||||
|
private String group;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 楼栋
|
||||||
|
*/
|
||||||
|
private String buildingNumber;
|
||||||
|
/**
|
||||||
|
* 单元
|
||||||
|
*/
|
||||||
|
private String unitNumber;
|
||||||
|
/**
|
||||||
|
* 楼层
|
||||||
|
*/
|
||||||
|
private String floor;
|
||||||
|
/**
|
||||||
|
* 室号
|
||||||
|
*/
|
||||||
|
private String roomNumber;
|
||||||
|
/**
|
||||||
|
* 地址验证
|
||||||
|
*/
|
||||||
|
private String addrVerify;
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDev() {
|
||||||
|
return dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDev(String dev) {
|
||||||
|
this.dev = dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTownship() {
|
||||||
|
return township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTownship(String township) {
|
||||||
|
this.township = township;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreet() {
|
||||||
|
return street;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreet(String street) {
|
||||||
|
this.street = street;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreetNumber() {
|
||||||
|
return streetNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreetNumber(String streetNumber) {
|
||||||
|
this.streetNumber = streetNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommunity() {
|
||||||
|
return community;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommunity(String community) {
|
||||||
|
this.community = community;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroup() {
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroup(String group) {
|
||||||
|
this.group = group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuildingNumber() {
|
||||||
|
return buildingNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildingNumber(String buildingNumber) {
|
||||||
|
this.buildingNumber = buildingNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnitNumber() {
|
||||||
|
return unitNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnitNumber(String unitNumber) {
|
||||||
|
this.unitNumber = unitNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFloor() {
|
||||||
|
return floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFloor(String floor) {
|
||||||
|
this.floor = floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoomNumber() {
|
||||||
|
return roomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomNumber(String roomNumber) {
|
||||||
|
this.roomNumber = roomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddrVerify() {
|
||||||
|
return addrVerify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddrVerify(String addrVerify) {
|
||||||
|
this.addrVerify = addrVerify;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
private String preciseLevel;
|
private String preciseLevel;
|
||||||
private String province;
|
private String province;
|
||||||
private String district;
|
private String district;
|
||||||
|
private String region;
|
||||||
|
|
||||||
private String chooseId;
|
private String chooseId;
|
||||||
|
|
||||||
@@ -36,6 +37,9 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
private Integer pageNo;
|
private Integer pageNo;
|
||||||
// 是否用于检查
|
// 是否用于检查
|
||||||
private String dataLevel;
|
private String dataLevel;
|
||||||
|
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
public boolean isContainsLocation() {
|
public boolean isContainsLocation() {
|
||||||
return containsLocation;
|
return containsLocation;
|
||||||
}
|
}
|
||||||
@@ -228,5 +232,20 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
public void setDataLevel(String dataLevel) {
|
public void setDataLevel(String dataLevel) {
|
||||||
this.dataLevel = dataLevel;
|
this.dataLevel = dataLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getKeyword() {
|
||||||
|
return keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyword(String keyword) {
|
||||||
|
this.keyword = keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.fangjia.open.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用实体与DTO互相转换工具类
|
||||||
|
*
|
||||||
|
* @author shenjian
|
||||||
|
* @date 2021/06/16
|
||||||
|
*/
|
||||||
|
public class CommonDtoUtils {
|
||||||
|
public static <T> T transformV(Class<T> targetClass, Object source) {
|
||||||
|
if (source == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
String jsonSource = JSON.toJSONString(source);
|
||||||
|
return JSONObject.parseObject(jsonSource, targetClass);
|
||||||
|
} catch (Exception var3) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> List<T> transformListV(Class<T> targetClass, List<?> listSource) {
|
||||||
|
if (listSource == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
String jsonSource = JSON.toJSONString(listSource);
|
||||||
|
return JSONArray.parseArray(jsonSource, targetClass);
|
||||||
|
} catch (Exception var3) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user