乡镇街道修改
This commit is contained in:
+84
@@ -0,0 +1,84 @@
|
||||
package com.fangjia.bkoff.controllers;
|
||||
|
||||
import com.fangjia.bkoff.model.DevelopmentZoneModel;
|
||||
import com.fangjia.bkoff.model.JsonModel;
|
||||
import com.fangjia.bkoff.model.TownshipModel;
|
||||
import com.fangjia.core.util.ThreadLocalData;
|
||||
import com.fangjia.core.util.ThreadLocalKey;
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
import com.fangjia.dal.mongo.model.bkoff.BkoffUsers;
|
||||
import com.fangjia.service.mongo.bkoff.BkoffUsersService;
|
||||
import com.fangjia.service.mongo.fangjia.TownshipService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.sothis.core.util.Pager;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by dxy on 2015/6/8.
|
||||
*/
|
||||
public class TownshipController {
|
||||
private TownshipService townshipService;
|
||||
private BkoffUsersService bkoffUsersService;
|
||||
|
||||
public Object listAction(TownshipModel model) {
|
||||
Pager pager = model.getPager(30);
|
||||
if (pager.getCurrentPage() > 100) {
|
||||
pager.setCurrentPage(1);
|
||||
}
|
||||
long countDev = townshipService.countTownship(model.getProvince(), model.getCity1(), model.getDistrict(),model.getStreet());
|
||||
pager.setTotalRows((int) countDev);
|
||||
List<Township> townships = townshipService.findTownship(model.getProvince(), model.getCity1(), model.getDistrict(),model.getStreet(), pager);
|
||||
model.setTownshipList(townships);
|
||||
model.setPager(pager);
|
||||
return model;
|
||||
}
|
||||
|
||||
public Object editAction(TownshipModel model) {
|
||||
if (model.getId() == null) {
|
||||
return model;
|
||||
}
|
||||
|
||||
model.setTownship(townshipService.findTownship(model.getId()));
|
||||
return model;
|
||||
}
|
||||
|
||||
public Object updateAction(TownshipModel model) {
|
||||
String userId = (String) ThreadLocalData.getInstance().get(ThreadLocalKey.UserId);
|
||||
BkoffUsers user = bkoffUsersService.findBkoffUsersById(userId);
|
||||
JsonModel ret = new JsonModel();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
if (model.getId() != null) {
|
||||
Map<String, Object> udata = new HashMap<String, Object>();
|
||||
if (StringUtils.isNotBlank(model.getAlias())) {
|
||||
String aliasString = model.getAlias().replaceAll(",", ",");
|
||||
List<String> alias = Arrays.asList(aliasString.split("\\s*,\\s*"));
|
||||
udata.put("alias", alias);
|
||||
}
|
||||
udata.put("updateTime", new Date());
|
||||
//记录操作人员
|
||||
udata.put("operator", user.getRealName());
|
||||
townshipService.updateTownship(udata, model.getId());
|
||||
data.put("msg", "修改成功");
|
||||
}
|
||||
ret.setJsonModel(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public void setBkoffUsersService(BkoffUsersService bkoffUsersService) {
|
||||
this.bkoffUsersService = bkoffUsersService;
|
||||
}
|
||||
|
||||
public TownshipService getTownshipService() {
|
||||
return townshipService;
|
||||
}
|
||||
|
||||
public void setTownshipService(TownshipService townshipService) {
|
||||
this.townshipService = townshipService;
|
||||
}
|
||||
|
||||
public BkoffUsersService getBkoffUsersService() {
|
||||
return bkoffUsersService;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
package com.fangjia.bkoff.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TownshipModel extends BaseModel {
|
||||
private String province;
|
||||
private String city1;
|
||||
private String district;
|
||||
private String street;
|
||||
private String pid;
|
||||
private String id;
|
||||
|
||||
@JSONField(name = "tjj_province_code")
|
||||
private String tjjProvinceCode;
|
||||
|
||||
@JSONField(name = "tjj_city_code")
|
||||
private String tjjCityCode;
|
||||
|
||||
@JSONField(name = "tjj_district_code")
|
||||
private String tjjDistrictCode;
|
||||
|
||||
@JSONField(name = "tjj_street_code")
|
||||
private String tjjStreetCode;
|
||||
|
||||
@JSONField(name = "tjj_source_year")
|
||||
private Integer tjjSourceYear;
|
||||
|
||||
@JSONField(name = "mzb_province_code")
|
||||
private String mzbProvinceCode;
|
||||
|
||||
@JSONField(name = "mzb_city_code")
|
||||
private String mzbCityCode;
|
||||
|
||||
@JSONField(name = "mzb_district_code")
|
||||
private String mzbDistrictCode;
|
||||
|
||||
@JSONField(name = "mzb_district_name")
|
||||
private String mzbDistrictName;
|
||||
|
||||
@JSONField(name = "mzb_street_code")
|
||||
private String mzbStreetCode;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private String alias;
|
||||
|
||||
|
||||
@JSONField(name = "street_pinyin")
|
||||
private String streetPinyin;
|
||||
|
||||
//民政部区域和统计局区域是否相同,1为相同,0为不同,为了解决2条的问题
|
||||
@JSONField(name = "district_diff")
|
||||
private Integer districtDiff;
|
||||
|
||||
|
||||
//乡镇街道是否输出 0:不输出 1:输出
|
||||
@JSONField(name = "street_output")
|
||||
private Integer streetOutput;
|
||||
|
||||
|
||||
@JSONField(name = "province_short")
|
||||
private String provinceShort;
|
||||
|
||||
@JSONField(name = "city_short")
|
||||
private String cityShort;
|
||||
|
||||
@JSONField(name = "district_short")
|
||||
private String districtShort;
|
||||
|
||||
private Township township;
|
||||
private List<Township> townshipList;
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getTjjProvinceCode() {
|
||||
return tjjProvinceCode;
|
||||
}
|
||||
|
||||
public void setTjjProvinceCode(String tjjProvinceCode) {
|
||||
this.tjjProvinceCode = tjjProvinceCode;
|
||||
}
|
||||
|
||||
public String getTjjCityCode() {
|
||||
return tjjCityCode;
|
||||
}
|
||||
|
||||
public void setTjjCityCode(String tjjCityCode) {
|
||||
this.tjjCityCode = tjjCityCode;
|
||||
}
|
||||
|
||||
public String getTjjDistrictCode() {
|
||||
return tjjDistrictCode;
|
||||
}
|
||||
|
||||
public void setTjjDistrictCode(String tjjDistrictCode) {
|
||||
this.tjjDistrictCode = tjjDistrictCode;
|
||||
}
|
||||
|
||||
public String getTjjStreetCode() {
|
||||
return tjjStreetCode;
|
||||
}
|
||||
|
||||
public void setTjjStreetCode(String tjjStreetCode) {
|
||||
this.tjjStreetCode = tjjStreetCode;
|
||||
}
|
||||
|
||||
public Integer getTjjSourceYear() {
|
||||
return tjjSourceYear;
|
||||
}
|
||||
|
||||
public void setTjjSourceYear(Integer tjjSourceYear) {
|
||||
this.tjjSourceYear = tjjSourceYear;
|
||||
}
|
||||
|
||||
public String getMzbProvinceCode() {
|
||||
return mzbProvinceCode;
|
||||
}
|
||||
|
||||
public void setMzbProvinceCode(String mzbProvinceCode) {
|
||||
this.mzbProvinceCode = mzbProvinceCode;
|
||||
}
|
||||
|
||||
public String getMzbCityCode() {
|
||||
return mzbCityCode;
|
||||
}
|
||||
|
||||
public void setMzbCityCode(String mzbCityCode) {
|
||||
this.mzbCityCode = mzbCityCode;
|
||||
}
|
||||
|
||||
public String getMzbDistrictCode() {
|
||||
return mzbDistrictCode;
|
||||
}
|
||||
|
||||
public void setMzbDistrictCode(String mzbDistrictCode) {
|
||||
this.mzbDistrictCode = mzbDistrictCode;
|
||||
}
|
||||
|
||||
public String getMzbDistrictName() {
|
||||
return mzbDistrictName;
|
||||
}
|
||||
|
||||
public void setMzbDistrictName(String mzbDistrictName) {
|
||||
this.mzbDistrictName = mzbDistrictName;
|
||||
}
|
||||
|
||||
public String getMzbStreetCode() {
|
||||
return mzbStreetCode;
|
||||
}
|
||||
|
||||
public void setMzbStreetCode(String mzbStreetCode) {
|
||||
this.mzbStreetCode = mzbStreetCode;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
public String getStreetPinyin() {
|
||||
return streetPinyin;
|
||||
}
|
||||
|
||||
public void setStreetPinyin(String streetPinyin) {
|
||||
this.streetPinyin = streetPinyin;
|
||||
}
|
||||
|
||||
public Integer getDistrictDiff() {
|
||||
return districtDiff;
|
||||
}
|
||||
|
||||
public void setDistrictDiff(Integer districtDiff) {
|
||||
this.districtDiff = districtDiff;
|
||||
}
|
||||
|
||||
public Integer getStreetOutput() {
|
||||
return streetOutput;
|
||||
}
|
||||
|
||||
public void setStreetOutput(Integer streetOutput) {
|
||||
this.streetOutput = streetOutput;
|
||||
}
|
||||
|
||||
public String getProvinceShort() {
|
||||
return provinceShort;
|
||||
}
|
||||
|
||||
public void setProvinceShort(String provinceShort) {
|
||||
this.provinceShort = provinceShort;
|
||||
}
|
||||
|
||||
public String getCityShort() {
|
||||
return cityShort;
|
||||
}
|
||||
|
||||
public void setCityShort(String cityShort) {
|
||||
this.cityShort = cityShort;
|
||||
}
|
||||
|
||||
public String getDistrictShort() {
|
||||
return districtShort;
|
||||
}
|
||||
|
||||
public void setDistrictShort(String districtShort) {
|
||||
this.districtShort = districtShort;
|
||||
}
|
||||
|
||||
public String getCity1() {
|
||||
return city1;
|
||||
}
|
||||
|
||||
public void setCity1(String city1) {
|
||||
this.city1 = city1;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
}
|
||||
|
||||
public void setAlias(String alias) {
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
public Township getTownship() {
|
||||
return township;
|
||||
}
|
||||
|
||||
public void setTownship(Township township) {
|
||||
this.township = township;
|
||||
}
|
||||
|
||||
public List<Township> getTownshipList() {
|
||||
return townshipList;
|
||||
}
|
||||
|
||||
public void setTownshipList(List<Township> townshipList) {
|
||||
this.townshipList = townshipList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!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">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>乡镇编辑</title>
|
||||
<link rel="stylesheet" type="text/css" href="../style/main.css?v=${version}" />
|
||||
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<#include "/common_js.ftl" />
|
||||
<#include "/layout/header.ftl" />
|
||||
<div class="main-content">
|
||||
<div class="menuButton">
|
||||
<a href="../township/list" class="list">乡镇街道列表</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form id="form1">
|
||||
<#if township??>
|
||||
<input id="id" name="id" type="hidden" value="${township.id!}"/>
|
||||
</#if>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="province">省份:${township.province!}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="city1">城市:${township.city1!}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="district">区域:${township.district!}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="mzbDistrictName">民政部区域:${township.mzbDistrictName!}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="street">乡镇街道:${township.street!}</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="alias">别名:</label>
|
||||
<input id="alias" name="alias" type="text" placeholder="多个别名用,隔开" value="<#if township??><#list (township.alias)! as alia>${alia + ','}</#list><#else></#if>"/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center">
|
||||
<input id="update" type="button" value="提交"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
$("#update").click(function(){
|
||||
jQuery.ajax({
|
||||
type: 'POST',
|
||||
url: '../township/update',
|
||||
data: $("#form1").serialize(),
|
||||
dataType: 'json',
|
||||
timeout: 100000,
|
||||
success: function(data) {
|
||||
alert(data.msg);
|
||||
location.href="list";
|
||||
},
|
||||
error : function() {
|
||||
alert("请求失败")
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -0,0 +1,63 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!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">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>乡镇街道列表</title>
|
||||
<link rel="stylesheet" type="text/css" href="../style/main.css?v=${version}"/>
|
||||
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<#include "/common_js.ftl" />
|
||||
<#include "/layout/header.ftl" />
|
||||
<div class="main-content">
|
||||
<form action="../township/list" id="_search_log_form">
|
||||
<div>
|
||||
<label for="province">省份:</label>
|
||||
<input type="text" name="province" id="province" class="input-medium" style="margin-top:9px;"
|
||||
value="${province!}"></input>
|
||||
<label for="name">城市:</label>
|
||||
<input type="text" name="city1" id="city1" class="input-medium" style="margin-top:9px;"
|
||||
value="${city1!}"></input>
|
||||
<label for="name">区域:</label>
|
||||
<input type="text" name="district" id="district" class="input-medium" style="margin-top:9px;"
|
||||
value="${district!}"></input>
|
||||
<label for="name">乡镇:</label>
|
||||
<input type="text" name="street" id="street" class="input-medium" style="margin-top:9px;"
|
||||
value="${street!}"></input>
|
||||
<input id="queryBtn" class="btn btn-primary" type="submit" value="查询"/>
|
||||
</div>
|
||||
</form>
|
||||
<div class="list" style="margin-top:5px;">
|
||||
<span style="font-size:12px;">查询到<b style="color:red;">${pager.totalRows!}</b>条记录</span>
|
||||
<table style="float:left;" name="reginTable" class="regionTab">
|
||||
<tr>
|
||||
<th>省份</th>
|
||||
<th>城市</th>
|
||||
<th>区域</th>
|
||||
<th>乡镇</th>
|
||||
<th>修改日期</th>
|
||||
<th>操作人</th>
|
||||
</tr>
|
||||
<#list townshipList as it>
|
||||
<tr>
|
||||
<td>${it.province!}</td>
|
||||
<td>${it.city1!}</td>
|
||||
<td>${it.district!}</td>
|
||||
<td><a href="../township/edit?id=${it.id!}"> ${it.street!}</a></td>
|
||||
<td>${it.updateTime!?string("yyyy-MM-dd HH:mm:ss")}</td>
|
||||
<td>${it.operator!}</td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
<#if pager??>
|
||||
<@d_pager controller="township" action="list" currentPage=pager.currentPage totalPages=pager.totalPages theme="full"/>
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
|
||||
public interface TownshipDao extends MongoDao<Township> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
|
||||
public class TownshipDaoImpl extends MongoDaoImpl<Township> implements TownshipDao {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
package com.fangjia.dal.mongo.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Entity
|
||||
@Table(name = "business.administrative_mapping")
|
||||
public class Township implements MongoEntity {
|
||||
|
||||
|
||||
private String province;
|
||||
private String city1;
|
||||
private String district;
|
||||
private String street;
|
||||
private String pid;
|
||||
private String id;
|
||||
@JSONField(name = "tjj_province_code")
|
||||
private String tjjProvinceCode;
|
||||
|
||||
@JSONField(name = "tjj_city_code")
|
||||
private String tjjCityCode;
|
||||
|
||||
@JSONField(name = "tjj_district_code")
|
||||
private String tjjDistrictCode;
|
||||
|
||||
@JSONField(name = "tjj_street_code")
|
||||
private String tjjStreetCode;
|
||||
|
||||
@JSONField(name = "tjj_source_year")
|
||||
private Integer tjjSourceYear;
|
||||
|
||||
@JSONField(name = "mzb_province_code")
|
||||
private String mzbProvinceCode;
|
||||
|
||||
@JSONField(name = "mzb_city_code")
|
||||
private String mzbCityCode;
|
||||
|
||||
@JSONField(name = "mzb_district_code")
|
||||
private String mzbDistrictCode;
|
||||
|
||||
@JSONField(name = "mzb_district_name")
|
||||
private String mzbDistrictName;
|
||||
|
||||
@JSONField(name = "mzb_street_code")
|
||||
private String mzbStreetCode;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private List<String> alias;
|
||||
|
||||
|
||||
@JSONField(name = "street_pinyin")
|
||||
private String streetPinyin;
|
||||
|
||||
//民政部区域和统计局区域是否相同,1为相同,0为不同,为了解决2条的问题
|
||||
@JSONField(name = "district_diff")
|
||||
private Integer districtDiff;
|
||||
|
||||
|
||||
//乡镇街道是否输出 0:不输出 1:输出
|
||||
@JSONField(name = "street_output")
|
||||
private Integer streetOutput;
|
||||
|
||||
|
||||
@JSONField(name = "province_short")
|
||||
private String provinceShort;
|
||||
|
||||
@JSONField(name = "city_short")
|
||||
private String cityShort;
|
||||
|
||||
@JSONField(name = "district_short")
|
||||
private String districtShort;
|
||||
|
||||
private String operator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
@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 getCity1() {
|
||||
return city1;
|
||||
}
|
||||
|
||||
public void setCity1(String city1) {
|
||||
this.city1 = city1;
|
||||
}
|
||||
|
||||
@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 = "type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Column(name = "district_diff")
|
||||
public Integer getDistrictDiff() {
|
||||
return districtDiff;
|
||||
}
|
||||
|
||||
public void setDistrictDiff(Integer districtDiff) {
|
||||
this.districtDiff = districtDiff;
|
||||
}
|
||||
|
||||
@Column(name = "street_output")
|
||||
public Integer getStreetOutput() {
|
||||
return streetOutput;
|
||||
}
|
||||
|
||||
public void setStreetOutput(Integer streetOutput) {
|
||||
this.streetOutput = streetOutput;
|
||||
}
|
||||
|
||||
@Column(name = "province_short")
|
||||
public String getProvinceShort() {
|
||||
return provinceShort;
|
||||
}
|
||||
|
||||
public void setProvinceShort(String provinceShort) {
|
||||
this.provinceShort = provinceShort;
|
||||
}
|
||||
|
||||
@Column(name = "city_short")
|
||||
public String getCityShort() {
|
||||
return cityShort;
|
||||
}
|
||||
|
||||
public void setCityShort(String cityShort) {
|
||||
this.cityShort = cityShort;
|
||||
}
|
||||
|
||||
@Column(name = "district_short")
|
||||
public String getDistrictShort() {
|
||||
return districtShort;
|
||||
}
|
||||
|
||||
public void setDistrictShort(String districtShort) {
|
||||
this.districtShort = districtShort;
|
||||
}
|
||||
|
||||
@Column(name = "operator")
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
@Column(name = "c_date")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Column(name = "m_date")
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.fangjia.service.mongo.fangjia;
|
||||
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
import org.sothis.core.util.Pager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by dxy on 2015/6/8.
|
||||
*/
|
||||
public interface TownshipService {
|
||||
|
||||
|
||||
/**
|
||||
* ¸üÐÂ
|
||||
*
|
||||
* @param id
|
||||
* @param udata
|
||||
*/
|
||||
public void updateTownship(Map<String, Object> udata, String id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param province
|
||||
* @param city
|
||||
* @param district
|
||||
* @param pager
|
||||
* @return
|
||||
*/
|
||||
public List<Township> findTownship(String province, String city, String district,String street, Pager pager);
|
||||
|
||||
/**
|
||||
* ͳ¼ÆÊýÁ¿
|
||||
* @param province
|
||||
* @param city
|
||||
* @param district
|
||||
* @return
|
||||
*/
|
||||
public long countTownship(String province, String city, String district,String street);
|
||||
|
||||
/**
|
||||
* ¸ù¾ÝID²éÕÒ
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Township findTownship(String id);
|
||||
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.fangjia.service.mongo.fangjia;
|
||||
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.mongo.dao.AdministrativeMappingDao;
|
||||
import com.fangjia.dal.mongo.dao.TownshipDao;
|
||||
import com.fangjia.dal.mongo.model.Township;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.sothis.core.util.Pager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class TownshipServiceImpl implements TownshipService {
|
||||
private TownshipDao townshipDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateTownship(Map<String,Object> map,String id) {
|
||||
townshipDao.updateById(map,id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<Township> findTownship(String province, String city, String district,String street, Pager pager) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
if (StringUtils.isNotBlank(province)) {
|
||||
Pattern pattern = Pattern.compile(".*" + province + ".*");
|
||||
params.add(new QueryParam("province", pattern));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(city)) {
|
||||
Pattern pattern = Pattern.compile(".*" + city + ".*");
|
||||
params.add(new QueryParam("city1", pattern));
|
||||
}
|
||||
if (StringUtils.isNotBlank(district)) {
|
||||
Pattern pattern = Pattern.compile(".*" + district + ".*");
|
||||
params.add(new QueryParam("district", pattern));
|
||||
}
|
||||
if (StringUtils.isNotBlank(street)) {
|
||||
Pattern pattern = Pattern.compile(".*" + street + ".*");
|
||||
params.add(new QueryParam("street", pattern));
|
||||
}
|
||||
params.add(new QueryParam("type","ÏçÕò½ÖµÀ"));
|
||||
|
||||
return townshipDao.findAllByParams(params, pager.getStartRow(), pager.getPageSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long countTownship(String province, String city,String district,String street) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
if (StringUtils.isNotBlank(province)) {
|
||||
Pattern pattern = Pattern.compile(".*" + province + ".*");
|
||||
params.add(new QueryParam("province", pattern));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(city)) {
|
||||
Pattern pattern = Pattern.compile(".*" + city + ".*");
|
||||
params.add(new QueryParam("city1", pattern));
|
||||
}
|
||||
if (StringUtils.isNotBlank(district)) {
|
||||
Pattern pattern = Pattern.compile(".*" + district + ".*");
|
||||
params.add(new QueryParam("district", pattern));
|
||||
}
|
||||
if (StringUtils.isNotBlank(street)) {
|
||||
Pattern pattern = Pattern.compile(".*" + street + ".*");
|
||||
params.add(new QueryParam("street", pattern));
|
||||
}
|
||||
params.add(new QueryParam("type","ÏçÕò½ÖµÀ"));
|
||||
return townshipDao.findCountByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Township findTownship(String id) {
|
||||
return townshipDao.findById(id);
|
||||
}
|
||||
|
||||
public void setTownshipDao(TownshipDao townshipDao) {
|
||||
this.townshipDao = townshipDao;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user