开发区省市区改为下拉框
This commit is contained in:
+24
@@ -126,6 +126,7 @@ public class DevelopmentZoneController {
|
|||||||
entity.setType(StringUtils.isBlank(model.getType()) ? "" : model.getType());
|
entity.setType(StringUtils.isBlank(model.getType()) ? "" : model.getType());
|
||||||
entity.setUrl(StringUtils.isBlank(model.getUrl()) ? "" : model.getUrl());
|
entity.setUrl(StringUtils.isBlank(model.getUrl()) ? "" : model.getUrl());
|
||||||
entity.setCityName(StringUtils.isBlank(model.getCityName()) ? "" : model.getCityName());
|
entity.setCityName(StringUtils.isBlank(model.getCityName()) ? "" : model.getCityName());
|
||||||
|
entity.setDistrict(StringUtils.isBlank(model.getDistrict()) ? "" : model.getDistrict());
|
||||||
//记录操作人员
|
//记录操作人员
|
||||||
entity.setOperator(user.getRealName());
|
entity.setOperator(user.getRealName());
|
||||||
developmentZoneService.saveDevelopmentZone(entity);
|
developmentZoneService.saveDevelopmentZone(entity);
|
||||||
@@ -200,6 +201,9 @@ public class DevelopmentZoneController {
|
|||||||
if (StringUtils.isNotBlank(model.getCityName())) {
|
if (StringUtils.isNotBlank(model.getCityName())) {
|
||||||
udata.put("cityName", model.getCityName());
|
udata.put("cityName", model.getCityName());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(model.getDistrict())){
|
||||||
|
udata.put("district", model.getDistrict());
|
||||||
|
}
|
||||||
udata.put("createTime", new Date());
|
udata.put("createTime", new Date());
|
||||||
//记录操作人员
|
//记录操作人员
|
||||||
udata.put("operator", user.getRealName());
|
udata.put("operator", user.getRealName());
|
||||||
@@ -210,6 +214,26 @@ public class DevelopmentZoneController {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JsonModel provincesAction() {
|
||||||
|
JsonModel model = new JsonModel();
|
||||||
|
List<String> provinces = developmentZoneService.findProvinces();
|
||||||
|
model.setJsonModel(provinces);
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonModel citiesAction(DevelopmentZoneModel model) {
|
||||||
|
JsonModel jsonModel = new JsonModel();
|
||||||
|
List<String> cities = developmentZoneService.findCities(model.getProvince());
|
||||||
|
jsonModel.setJsonModel(cities);
|
||||||
|
return jsonModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonModel districtsAction(DevelopmentZoneModel model) {
|
||||||
|
JsonModel jsonModel = new JsonModel();
|
||||||
|
List<String> districts = developmentZoneService.findDistricts(model.getCityName());
|
||||||
|
jsonModel.setJsonModel(districts);
|
||||||
|
return jsonModel;
|
||||||
|
}
|
||||||
|
|
||||||
public void setDevelopmentZoneService(DevelopmentZoneService developmentZoneService) {
|
public void setDevelopmentZoneService(DevelopmentZoneService developmentZoneService) {
|
||||||
this.developmentZoneService = developmentZoneService;
|
this.developmentZoneService = developmentZoneService;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||||
<#compress>
|
<#compress>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
@@ -25,28 +26,52 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<#if developmentZone??>
|
<@d_city defaultValue="" callback="changeCity" callbackField="display" name="cityDisplay" />
|
||||||
<@d_city defaultValue="${developmentZone.cityName!}" callback="changeCity" callbackField="display" name="cityDisplay" />
|
|
||||||
<#else>
|
|
||||||
<@d_city defaultValue="上海" callback="changeCity" callbackField="display" name="cityDisplay" />
|
|
||||||
</#if>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label for="name">开发区名称:</label> <input id="name" name="name" type="text" placeholder="必填" value="<#if developmentZone??>${developmentZone.name!}</#if>"/>
|
<label for="province">所在省份:</label>
|
||||||
|
<select id="province" name="province" onchange="updateCityAndDistrict()">
|
||||||
|
<#if province??>
|
||||||
|
<option value="${province}">${province}</option>
|
||||||
|
<#else>
|
||||||
|
<option value="">请选择省份</option>
|
||||||
|
</#if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<label for="cityName">城市:</label>
|
||||||
|
<select id="cityName" name="cityName" onchange="updateDistrict()">
|
||||||
|
<!-- Options for cities will be populated by JavaScript -->
|
||||||
|
</select>
|
||||||
|
<label for="district">区域:</label>
|
||||||
|
<select id="district" name="district">
|
||||||
|
<!-- Options for districts will be populated by JavaScript -->
|
||||||
|
</select>
|
||||||
|
<label for="name">开发区名称:</label> <input id="name" name="name" type="text"
|
||||||
|
placeholder="必填"
|
||||||
|
value="<#if developmentZone??>${developmentZone.name!}</#if>"/>
|
||||||
<label for="alias">别名:</label>
|
<label for="alias">别名:</label>
|
||||||
<input id="alias" name="alias" type="text" placeholder="多个别名用,隔开" value="<#if developmentZone??><#list (developmentZone.alias)! as alia>${alia + ','}</#list><#else></#if>"/>
|
<input id="alias" name="alias" type="text" placeholder="多个别名用,隔开"
|
||||||
<label for="nameEn">开发区名称拼音:</label> <input id="nameEn" name="nameEn" type="text" value="<#if developmentZone??>${developmentZone.nameEn!}</#if>"/>
|
value="<#if developmentZone??><#list (developmentZone.alias)! as alia>${alia + ','}</#list><#else></#if>"/>
|
||||||
<label for="province">所在省份:</label> <input id="province" name="province" type="text" placeholder="必填" value="<#if developmentZone??>${developmentZone.province!}</#if>"/><br>
|
<label for="nameEn">开发区名称拼音:</label> <input id="nameEn" name="nameEn" type="text"
|
||||||
<label for="cityName">城市:</label><input id="cityName" name="cityName" type="text" value="<#if developmentZone??>${developmentZone.cityName!}</#if>"/>
|
value="<#if developmentZone??>${developmentZone.nameEn!}</#if>"/>
|
||||||
<label for="district">区域:</label><input id="district" name="district" type="text" value="<#if developmentZone??>${developmentZone.district!}</#if>"/>
|
</br>
|
||||||
<label for="level">级别:</label> <input id="level" name="level" type="text" placeholder="必填" value="<#if developmentZone??>${developmentZone.level!}</#if>"/>
|
<label for="level">级别:</label> <input id="level" name="level" type="text"
|
||||||
<label for="address">地址:</label> <input id="address" name="address" type="text" value="<#if developmentZone??>${developmentZone.address!}</#if>"/><br>
|
placeholder="必填"
|
||||||
<label for="area">所在地区:</label> <input id="area" name="area" type="text" value="<#if developmentZone??>${developmentZone.area!}</#if>"/>
|
value="<#if developmentZone??>${developmentZone.level!}</#if>"/>
|
||||||
<label for="buildDate">建立年代:</label><input id="buildDate" name="buildDate" type="text" value="<#if developmentZone??>${developmentZone.buildDate!}</#if>"/>
|
<label for="address">地址:</label> <input id="address" name="address" type="text"
|
||||||
<label for="type">类型:</label><input id="type" name="type" type="text" value="<#if developmentZone??>${developmentZone.type!}</#if>"/>
|
value="<#if developmentZone??>${developmentZone.address!}</#if>"/><br>
|
||||||
<label for="url">URL:</label><input id="url" name="url" type="text" value="<#if developmentZone??>${developmentZone.url!}</#if>"/><br>
|
<label for="area">所在地区:</label> <input id="area" name="area" type="text"
|
||||||
<label for="industry">主导产业:</label><input id="industry" name="industry" type="text" value="<#if developmentZone??>${developmentZone.industry!}</#if>"/>
|
value="<#if developmentZone??>${developmentZone.area!}</#if>"/>
|
||||||
<label for="block">区块:</label><input id="block" name="block" type="text" value="<#if developmentZone??>${developmentZone.block!}</#if>"/><br/>
|
<label for="buildDate">建立年代:</label><input id="buildDate" name="buildDate" type="text"
|
||||||
|
value="<#if developmentZone??>${developmentZone.buildDate!}</#if>"/>
|
||||||
|
<label for="type">类型:</label><input id="type" name="type" type="text"
|
||||||
|
value="<#if developmentZone??>${developmentZone.type!}</#if>"/>
|
||||||
|
<label for="url">URL:</label><input id="url" name="url" type="text"
|
||||||
|
value="<#if developmentZone??>${developmentZone.url!}</#if>"/><br>
|
||||||
|
<label for="industry">主导产业:</label><input id="industry" name="industry" type="text"
|
||||||
|
value="<#if developmentZone??>${developmentZone.industry!}</#if>"/>
|
||||||
|
<label for="block">区块:</label><input id="block" name="block" type="text"
|
||||||
|
value="<#if developmentZone??>${developmentZone.block!}</#if>"/><br/>
|
||||||
<input id="saveOrUpdate" type="button" value="提交"/>
|
<input id="saveOrUpdate" type="button" value="提交"/>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@@ -61,13 +86,103 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
fetchProvinces();
|
||||||
|
|
||||||
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=3E63A744012f88c9a73a2f051aece58b"></script>
|
$('#province').change(function () {
|
||||||
|
updateCityAndDistrict();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#cityName').change(function () {
|
||||||
|
updateDistrict();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function fetchProvinces() {
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: '../developmentZone/provinces',
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
let provinceSelect = $('#province');
|
||||||
|
provinceSelect.empty();
|
||||||
|
provinceSelect.append('<option value="">请选择省份</option>');
|
||||||
|
$.each(data, function (index, province) {
|
||||||
|
provinceSelect.append('<option value="' + province + '">' + province + '</option>');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateCityAndDistrict() {
|
||||||
|
let province = $('#province').val();
|
||||||
|
let citySelect = $('#cityName');
|
||||||
|
let districtSelect = $('#district');
|
||||||
|
|
||||||
|
citySelect.empty();
|
||||||
|
districtSelect.empty();
|
||||||
|
citySelect.append('<option value="">请选择城市</option>');
|
||||||
|
districtSelect.append('<option value="">请选择区域</option>');
|
||||||
|
|
||||||
|
if (province) {
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: '../developmentZone/cities',
|
||||||
|
data: {province: province},
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
$.each(data, function (index, city) {
|
||||||
|
citySelect.append('<option value="' + city + '">' + city + '</option>');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateDistrict() {
|
||||||
|
let cityName = $('#cityName').val();
|
||||||
|
let districtSelect = $('#district');
|
||||||
|
|
||||||
|
districtSelect.empty();
|
||||||
|
districtSelect.append('<option value="">请选择区域</option>');
|
||||||
|
|
||||||
|
if (cityName) {
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: '../developmentZone/districts',
|
||||||
|
data: {cityName: cityName},
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
$.each(data, function (index, district) {
|
||||||
|
districtSelect.append('<option value="' + district + '">' + district + '</option>');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="https://api.map.baidu.com/api?v=2.0&ak=3E63A744012f88c9a73a2f051aece58b"></script>
|
||||||
<!--加载鼠标绘制工具-->
|
<!--加载鼠标绘制工具-->
|
||||||
<script type="text/javascript" src="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
|
<script type="text/javascript"
|
||||||
|
src="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
|
||||||
<link rel="stylesheet" href="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"/>
|
<link rel="stylesheet" href="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"/>
|
||||||
<!--加载检索信息窗口-->
|
<!--加载检索信息窗口-->
|
||||||
<script type="text/javascript" src="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
|
<script type="text/javascript"
|
||||||
|
src="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
|
||||||
<link rel="stylesheet" href="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.css"/>
|
<link rel="stylesheet" href="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.css"/>
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
@@ -124,6 +239,7 @@
|
|||||||
});
|
});
|
||||||
//添加鼠标绘制工具监听事件,用于获取绘制结果
|
//添加鼠标绘制工具监听事件,用于获取绘制结果
|
||||||
drawingManager.addEventListener('overlaycomplete', overlaycomplete);
|
drawingManager.addEventListener('overlaycomplete', overlaycomplete);
|
||||||
|
|
||||||
function clearAll() {
|
function clearAll() {
|
||||||
for (var i = 0; i < overlays.length; i++) {
|
for (var i = 0; i < overlays.length; i++) {
|
||||||
map.removeOverlay(overlays[i]);
|
map.removeOverlay(overlays[i]);
|
||||||
@@ -209,7 +325,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fetchProvinces()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package com.fangjia.dal.mongo;
|
||||||
|
|
||||||
|
import com.fangjia.dal.MongoDaoImpl;
|
||||||
|
import com.fangjia.dal.mongo.dao.AdministrativeMappingDao;
|
||||||
|
import com.fangjia.dal.mongo.model.AdministrativeMapping;
|
||||||
|
|
||||||
|
public class AdministrativeMappingDaoImpl extends MongoDaoImpl<AdministrativeMapping> implements AdministrativeMappingDao {
|
||||||
|
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package com.fangjia.dal.mongo.dao;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fangjia.dal.MongoDao;
|
||||||
|
import com.fangjia.dal.mongo.model.AdministrativeMapping;
|
||||||
|
|
||||||
|
public interface AdministrativeMappingDao extends MongoDao<AdministrativeMapping> {
|
||||||
|
|
||||||
|
}
|
||||||
+255
@@ -0,0 +1,255 @@
|
|||||||
|
package com.fangjia.dal.mongo.model;
|
||||||
|
|
||||||
|
import com.fangjia.dal.MongoEntity;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "business.administrative_mapping")
|
||||||
|
public class AdministrativeMapping implements MongoEntity {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String province;
|
||||||
|
private String city;
|
||||||
|
private String district;
|
||||||
|
private String street;
|
||||||
|
private String tjjStreetCode;
|
||||||
|
private String streetPinyin;
|
||||||
|
private String pid;
|
||||||
|
private String tjjProvinceCode;
|
||||||
|
|
||||||
|
private String tjjCityCode;
|
||||||
|
|
||||||
|
private String tjjDistrictCode;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer tjjSourceYear;
|
||||||
|
|
||||||
|
private String mzbProvinceCode;
|
||||||
|
|
||||||
|
private String mzbCityCode;
|
||||||
|
|
||||||
|
private String mzbDistrictCode;
|
||||||
|
|
||||||
|
private String mzbDistrictName;
|
||||||
|
|
||||||
|
private String mzbStreetCode;
|
||||||
|
private Integer mzbSourceYear;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
private String districtShort;
|
||||||
|
private String cityShort;
|
||||||
|
private String provinceShort;
|
||||||
|
|
||||||
|
private List<String> alias;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
@Column(name = "_id")
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "province")
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "city")
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "district")
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "street")
|
||||||
|
public String getStreet() {
|
||||||
|
return street;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreet(String street) {
|
||||||
|
this.street = street;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "pid")
|
||||||
|
public String getPid() {
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPid(String pid) {
|
||||||
|
this.pid = pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "tjj_province_code")
|
||||||
|
public String getTjjProvinceCode() {
|
||||||
|
return tjjProvinceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTjjProvinceCode(String tjjProvinceCode) {
|
||||||
|
this.tjjProvinceCode = tjjProvinceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "tjj_city_code")
|
||||||
|
public String getTjjCityCode() {
|
||||||
|
return tjjCityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTjjCityCode(String tjjCityCode) {
|
||||||
|
this.tjjCityCode = tjjCityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "tjj_district_code")
|
||||||
|
public String getTjjDistrictCode() {
|
||||||
|
return tjjDistrictCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTjjDistrictCode(String tjjDistrictCode) {
|
||||||
|
this.tjjDistrictCode = tjjDistrictCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "tjj_street_code")
|
||||||
|
public String getTjjStreetCode() {
|
||||||
|
return tjjStreetCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTjjStreetCode(String tjjStreetCode) {
|
||||||
|
this.tjjStreetCode = tjjStreetCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "tjj_source_year")
|
||||||
|
public Integer getTjjSourceYear() {
|
||||||
|
return tjjSourceYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTjjSourceYear(Integer tjjSourceYear) {
|
||||||
|
this.tjjSourceYear = tjjSourceYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "mzb_province_code")
|
||||||
|
public String getMzbProvinceCode() {
|
||||||
|
return mzbProvinceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMzbProvinceCode(String mzbProvinceCode) {
|
||||||
|
this.mzbProvinceCode = mzbProvinceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "mzb_city_code")
|
||||||
|
public String getMzbCityCode() {
|
||||||
|
return mzbCityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMzbCityCode(String mzbCityCode) {
|
||||||
|
this.mzbCityCode = mzbCityCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "mzb_district_code")
|
||||||
|
public String getMzbDistrictCode() {
|
||||||
|
return mzbDistrictCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMzbDistrictCode(String mzbDistrictCode) {
|
||||||
|
this.mzbDistrictCode = mzbDistrictCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "mzb_district_name")
|
||||||
|
public String getMzbDistrictName() {
|
||||||
|
return mzbDistrictName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMzbDistrictName(String mzbDistrictName) {
|
||||||
|
this.mzbDistrictName = mzbDistrictName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "mzb_street_code")
|
||||||
|
public String getMzbStreetCode() {
|
||||||
|
return mzbStreetCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMzbStreetCode(String mzbStreetCode) {
|
||||||
|
this.mzbStreetCode = mzbStreetCode;
|
||||||
|
}
|
||||||
|
@Column(name = "mzb_source_year")
|
||||||
|
public Integer getMzbSourceYear() {
|
||||||
|
return mzbSourceYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMzbSourceYear(Integer mzbSourceYear) {
|
||||||
|
this.mzbSourceYear = mzbSourceYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "type")
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "district_short")
|
||||||
|
public String getDistrictShort() {
|
||||||
|
return districtShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrictShort(String districtShort) {
|
||||||
|
this.districtShort = districtShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "city_short")
|
||||||
|
public String getCityShort() {
|
||||||
|
return cityShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCityShort(String cityShort) {
|
||||||
|
this.cityShort = cityShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "province_short")
|
||||||
|
public String getProvinceShort() {
|
||||||
|
return provinceShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvinceShort(String provinceShort) {
|
||||||
|
this.provinceShort = provinceShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "alias")
|
||||||
|
public List<String> getAlias() {
|
||||||
|
return alias;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlias(List<String> alias) {
|
||||||
|
this.alias = alias;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "street_pinyin")
|
||||||
|
public String getStreetPinyin() {
|
||||||
|
return streetPinyin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreetPinyin(String streetPinyin) {
|
||||||
|
this.streetPinyin = streetPinyin;
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-1
@@ -55,5 +55,7 @@ public interface DevelopmentZoneService {
|
|||||||
|
|
||||||
public long countDev(String province,String name,String level);
|
public long countDev(String province,String name,String level);
|
||||||
|
|
||||||
|
public List<String> findProvinces();
|
||||||
|
public List<String> findCities(String province);
|
||||||
|
public List<String> findDistricts(String city);
|
||||||
}
|
}
|
||||||
|
|||||||
+45
@@ -1,7 +1,9 @@
|
|||||||
package com.fangjia.service.mongo.fangjia;
|
package com.fangjia.service.mongo.fangjia;
|
||||||
|
|
||||||
import com.fangjia.dal.QueryParam;
|
import com.fangjia.dal.QueryParam;
|
||||||
|
import com.fangjia.dal.mongo.dao.AdministrativeMappingDao;
|
||||||
import com.fangjia.dal.mongo.dao.DevelopmentZoneDao;
|
import com.fangjia.dal.mongo.dao.DevelopmentZoneDao;
|
||||||
|
import com.fangjia.dal.mongo.model.AdministrativeMapping;
|
||||||
import com.fangjia.dal.mongo.model.DevelopmentZone;
|
import com.fangjia.dal.mongo.model.DevelopmentZone;
|
||||||
import com.fangjia.dal.mongo.model.DevelopmentZone;
|
import com.fangjia.dal.mongo.model.DevelopmentZone;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -14,6 +16,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public class DevelopmentZoneServiceImpl implements DevelopmentZoneService {
|
public class DevelopmentZoneServiceImpl implements DevelopmentZoneService {
|
||||||
private DevelopmentZoneDao developmentZoneDao;
|
private DevelopmentZoneDao developmentZoneDao;
|
||||||
|
private AdministrativeMappingDao administrativeMappingDao;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -76,8 +79,50 @@ public class DevelopmentZoneServiceImpl implements DevelopmentZoneService {
|
|||||||
return developmentZoneDao.findCountByParams(params);
|
return developmentZoneDao.findCountByParams(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> findProvinces() {
|
||||||
|
List<QueryParam> queryParams = new ArrayList<QueryParam>();
|
||||||
|
queryParams.add(new QueryParam("type", "Ê¡·Ý"));
|
||||||
|
List<AdministrativeMapping> allProvince = administrativeMappingDao.findAllByParams(queryParams,null,0,100,new String[]{"province"});
|
||||||
|
List<String> provinces = new ArrayList<String>();
|
||||||
|
for (AdministrativeMapping mapping : allProvince) {
|
||||||
|
provinces.add(mapping.getProvince());
|
||||||
|
}
|
||||||
|
return provinces;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> findCities(String province) {
|
||||||
|
List<QueryParam> queryParams = new ArrayList<QueryParam>();
|
||||||
|
queryParams.add(new QueryParam("type", "³ÇÊÐ"));
|
||||||
|
queryParams.add(new QueryParam("province", province));
|
||||||
|
List<AdministrativeMapping> allCity = administrativeMappingDao.findAllByParams(queryParams,null,0,1000,new String[]{"city"});
|
||||||
|
List<String> cities = new ArrayList<String>();
|
||||||
|
for (AdministrativeMapping mapping : allCity) {
|
||||||
|
cities.add(mapping.getCity());
|
||||||
|
}
|
||||||
|
return cities;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> findDistricts(String city) {
|
||||||
|
List<QueryParam> queryParams = new ArrayList<QueryParam>();
|
||||||
|
queryParams.add(new QueryParam("type", "ÇøÓò"));
|
||||||
|
queryParams.add(new QueryParam("city", city));
|
||||||
|
List<AdministrativeMapping> allDistrict = administrativeMappingDao.findAllByParams(queryParams,null,0,1000,new String[]{"district"});
|
||||||
|
List<String> districts = new ArrayList<String>();
|
||||||
|
for (AdministrativeMapping mapping : allDistrict) {
|
||||||
|
districts.add(mapping.getDistrict());
|
||||||
|
}
|
||||||
|
return districts;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setDevelopmentZoneDao(DevelopmentZoneDao developmentZoneDao) {
|
public void setDevelopmentZoneDao(DevelopmentZoneDao developmentZoneDao) {
|
||||||
this.developmentZoneDao = developmentZoneDao;
|
this.developmentZoneDao = developmentZoneDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAdministrativeMappingDao(AdministrativeMappingDao administrativeMappingDao) {
|
||||||
|
this.administrativeMappingDao = administrativeMappingDao;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user