Merge branch 'script_gj' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
+160
@@ -0,0 +1,160 @@
|
|||||||
|
package com.fangjia.bkoff.controllers;
|
||||||
|
|
||||||
|
import com.fangjia.bkoff.model.BuildingRatioModel;
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
||||||
|
import com.fangjia.service.bo.BuildingRatioBo;
|
||||||
|
import com.fangjia.service.mongo.bkoff.BuildingRatioService;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public class BuildingRatioController {
|
||||||
|
|
||||||
|
private BuildingRatioService buildingRatioService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建楼栋系数信息
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object doAddAction(BuildingRatioModel model) throws Exception {
|
||||||
|
if (StringUtils.isBlank(model.getCity_name()) || StringUtils.isBlank(model.getRegion())
|
||||||
|
|| StringUtils.isBlank(model.getDistrict()) || StringUtils.isBlank(model.getBuilding_name())
|
||||||
|
|| model.getRatio() == null) {
|
||||||
|
model.setMsg("城市,区域,小区,楼栋名称,楼栋系数不能为空");
|
||||||
|
model.forward("/buildingRatio/add");
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Date date = new Date();
|
||||||
|
BuildingRatio buildingRatio = new BuildingRatio();
|
||||||
|
buildingRatio.setCity(model.getCity_name());
|
||||||
|
buildingRatio.setRegion(model.getRegion());
|
||||||
|
buildingRatio.setDistrict(model.getDistrict());
|
||||||
|
buildingRatio.setBuilding_name(model.getBuilding_name());
|
||||||
|
buildingRatio.setRatio(model.getRatio());
|
||||||
|
buildingRatio.setC_date(date);
|
||||||
|
buildingRatio.setM_date(date);
|
||||||
|
this.buildingRatioService.save(buildingRatio);
|
||||||
|
|
||||||
|
model.setMsg("新建成功!");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
model.setMsg("新建失败!");
|
||||||
|
}
|
||||||
|
model.redirect("/buildingRatio/add?msg=" + URLEncoder.encode(model.getMsg(), "UTF-8"));
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object doDeleteAction(BuildingRatioModel model){
|
||||||
|
if(StringUtils.isNotBlank(model.getId())){
|
||||||
|
this.buildingRatioService.deleteById(model.getId());
|
||||||
|
}
|
||||||
|
model.setViewType("redirect");
|
||||||
|
model.setViewParam("location","/buildingRatio/list");
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改楼栋系数信息
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object updateAction(BuildingRatioModel model){
|
||||||
|
String id = model.getId();
|
||||||
|
if (StringUtils.isBlank(model.getCity_name()) ||
|
||||||
|
StringUtils.isBlank(model.getRegion()) ||
|
||||||
|
StringUtils.isBlank(model.getDistrict()) ||
|
||||||
|
StringUtils.isBlank(model.getBuilding_name()) ||
|
||||||
|
model.getRatio() == null) {
|
||||||
|
model.setMsg("城市,区域,小区,楼栋名称,楼栋系数不能为空");
|
||||||
|
model.forward("/buildingRatio/edit");
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> data_buildingRatio = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
data_buildingRatio.put("id", model.getId());
|
||||||
|
data_buildingRatio.put("city", model.getCity_name());
|
||||||
|
data_buildingRatio.put("region", model.getRegion());
|
||||||
|
data_buildingRatio.put("district", model.getDistrict());
|
||||||
|
data_buildingRatio.put("building_name", model.getBuilding_name());
|
||||||
|
data_buildingRatio.put("ratio", model.getRatio());
|
||||||
|
data_buildingRatio.put("m_date", new Date());
|
||||||
|
|
||||||
|
this.buildingRatioService.saveOrUpdateByBuildingName(model.getCity_name(),model.getRegion(),model.getDistrict(),model.getBuilding_name(), data_buildingRatio);
|
||||||
|
|
||||||
|
model.setViewType("redirect");
|
||||||
|
model.setViewParam("location", "/buildingRatio/list");
|
||||||
|
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object listAction(BuildingRatioModel model) {
|
||||||
|
|
||||||
|
List<BuildingRatio> buildingRatioList = this.buildingRatioService.findAllByDistrict(model.getCity_name(),model.getRegion(),model.getDistrict());
|
||||||
|
|
||||||
|
List<BuildingRatioBo> buildingRatioBoList = new ArrayList<BuildingRatioBo>();
|
||||||
|
|
||||||
|
for (BuildingRatio buildingRatio : buildingRatioList) {
|
||||||
|
BuildingRatioBo bo = new BuildingRatioBo();
|
||||||
|
|
||||||
|
bo.setId(buildingRatio.getId());
|
||||||
|
bo.setCity_name(buildingRatio.getCity());
|
||||||
|
bo.setRegion(buildingRatio.getRegion());
|
||||||
|
bo.setDistrict(buildingRatio.getDistrict());
|
||||||
|
bo.setBuilding_name(buildingRatio.getBuilding_name());
|
||||||
|
bo.setRatio(buildingRatio.getRatio());
|
||||||
|
bo.setC_date(buildingRatio.getC_date());
|
||||||
|
bo.setM_date(buildingRatio.getM_date());
|
||||||
|
|
||||||
|
buildingRatioBoList.add(bo);
|
||||||
|
}
|
||||||
|
|
||||||
|
model.setBuildingRatioBoList(buildingRatioBoList);
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object addAction(BuildingRatioModel model) {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑api用户信息
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object editAction(BuildingRatioModel model) {
|
||||||
|
BuildingRatio buildingRatio = this.buildingRatioService.findBuildingRatioById(model.getId());
|
||||||
|
|
||||||
|
BuildingRatioBo bo = new BuildingRatioBo();
|
||||||
|
bo.setId(buildingRatio.getId());
|
||||||
|
bo.setCity_name(buildingRatio.getCity());
|
||||||
|
bo.setRegion(buildingRatio.getRegion());
|
||||||
|
bo.setDistrict(buildingRatio.getDistrict());
|
||||||
|
bo.setBuilding_name(buildingRatio.getBuilding_name());
|
||||||
|
bo.setRatio(buildingRatio.getRatio());
|
||||||
|
|
||||||
|
model.setBuildingRatioBo(bo);
|
||||||
|
if (StringUtils.isNotBlank(model.getMsg()) && model.getMsg().equals("success")) {
|
||||||
|
model.setMsg("更新成功!");
|
||||||
|
}
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BuildingRatioService getBuildingRatioService() {
|
||||||
|
return buildingRatioService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildingRatioService(BuildingRatioService buildingRatioService) {
|
||||||
|
this.buildingRatioService = buildingRatioService;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
package com.fangjia.bkoff.model;
|
||||||
|
|
||||||
|
import com.fangjia.service.bo.BuildingRatioBo;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public class BuildingRatioModel extends BaseModel{
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String city_name;
|
||||||
|
private String region;
|
||||||
|
private String district;
|
||||||
|
private String building_name;
|
||||||
|
private String building_id;
|
||||||
|
private Double ratio;
|
||||||
|
private String msg;
|
||||||
|
private List<BuildingRatioBo> buildingRatioBoList;
|
||||||
|
private BuildingRatioBo buildingRatioBo;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date c_date;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date m_date;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity_name() {
|
||||||
|
return city_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity_name(String city_name) {
|
||||||
|
this.city_name = city_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district_name) {
|
||||||
|
this.district = district_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuilding_name() {
|
||||||
|
return building_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuilding_name(String building_name) {
|
||||||
|
this.building_name = building_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuilding_id() {
|
||||||
|
return building_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuilding_id(String building_id) {
|
||||||
|
this.building_id = building_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRatio() {
|
||||||
|
return ratio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRatio(Double ratio) {
|
||||||
|
this.ratio = ratio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getC_date() {
|
||||||
|
return c_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setC_date(Date c_date) {
|
||||||
|
this.c_date = c_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getM_date() {
|
||||||
|
return m_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setM_date(Date m_date) {
|
||||||
|
this.m_date = m_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BuildingRatioBo> getBuildingRatioBoList() {
|
||||||
|
return buildingRatioBoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildingRatioBoList(List<BuildingRatioBo> buildingRatioBoList) {
|
||||||
|
this.buildingRatioBoList = buildingRatioBoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BuildingRatioBo getBuildingRatioBo() {
|
||||||
|
return buildingRatioBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildingRatioBo(BuildingRatioBo buildingRatioBo) {
|
||||||
|
this.buildingRatioBo = buildingRatioBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<#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}" />
|
||||||
|
<#include "/common_js.ftl" />
|
||||||
|
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<#include "/layout/header.ftl" />
|
||||||
|
<div class="main-content">
|
||||||
|
<font color="red">${msg!''}</font>
|
||||||
|
<div class="menuButton">
|
||||||
|
<a href="list" class="list">楼栋系数列表</a>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div class="list">
|
||||||
|
<table width="50%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th align="center" width="150px;">
|
||||||
|
栏位
|
||||||
|
</th>
|
||||||
|
<th align="center">
|
||||||
|
值
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<form id="addForm" action="doAdd" method="post" >
|
||||||
|
<tr>
|
||||||
|
<td><b>城市</b></td>
|
||||||
|
<td><input name="city_name" value="${city_name!}" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>区域</b></td>
|
||||||
|
<td><input id="region" name="region" value="${region!}" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>小区名称</b></td>
|
||||||
|
<td><input name="district" type="text" value="${district!}" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>楼栋名称</td>
|
||||||
|
<td><input name="building_name" value="${building_name!}" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>楼栋系数</td>
|
||||||
|
<td><input name="ratio" value="${ratio!}" /></td>
|
||||||
|
</tr>
|
||||||
|
</form>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><input onclick="submitForm();" type="submit" value="新增"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function submitForm(){
|
||||||
|
$("#addForm").submit();
|
||||||
|
}
|
||||||
|
var getErrorValidate= function(mess){
|
||||||
|
var _html='<span class=\"wrong\">';
|
||||||
|
_html=_html+mess;
|
||||||
|
_html=_html+'</span>';
|
||||||
|
return _html;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</#compress>
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<#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>
|
||||||
|
<#include "/common_js.ftl" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<#include "/layout/header.ftl" />
|
||||||
|
<div class="main-content">
|
||||||
|
<font color="red">${msg!''}</font>
|
||||||
|
<div class="menuButton">
|
||||||
|
<a href="list" class="list">楼栋系数列表</a><a href="add" class="create">新建楼栋系数</a>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div class="list">
|
||||||
|
<table width="50%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th align="center" width="10%">
|
||||||
|
栏位
|
||||||
|
</th>
|
||||||
|
<th align="center" width="30%">
|
||||||
|
值
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<form id="submitForm" action="update" method="post">
|
||||||
|
<tr>
|
||||||
|
<td>城市</td>
|
||||||
|
<td><input name="city_name" value="${buildingRatioBo.city_name!}"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>区域</td>
|
||||||
|
<td><input name="region" value="${buildingRatioBo.region!}"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>小区名称</td>
|
||||||
|
<td><input name="district" value="${buildingRatioBo.district!}"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>楼栋名称</td>
|
||||||
|
<input name="id" value="${buildingRatioBo.id!}" type="hidden"/>
|
||||||
|
<td><input name="building_name" value="${buildingRatioBo.building_name!}"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>楼栋系数</td>
|
||||||
|
<td><input name="ratio" value="${buildingRatioBo.ratio!}" /></td>
|
||||||
|
</tr>
|
||||||
|
</form>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><input onclick="submitForm();" type="reset" value="修改"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function submitForm() {
|
||||||
|
$("#submitForm").attr("action", "update");
|
||||||
|
$("#submitForm").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</#compress>
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
<#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}" />
|
||||||
|
<#include "/common_js.ftl" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<#include "/layout/header.ftl" />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<form action="../buildingRatio/list" id="_search_ratio_form">
|
||||||
|
城市:<input type="text" name="city_name" value="${city_name!}" />
|
||||||
|
区域:<input type="text" name="region" value="${region!}" />
|
||||||
|
小区:<input type="text" name="district" value="${district!}" />
|
||||||
|
<input type="submit" value="查询" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="main-content">
|
||||||
|
<font color="red">${msg!''}</font>
|
||||||
|
<div class="menuButton">
|
||||||
|
<a href="list" class="list">楼栋系数列表</a><a href="add" class="create">新建楼栋系数</a>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div class="list">
|
||||||
|
<div style="padding-left:5px;">
|
||||||
|
共有楼栋系数<b>${buildingRatioBoList?size}</b>个
|
||||||
|
</div>
|
||||||
|
<table width="100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th align="center" width="55px">
|
||||||
|
ID
|
||||||
|
</th>
|
||||||
|
<th align="center" width="100px">
|
||||||
|
城市
|
||||||
|
</th>
|
||||||
|
<th align="center" width="60px">
|
||||||
|
区域
|
||||||
|
</th>
|
||||||
|
<th align="center" width="100px">
|
||||||
|
小区名称
|
||||||
|
</th>
|
||||||
|
<th align="center" width="60px">
|
||||||
|
楼栋名称
|
||||||
|
</th>
|
||||||
|
<th align="center" width="100px">
|
||||||
|
楼栋系数
|
||||||
|
</th>
|
||||||
|
<th align="center" width="200px">
|
||||||
|
创建日期
|
||||||
|
</th>
|
||||||
|
<th align="center" width="200px">
|
||||||
|
修改日期
|
||||||
|
</th>
|
||||||
|
<th align="center">
|
||||||
|
操作
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<#if (buildingRatioBoList??&&buildingRatioBoList?size>0)>
|
||||||
|
<#list buildingRatioBoList as bo>
|
||||||
|
<tr>
|
||||||
|
<td align="center">
|
||||||
|
${bo.id!}
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
${bo.city_name!}
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
${bo.region!}
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
${bo.district!}
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
${bo.building_name!}
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
${bo.ratio!}
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<#if bo.c_date??>
|
||||||
|
${bo.c_date?string("yyyy年MM月dd日 HH:mm:ss")}
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<#if bo.m_date??>
|
||||||
|
${bo.m_date?string("yyyy年MM月dd日 HH:mm:ss")}
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="../buildingRatio/edit?id=${bo.id!}">编辑</a>
|
||||||
|
<a href="../buildingRatio/doDelete?id=${bo.id}" onclick="return confirm('确定要删除 ${bo.city_name!}-${bo.region!}-${bo.district!}-${bo.building_name!}?')">删除</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</#compress>
|
||||||
@@ -90,6 +90,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<@menuitem uri='/avgPriceUpdate/doCreatTask' text="住宅均价管理" />
|
<@menuitem uri='/avgPriceUpdate/doCreatTask' text="住宅均价管理" />
|
||||||
<@menuitem uri='/averagerConfig/list' text="住宅系数管理" />
|
<@menuitem uri='/averagerConfig/list' text="住宅系数管理" />
|
||||||
|
<@menuitem uri='/buildingRatio/list' text="楼栋系数管理" />
|
||||||
<@menuitem uri='/avgPriceUpdate/listQR' text="价格质量跟踪" />
|
<@menuitem uri='/avgPriceUpdate/listQR' text="价格质量跟踪" />
|
||||||
<@menuitem uri='/avgPriceUpdate/listSQR' text="样本质量跟踪" />
|
<@menuitem uri='/avgPriceUpdate/listSQR' text="样本质量跟踪" />
|
||||||
<@menuitem uri='/comparePrice/listQR' text="调查数据跟踪" />
|
<@menuitem uri='/comparePrice/listQR' text="调查数据跟踪" />
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.fangjia.dal.mongo.dao.bkoff;
|
||||||
|
|
||||||
|
import com.fangjia.dal.MongoDao;
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.AveragerConfig;
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public interface BuildingRatioDao extends MongoDao<BuildingRatio> {
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.fangjia.dal.mongo.dao.bkoff;
|
||||||
|
|
||||||
|
import com.fangjia.dal.MongoDaoImpl;
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.AveragerConfig;
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public class BuildingRatioDaoImpl extends MongoDaoImpl<BuildingRatio> implements BuildingRatioDao {
|
||||||
|
}
|
||||||
+95
@@ -0,0 +1,95 @@
|
|||||||
|
package com.fangjia.dal.mongo.model.bkoff;
|
||||||
|
|
||||||
|
import com.fangjia.dal.MongoEntity;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "business.building_ratio")
|
||||||
|
public class BuildingRatio implements MongoEntity {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String city;
|
||||||
|
private String region;
|
||||||
|
private String district;
|
||||||
|
private String building_name;
|
||||||
|
|
||||||
|
private Double ratio;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date c_date;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date m_date;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
@Column(name = "_id")
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
@Column(name = "city")
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
@Column(name = "region")
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
@Column(name = "district")
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
@Column(name = "building_name")
|
||||||
|
public String getBuilding_name() {
|
||||||
|
return building_name;
|
||||||
|
}
|
||||||
|
public void setBuilding_name(String building_name) {
|
||||||
|
this.building_name = building_name;
|
||||||
|
}
|
||||||
|
@Column(name = "ratio")
|
||||||
|
public Double getRatio() {
|
||||||
|
return ratio;
|
||||||
|
}
|
||||||
|
public void setRatio(Double ratio) {
|
||||||
|
this.ratio = ratio;
|
||||||
|
}
|
||||||
|
@Column(name = "c_date")
|
||||||
|
public Date getC_date() {
|
||||||
|
return c_date;
|
||||||
|
}
|
||||||
|
public void setC_date(Date c_date) {
|
||||||
|
this.c_date = c_date;
|
||||||
|
}
|
||||||
|
@Column(name = "m_date")
|
||||||
|
public Date getM_date() {
|
||||||
|
return m_date;
|
||||||
|
}
|
||||||
|
public void setM_date(Date m_date) {
|
||||||
|
this.m_date = m_date;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -24,7 +24,7 @@ class CommitteeLatLng {
|
|||||||
static ExecutorService executorService = Executors.newFixedThreadPool(10)
|
static ExecutorService executorService = Executors.newFixedThreadPool(10)
|
||||||
|
|
||||||
static void main(String[] args) {
|
static void main(String[] args) {
|
||||||
dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0)).append("year", 2021))
|
dealPoi(new BasicDBObject("location", "").append("year", 2022))
|
||||||
//dealLocation()
|
//dealLocation()
|
||||||
executorService.shutdown()
|
executorService.shutdown()
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ class CommitteeLatLng {
|
|||||||
if (amapPoi && amapPoi.size() > 0) {
|
if (amapPoi && amapPoi.size() > 0) {
|
||||||
def poi = amapPoi[0]
|
def poi = amapPoi[0]
|
||||||
double similarity = CosineSimilarAlgorithm.getSimilarity(poi.name, name)
|
double similarity = CosineSimilarAlgorithm.getSimilarity(poi.name, name)
|
||||||
if (similarity <= 0.8) {
|
if (similarity <= 0.8 && !String.valueOf(poi.name).contains(name)) {
|
||||||
amapPoi = GaoDeUtils.searchPoi(city, address, area, "")
|
amapPoi = GaoDeUtils.searchPoi(city, address, area, "")
|
||||||
}
|
}
|
||||||
poi = amapPoi[0]
|
poi = amapPoi[0]
|
||||||
|
|||||||
+13
-9
@@ -55,13 +55,17 @@ class GaoDeUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static String getGaodeKey(String type) {
|
static String getGaodeKey(String type) {
|
||||||
Map<String, String> params = new HashMap<>();
|
// Map<String, String> params = new HashMap<>();
|
||||||
params.put("type", type)
|
// params.put("type", type)
|
||||||
JSONObject json = HttpRequestUtil.getJsonContent("http://192.168.0.100:38080/FangJiaDataService/getAmapKey", params)
|
// JSONObject json = HttpRequestUtil.getJsonContent("http://192.168.0.100:38080/FangJiaDataService/getAmapKey", params)
|
||||||
if (json.status == 0 && json.result != null) {
|
// if (json.status == 0 && json.result != null) {
|
||||||
return json.result
|
// return json.result
|
||||||
}
|
// }
|
||||||
System.exit(1);
|
// System.exit(1);
|
||||||
|
return "8796b9dfb3889b57c38e2fff1b7e51bd";
|
||||||
|
// 'eb69e4ad2a9cdd31f163a0ed32effe6e', '60f764d228d64addf390e28d68a01a35', '66e6771767ab293ace441553c36621c1',
|
||||||
|
// 'a63254b4a1b2e6f4bb11058e0b5d9fa2', '743ad872ad39f0a10665b28fa968af0b', '3b7c1d201c403bb416b63535ed3d0e98',
|
||||||
|
// 'a34894d151fffff94f9a33bae3d5565c', '389e0a3a155e8d28728c3faede4ebd4f'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -330,10 +334,10 @@ class GaoDeUtils {
|
|||||||
params.page = "${page}".toString()
|
params.page = "${page}".toString()
|
||||||
page++
|
page++
|
||||||
params.key = this.getGaodeKey("v5/place/text")
|
params.key = this.getGaodeKey("v5/place/text")
|
||||||
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/text", params);
|
JSONObject json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/text", params);
|
||||||
if (json == null) {
|
if (json == null) {
|
||||||
params.key = this.getGaodeKey("v5/place/text")
|
params.key = this.getGaodeKey("v5/place/text")
|
||||||
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v5/place/text", params);
|
json = HttpRequestUtil.getJsonContent("http://restapi.amap.com/v3/place/text", params);
|
||||||
}
|
}
|
||||||
if (json && json.info && json.info == "OK") {
|
if (json && json.info && json.info == "OK") {
|
||||||
count = json.getString("count").toInteger()
|
count = json.getString("count").toInteger()
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.fangjia.service.bo;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public class BuildingRatioBo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private String id;
|
||||||
|
private String city_name;
|
||||||
|
private String region;
|
||||||
|
private String district;
|
||||||
|
private String building_name;
|
||||||
|
private Double ratio;
|
||||||
|
private Date c_date;
|
||||||
|
private Date m_date;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity_name() {
|
||||||
|
return city_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity_name(String city_name) {
|
||||||
|
this.city_name = city_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistrict() {
|
||||||
|
return district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistrict(String district) {
|
||||||
|
this.district = district;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuilding_name() {
|
||||||
|
return building_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuilding_name(String building_name) {
|
||||||
|
this.building_name = building_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRatio() {
|
||||||
|
return ratio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRatio(Double ratio) {
|
||||||
|
this.ratio = ratio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getC_date() {
|
||||||
|
return c_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setC_date(Date c_date) {
|
||||||
|
this.c_date = c_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getM_date() {
|
||||||
|
return m_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setM_date(Date m_date) {
|
||||||
|
this.m_date = m_date;
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.fangjia.service.mongo.bkoff;
|
||||||
|
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public interface BuildingRatioService {
|
||||||
|
public void save(BuildingRatio buildingRatio);
|
||||||
|
public void deleteById(String id);
|
||||||
|
public void saveOrUpdateByBuildingName(String city, String region, String district, String building_name, Map<String, Object> data);
|
||||||
|
public BuildingRatio findBuildingRatioById(String id);
|
||||||
|
public List<BuildingRatio> findAllByDistrict(String city, String region, String district);
|
||||||
|
}
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
package com.fangjia.service.mongo.bkoff;
|
||||||
|
|
||||||
|
import com.fangjia.dal.QueryParam;
|
||||||
|
import com.fangjia.dal.SortParam;
|
||||||
|
import com.fangjia.dal.mongo.dao.bkoff.BuildingRatioDao;
|
||||||
|
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
||||||
|
import com.fangjia.dal.sql.model.FjtUsers;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhaojixiang
|
||||||
|
* @since 2023/7/5
|
||||||
|
*/
|
||||||
|
public class BuildingRatioServiceImpl implements BuildingRatioService{
|
||||||
|
|
||||||
|
private BuildingRatioDao buildingRatioDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(BuildingRatio buildingRatio) {
|
||||||
|
|
||||||
|
this.buildingRatioDao.save(buildingRatio);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteById(String id) {
|
||||||
|
this.buildingRatioDao.deleteById(id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void saveOrUpdateByBuildingName(String city, String region, String district, String building_name, Map<String, Object> data) {
|
||||||
|
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||||
|
params.add(new QueryParam("city", city));
|
||||||
|
params.add(new QueryParam("region", region));
|
||||||
|
params.add(new QueryParam("district", district));
|
||||||
|
params.add(new QueryParam("building_name", building_name));
|
||||||
|
data.put("city", city);
|
||||||
|
data.put("region", region);
|
||||||
|
data.put("district", district);
|
||||||
|
data.put("building_name", building_name);
|
||||||
|
this.buildingRatioDao.updateByParams(data, params, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BuildingRatio findBuildingRatioById(String id) {
|
||||||
|
|
||||||
|
return this.buildingRatioDao.findById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BuildingRatio> findAllByDistrict(String city, String region, String district) {
|
||||||
|
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||||
|
if(StringUtils.isNotBlank(city)){
|
||||||
|
params.add(new QueryParam("city", city));
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(region)){
|
||||||
|
params.add(new QueryParam("region", region));
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(district)){
|
||||||
|
params.add(new QueryParam("district", district));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||||
|
sortParams.add(new SortParam("m_date", false));
|
||||||
|
|
||||||
|
return this.buildingRatioDao.findAllByParams(params, sortParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BuildingRatioDao getBuildingRatioDao() {
|
||||||
|
return buildingRatioDao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildingRatioDao(BuildingRatioDao buildingRatioDao) {
|
||||||
|
this.buildingRatioDao = buildingRatioDao;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user