Merge branch 'master' of http://gitlab.fangjia.com/dev0/main
@@ -1265,6 +1265,7 @@ public class DistrictController {
|
||||
district.setAddrAlias(new ArrayList<String>(addrAlias));
|
||||
}
|
||||
district.setStatus(0);
|
||||
district.setNameCat(0);
|
||||
district.setCategory("district");
|
||||
district.setPublisherType(11);
|
||||
district.setCreationDate(new Date());
|
||||
|
||||
@@ -176,7 +176,7 @@ table{text-align: left;}
|
||||
}
|
||||
})
|
||||
|
||||
if(role==12){
|
||||
if(role==12||role==17){
|
||||
if(userStr.length>0){
|
||||
console.log(userStr);
|
||||
$("input[name=roleUsers]").val(userStr);
|
||||
@@ -306,7 +306,7 @@ $("input[name=email]").blur(function(){
|
||||
$("#role").change(function() {
|
||||
var role = $(this).val();
|
||||
//只对农行生效
|
||||
if (role == 12) {
|
||||
if (role == 12 || role == 17) {
|
||||
$("#show_chk_all").removeAttr("style");
|
||||
jQuery.ajax({
|
||||
type: 'POST',
|
||||
@@ -340,12 +340,12 @@ $("input[name=email]").blur(function(){
|
||||
}
|
||||
return false;
|
||||
}
|
||||
<#if user?? && user.role == 12>
|
||||
<#if user?? && (user.role == 12 || user.role == 17)>
|
||||
$("#show_chk_all").removeAttr("style");
|
||||
jQuery.ajax({
|
||||
type: 'POST',
|
||||
url: '../fjt/getUsersByRole',
|
||||
data: {role:12},
|
||||
data: {role:${user.role}},
|
||||
dataType: 'json',
|
||||
timeout: 100000,
|
||||
success: function(model) {
|
||||
|
||||
@@ -258,8 +258,9 @@ public class BaiDuApiUtils {
|
||||
params.put("coords", lng.toString() + "," + lat.toString());
|
||||
params.put("from", String.valueOf(from));
|
||||
HttpRequest request = new HttpRequest();
|
||||
String result = null;
|
||||
try{
|
||||
String result = request.get("http://api.map.baidu.com/geoconv/v1/",params,"UTF-8");
|
||||
result = request.get("http://api.map.baidu.com/geoconv/v1/",params,"UTF-8");
|
||||
JSONObject json = JSONObject.fromObject(result);
|
||||
while(!(json == null || json.containsKey("result") || json.getJSONArray("result").size() == 0)){
|
||||
changeAK();
|
||||
@@ -273,6 +274,7 @@ public class BaiDuApiUtils {
|
||||
}
|
||||
return json.getJSONArray("result").getJSONObject(0);
|
||||
}catch (Exception e){
|
||||
System.out.println("错误:"+result);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.fangjia.coresite.controllers;
|
||||
|
||||
import com.fangjia.coresite.model.AdviceLeadsModel;
|
||||
import com.fangjia.coresite.model.user.Message;
|
||||
import com.fangjia.coresite.model.user.UserRegJsonModel;
|
||||
import com.fangjia.coresite.util.CoresiteCookieContext;
|
||||
import com.fangjia.coresite.util.LoginUtil;
|
||||
import com.fangjia.dal.mongo.fangjia.model.AdviceLeads;
|
||||
import com.fangjia.service.common.CookieName;
|
||||
import com.fangjia.service.fangjia.AdviceLeadsService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
|
||||
public class AdviceLeadsController {
|
||||
|
||||
private AdviceLeadsService adviceLeadsService;
|
||||
|
||||
private static final CoresiteCookieContext COOKIE_CONTEXT = CoresiteCookieContext
|
||||
.getInstance();
|
||||
|
||||
public Object doAddAction(AdviceLeadsModel model, HttpServletRequest req) {
|
||||
UserRegJsonModel result = new UserRegJsonModel();
|
||||
model.setViewType("redirect");
|
||||
|
||||
String tempId = COOKIE_CONTEXT.getCookieValue(req, CookieName.UID);
|
||||
AdviceLeads adviceLeads = new AdviceLeads();
|
||||
adviceLeads.setName(model.getName());
|
||||
adviceLeads.setMobile(model.getMobile());
|
||||
adviceLeads.setEmail(model.getEmail());
|
||||
adviceLeads.setCompany(model.getCompany());
|
||||
adviceLeads.setDepartment(model.getDepartment());
|
||||
adviceLeads.setPosition(model.getPosition());
|
||||
adviceLeads.setCreateDate(new Date());
|
||||
adviceLeads.setModifyDate(new Date());
|
||||
adviceLeads.setUserId(LoginUtil.getUserId(req));
|
||||
adviceLeads.setTempId(tempId);
|
||||
adviceLeadsService.save(adviceLeads);
|
||||
result.setResult(Message.RESULT_SUCCESS);
|
||||
return result;
|
||||
}
|
||||
|
||||
public AdviceLeadsService getAdviceLeadsService() {
|
||||
return adviceLeadsService;
|
||||
}
|
||||
|
||||
public void setAdviceLeadsService(AdviceLeadsService adviceLeadsService) {
|
||||
this.adviceLeadsService = adviceLeadsService;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.fangjia.coresite.model;
|
||||
|
||||
public class AdviceLeadsModel extends BaseModel{
|
||||
|
||||
private static final long serialVersionUID = -5664116886759283515L;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 公司
|
||||
*/
|
||||
private String company;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String department;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
private String position;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="con1">
|
||||
<p>上海总部</p>
|
||||
<b>电 话</b>: 4001883787(周一至周五 09:00-18:00)<br>
|
||||
<b>邮 箱</b>: <a href="mailto:service@fangjia.com">service@fangjia.com</a><br>
|
||||
<b>邮 箱</b>: <a href="mailto:gujia@fangjia.com">gujia@fangjia.com</a><br>
|
||||
<b>地 址</b>: 上海市长宁区协和路1033号文洋大厦B座10楼<br>
|
||||
<b>邮 编</b>: 200335<br><br>
|
||||
</div>
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
<div class="c0">
|
||||
<ul>
|
||||
<li class="t0">咨询电话:021-62391139</li>
|
||||
<li class="email">邮 箱:<a href="mailto:service@fangjia.com">service@fangjia.com</a></li>
|
||||
<li class="email">邮 箱:<a href="mailto:gujia@fangjia.com">gujia@fangjia.com</a></li>
|
||||
<li class="line"></li>
|
||||
<li class="tips">商务合作,请提交信息获得产品体验</li>
|
||||
<li class="t1 contact_form"><span><i>*</i>姓名:</span><input type="text" id="f_name" /></li>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<a ref="nofollow"><img src="${staticUrl}/images/wj110.png?v=${version}" height="47" border="0" /></a>
|
||||
</p>
|
||||
<p class="footer_text">
|
||||
客服热线:4001883787 电子邮箱:service@fangjia.com
|
||||
客服热线:4001883787 电子邮箱:gujia@fangjia.com
|
||||
<br />
|
||||
©2006-${now?string("yyyy")} 估家网络 版权所有 <a href="http://www.shcaeg.gov.cn/main.action" target="_blank">沪B2-20130098</a>
|
||||
<br/>
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -262,9 +262,9 @@
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="mailto:service@fangjia.com" class="icon two-code" title="客服邮箱"></a>
|
||||
<a href="mailto:gujia@fangjia.com" class="icon two-code" title="客服邮箱"></a>
|
||||
<div class="fixedNav02">
|
||||
<span>service@fangjia.com</span>
|
||||
<span>gujia@fangjia.com</span>
|
||||
<font></font>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -77,15 +77,17 @@
|
||||
<p class="office01 current"><i></i><a>上海</a></p>
|
||||
<p>
|
||||
<font>电 话: 4001883787(周一至周五 09:00-18:00)<br>
|
||||
邮 箱: service@fangjia.com</font>
|
||||
邮 箱: gujia@fangjia.com</font>
|
||||
<font>地 址:上海市黄浦区黄陂北路227号中区广场1207室<br>
|
||||
邮 编: 200003</font>
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!-- <div>
|
||||
<p class="office01 current"><i></i><a>上海总部</a></p>
|
||||
<p>电 话: 4001883787(周一至周五 09:00-18:00)<br>
|
||||
邮 箱: service@fangjia.com<br>
|
||||
邮 箱: gujia@fangjia.com<br>
|
||||
地 址: 上海市黄浦区黄陂北路227号中区广场1207室<br>
|
||||
邮 编: 200003</p>
|
||||
</div>
|
||||
@@ -102,7 +104,24 @@
|
||||
邮 编: 518028</p>
|
||||
</div> -->
|
||||
<div class="officeMapBox">
|
||||
<div class="officeMap" id="officeMap01"></div>
|
||||
<div class="officeMap" id="officeMap01" style="width: 50%; float:left" ></div>
|
||||
<div style="padding-left: 5%; float:left;width: 25%;padding-top: 5%; text-align: center;">
|
||||
<img src="${staticUrl}/images/fangjia/v5/KfWx.png" style="width: 200px; display: inline-block;"><br><br>
|
||||
<span>关注估家科技客服微信号<br>
|
||||
Follow us on WeChat</span>
|
||||
</div>
|
||||
<div style="float:left; padding-top: 5%; text-align: center;">
|
||||
<img src="${staticUrl}/images/fangjia/v5/GfWx.png" style="width: 200px; display: inline-block;"><br><br>
|
||||
<span>关注官方微信公众号<br>
|
||||
Follow us on WeChat</span>
|
||||
</div>
|
||||
<#--<div style="padding-left: 85%; float:left">
|
||||
<img src="${staticUrl}/images/fangjia/v5/GfWx.png"><br>
|
||||
<span> 关注官方微信公众号</span><br>
|
||||
<span> Follow us on WeChat</span>
|
||||
</div>-->
|
||||
|
||||
|
||||
<!-- <div class="officeMap" id="officeMap02"></div>
|
||||
<div class="officeMap" id="officeMap03"></div> -->
|
||||
</div>
|
||||
@@ -111,13 +130,27 @@
|
||||
<div>
|
||||
<p class="office01 current"><i></i><a>上海</a></p>
|
||||
<p>电 话: 4001883787(周一至周五 09:00-18:00)<br>
|
||||
邮 箱: service@fangjia.com<br>
|
||||
邮 箱: gujia@fangjia.com<br>
|
||||
地 址: 上海市黄浦区黄陂北路227号中区广场1207室<br>
|
||||
邮 编: 200003</p>
|
||||
</div>
|
||||
<div class="officeMapBox">
|
||||
<div class="officeMap" id="officeMap04"></div>
|
||||
<div>
|
||||
<div style="float:left;">
|
||||
<img src="${staticUrl}/images/fangjia/v5/KfWx.png" style="height:80px;padding-left: 20%;"><br>
|
||||
<span>关注估家科技客服微信号</span><br>
|
||||
<span> Follow us on WeChat</span>
|
||||
</div>
|
||||
<div style="float:left;margin-left: 10%;">
|
||||
<img src="${staticUrl}/images/fangjia/v5/GfWx.png" style="height:80px;margin-left: 15%;"><br>
|
||||
<span> 关注官方微信公众号</span><br>
|
||||
<span> Follow us on WeChat</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="officeMapBox" >
|
||||
<div class="officeMap" id="officeMap04" style="margin-top: 10px"></div>
|
||||
<#-- <div class="officeMap" id="officeMap01" style="width: 80%; float:left" ></div>-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="main_title" id="partner" style="padding-top:100px;">他们都在和我们合作</div>
|
||||
<div class="main_content partner mobile01">
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</p>
|
||||
|
||||
<div class="footer_in por">
|
||||
客服热线:4001883787 电子邮箱:service@fangjia.com
|
||||
客服热线:4001883787 电子邮箱:gujia@fangjia.com
|
||||
<br />
|
||||
©2006-${now?string("yyyy")} 房价网 版权所有 沪ICP备10203734号-1
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<a ref="nofollow"><img src="${staticUrl}/images/wj110.png?v=${version}" height="47" border="0" /></a>
|
||||
</p>
|
||||
<p class="footer_text">
|
||||
客服热线:4001883787 电子邮箱:service@fangjia.com
|
||||
客服热线:4001883787 电子邮箱:gujia@fangjia.com
|
||||
<br />
|
||||
©2006-${now?string("yyyy")} 估家网络 版权所有 <a href="http://www.miitbeian.gov.cn/" target="_blank">沪ICP备10203734号-1</a>
|
||||
<br/>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<p class="footer_text">
|
||||
图片来源于网络,版权属于作者,请勿用于商业用途。<br/>
|
||||
客服热线:4001883787 电子邮箱:service@fangjia.com
|
||||
客服热线:4001883787 电子邮箱:gujia@fangjia.com
|
||||
<br />
|
||||
©2006-${now?string("yyyy")} 估家网络 版权所有 <a href="http://www.shcaeg.gov.cn/main.action" target="_blank">沪B2-20130098</a>
|
||||
<br/>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${_currentCityUrl}/ershoufang/">上海找房子</a><span>,</span><a href="${_currentCityUrl}/gujia/">估房价</a><span>,百度 </span><a href="http://www.baidu.com/s?wd=%B7%BF%BC%DB%CD%F8">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${_currentCityUrl}/ershoufang/">上海找房子</a><span>,</span><a href="${_currentCityUrl}/gujia/">估房价</a><span>,百度 </span><a href="http://www.baidu.com/s?wd=%B7%BF%BC%DB%CD%F8">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
<a ref="nofollow" href="#"><img src="${staticUrl}/images/wlzx.png?v=${version}" height="47" border="0" /></a>
|
||||
<a ref="nofollow" href="#"><img src="${staticUrl}/images/wj110.png?v=${version}" height="47" border="0" /></a>
|
||||
</p>
|
||||
<p class="copyrights">客服热线:4001883787 电子邮箱:service@fangjia.com<br />
|
||||
<p class="copyrights">客服热线:4001883787 电子邮箱:gujia@fangjia.com<br />
|
||||
©2006-${now?string("yyyy")} 房价网 版权所有 沪ICP备10203734号-1<br/>
|
||||
<a class="grey9c" target="_blank" href="<@d_url schema="${citySchema}" uri="/sellHouseSearch/list" />"><#if (!serverAreaMap?exists && actionName == 'index')>${cityName}</#if>找房子</a>,<a class="grey9c" target="_blank" href="<@d_url uri="/evaluation/report" schema="${cityDomain}" />">估房价</a>,百度 <a class="grey9c" target="_blank" href="http://www.baidu.com/s?wd=%B7%BF%BC%DB%CD%F8">房价网</a>
|
||||
</p>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<font>|</font>
|
||||
<a href="https://www.linkedin.com/company/fangjia" title="LinkedIn" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon03.png" class="footer_icon03"><span style="width:56px;">LinkedIn</span></a>
|
||||
<font>|</font>
|
||||
<a href="mailto:service@fangjia.com" title="客服邮箱" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon06.png" class="footer_icon06"><span>客服邮箱</span></a>
|
||||
<a href="mailto:gujia@fangjia.com" title="客服邮箱" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon06.png" class="footer_icon06"><span>客服邮箱</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer_bottom">
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<font>|</font>
|
||||
<a href="https://www.linkedin.com/company/fangjia" title="LinkedIn" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon03.png" class="footer_icon03"><span style="width:56px;">LinkedIn</span></a>
|
||||
<font>|</font>
|
||||
<a href="mailto:service@fangjia.com" title="客服邮箱" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon06.png" class="footer_icon06"><span>客服邮箱</span></a>
|
||||
<a href="mailto:gujia@fangjia.com" title="客服邮箱" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon06.png" class="footer_icon06"><span>客服邮箱</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer_bottom">
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="mailto:market@fangjia.com" class="icon two-code" title="客服邮箱"></a>
|
||||
<a href="mailto:gujia@fangjia.com" class="icon two-code" title="客服邮箱"></a>
|
||||
<div class="fixedNav02">
|
||||
<span>market@fangjia.com</span>
|
||||
<span>gujia@fangjia.com</span>
|
||||
<font></font>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -1476,9 +1476,9 @@
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="mailto:market@fangjia.com" class="icon two-code" title="客服邮箱"></a>
|
||||
<a href="mailto:gujia@fangjia.com" class="icon two-code" title="客服邮箱"></a>
|
||||
<div class="fixedNav02">
|
||||
<span>market@fangjia.com</span>
|
||||
<span>gujia@fangjia.com</span>
|
||||
<font></font>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<font>|</font>
|
||||
<a href="https://www.linkedin.com/company/fangjia" title="LinkedIn" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon03.png" class="footer_icon03"><span style="width:56px;">LinkedIn</span></a>
|
||||
<font>|</font>
|
||||
<a href="mailto:service@fangjia.com" title="客服邮箱" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon06.png" class="footer_icon06"><span>客服邮箱</span></a>
|
||||
<a href="mailto:gujia@fangjia.com" title="客服邮箱" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon06.png" class="footer_icon06"><span>客服邮箱</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer_bottom">
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -243,14 +243,14 @@
|
||||
<div class="error error01 dn"><i></i><span></span></div>
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>电子邮箱<i>*</i></label>
|
||||
<label>电子邮箱</label>
|
||||
<input class="inpu inpu02" type="text" name="saleLeads.email" id="email" autocomplete="off" placeholder="请输入您的电子邮箱">
|
||||
<div class="error error01 dn"><i></i><span></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inputInfoBox01">
|
||||
<div class="inputInfo">
|
||||
<label>所在城市<i>*</i></label>
|
||||
<label>所在城市</label>
|
||||
<div class="inpu inpu02 cityChoice open-about01">
|
||||
<input type="hidden" name="saleLeads.city" id="city" value="上海">
|
||||
<input id="selectedCity" value="上海" placeholder="请选择城市" readonly>
|
||||
@@ -259,7 +259,7 @@
|
||||
<div class="error error01 dn"><i></i>所在城市不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>行业性质<i>*</i></label>
|
||||
<label>行业性质</label>
|
||||
<select class="sel" id="nature" name="saleLeads.industryNature">
|
||||
<option value="">请选择您所在的行业性质</option>
|
||||
<option value="银行">银行</option>
|
||||
@@ -280,7 +280,7 @@
|
||||
</div>
|
||||
<input name="saleLeads.work" id="work" type="hidden"/>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel" name="">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>风控管理</option>
|
||||
@@ -296,7 +296,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>风控管理</option>
|
||||
@@ -311,7 +311,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>数据分析</option>
|
||||
@@ -324,7 +324,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>房地产评估</option>
|
||||
@@ -337,7 +337,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>课题研究</option>
|
||||
@@ -351,7 +351,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>信用征集</option>
|
||||
@@ -366,7 +366,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>市场研究与分析</option>
|
||||
@@ -377,7 +377,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>数据分析</option>
|
||||
@@ -391,7 +391,7 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label>工作职能<i>*</i></label>
|
||||
<label>工作职能</label>
|
||||
<select class="sel">
|
||||
<option>请选择您的工作职能</option>
|
||||
<option>项目策划与开发</option>
|
||||
@@ -407,20 +407,20 @@
|
||||
<div class="error error01 dn"><i></i>工作职能不能为空</div>
|
||||
</div>
|
||||
<div class="inputInfo duty dn">
|
||||
<label class="label01">其他行业性质<i>*</i></label>
|
||||
<label class="label01">其他行业性质</label>
|
||||
<input class="inpu inpu02" type="text" autocomplete="off" placeholder="请输入其他行业性质" id="otherIndustryNature" name="saleLeads.otherIndustryNature">
|
||||
<div class="error error01 dn"><i></i><span></span></div>
|
||||
<label class="label01 label01a">其他工作职能<i>*</i></label>
|
||||
<label class="label01 label01a">其他工作职能</label>
|
||||
<input class="inpu inpu02 inpu02a" type="text" id="otherWork2" name="saleLeads.otherWork" autocomplete="off" placeholder="请输入其他工作职能">
|
||||
<div class="error error01 dn" style="top:91px;"><i></i><span></span></div>
|
||||
</div>
|
||||
<div class="inputInfo duty01 dn">
|
||||
<label class="label01">其他工作职能<i>*</i></label>
|
||||
<label class="label01">其他工作职能</label>
|
||||
<input class="inpu inpu02" type="text" id="otherWork" name="saleLeads.otherWork" autocomplete="off" placeholder="请输入其他工作职能">
|
||||
<div class="error error01 dn"><i></i><span></span></div>
|
||||
</div>
|
||||
<div class="inputInfo <#if mid?? && mid!='1018'&&mid!='1016'>dn</#if>" >
|
||||
<label>业务需求<i>*</i></label>
|
||||
<label>业务需求</label>
|
||||
<input name="saleLeads.business" id="business" type="hidden"/>
|
||||
<div class="demand">
|
||||
<p><b><i></i>解决方案</b></p>
|
||||
@@ -445,7 +445,7 @@
|
||||
<div class="error error01 dn"><i></i><span></span></div>
|
||||
</div>
|
||||
<div class="inputInfo demand01 dn">
|
||||
<label class="label01">其他业务需求<i>*</i></label>
|
||||
<label class="label01">其他业务需求</label>
|
||||
<input class="inpu inpu02" type="text" id="otherBusiness" name="saleLeads.otherBusiness" autocomplete="off" placeholder="请输入其他业务需求">
|
||||
<div class="error error01 dn"><i></i>其他业务需求不能为空</div>
|
||||
</div>
|
||||
@@ -556,7 +556,7 @@ $(".user_btn").click(function(){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!checkEmail()){
|
||||
/*if(!checkEmail()){
|
||||
scrollBy(0,-300);
|
||||
return false;
|
||||
}
|
||||
@@ -575,7 +575,7 @@ $(".user_btn").click(function(){
|
||||
scrollBy(0,-100);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
var cls = $(".agreement i").attr("class");
|
||||
if(cls.indexOf("checked")>-1){
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<p class="p02" style="width:1250px;"><label>高效率、高智能的批量地址标准化分析与处理</label></p>
|
||||
<p><small>无论在风控、征信还是营销领域,任何批量地址数据的处理都离不开地址标准化。<br>房价网基于强大的CPDB数据库和人机技术,为各行业提供高效智能的地址标准化服务。</small></p>
|
||||
<div class="btnGroup">
|
||||
<a class="link_btn link01_btn large" data_id="1007" cat="solution">立即咨询专业顾问</a>
|
||||
<a class="link_btn link01_btn large" data_id="1007" id="seekAdvice" style="width: 222px; font-size: 25px; color: #FB8;">立即咨询专业顾问</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<p class="p01"><small>地址标准化解决方案</small></p>
|
||||
<p class="p02"><label>高效率、高智能的批量地址标准化分析与处理</label></p>
|
||||
<div class="btnGroup">
|
||||
<a class="link_btn link01_btn large" data_id="1007" cat="solution">立即咨询专业顾问</a>
|
||||
<a class="link_btn link01_btn large" data_id="1007" id="seekAdvice_mobile">立即咨询专业顾问</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
<div class="adBox adBox03">
|
||||
<p><small>您可通过在线方式联系专业顾问,他们将非常乐意为您提供更多服务。</small></p>
|
||||
<a class="link_btn" data_id="1007" cat="solution">立即咨询</a>
|
||||
<a class="link_btn" data_id="1007" id="seekAdvice2" style="width: 150px; height: 38px; background: #FB8;">立即咨询</a>
|
||||
</div>
|
||||
|
||||
<div class="resource" data-url = "${wwwUrl}/resource/recommend?module=1016"></div>
|
||||
@@ -128,9 +128,134 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialogBox dialogBoxSolution dn" style="top: 40%;">
|
||||
<#--<div class="dialogBox_title">申请贷款<i class="close" id="loanWin"></i></div>-->
|
||||
<div class="dialogBox_content" style="padding: 20px;">
|
||||
<div class="user" style="margin-top: 40px;">
|
||||
<div class="content">
|
||||
<div class="inputInfoBox">
|
||||
<div class="inputInfo">
|
||||
<label>姓名<i style="color: red;">*</i></label>
|
||||
<input id="name_d" class="inpu" type="text" autocomplete="off" placeholder="请输入您的姓名">
|
||||
<div class="error dn"><i></i><span></span></div>
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>手机<i style="color: red;">*</i></label>
|
||||
<input id="mobile_d" class="inpu" type="text" autocomplete="off" placeholder="请输入手机号码">
|
||||
<div class="error dn"><i></i><span></span></div>
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>邮箱</label>
|
||||
<input id="email_d" class="inpu" type="text" autocomplete="off" placeholder="请输入邮箱">
|
||||
<div class="error dn email_err"></div>
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>公司</label>
|
||||
<input id="company_d" class="inpu" type="text" autocomplete="off" placeholder="请输入公司">
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>部门</label>
|
||||
<input id="department_d" class="inpu" type="text" autocomplete="off" placeholder="请输入部门">
|
||||
</div>
|
||||
<div class="inputInfo">
|
||||
<label>职位</label>
|
||||
<input id="position_d" class="inpu" type="text" autocomplete="off" placeholder="请输入职位">
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center">
|
||||
<#--<a style="width: 100px;background: #f08300;line-height: 40px;color: #fff;display: block;float: left;margin-left: 100px;" id="addData">提交</a>
|
||||
<a style="width: 100px;background: #f08300;line-height: 40px;color: #fff;float: left;margin-left: 20px;" id="close_d">返回</a>-->
|
||||
|
||||
<a style="width: 25%;background: #f08300;line-height: 40px;color: #fff;display: block;float: left;margin-left: 23%;" id="addData">提交</a>
|
||||
<a style="width: 25%;background: #f08300;line-height: 40px;color: #fff;float: left;margin-left: 4%;" id="close_d">返回</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<#include "/header/v5/_footer.ftl"/>
|
||||
|
||||
<script src="${staticUrl}/js/fangjia/v5/main.js?v=${version}"></script>
|
||||
<script>
|
||||
$("#seekAdvice,#seekAdvice2,#seekAdvice_mobile").click(function(){
|
||||
$("#name_d").val(""),
|
||||
$("#mobile_d").val(""),
|
||||
$("#email_d").val(""),
|
||||
$("#company_d").val(""),
|
||||
$("#department_d").val(""),
|
||||
$("#position_d").val("")
|
||||
$(".mask").show();
|
||||
$(".dialogBoxSolution").removeClass("dn");
|
||||
});
|
||||
|
||||
$("#close_d").click(function(){
|
||||
$(".mask").hide();
|
||||
$(".dialogBoxSolution").addClass("dn");
|
||||
});
|
||||
|
||||
|
||||
$("#addData").click(function(){
|
||||
if(!checkName()){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!checkMobile()){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : " ${wwwUrl}/adviceLeads/doAdd",
|
||||
data : {
|
||||
name:$("#name_d").val(),
|
||||
mobile:$("#mobile_d").val(),
|
||||
email:$("#email_d").val(),
|
||||
company:$("#company_d").val(),
|
||||
department:$("#department_d").val(),
|
||||
position:$("#position_d").val()
|
||||
},
|
||||
success : function(result) {
|
||||
var re = $.parseJSON(result);
|
||||
if(re.result == "fail"){
|
||||
alert("申请失败,请重试");
|
||||
} else {
|
||||
$(".mask").hide();
|
||||
$(".dialogBoxSolution").addClass("dn");
|
||||
popMsg("申请成功");
|
||||
}
|
||||
},error:function (data, status) {
|
||||
alert("申请失败,请重试");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function checkMobile(){
|
||||
var val = $("#mobile_d").val();
|
||||
if ($.trim(val) == "") {
|
||||
$("#mobile_d").parent().find(".error span").text("手机号码不能为空");
|
||||
$("#mobile_d").parent().find(".error").show();
|
||||
return false;
|
||||
}else if(!(/^1\d{10}$/.test(val))){
|
||||
$("#mobile_d").parent().find(".error span").text("手机号码格式错误");
|
||||
$("#mobile_d").parent().find(".error").show();
|
||||
return false;
|
||||
} else{
|
||||
$("#mobile_d").parent().find(".error").text("");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkName(){
|
||||
var val = $("#name_d").val();
|
||||
if ($.trim(val) == "") {
|
||||
$("#name_d").parent().find(".error span").text("您的姓名不能为空");
|
||||
$("#name_d").parent().find(".error").show();
|
||||
return false;
|
||||
}else{
|
||||
$("#name_d").parent().find(".error").hide();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<span>前台总机:021-62393138</span><br>
|
||||
<span>客服热线:4001883787</span><br>
|
||||
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度 </span><a href="https://www.baidu.com">房价网</a><br>
|
||||
<span>电子邮箱:service@fangjia.com</span>
|
||||
<span>电子邮箱:gujia@fangjia.com</span>
|
||||
</div>
|
||||
<div class="wx"></div>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<a href="http://support.fangjia.com/pinpai">热门品牌</a>
|
||||
</p>
|
||||
<div class="footer_in por">
|
||||
客服热线:4001883787 电子邮箱:service@fangjia.com
|
||||
客服热线:4001883787 电子邮箱:gujia@fangjia.com
|
||||
<br>
|
||||
©2006-2013 <strong class="yhua">房价</strong>网 版权所有 沪ICP备10203734号-1
|
||||
<b class="bg_common"></b>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.model.PriceBorder;
|
||||
import com.fangjia.dal.mongo.model.PriceJiucuo;
|
||||
|
||||
public interface PriceBorderDao extends MongoDao<PriceBorder> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.fangjia.dal.mongo.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.model.PriceBorder;
|
||||
|
||||
public class PriceBorderDaoImpl extends MongoDaoImpl<PriceBorder> implements PriceBorderDao{
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.fangjia.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDao;
|
||||
import com.fangjia.dal.mongo.fangjia.model.AdviceLeads;
|
||||
|
||||
public interface AdviceLeadsDao extends MongoDao<AdviceLeads> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fangjia.dal.mongo.fangjia.dao;
|
||||
|
||||
import com.fangjia.dal.MongoDaoImpl;
|
||||
import com.fangjia.dal.mongo.fangjia.model.AdviceLeads;
|
||||
|
||||
public class AdviceLeadsDaoImpl extends MongoDaoImpl<AdviceLeads> implements AdviceLeadsDao {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.fangjia.dal.mongo.fangjia.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 新版房价网咨询线索表
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "fangjia_coresite.advice_leads")
|
||||
public class AdviceLeads implements MongoEntity {
|
||||
|
||||
private static final long serialVersionUID = 3318465986161755755L;
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 公司
|
||||
*/
|
||||
private String company;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String department;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
private String position;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modifyDate;
|
||||
|
||||
/**
|
||||
* 临时用户id
|
||||
*/
|
||||
private String tempId;
|
||||
|
||||
/**
|
||||
* 真实用户id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@Column(name = "_id", unique = true, nullable = false)
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Column(name = "name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Column(name = "company")
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
@Column(name = "mobile")
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
@Column(name = "email")
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Column(name = "department")
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
@Column(name = "position")
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
@Column(name = "c_date")
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@Column(name = "m_date")
|
||||
public Date getModifyDate() {
|
||||
return modifyDate;
|
||||
}
|
||||
|
||||
public void setModifyDate(Date modifyDate) {
|
||||
this.modifyDate = modifyDate;
|
||||
}
|
||||
|
||||
@Column(name = "temp_id")
|
||||
public String getTempId() {
|
||||
return tempId;
|
||||
}
|
||||
|
||||
public void setTempId(String tempId) {
|
||||
this.tempId = tempId;
|
||||
}
|
||||
|
||||
@Column(name = "user_id")
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.fangjia.dal.mongo.model;
|
||||
|
||||
import com.fangjia.dal.MongoEntity;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "fangjia_crawl.price_border")
|
||||
public class PriceBorder implements MongoEntity {
|
||||
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String name;
|
||||
private Double latitude;
|
||||
private Double longitude;
|
||||
private String border;
|
||||
private Integer level;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@Column(name = "_id", unique = true, nullable = false)
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
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 = "name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@Column(name = "latitude")
|
||||
public Double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(Double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
@Column(name = "longitude")
|
||||
public Double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(Double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
@Column(name = "border")
|
||||
public String getBorder() {
|
||||
return border;
|
||||
}
|
||||
|
||||
public void setBorder(String border) {
|
||||
this.border = border;
|
||||
}
|
||||
|
||||
@Column(name = "level")
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
}
|
||||
@@ -234,6 +234,8 @@ public class District implements SeaweedEntity {
|
||||
private String mainTypeArea;
|
||||
|
||||
private String createYear;
|
||||
|
||||
private Integer nameCat;
|
||||
|
||||
@Column(name = "source_web")
|
||||
public String getSourceWeb() {
|
||||
@@ -1879,9 +1881,13 @@ public class District implements SeaweedEntity {
|
||||
public void setTownship(String township) {
|
||||
this.township = township;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Column(name = "name_cat")
|
||||
public Integer getNameCat() {
|
||||
return nameCat;
|
||||
}
|
||||
|
||||
public void setNameCat(Integer nameCat) {
|
||||
this.nameCat = nameCat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2751,10 +2751,10 @@ public class AddressController {
|
||||
@Authority(role = Role.USER)
|
||||
public Object riskAction(AddesssMatchModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isEmpty(model.getCity())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数错误,城市不能为空!"));
|
||||
return mav;
|
||||
}
|
||||
// if (StringUtils.isEmpty(model.getCity())) {
|
||||
// mav.setModel(BasicModel.buildBadRequestModel("参数错误,城市不能为空!"));
|
||||
// return mav;
|
||||
// }
|
||||
if (StringUtils.isEmpty(model.getAddress())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数错误,地址不能为空!"));
|
||||
return mav;
|
||||
|
||||
@@ -1,154 +1,424 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import com.fangjia.core.util.AnalyticsUtil;
|
||||
import com.fangjia.core.util.BeanUtils;
|
||||
import com.fangjia.core.util.DataUtil;
|
||||
import com.fangjia.dal.common.DistrictKey;
|
||||
import com.fangjia.dal.mongo.model.CzbankSampleLog;
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import com.fangjia.dal.mongo.model.FangjiaOfficialAreaMap;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.CzbankSampleModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.open.util.EvaluationFactorUtil;
|
||||
import com.fangjia.open.ws.query.CollateralSampleQuery;
|
||||
import com.fangjia.open.ws.query.EvaluationQuery;
|
||||
import com.fangjia.service.api.AddressMatchProxyService;
|
||||
import com.fangjia.service.bo.Collateral;
|
||||
import com.fangjia.service.bo.EvaluationResult;
|
||||
import com.fangjia.service.bo.Sample;
|
||||
import com.fangjia.service.datastore.CzbankSampleService;
|
||||
import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.datastore.EvaluationService;
|
||||
import com.fangjia.service.datastore.bean.CollateralSampleQueryBean;
|
||||
import com.fangjia.service.mongo.fangjia.CzbankSampleLogService;
|
||||
import com.fangjia.service.open.FangjiaOfficialAreaService;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
import net.sf.json.util.PropertyFilter;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.cxf.interceptor.Fault;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.sothis.web.mvc.ActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 浙商银行风险缓释项目接口
|
||||
*/
|
||||
@Authority(role = Role.USER)
|
||||
public class CzbankController {
|
||||
|
||||
|
||||
private CzbankSampleService czbankSampleService;
|
||||
private DistrictService districtService;
|
||||
private CzbankSampleLogService czbankSampleLogService;
|
||||
private FangjiaOfficialAreaService fangjiaOfficialAreaService;
|
||||
private AddressMatchProxyService addressMatchProxyService;
|
||||
private EvaluationService evaluationService;
|
||||
|
||||
private List<String> PROPERTY_TYPE_CODE_LIST = Arrays.asList("01", "02");
|
||||
|
||||
|
||||
/**
|
||||
* 样本查询接口
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object sampleAction(HttpServletRequest request){
|
||||
@Authority(role = Role.USER)
|
||||
public Object sampleAction(CzbankSampleModel model){
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
List<CollateralSampleQueryBean> queryBeans = null;
|
||||
try {
|
||||
queryBeans = parseParams(request);
|
||||
} catch (Exception e) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel(e.getMessage()));
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
if(StringUtils.isBlank(model.getCltNo())){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("cltNo押品编号不能为空"));
|
||||
return mav;
|
||||
}
|
||||
if(queryBeans == null || queryBeans.isEmpty()){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数无效"));
|
||||
|
||||
if (StringUtils.isBlank(model.getProvince()) ||StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getDistrict())
|
||||
|| StringUtils.isBlank(model.getBuildingName()) || StringUtils.isBlank(model.getPropertyTypeCode())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数缺失:province(省),city(城市),district(区域),buildingName(名称),propertyTypeCode(物业类型编码)是必须参数"));
|
||||
return mav;
|
||||
}
|
||||
String paramMax = request.getParameter("max");
|
||||
if(StringUtils.isBlank(paramMax) || !StringUtils.isNumeric(paramMax)){
|
||||
paramMax = "5";
|
||||
|
||||
FangjiaOfficialAreaMap fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertOfficialCodeToFangjia(model.getDistrict());
|
||||
if(fangjiaOfficialAreaMap == null){
|
||||
fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertOfficialCodeToFangjiaCity(model.getDistrict());
|
||||
}
|
||||
int max = Integer.valueOf(paramMax);
|
||||
if(max < 1 || max > 20){
|
||||
max = 5;
|
||||
if(fangjiaOfficialAreaMap == null){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("地区信息无法映射到房价网的地区信息->(province:" + model.getProvince() + " ,city: " + model.getCity() + " ,district: " + model.getDistrict() + ")"));
|
||||
return mav;
|
||||
}
|
||||
List<Collateral> collateralList = czbankSampleService.findSample(queryBeans, max);
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(collateralList));
|
||||
|
||||
|
||||
|
||||
String propertyTypeCode = model.getPropertyTypeCode();
|
||||
if(StringUtils.isBlank(propertyTypeCode)){
|
||||
propertyTypeCode = "01";
|
||||
}
|
||||
if(!PROPERTY_TYPE_CODE_LIST.contains(propertyTypeCode)){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("propertyTypeCode取值非法"));
|
||||
return mav;
|
||||
}
|
||||
if(model.getStrctureArea() <= 0){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("strctureArea取值非法"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
if (model.getFloorNumber() != null && (model.getFloorNumber() <= 0 || model.getFloorNumber() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("floorNumber,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if (model.getAboveFloorAmount() != null && (model.getAboveFloorAmount() <= 0 || model.getAboveFloorAmount() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("floorAmount,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
if (model.getAboveFloorAmount() != null && model.getAboveFloorAmount() != null && model.getFloorNumber()> model.getAboveFloorAmount()) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("所在楼层不能大于总楼层"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Integer decrCondCode = model.getDecrCondCode();
|
||||
if(decrCondCode == null){
|
||||
decrCondCode = 2;
|
||||
}
|
||||
if(decrCondCode > 5 || decrCondCode < 1){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("decrCondCode取值非法"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
Integer towardDirectCode = model.getTowardDirectCode();
|
||||
if(towardDirectCode == null || towardDirectCode == 0){
|
||||
towardDirectCode = 3;
|
||||
}
|
||||
if(towardDirectCode > 10 || towardDirectCode < 1){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("towardDirectCode取值非法"));
|
||||
return mav;
|
||||
}
|
||||
CollateralSampleQueryBean queryBean = new CollateralSampleQueryBean();
|
||||
BeanUtils.copyProperties(model, queryBean);
|
||||
queryBean.setFangjiaCity(fangjiaOfficialAreaMap.getFangjiaCity());
|
||||
queryBean.setFangjiaDistrict(fangjiaOfficialAreaMap.getFangjiaDistrict());
|
||||
|
||||
District property = districtService.findByNameAndAlias(queryBean.getFangjiaCity(), queryBean.getFangjiaDistrict(), model.getBuildingName(), "district");
|
||||
if(property == null){
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("city", queryBean.getFangjiaCity());
|
||||
params.put("suggestDistrict", queryBean.getFangjiaDistrict());
|
||||
if(StringUtils.isBlank(queryBean.getAddress())){
|
||||
params.put("address", model.getBuildingName());
|
||||
}else{
|
||||
params.put("address", queryBean.getAddress());
|
||||
params.put("suggestName", model.getBuildingName());
|
||||
}
|
||||
params.put("category", "district");
|
||||
String result = addressMatchProxyService.parser(params);
|
||||
if (result != null) {
|
||||
JSONObject json = JSONObject.fromObject(result);
|
||||
if(json.getInt("code")==200){
|
||||
Map<String, Object> map = (Map<String, Object>) json.get("result");
|
||||
if((Integer)map.get("precise")>=0){
|
||||
property = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name"), "district");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(property == null){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该楼盘不存在 city:" + queryBean.getFangjiaCity() + " region:" + queryBean.getFangjiaDistrict() + " name:" + model.getBuildingName()));
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
||||
queryBean.setProperty(property);
|
||||
List<CollateralSampleQueryBean> queryBeans = new ArrayList<CollateralSampleQueryBean>();
|
||||
queryBeans.add(queryBean);
|
||||
List<Collateral> collaterals = czbankSampleService.findSample(queryBeans, 5);
|
||||
long time = System.currentTimeMillis() - start;
|
||||
Map<String, Object> stat = new HashMap<String, Object>();
|
||||
for(Collateral collateral : collaterals){
|
||||
// stat.put(collateral.getCltNo(), collateral.getSample());
|
||||
stat.put("cltNo", collateral.getCltNo());
|
||||
stat.put("sample", collateral.getSample());
|
||||
}
|
||||
for(CollateralSampleQueryBean qb : queryBeans){
|
||||
JsonConfig jsonConfig = new JsonConfig();
|
||||
jsonConfig.setJsonPropertyFilter(new PropertyFilter() {
|
||||
@Override
|
||||
public boolean apply(Object o, String s, Object o1) {
|
||||
return o1 == null;
|
||||
}
|
||||
});
|
||||
qb.setProperty(null);
|
||||
JSONObject query = JSONObject.fromObject(qb, jsonConfig);
|
||||
CzbankSampleLog log = new CzbankSampleLog();
|
||||
log.setCaseId(qb.getCltNo());
|
||||
log.setCreatedDate(new Date());
|
||||
log.setQuery(DataUtil.toMongoDbObj(query));
|
||||
List<Sample> samples = (List)stat.get("sample");
|
||||
if(samples != null){
|
||||
log.setSamples(DataUtil.toMongoDbObj(JSONArray.fromObject(samples, jsonConfig)));
|
||||
}
|
||||
log.setTime(time);
|
||||
czbankSampleLogService.save(log);
|
||||
}
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(stat));
|
||||
return mav;
|
||||
}
|
||||
|
||||
private List<CollateralSampleQueryBean> parseParams(HttpServletRequest request) throws Exception {
|
||||
String xml = null;
|
||||
|
||||
@Authority(role = Role.USER)
|
||||
public Object evaluationAction(EvaluationQuery evaluationQuery) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
District property = null;
|
||||
try {
|
||||
xml = IOUtils.toString(request.getInputStream(), "UTF-8");
|
||||
if (StringUtils.isBlank(evaluationQuery.getCity()) || StringUtils.isBlank(evaluationQuery.getDistrict()) || StringUtils.isBlank(evaluationQuery.getName())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数缺失:city(城市),district(区域),buildingName(名称)是必须参数"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if(evaluationQuery.getSize() <= 0){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("size不能为空"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if (evaluationQuery.getCarportPrice() != null && (evaluationQuery.getCarportPrice() < 0 || evaluationQuery.getCarportPrice() > 1000000)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("carportPrice(车位)取值不合法"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if (evaluationQuery.getMaxFloor() != null && (evaluationQuery.getMaxFloor() <= 0 || evaluationQuery.getMaxFloor() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("maxFloor取值非法,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
if (evaluationQuery.getFloor() != null && (evaluationQuery.getFloor() <= 0 || evaluationQuery.getFloor() > 59)) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("floor取值非法,正确范围[1,60)"));
|
||||
return mav;
|
||||
}
|
||||
if (evaluationQuery.getMaxFloor() != null && evaluationQuery.getFloor() != null && evaluationQuery.getFloor() > evaluationQuery.getMaxFloor()) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("所在楼层不能大于总楼层"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
FangjiaOfficialAreaMap fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertOfficialCodeToFangjia(evaluationQuery.getDistrict());
|
||||
if(fangjiaOfficialAreaMap == null){
|
||||
fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertOfficialCodeToFangjiaCity(evaluationQuery.getDistrict());
|
||||
}
|
||||
if(fangjiaOfficialAreaMap == null){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("地区信息无法映射到房价网的地区信息->(province:" + evaluationQuery.getProvince() + " ,city: " + evaluationQuery.getCity() + " ,district: " + evaluationQuery.getDistrict() + ")"));
|
||||
return mav;
|
||||
}
|
||||
String fangjiaCity = fangjiaOfficialAreaMap.getFangjiaCity();
|
||||
String fangjiaDistrict = fangjiaOfficialAreaMap.getFangjiaDistrict();
|
||||
|
||||
property = districtService.findByNameAndAlias(fangjiaCity, fangjiaDistrict, evaluationQuery.getName(), "district");
|
||||
if(property == null){
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("city", fangjiaCity);
|
||||
params.put("suggestDistrict", fangjiaDistrict);
|
||||
if(StringUtils.isBlank(evaluationQuery.getAddress())){
|
||||
params.put("address", evaluationQuery.getName());
|
||||
}else{
|
||||
params.put("address", evaluationQuery.getAddress());
|
||||
params.put("suggestName", evaluationQuery.getName());
|
||||
}
|
||||
params.put("category", "district");
|
||||
String result = addressMatchProxyService.parser(params);
|
||||
if (result != null) {
|
||||
JSONObject json = JSONObject.fromObject(result);
|
||||
if(json.getInt("code")==200){
|
||||
Map<String, Object> map = (Map<String, Object>) json.get("result");
|
||||
if((Integer)map.get("precise")>=0){
|
||||
property = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name"), "district");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(property == null){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该楼盘不存在 city:" + fangjiaCity + " region:" + fangjiaDistrict + " name:" + evaluationQuery.getName()));
|
||||
return mav;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(property != null){
|
||||
if(StringUtils.isNotBlank(fangjiaDistrict) && !property.getRegion().equals(fangjiaDistrict)){
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该楼盘不存在 city:" + fangjiaCity + " region:" + fangjiaDistrict + " name:" + evaluationQuery.getName()));
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
if(StringUtils.isBlank(xml)){
|
||||
throw new Exception("数据读取异常");
|
||||
}
|
||||
Document document;
|
||||
try{
|
||||
document = DocumentHelper.parseText(xml);
|
||||
}catch (Exception e){
|
||||
throw e;
|
||||
throw new Fault(e);
|
||||
}
|
||||
EvaluationResult result = null;
|
||||
if (property != null) {
|
||||
HttpServletRequest request = ActionContext.getContext().getRequest();
|
||||
Evaluation evaluation = evaluationService.evaluate(property, buildEvaluation(evaluationQuery, request),
|
||||
evaluationQuery.getCalDate());
|
||||
|
||||
|
||||
Element root = document.getRootElement();
|
||||
List<Element> params = root.elements();
|
||||
List<CollateralSampleQueryBean> queryBeans = new ArrayList<CollateralSampleQueryBean>();
|
||||
for(Element param : params){
|
||||
|
||||
String cltNo = param.elementText("cltNo");
|
||||
if(StringUtils.isBlank(cltNo)){
|
||||
throw new Exception("cltNo不能为空");
|
||||
if(null != evaluation && evaluation.getTotalPrice()!=null){
|
||||
result = new EvaluationResult();
|
||||
result.setTotalPrice(evaluation.getTotalPrice());
|
||||
result.setAvgPrice(evaluation.getAvgPrice());
|
||||
}else{
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该楼盘暂无法估值!"));
|
||||
return mav;
|
||||
}
|
||||
String city = param.elementText("city");
|
||||
if(StringUtils.isBlank(city)){
|
||||
throw new Exception("city不能为空,cltNo:" + cltNo);
|
||||
}
|
||||
String district = param.elementText("district");
|
||||
if(StringUtils.isBlank(district)){
|
||||
throw new Exception("district不能为空,cltNo:" + cltNo);
|
||||
}
|
||||
String buildingName = param.elementText("buildingName");
|
||||
if(StringUtils.isBlank(buildingName)){
|
||||
throw new Exception("buildingName不能为空,cltNo:" + cltNo);
|
||||
}
|
||||
District d = districtService.findOneByKey(new DistrictKey(city, district, buildingName), "district");
|
||||
if(d == null){
|
||||
throw new Exception("楼盘不存在,cltNo:" + cltNo);
|
||||
}
|
||||
String propertyTypeCode = param.elementText("propertyTypeCode");
|
||||
if(StringUtils.isBlank(propertyTypeCode)){
|
||||
throw new Exception("propertyTypeCode不能为空,cltNo:" + cltNo);
|
||||
}
|
||||
if(!"1".equals(propertyTypeCode) && !"0".equals(propertyTypeCode)){
|
||||
throw new Exception("propertyTypeCode取值非法,cltNo:" + cltNo);
|
||||
}
|
||||
String floorNumber = param.elementText("floorNumber");
|
||||
if(StringUtils.isBlank(floorNumber) || !StringUtils.isNumeric(floorNumber)){
|
||||
throw new Exception("floorNumber取值非法,cltNo:" + cltNo);
|
||||
}
|
||||
String strctureArea = param.elementText("strctureArea");
|
||||
if(StringUtils.isBlank(strctureArea) || !DataUtil.isNumeric(strctureArea)){
|
||||
throw new Exception("strctureArea取值非法,cltNo:" + cltNo);
|
||||
}
|
||||
String decrCondCode = param.elementText("decrCondCode");
|
||||
if(StringUtils.isBlank(decrCondCode)){
|
||||
decrCondCode = "2";
|
||||
}
|
||||
if(!StringUtils.isNumeric(decrCondCode) || (Integer.valueOf(decrCondCode) > 5 || Integer.valueOf(decrCondCode) < 1)){
|
||||
throw new Exception("decrCondCode取值非法,cltNo:" + cltNo);
|
||||
}
|
||||
String towardDirectCode = param.elementText("towardDirectCode");
|
||||
if(StringUtils.isBlank(towardDirectCode)){
|
||||
towardDirectCode = "3";
|
||||
}
|
||||
if(!StringUtils.isNumeric(towardDirectCode) || (Integer.valueOf(towardDirectCode) > 10 || Integer.valueOf(towardDirectCode) < 1)){
|
||||
throw new Exception("towardDirectCode取值非法,cltNo:" + cltNo);
|
||||
}
|
||||
CollateralSampleQueryBean queryBean = new CollateralSampleQueryBean();
|
||||
queryBean.setCltNo(cltNo);
|
||||
queryBean.setCity(city);
|
||||
queryBean.setDistrict(district);
|
||||
queryBean.setBuildingName(buildingName);
|
||||
queryBean.setPropertyTypeCode(propertyTypeCode);
|
||||
queryBean.setFloorNumber(Integer.valueOf(floorNumber));
|
||||
queryBean.setStrctureArea(Double.valueOf(strctureArea));
|
||||
queryBean.setTowardDirectCode(Integer.valueOf(towardDirectCode));
|
||||
queryBean.setDecrCondCode(Integer.valueOf(decrCondCode));
|
||||
queryBean.setProperty(d);
|
||||
queryBeans.add(queryBean);
|
||||
}
|
||||
return queryBeans;
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(result));
|
||||
return mav;
|
||||
}
|
||||
|
||||
private Evaluation buildEvaluation(EvaluationQuery model, HttpServletRequest request) {
|
||||
Evaluation evaluation = new Evaluation();
|
||||
evaluation.setCity(model.getCity());
|
||||
evaluation.setRegion(model.getDistrict());
|
||||
evaluation.setDistrictName(model.getName());
|
||||
|
||||
|
||||
if (StringUtils.isNotBlank(model.getBuildingNumber())) {
|
||||
evaluation.setHouseNum(model.getBuildingNumber());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(model.getRoomNumber())) {
|
||||
evaluation.setRoomNum(model.getRoomNumber());
|
||||
}
|
||||
evaluation.setArea(model.getSize());
|
||||
|
||||
if (null != model.getFloor()) {
|
||||
evaluation.setFloor(model.getFloor());
|
||||
}
|
||||
if (model.getMaxFloor() != null && 0 != model.getMaxFloor()) {
|
||||
evaluation.setHeight(model.getMaxFloor());
|
||||
}
|
||||
if (0 != model.getRoom()) {
|
||||
evaluation.setRoom(model.getRoom());
|
||||
}
|
||||
if (0 != model.getHall()) {
|
||||
evaluation.setHall(model.getHall());
|
||||
}
|
||||
if (0 != model.getToilet()) {
|
||||
evaluation.setToilet(model.getToilet());
|
||||
}
|
||||
evaluation.setEstateType(EvaluationFactorUtil.PROPERTY_TYPES.get(model.getPropertyType()));
|
||||
evaluation.setDirection(EvaluationFactorUtil.DIRECTION.get(model.getDirection()));
|
||||
evaluation.setFitment(EvaluationFactorUtil.EVALUATION_MODEL_FITMENT.get(EvaluationFactorUtil.FITMENT.get(model.getDecoration())));
|
||||
if (model.getDecorationAge() >= 1 && model.getDecorationAge() <= 5) {
|
||||
evaluation.setFitmentAge(model.getDecorationAge());
|
||||
}
|
||||
|
||||
if (model.getDecorationCost() != null && model.getDecorationCost() > 0) {
|
||||
evaluation.setFitmentCharge(model.getDecorationCost());
|
||||
}
|
||||
evaluation.setSight(EvaluationFactorUtil.SIGHT.get(model.getView()));
|
||||
evaluation.setNoise(EvaluationFactorUtil.NOISE.get(model.getNoise()));
|
||||
|
||||
if (model.getGardenSize()!=null && 0 != model.getGardenSize()) {
|
||||
evaluation.setGardenArea(((Number) model.getGardenSize()).doubleValue());
|
||||
}
|
||||
if (model.getBasementSize()!=null && 0 != model.getBasementSize()) {
|
||||
evaluation.setBasementArea(((Number) model.getBasementSize()).doubleValue());
|
||||
}
|
||||
|
||||
if (model.getAtticSize()!=null && 0 != model.getAtticSize()) {
|
||||
evaluation.setAtticArea(((Number) model.getAtticSize()).doubleValue());
|
||||
}
|
||||
|
||||
// if (0 != model.getOuterSize()) {
|
||||
// evaluation.setOtherFactor(((Number) model.getOuterSize()).doubleValue());
|
||||
// }
|
||||
|
||||
String worryFacility = model.getNegativeFactor();
|
||||
evaluation.setWorryFacility(EvaluationFactorUtil.NEGATIVE_FACTOR.get(worryFacility));
|
||||
if (0 != model.getAge()) {
|
||||
evaluation.setAge(model.getAge());
|
||||
}
|
||||
evaluation.setCarportPrice(model.getCarportPrice());
|
||||
|
||||
if (model.getFacilities() != null) {
|
||||
String facilities = model.getFacilities();
|
||||
String[] fs = facilities.split(",");
|
||||
for (int i = 0; i < fs.length; i++) {
|
||||
fs[i] = EvaluationFactorUtil.FACILITIES.get(fs[i]);
|
||||
}
|
||||
evaluation.setFacilities(convertToString(fs));
|
||||
}
|
||||
|
||||
evaluation.setCreationDate(new Date());
|
||||
evaluation.setModificationDate(new Date());
|
||||
|
||||
|
||||
String ip = AnalyticsUtil.getIpAddress(request);
|
||||
evaluation.setIp(ip);
|
||||
|
||||
String fromUserId = (String) request.getAttribute("from_user_id");
|
||||
if (StringUtils.isNotBlank(fromUserId)) {
|
||||
evaluation.setFromUserId(String.valueOf(fromUserId));
|
||||
}
|
||||
evaluation.setSource("cz_property_evaluation");
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
private String convertToString(String[] strs) {
|
||||
if (ArrayUtils.isNotEmpty(strs)) {
|
||||
StringBuffer ret = new StringBuffer();
|
||||
for (String str : strs) {
|
||||
if (StringUtils.isEmpty(ret.toString())) {
|
||||
ret.append(str);
|
||||
} else {
|
||||
ret.append(",").append(str);
|
||||
}
|
||||
}
|
||||
return ret.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setCzbankSampleService(CzbankSampleService czbankSampleService) {
|
||||
this.czbankSampleService = czbankSampleService;
|
||||
}
|
||||
@@ -156,4 +426,20 @@ public class CzbankController {
|
||||
public void setDistrictService(DistrictService districtService) {
|
||||
this.districtService = districtService;
|
||||
}
|
||||
|
||||
public void setCzbankSampleLogService(CzbankSampleLogService czbankSampleLogService) {
|
||||
this.czbankSampleLogService = czbankSampleLogService;
|
||||
}
|
||||
|
||||
public void setFangjiaOfficialAreaService(FangjiaOfficialAreaService fangjiaOfficialAreaService) {
|
||||
this.fangjiaOfficialAreaService = fangjiaOfficialAreaService;
|
||||
}
|
||||
|
||||
public void setAddressMatchProxyService(AddressMatchProxyService addressMatchProxyService) {
|
||||
this.addressMatchProxyService = addressMatchProxyService;
|
||||
}
|
||||
|
||||
public void setEvaluationService(EvaluationService evaluationService) {
|
||||
this.evaluationService = evaluationService;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2447,7 +2447,8 @@ public class PropertyController {
|
||||
evaluation.setRegion(model.getRegion());
|
||||
evaluation.setDistrictName(model.getName());
|
||||
evaluation.setDirection(DIRECTION.get(model.getDirection()));
|
||||
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(model.getDecoration())));
|
||||
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(StringUtils.isNotBlank(model.getDecoration()) ?
|
||||
model.getDecoration() : model.getFitment())));
|
||||
evaluation.setNoise(NOISE.get(model.getNoise()));
|
||||
evaluation.setEstateType(PROPERTY_TYPES.get(model.getPropertyType()));
|
||||
evaluation.setSight(SIGHT.get(model.getView()));
|
||||
@@ -4959,7 +4960,7 @@ public class PropertyController {
|
||||
}
|
||||
|
||||
/***
|
||||
* Ð¡Çø×â½ð¹ÀÖµ±¨¸æ
|
||||
* 小区租金估值报告(上半部分)
|
||||
* @param model
|
||||
* @param request
|
||||
* @return
|
||||
@@ -5047,17 +5048,165 @@ public class PropertyController {
|
||||
districtPriceMap.put("name", district.getName());
|
||||
districtPriceMap.put("address", district.getAddress());
|
||||
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
|
||||
districtPriceMap.put("totalPriceUpper", CNNMFilter.convert(String.valueOf(evaluation.getTotalPrice())));
|
||||
districtPriceMap.put("totalPriceUpper", CurrencyConverter.toChinese(String.valueOf(evaluation.getTotalPrice())));
|
||||
districtPriceMap.put("cal_date", DateUtil.formatByPattern(new Date(), "yyyy/MM/dd"));
|
||||
districtPriceMap.put("direction", evaluation.getDirection());
|
||||
districtPriceMap.put("size", evaluation.getArea());
|
||||
districtPriceMap.put("floor", model.getFloor());
|
||||
districtPriceMap.put("height", model.getHeight());
|
||||
districtPriceMap.put("fitment", evaluation.getFitment());
|
||||
districtPriceMap.put("buildYear",district.getFinishBuildingDate());
|
||||
|
||||
Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2);
|
||||
Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2);
|
||||
|
||||
//周边相似小区
|
||||
// if (null == model.getRadius()) {// 设置默认值
|
||||
// model.setRadius(1000);
|
||||
// }
|
||||
// String[] fields = { "city", "region", "name", "estateType2", "id","finishBuildingDate"};
|
||||
// List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
||||
// //按条件过滤相似小区
|
||||
// Integer buildYear = null;
|
||||
// List<District> districts = new ArrayList<District>();
|
||||
// if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
||||
// buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
// if(buildYear!=null){
|
||||
// districts = new ArrayList<District>();
|
||||
// int startYear = buildYear -7;
|
||||
// int endYear = buildYear + 7;
|
||||
// for(District dist : allDistricts){
|
||||
// if(StringUtils.isNotBlank(dist.getFinishBuildingDate())){
|
||||
// int simlarDistYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
// if(simlarDistYear>=startYear && simlarDistYear<=endYear && StringUtils.isNotBlank(district.getEstateType2()) && StringUtils.isNotBlank(dist.getEstateType2()) && district.getEstateType2().equals(dist.getEstateType2())){
|
||||
// districts.add(dist);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//相似房源
|
||||
// Double startArea = model.getSize() - model.getSize()*0.1;
|
||||
// Double endArea = model.getSize() + model.getSize()*0.1;
|
||||
// Integer startDate = Integer.parseInt(org.apache.tools.ant.util.DateUtils.format(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||
// List<Seawater> houses = seawaterService.findSeawatersFromEs2("rent", district.getCity(), district.getRegion(), district.getName(), null, null, startDate, null,
|
||||
// startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
// //无评估小区房源用周边相似小区的房源
|
||||
// if(null == houses || houses.size()==0){
|
||||
// for (District dist : districts) {
|
||||
// houses = seawaterService.findSeawatersFromEs2("rent", dist.getCity(), dist.getRegion(), dist.getName(), null, null, startDate, null,
|
||||
// startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
||||
// if(houses!=null && houses.size()>0){
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// districtPriceMap.put("houses", houses);
|
||||
|
||||
// //周边相似小区租金
|
||||
// Integer room = null;
|
||||
// if(model.getRoom()!=0){
|
||||
// room = model.getRoom();
|
||||
// }else{
|
||||
// room = houseService.getDistrictRoomType((float)model.getSize());
|
||||
// }
|
||||
// if (null != districts) {
|
||||
// if (null != room) {
|
||||
// List<DistrictHouseDtao> dtos = new ArrayList<DistrictHouseDtao>();
|
||||
// Date weekend = DateUtil.getFirstDayOfWeek(new Date());
|
||||
// for (District dist : districts) {
|
||||
//
|
||||
// List<DistrictRoomSqmetreRent> districtRoomSqmetreRents = districtRoomSqmetreRentService.findDistrictRoomSqmetreRents(dist, 1, room);
|
||||
//
|
||||
// ///List<DistrictStatRent> districtStatRents = districtStatRentService.findLatestDistrictStatRent(dist, 1, room);
|
||||
// if (null != districtRoomSqmetreRents && districtRoomSqmetreRents.size() > 0) {
|
||||
// DistrictRoomSqmetreRent districtRoomSqmetreRent = districtRoomSqmetreRents.get(0);
|
||||
// if (districtRoomSqmetreRent.getAvgPrice() > 0) {
|
||||
//
|
||||
// int startSqPrice = (int)(evaluation.getAvgPrice() - evaluation.getAvgPrice()*0.1);
|
||||
// int endSqPrice = (int)(evaluation.getAvgPrice() + evaluation.getAvgPrice()*0.1);
|
||||
//// SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(dist.getCity(), dist.getRegion(), dist.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||
// if(districtRoomSqmetreRent.getAvgPrice()>=startSqPrice && districtRoomSqmetreRent.getAvgPrice()<=endSqPrice){
|
||||
// DistrictHouseDtao dto = new DistrictHouseDtao();
|
||||
// dto.setCity(dist.getCity());
|
||||
// dto.setRegion(dist.getRegion());
|
||||
// dto.setDistrictName(dist.getName());
|
||||
// dto.setSqAvgPrice(districtRoomSqmetreRent.getAvgPrice());
|
||||
// dto.setRoom(room);
|
||||
// dtos.add(dto);
|
||||
// if(dtos.size()>=5){
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// districtPriceMap.put("districts", dtos);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //近一年户型租金走势
|
||||
// Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
//// Map<String, Object> trendsMap = districtStatRentService.getRentTrend(district.getCity(), district.getRegion(), district.getDistrictName(), -12);
|
||||
// if (MapUtils.isNotEmpty(trendsMap)) {
|
||||
// Map distMap = (Map) trendsMap.get("distMap");
|
||||
// Map<String, Integer> trendMap = (Map) distMap.get(String.valueOf(trendsMap.get("room")));
|
||||
// if (MapUtils.isNotEmpty(trendMap)) {
|
||||
// for (String key : trendMap.keySet()) {
|
||||
// Double totalPrice = (trendMap.get(key) * evaluation.getArea());
|
||||
// trendMap.put(key, totalPrice.intValue());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// districtPriceMap.put("trends", trendsMap);
|
||||
//
|
||||
//
|
||||
// //成交的租房房源
|
||||
// List<RentDealPrice> rentTrades = rentDealPriceService.getRentDealPrices(district.getCity(), district.getRegion(), district.getName(), 5);
|
||||
// districtPriceMap.put("trades", rentTrades);
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||
return mav;
|
||||
} else {
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的租金估价").markNoData());
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* 小区租金估值报告(下半部分)
|
||||
* @param model
|
||||
* @param request
|
||||
* @return
|
||||
* @throws NumberFormatException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
@Authority(role = Role.NONE)
|
||||
public Object rentReport2Action(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
/* 先到CPDB库中查找小区 */
|
||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
|
||||
model.setRegion(district.getRegion());
|
||||
model.setDistrictName(district.getName());
|
||||
if (StringUtils.isBlank(model.getPropertyType())) {
|
||||
if (district.getEstateType2() != null && district.getEstateType2().contains("别墅")) {
|
||||
model.setPropertyType("1");
|
||||
}
|
||||
}
|
||||
Evaluation evaluation = buildEvaluation(model, request);
|
||||
evaluation.setSource("api_property_evaluate_rent");
|
||||
evaluation = evaluationService.evaluateRent(district, evaluation, model.getCalDate());
|
||||
|
||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
||||
evaluation.setAvgPrice((int)(evaluation.getTotalPrice()/evaluation.getArea()));
|
||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||
Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2);
|
||||
Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2);
|
||||
|
||||
//周边相似小区
|
||||
if (null == model.getRadius()) {// 设置默认值
|
||||
model.setRadius(1000);
|
||||
@@ -5066,7 +5215,7 @@ public class PropertyController {
|
||||
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
||||
//按条件过滤相似小区
|
||||
Integer buildYear = null;
|
||||
List<District> districts = null;
|
||||
List<District> districts = new ArrayList<District>();
|
||||
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
||||
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
if(buildYear!=null){
|
||||
@@ -5146,8 +5295,18 @@ public class PropertyController {
|
||||
|
||||
|
||||
//近一年户型租金走势
|
||||
Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
// Map<String, Object> trendsMap = districtStatRentService.getRentTrend(district.getCity(), district.getRegion(), district.getDistrictName(), -12);
|
||||
// Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
Map<String, Object> trendsMap = districtStatRentService.getRentTrend(district.getCity(), district.getRegion(), district.getDistrictName(), -12);
|
||||
if (MapUtils.isNotEmpty(trendsMap)) {
|
||||
Map distMap = (Map) trendsMap.get("distMap");
|
||||
Map<String, Integer> trendMap = (Map) distMap.get(String.valueOf(trendsMap.get("room")));
|
||||
if (MapUtils.isNotEmpty(trendMap)) {
|
||||
for (String key : trendMap.keySet()) {
|
||||
Double totalPrice = (trendMap.get(key) * evaluation.getArea());
|
||||
trendMap.put(key, totalPrice.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("trends", trendsMap);
|
||||
|
||||
|
||||
@@ -5158,7 +5317,6 @@ public class PropertyController {
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||
return mav;
|
||||
} else {
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的租金估价").markNoData());
|
||||
return mav;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fangjia.core.util.AnalyticsUtil;
|
||||
import com.fangjia.dal.mongo.model.SendSmsLog;
|
||||
import com.fangjia.open.model.weixin.SendCodeJsonModel;
|
||||
import com.fangjia.open.model.weixin.SendCodeModel;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
@@ -18,6 +23,8 @@ import com.fangjia.service.mongo.mobile.UserInfoService;
|
||||
import com.fangjia.service.sql.UserService;
|
||||
import com.fangjia.service.util.UsersUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class UsersController {
|
||||
private UserService userService;
|
||||
private UserInfoService userInfoService;
|
||||
@@ -114,5 +121,5 @@ public class UsersController {
|
||||
this.userInfoService = userInfoService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.fangjia.open.APIConstant;
|
||||
import com.fangjia.open.compatible.model.JsonModel;
|
||||
import com.fangjia.open.dto.DistrictHouseDtao;
|
||||
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||
import com.fangjia.open.model.AddesssMatchModel;
|
||||
import com.fangjia.open.model.BaseModel;
|
||||
import com.fangjia.open.model.weixin.EvaluationModel;
|
||||
import com.fangjia.open.model.weixin.PropertyEvaluationModel;
|
||||
@@ -22,6 +23,7 @@ import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.datastore.EvaluationService;
|
||||
import com.fangjia.service.datastore.HouseService;
|
||||
import com.fangjia.service.district.DistrictRoomSqmetreRentService;
|
||||
import com.fangjia.service.district.DistrictStatRentService;
|
||||
import com.fangjia.service.district.RentDealPriceService;
|
||||
import com.fangjia.service.mongo.fangjia.FileService;
|
||||
import com.fangjia.service.mongo.fangjia.SeawaterService;
|
||||
@@ -32,6 +34,7 @@ import org.apache.batik.transcoder.TranscoderException;
|
||||
import org.apache.batik.transcoder.TranscoderInput;
|
||||
import org.apache.batik.transcoder.TranscoderOutput;
|
||||
import org.apache.batik.transcoder.image.PNGTranscoder;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.BooleanClause;
|
||||
@@ -50,6 +53,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
@@ -65,6 +69,7 @@ public class CcbRentController {
|
||||
|
||||
private DistrictService districtService;
|
||||
private SeawaterService seawaterService;
|
||||
private DistrictStatRentService districtStatRentService;
|
||||
private DistrictRoomSqmetreRentService districtRoomSqmetreRentService;
|
||||
private EvaluationService evaluationService;
|
||||
private HouseService houseService;
|
||||
@@ -87,6 +92,27 @@ public class CcbRentController {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object matchAction(AddesssMatchModel model) {
|
||||
String result = null;
|
||||
HttpRequest httpRequest = new HttpRequest();
|
||||
try {
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
// &__refresh_cache=1 ˢлº´æ
|
||||
String url = "http://open.fangjia.com/address/match?token=" + APIConstant.SUPER_USER_TOKEN;
|
||||
Map<String, String> params = org.apache.commons.beanutils.BeanUtils.describe(model);
|
||||
result = httpRequest.post(url, params, headers,"UTF-8");
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (HttpRequestException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object evaluateRentAction(com.fangjia.open.model.PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
String result = null;
|
||||
HttpRequest httpRequest = new HttpRequest();
|
||||
@@ -107,9 +133,9 @@ public class CcbRentController {
|
||||
}
|
||||
|
||||
public Object downloadPageAction(PropertyEvaluationModel result, HttpServletRequest request, @Param(name = "city") String city, @Param(name = "district") String districtStr,
|
||||
@Param(name = "name") String name, @Param(name = "address") String address,
|
||||
@Param(name = "name") String name, @Param(name = "address") String address, @Param(name = "addressDetail") String addressDetail,
|
||||
@Param(name = "size") Double size, @Param(name = "floor") Integer floor, @Param(name = "height") Integer height, @Param(name = "room") Integer room,
|
||||
@Param(name = "hall") Integer hall, @Param(name = "toilet") Integer toilet, @Param(name = "direction") String direction, @Param(name = "fitment") String fitment, @Param(name = "chartImgUrl") String chartImgUrl) {
|
||||
@Param(name = "hall") Integer hall, @Param(name = "toilet") Integer toilet, @Param(name = "direction") String direction, @Param(name = "fitment") String fitment, @Param(name = "hasLift") String hasLift, @Param(name = "chartImgUrl") String chartImgUrl) {
|
||||
com.fangjia.open.model.PropertyEvaluationModel model = new com.fangjia.open.model.PropertyEvaluationModel();
|
||||
model.setCity(city);
|
||||
model.setDistrict(districtStr);
|
||||
@@ -178,13 +204,17 @@ public class CcbRentController {
|
||||
districtPriceMap.put("name", district.getName());
|
||||
districtPriceMap.put("address", district.getAddress());
|
||||
districtPriceMap.put("totalPrice", evaluation.getTotalPrice());
|
||||
districtPriceMap.put("totalPriceUpper", CNNMFilter.convert(String.valueOf(evaluation.getTotalPrice())));
|
||||
districtPriceMap.put("totalPriceUpper", CurrencyConverter.toChinese(String.valueOf(evaluation.getTotalPrice())));
|
||||
districtPriceMap.put("cal_date", DateUtil.formatByPattern(new Date(), "yyyy/MM/dd"));
|
||||
districtPriceMap.put("direction", evaluation.getDirection());
|
||||
districtPriceMap.put("size", evaluation.getArea());
|
||||
districtPriceMap.put("floor", model.getFloor());
|
||||
districtPriceMap.put("height", model.getHeight());
|
||||
districtPriceMap.put("fitment", evaluation.getFitment());
|
||||
districtPriceMap.put("buildYear",district.getFinishBuildingDate());
|
||||
districtPriceMap.put("hasLift",hasLift);
|
||||
districtPriceMap.put("room", room);
|
||||
districtPriceMap.put("addressDetail", addressDetail);
|
||||
|
||||
Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2);
|
||||
Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2);
|
||||
@@ -197,7 +227,7 @@ public class CcbRentController {
|
||||
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
||||
//按条件过滤相似小区
|
||||
Integer buildYear = null;
|
||||
List<District> districts = null;
|
||||
List<District> districts = new ArrayList<District>();
|
||||
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
||||
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||
if(buildYear!=null){
|
||||
@@ -282,7 +312,18 @@ public class CcbRentController {
|
||||
}
|
||||
|
||||
//近一年户型租金走势
|
||||
Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
//Map<String, Object> trendsMap = districtRoomSqmetreRentService.getRentTrends(district.getCity(), district.getRegion(), district.getName(), room, -12);
|
||||
Map<String, Object> trendsMap = districtStatRentService.getRentTrend(district.getCity(), district.getRegion(), district.getDistrictName(), -12);
|
||||
if (MapUtils.isNotEmpty(trendsMap)) {
|
||||
Map distMap = (Map) trendsMap.get("distMap");
|
||||
Map<String, Integer> trendMap = (Map) distMap.get(String.valueOf(trendsMap.get("room")));
|
||||
if (MapUtils.isNotEmpty(trendMap)) {
|
||||
for (String key : trendMap.keySet()) {
|
||||
Double totalPrice = (trendMap.get(key) * evaluation.getArea());
|
||||
trendMap.put(key, totalPrice.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
districtPriceMap.put("trends", trendsMap);
|
||||
|
||||
// 生成走势图图片,一遍转pdf
|
||||
@@ -341,7 +382,8 @@ public class CcbRentController {
|
||||
evaluation.setRegion(model.getRegion());
|
||||
evaluation.setDistrictName(model.getName());
|
||||
evaluation.setDirection(DIRECTION.get(model.getDirection()));
|
||||
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(model.getDecoration())));
|
||||
evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(StringUtils.isNotBlank(model.getDecoration()) ?
|
||||
model.getDecoration() : model.getFitment())));
|
||||
evaluation.setAtticArea(model.getAtticSize());
|
||||
evaluation.setTerraceArea(model.getOuterSize());
|
||||
evaluation.setBasementArea(model.getBasementSize());
|
||||
@@ -484,10 +526,10 @@ public class CcbRentController {
|
||||
}
|
||||
|
||||
public void downloadAction(HttpServletResponse response, HttpServletRequest request, @Param(name = "city") String city, @Param(name = "district") String district,
|
||||
@Param(name = "name") String name, @Param(name = "address") String address,
|
||||
@Param(name = "name") String name, @Param(name = "address") String address, @Param(name = "addressDetail") String addressDetail,
|
||||
@Param(name = "size") Double size, @Param(name = "floor") Integer floor, @Param(name = "height") Integer height, @Param(name = "room") Integer room,
|
||||
@Param(name = "hall") Integer hall, @Param(name = "toilet") Integer toilet, @Param(name = "direction") String direction, @Param(name = "fitment") String fitment, @Param(name = "chartImgUrl") String chartImgUrl) throws IOException {
|
||||
response.setHeader("Content-disposition", "attachment; filename=report.pdf");
|
||||
@Param(name = "hall") Integer hall, @Param(name = "toilet") Integer toilet, @Param(name = "direction") String direction, @Param(name = "fitment") String fitment, @Param(name = "hasLift") String hasLift, @Param(name = "chartImgUrl") String chartImgUrl) throws IOException {
|
||||
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode("×â½ð¹ÀÖµ±¨¸æ", "UTF-8") + ".pdf");
|
||||
response.setContentType("application/pdf;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
OutputStream os = null;
|
||||
@@ -499,7 +541,7 @@ public class CcbRentController {
|
||||
fontResolver.addFont(fontUrl, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
||||
final String path = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
|
||||
String url = path + "/ccbRent/downloadPage?city=" + DataUtil.urlEncode(city) + "&district="+DataUtil.urlEncode(district)+"&name="+DataUtil.urlEncode(name);
|
||||
url += "&address=" + DataUtil.urlEncode(address) +"&size="+size+"&floor="+floor+"&height="+height+"&room="+room+"&hall="+hall+"&toilet="+toilet+"&direction="+direction+"&fitment="+fitment+"&chartImgUrl="+chartImgUrl;
|
||||
url += "&address=" + DataUtil.urlEncode(address) + "&addressDetail=" + DataUtil.urlEncode(addressDetail) +"&size="+size+"&floor="+floor+"&height="+height+"&room="+room+"&hall="+hall+"&toilet="+toilet+"&direction="+direction+"&fitment="+fitment+"&chartImgUrl="+chartImgUrl + "&hasLift=" + DataUtil.urlEncode(hasLift);
|
||||
renderer.setDocument(url);
|
||||
renderer.layout();
|
||||
renderer.createPDF(os, true);
|
||||
@@ -638,4 +680,8 @@ public class CcbRentController {
|
||||
public void setFileService(FileService fileService) {
|
||||
this.fileService = fileService;
|
||||
}
|
||||
|
||||
public void setDistrictStatRentService(DistrictStatRentService districtStatRentService) {
|
||||
this.districtStatRentService = districtStatRentService;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,13 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fangjia.dal.common.XcxKey;
|
||||
import com.fangjia.dal.mongo.model.bkoff.XcxUserInfo;
|
||||
import com.fangjia.service.fangjia.FangJiaUserService;
|
||||
import com.fangjia.service.mongo.fangjia.XcxUserInfoService;
|
||||
import com.fangjia.service.open.WeChatAuthService;
|
||||
import com.fangjia.service.open.WeChatAuthServiceImpl;
|
||||
import com.fangjia.service.util.CookieUtils;
|
||||
|
||||
import com.fangjia.service.util.DataConvertUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.fangjia.core.util.CacheUtils;
|
||||
@@ -63,7 +65,29 @@ public class UserController {
|
||||
return model;
|
||||
}
|
||||
|
||||
public Object bhydLoginPageAction(UserModel model) {
|
||||
//渤海银行登录
|
||||
public Object bhydLoginPageAction(UserModel model, HttpServletResponse response, HttpServletRequest request) {
|
||||
String type = StringUtils.trimToNull(model.getType());
|
||||
if(!StringUtils.isBlank(type)){
|
||||
model.setType(type);
|
||||
CookieUtils.setCookie("login_user_type", type, "/", 60 * 60 * 24 *7, response);
|
||||
}
|
||||
|
||||
WeChatAuthServiceImpl.WeChatWebToken token = weChatAuthService.getWeChatWebToken(model.getCode());
|
||||
String weiXinId = "";
|
||||
if(token != null) {
|
||||
weiXinId = token.getOpenid();
|
||||
} else {
|
||||
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
||||
}
|
||||
if(weiXinId == null && StringUtils.isNotBlank(model.getCode())) {//微信公众号渤海银行
|
||||
weiXinId = DataConvertUtil.getRandomString2(16);
|
||||
}
|
||||
if(weiXinId != null && !weiXinId.equals("")){
|
||||
CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response);
|
||||
}
|
||||
System.out.println("bhyd微信OPEN_ID:" + weiXinId);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
@@ -274,6 +298,75 @@ public class UserController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 渤海
|
||||
* @param model
|
||||
* @param response
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public Object enterpriseLoginBHAction(UserModel model, HttpServletResponse response, HttpServletRequest request) {
|
||||
UserJsonModel resultModel = new UserJsonModel();
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
String username = StringUtils.trimToNull(model.getUsername());
|
||||
String pass = StringUtils.trimToNull(model.getPass());
|
||||
String code = model.getCode();
|
||||
String type = StringUtils.trimToNull(model.getType());
|
||||
|
||||
String cacheCode = getCacheCode(username, type, request);
|
||||
if (cacheCode == null) {
|
||||
resultModel.setMsg(Message.MOBILE_NOT_SEND_CODE);
|
||||
return resultModel;
|
||||
}
|
||||
if (!cacheCode.equals(code)) {
|
||||
resultModel.setMsg(Message.CODE_ERROR);
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
String weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
||||
|
||||
if(StringUtils.isBlank(weiXinId) && StringUtils.isNotBlank(model.getCode())){
|
||||
System.out.println("小程序code:"+model.getCode());
|
||||
System.out.println("小程序AppId:"+model.getAppId());
|
||||
System.out.println("小程序AppSecret:"+model.getAppSecret());
|
||||
System.out.println("sid:"+model.getSid());
|
||||
XcxKey sessionValue = getSessionValue(model.getCode(), null, model.getAppId(), model.getAppSecret());
|
||||
if(sessionValue!=null){
|
||||
weiXinId = sessionValue.getOpenId();
|
||||
}
|
||||
if(weiXinId == null) {
|
||||
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
||||
}
|
||||
if(weiXinId != null && !weiXinId.equals("")){
|
||||
CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response);
|
||||
}
|
||||
System.out.println("[sid]小程序微信OPEN_ID:" + weiXinId);
|
||||
}
|
||||
|
||||
//测试时可以先去掉
|
||||
if (StringUtils.isBlank(username) || StringUtils.isBlank(pass) || StringUtils.isBlank(weiXinId)){
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
try {
|
||||
FjtUsers user = usersInfoService.enterpriseLogin(username, pass);
|
||||
if(user == null) {
|
||||
resultModel.setMsg(Message.LOGIN_FAIL);
|
||||
return resultModel;
|
||||
}
|
||||
CookieUtils.setCookie("login_user_id", user.getId() + "", "/", 60 * 60 * 24 *7, response);
|
||||
CookieUtils.setCookie("login_user_type", "b", "/", 60 * 60 * 24 *7, response);
|
||||
CookieUtils.setCookie("login_enterpriseuser_weixinid", weiXinId, "/", 60 * 60 * 24 *7, response);
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
return resultModel;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
resultModel.setMsg(e.getMessage());
|
||||
return resultModel;
|
||||
}
|
||||
}
|
||||
|
||||
public XcxKey getSessionValue(String code, String sid, String appId, String secret){
|
||||
XcxKey sessionValue = null;
|
||||
if(StringUtils.isNotBlank(sid)){
|
||||
@@ -325,18 +418,31 @@ public class UserController {
|
||||
String type = StringUtils.trimToNull(model.getType());
|
||||
String codeToken = StringUtils.trimToNull(model.getCodeToken());
|
||||
String code = StringUtils.trimToNull(model.getCode());
|
||||
if (StringUtils.isBlank(mobile) || StringUtils.isBlank(type) || StringUtils.isBlank(codeToken) || StringUtils.isBlank(code)) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
if(StringUtils.isNotBlank(type) && type.equals("bindmobilebh")){
|
||||
if (StringUtils.isBlank(mobile)) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
}
|
||||
}else{
|
||||
if (StringUtils.isBlank(mobile) || StringUtils.isBlank(type) || StringUtils.isBlank(codeToken) || StringUtils.isBlank(code)) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
}
|
||||
}
|
||||
|
||||
String cacheCode = getCacheCode(codeToken, Message.SMS_CODE_TYPE_LOGIN, request);
|
||||
if(!code.equals(cacheCode)){
|
||||
if(!type.equals("bindmobilebh") && !code.equals(cacheCode)){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.IMG_CODE_ERROR);
|
||||
return resultModel;
|
||||
}
|
||||
return sendCode(model, resultModel, mobile, type, resp);
|
||||
if(type.equals("bindmobilebh")){
|
||||
return sendBHCode(model, resultModel, mobile, type, resp);
|
||||
}else{
|
||||
return sendCode(model, resultModel, mobile, type, resp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -377,6 +483,34 @@ public class UserController {
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
|
||||
private Object sendBHCode(SendCodeModel model, SendCodeJsonModel resultModel, String mobile, String type, HttpServletResponse resp) {
|
||||
|
||||
Long sendCodeTime = (Long) CacheUtils.getValue(FjtUsers.class, mobile);
|
||||
if(sendCodeTime != null) {
|
||||
Long curTime = new Date().getTime();
|
||||
long second = (curTime - sendCodeTime)/1000;
|
||||
if(second < 300 ){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.SMS_CODE_SEND_FAIL_TIME);
|
||||
return resultModel;
|
||||
}
|
||||
}
|
||||
|
||||
String code = usersInfoService.randomCode();
|
||||
System.out.println(code);
|
||||
try {
|
||||
smsService.send(model.getMobile(), "【房价网】你的验证码是" + code + ",请立即验证。");
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
CookieUtils.setCookie(mobile + "_" + type, code, "/", 60 * 60 * 24 *7, resp);
|
||||
CacheUtils.putValue(CachePolicyEnum.TINY, FjtUsers.class, mobile, new Date().getTime());
|
||||
} catch (SmsException e) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.SMS_CODE_SEND_FAIL);
|
||||
}
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
public void setWeChatAuthService(WeChatAuthService weChatAuthService) {
|
||||
this.weChatAuthService = weChatAuthService;
|
||||
}
|
||||
@@ -394,4 +528,35 @@ public class UserController {
|
||||
CacheUtils.putValue(CachePolicyEnum.LONG, "fangjia-weiXin-key", model.getWeiXinId(), model.getUsername());
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
public Object setupAction(UserModel model){
|
||||
return model;
|
||||
}
|
||||
|
||||
public Object updateInfoAction(UserModel model, HttpServletRequest request){
|
||||
UserJsonModel resultModel = new UserJsonModel();
|
||||
Long userId = Long.parseLong(CookieUtils.getCookieValue(request,"login_user_id"));
|
||||
if(null != userId){
|
||||
if(!model.getPass1().equals(model.getPass2())){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PASS_REPEAT);
|
||||
return resultModel;
|
||||
}
|
||||
FjtUsers users = fjtUsersService.findById(userId);
|
||||
if(null != users){
|
||||
if(!users.getPassword().equals(model.getPass())){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.LOGIN_UPPSW);
|
||||
return resultModel;
|
||||
}else{
|
||||
users.setPassword(model.getPass1());
|
||||
fjtUsersService.update(users);
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ package com.fangjia.open.controllers.weixin;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.fangjia.open.util.InsidePolygon2;
|
||||
import com.fangjia.service.mongo.fangjia.PriceBorderService;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.fangjia.dal.common.DistrictKey;
|
||||
import com.fangjia.dal.mongo.model.AverageStatistics;
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import com.fangjia.dal.mongo.model.LatlngPolygon;
|
||||
import com.fangjia.dal.mongo.model.PriceBorder;
|
||||
import com.fangjia.dal.mongo.model.bkoff.DistrictHouseStat;
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.dal.sql.model.EvaluationAudit;
|
||||
@@ -105,6 +106,7 @@ public class WeiXinEvaluationController {
|
||||
private EvaluationRateService evaluationRateService;
|
||||
private EvaluationService evaluationService;
|
||||
private GoldLogsService goldLogsService;
|
||||
private PriceBorderService priceBorderService;
|
||||
|
||||
private final static String DD_ID = "5938c43984aec20a36f474c5";
|
||||
|
||||
@@ -369,15 +371,20 @@ public class WeiXinEvaluationController {
|
||||
|
||||
|
||||
FjtUsers fjtUser = fjtUsersService.findById(evaluation.getUserId());
|
||||
model.setRole(fjtUser.getRole());
|
||||
|
||||
model.setRole(fjtUser.getRole());
|
||||
|
||||
District district = districtService.findDistrict(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()), "district");
|
||||
model.setId(district.getId());
|
||||
//²Î¿¼¼Û
|
||||
EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId);
|
||||
model.setEvaluationAudit(evaluationAudit);
|
||||
|
||||
model.setRole(fjtUser.getRole());
|
||||
|
||||
if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("ÉϺ£")){
|
||||
Map<String, Object> retMap = getLoanInfo(district, evaluation.getHouseArea());
|
||||
if(retMap!=null && retMap.size()>0){
|
||||
model.setLoanInfoMap(retMap);
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
@@ -790,7 +797,65 @@ public class WeiXinEvaluationController {
|
||||
}
|
||||
return loopLine;
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> getLoanInfo(District district, Double area){
|
||||
List<PriceBorder> ranges = priceBorderService.getALLBlockRange();
|
||||
PriceBorder pbObj = null;
|
||||
for(PriceBorder pb : ranges){
|
||||
String[] pointArrs = pb.getBorder().split(";");
|
||||
List<Point> points = new ArrayList<Point>();
|
||||
for(String pointStr : pointArrs){
|
||||
String[] ll = pointStr.split(",");
|
||||
Point point = new Point(Double.valueOf(ll[0]), Double.valueOf(ll[1]));
|
||||
points.add(point);
|
||||
}
|
||||
Point point = new Point(district.getLng()/10000000000.0, district.getLat()/10000000000.0);
|
||||
//boolean flag = InsidePolygon.aboutZone(point, points);
|
||||
//boolean flag = InsidePolygon.isPtInPoly(point.getLon(), point.getLat(), points);
|
||||
boolean flag = InsidePolygon2.checkIsInPolygon(point, points);
|
||||
if(flag){
|
||||
pbObj = pb;
|
||||
System.out.println(district.getRegion()+" "+district.getName()+" "+pb.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
Integer yearAge = getBuildYear(district.getFinishBuildingDate());
|
||||
Map<String, Object> retsMap = new HashMap<String, Object>();
|
||||
if(pbObj!=null && pbObj.getLevel()!=null && pbObj.getLevel()==1 && yearAge!=null && yearAge<=25 && area>=60){
|
||||
retsMap.put("type", "A");
|
||||
retsMap.put("loan_ratio", 7);
|
||||
}else if(pbObj!=null && pbObj.getLevel()!=null && pbObj.getLevel()==2 && yearAge!=null && yearAge<=25 && area>=70){
|
||||
retsMap.put("type", "B");
|
||||
retsMap.put("loan_ratio", 6.5);
|
||||
}else if(yearAge!=null && yearAge<=25 && yearAge>20 && pbObj!=null && pbObj.getLevel()!=null && (pbObj.getLevel()==1 || pbObj.getLevel()==2)){
|
||||
retsMap.put("type", "C");
|
||||
retsMap.put("loan_ratio", 6);
|
||||
}else if(yearAge!=null && yearAge<=20 ){
|
||||
retsMap.put("type", "C");
|
||||
retsMap.put("loan_ratio", 6);
|
||||
}else if(yearAge!=null && yearAge>25){
|
||||
retsMap.put("type", "D");
|
||||
retsMap.put("loan_ratio", 5);
|
||||
}
|
||||
return retsMap;
|
||||
}
|
||||
|
||||
public Integer getBuildYear(String finishBuildingDate){
|
||||
if(StringUtils.isNotBlank(finishBuildingDate)){
|
||||
Pattern pat3 = Pattern.compile("\\d{4}");
|
||||
Matcher matcher3 = pat3.matcher(finishBuildingDate);
|
||||
if (matcher3.find()) {
|
||||
String year = matcher3.group();
|
||||
if(StringUtils.isNotBlank(year)){
|
||||
int curYear = Calendar.getInstance().get(Calendar.YEAR);
|
||||
return curYear - Integer.valueOf(year);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setFjtEvaluationService(FjtEvaluationService fjtEvaluationService) {
|
||||
this.fjtEvaluationService = fjtEvaluationService;
|
||||
@@ -868,6 +933,8 @@ public class WeiXinEvaluationController {
|
||||
public void setEmailService(EmailService emailService) {
|
||||
this.emailService = emailService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPriceBorderService(PriceBorderService priceBorderService) {
|
||||
this.priceBorderService = priceBorderService;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.fangjia.open.model;
|
||||
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
public class CzbankSampleModel extends FangjiaApiModel{
|
||||
private String cltNo;
|
||||
private String province;
|
||||
/**城市*/
|
||||
private String city;
|
||||
/**区域*/
|
||||
private String district;
|
||||
/**小区名*/
|
||||
private String buildingName;
|
||||
/**楼栋名称*/
|
||||
private String buildingNoName;
|
||||
/**物业类型编码*/
|
||||
private String propertyTypeCode;
|
||||
/**是否有电梯 0:无 1:有*/
|
||||
private Integer isElevator;
|
||||
/**总楼层*/
|
||||
private Integer aboveFloorAmount;
|
||||
/**所在楼层*/
|
||||
private Integer floorNumber;
|
||||
/**
|
||||
* 装修情况编码
|
||||
* 1:毛坯
|
||||
* 2:简装(默认)
|
||||
* 3:精装
|
||||
* 4:豪装
|
||||
* */
|
||||
private Integer decrCondCode;
|
||||
/**面积**/
|
||||
private Double strctureArea;
|
||||
/**
|
||||
* 朝向情况编码
|
||||
* 1:西南
|
||||
* 2:东南
|
||||
* 3:南(默认)
|
||||
* 4:西北
|
||||
* 5:东北
|
||||
* 6:东
|
||||
* 7:西
|
||||
* 8:北
|
||||
* 9:东西
|
||||
* 10:南北
|
||||
* */
|
||||
private Integer towardDirectCode;
|
||||
private Date updateDate;
|
||||
|
||||
public String getCltNo() {
|
||||
return cltNo;
|
||||
}
|
||||
|
||||
public void setCltNo(String cltNo) {
|
||||
this.cltNo = cltNo;
|
||||
}
|
||||
|
||||
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 getBuildingName() {
|
||||
return buildingName;
|
||||
}
|
||||
|
||||
public void setBuildingName(String buildingName) {
|
||||
this.buildingName = buildingName;
|
||||
}
|
||||
|
||||
public String getBuildingNoName() {
|
||||
return buildingNoName;
|
||||
}
|
||||
|
||||
public void setBuildingNoName(String buildingNoName) {
|
||||
this.buildingNoName = buildingNoName;
|
||||
}
|
||||
|
||||
public String getPropertyTypeCode() {
|
||||
return propertyTypeCode;
|
||||
}
|
||||
|
||||
public void setPropertyTypeCode(String propertyTypeCode) {
|
||||
this.propertyTypeCode = propertyTypeCode;
|
||||
}
|
||||
|
||||
public Integer getIsElevator() {
|
||||
return isElevator;
|
||||
}
|
||||
|
||||
public void setIsElevator(Integer isElevator) {
|
||||
this.isElevator = isElevator;
|
||||
}
|
||||
|
||||
public Integer getAboveFloorAmount() {
|
||||
return aboveFloorAmount;
|
||||
}
|
||||
|
||||
public void setAboveFloorAmount(Integer aboveFloorAmount) {
|
||||
this.aboveFloorAmount = aboveFloorAmount;
|
||||
}
|
||||
|
||||
public Integer getFloorNumber() {
|
||||
return floorNumber;
|
||||
}
|
||||
|
||||
public void setFloorNumber(Integer floorNumber) {
|
||||
this.floorNumber = floorNumber;
|
||||
}
|
||||
|
||||
public Integer getDecrCondCode() {
|
||||
return decrCondCode;
|
||||
}
|
||||
|
||||
public void setDecrCondCode(Integer decrCondCode) {
|
||||
this.decrCondCode = decrCondCode;
|
||||
}
|
||||
|
||||
public Double getStrctureArea() {
|
||||
return strctureArea;
|
||||
}
|
||||
|
||||
public void setStrctureArea(Double strctureArea) {
|
||||
this.strctureArea = strctureArea;
|
||||
}
|
||||
|
||||
public Integer getTowardDirectCode() {
|
||||
return towardDirectCode;
|
||||
}
|
||||
|
||||
public void setTowardDirectCode(Integer towardDirectCode) {
|
||||
this.towardDirectCode = towardDirectCode;
|
||||
}
|
||||
|
||||
public Date getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
public void setUpdateDate(Date updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.fangjia.open.model.weixin;
|
||||
|
||||
import com.fangjia.dal.mongo.model.Evaluation;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fangjia.dal.seaweed.model.District;
|
||||
import com.fangjia.dal.sql.model.EvaluationAudit;
|
||||
@@ -38,6 +39,7 @@ public class EvaluationModel extends BaseModel{
|
||||
private String userType;
|
||||
private Integer role;
|
||||
private String cardId;
|
||||
private Map<String, Object> loanInfoMap;
|
||||
|
||||
|
||||
public void setId(String id) {
|
||||
@@ -186,6 +188,12 @@ public class EvaluationModel extends BaseModel{
|
||||
public void setCardId(String cardId) {
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Map<String, Object> getLoanInfoMap() {
|
||||
return loanInfoMap;
|
||||
}
|
||||
|
||||
public void setLoanInfoMap(Map<String, Object> loanInfoMap) {
|
||||
this.loanInfoMap = loanInfoMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,6 @@ public class Message {
|
||||
public static final String PAY_PASSWORD_ERROR = "支付密码错误,请重新输入";
|
||||
|
||||
public static final String NOT_LOGIN = "请先进行登录";
|
||||
|
||||
public static final String LOGIN_UPPSW = "ÔʼÃÜÂëÊäÈë´íÎó";
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ public class UserModel extends BaseModel {
|
||||
private String weiXinId;
|
||||
private String username;
|
||||
private String pass;
|
||||
private String pass1;
|
||||
private String pass2;
|
||||
private String code;
|
||||
private List<String> citys;
|
||||
|
||||
@@ -108,4 +110,20 @@ public class UserModel extends BaseModel {
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getPass1() {
|
||||
return pass1;
|
||||
}
|
||||
|
||||
public void setPass1(String pass1) {
|
||||
this.pass1 = pass1;
|
||||
}
|
||||
|
||||
public String getPass2() {
|
||||
return pass2;
|
||||
}
|
||||
|
||||
public void setPass2(String pass2) {
|
||||
this.pass2 = pass2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,5 +143,44 @@ public class InsidePolygon {
|
||||
if ( ( (odd >> 1) << 1) == odd)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean isPtInPoly (double ALon , double ALat , List<Point> ps) {
|
||||
int iSum, iCount, iIndex;
|
||||
double dLon1 = 0, dLon2 = 0, dLat1 = 0, dLat2 = 0, dLon;
|
||||
if (ps.size() < 3) {
|
||||
return false;
|
||||
}
|
||||
iSum = 0;
|
||||
iCount = ps.size();
|
||||
for (iIndex = 0; iIndex<iCount;iIndex++) {
|
||||
if (iIndex == iCount - 1) {
|
||||
dLon1 = ps.get(iIndex).getLon();
|
||||
dLat1 = ps.get(iIndex).getLat();
|
||||
dLon2 = ps.get(0).getLon();
|
||||
dLat2 = ps.get(0).getLat();
|
||||
} else {
|
||||
dLon1 = ps.get(iIndex).getLon();
|
||||
dLat1 = ps.get(iIndex).getLat();
|
||||
dLon2 = ps.get(iIndex + 1).getLon();
|
||||
dLat2 = ps.get(iIndex + 1).getLat();
|
||||
}
|
||||
// 以下语句判断A点是否在边的两端点的水平平行线之间,在则可能有交点,开始判断交点是否在左射线上
|
||||
if (((ALat >= dLat1) && (ALat < dLat2)) || ((ALat >= dLat2) && (ALat < dLat1))) {
|
||||
if (Math.abs(dLat1 - dLat2) > 0) {
|
||||
//得到 A点向左射线与边的交点的x坐标:
|
||||
dLon = dLon1 - ((dLon1 - dLon2) * (dLat1 - ALat) ) / (dLat1 - dLat2);
|
||||
// 如果交点在A点左侧(说明是做射线与 边的交点),则射线与边的全部交点数加一:
|
||||
if (dLon < ALon) {
|
||||
iSum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((iSum % 2) != 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.fangjia.open.util;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InsidePolygon2 {
|
||||
/**
|
||||
* 判断当前位置是否在多边形区域内
|
||||
*
|
||||
* @param checkPoint 当前经纬度
|
||||
* @param areaAround 围栏范围
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkIsInPolygon(Point checkPoint, List<Point> areaAround) {
|
||||
Point2D.Double point = new Point2D.Double(checkPoint.getLat(), checkPoint.getLon());
|
||||
List<Point2D.Double> pointList = new ArrayList<Point2D.Double>();
|
||||
for (Point everyPoint : areaAround) {
|
||||
Point2D.Double polygonPoint = new Point2D.Double(everyPoint.getLat(), everyPoint.getLon());
|
||||
pointList.add(polygonPoint);
|
||||
}
|
||||
return checkIsPtInPoly(point, pointList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点是否在多边形内,如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true
|
||||
*
|
||||
* @param point 检测点
|
||||
* @param pts 多边形的顶点
|
||||
* @return 点在多边形内返回true, 否则返回false
|
||||
*/
|
||||
public static boolean checkIsPtInPoly(Point2D.Double point, List<Point2D.Double> pts) {
|
||||
int N = pts.size();
|
||||
//如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true
|
||||
boolean boundOrVertex = true;
|
||||
//cross points count of x
|
||||
int intersectCount = 0;
|
||||
//浮点类型计算时候与0比较时候的容差
|
||||
double precision = 2e-10;
|
||||
//neighbour bound vertices
|
||||
Point2D.Double p1, p2;
|
||||
//当前点
|
||||
Point2D.Double p = point;
|
||||
//left vertex
|
||||
p1 = pts.get(0);
|
||||
//check all rays
|
||||
for (int i = 1; i <= N; ++i) {
|
||||
if (p.equals(p1)) {
|
||||
//p is an vertex
|
||||
return boundOrVertex;
|
||||
}
|
||||
//right vertex
|
||||
p2 = pts.get(i % N);
|
||||
//ray is outside of our interests
|
||||
if (p.x < Math.min(p1.x, p2.x) || p.x > Math.max(p1.x, p2.x)) {
|
||||
p1 = p2;
|
||||
//next ray left point
|
||||
continue;
|
||||
}
|
||||
//ray is crossing over by the algorithm (common part of)
|
||||
if (p.x > Math.min(p1.x, p2.x) && p.x < Math.max(p1.x, p2.x)) {
|
||||
//x is before of ray
|
||||
if (p.y <= Math.max(p1.y, p2.y)) {
|
||||
//overlies on a horizontal ray
|
||||
if (p1.x == p2.x && p.y >= Math.min(p1.y, p2.y)) {
|
||||
return boundOrVertex;
|
||||
}
|
||||
//ray is vertical
|
||||
if (p1.y == p2.y) {
|
||||
//overlies on a vertical ray
|
||||
if (p1.y == p.y) {
|
||||
return boundOrVertex;
|
||||
//before ray
|
||||
} else {
|
||||
++intersectCount;
|
||||
}
|
||||
} else {
|
||||
//cross point on the left side
|
||||
//cross point of y
|
||||
double xinters = (p.x - p1.x) * (p2.y - p1.y) / (p2.x - p1.x) + p1.y;
|
||||
//overlies on a ray
|
||||
if (Math.abs(p.y - xinters) < precision) {
|
||||
return boundOrVertex;
|
||||
}
|
||||
//before ray
|
||||
if (p.y < xinters) {
|
||||
++intersectCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//special case when ray is crossing through the vertex
|
||||
//p crossing over p2
|
||||
if (p.x == p2.x && p.y <= p2.y) {
|
||||
//next vertex
|
||||
Point2D.Double p3 = pts.get((i + 1) % N);
|
||||
//p.x lies between p1.x & p3.x
|
||||
if (p.x >= Math.min(p1.x, p3.x) && p.x <= Math.max(p1.x, p3.x)) {
|
||||
++intersectCount;
|
||||
} else {
|
||||
intersectCount += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
//next ray left point
|
||||
p1 = p2;
|
||||
}
|
||||
//偶数在多边形外
|
||||
if (intersectCount % 2 == 0) {
|
||||
return false;
|
||||
} else {
|
||||
//奇数在多边形内
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,11 +405,7 @@ public class CzbankServiceImpl implements CzbankService {
|
||||
}
|
||||
evaluation.setFacilities(convertToString(fs));
|
||||
}
|
||||
|
||||
// if (StringUtils.isNotBlank(model.getInsidepos())) {
|
||||
// evaluation.setInsidepos(model.getInsidepos());
|
||||
// }
|
||||
|
||||
|
||||
evaluation.setCreationDate(new Date());
|
||||
evaluation.setModificationDate(new Date());
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
hjcJCHahWBw1Nj88
|
||||
@@ -12,7 +12,7 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="../static/style/wx.css"/>
|
||||
<style type="text/css">
|
||||
body {
|
||||
@@ -97,12 +97,12 @@
|
||||
<div>
|
||||
<div class="title1">4 房产状况</div>
|
||||
<div class="p">
|
||||
<b>详细地址</b>:<span name="address"></span><br/>
|
||||
<b>详细地址</b>:<span name="addressDetail"></span><br/>
|
||||
<b>楼盘名称</b>:<span name="name"></span><br/>
|
||||
<b>室号</b>:<span name="room"></span><br/>
|
||||
<b>室号</b>:<span name="roomNumber"></span><br/>
|
||||
<b>朝向</b>:<span name="direction"></span><br/>
|
||||
<b>建筑面积</b>:<span name="size"></span>平米<br/>
|
||||
<b>所在楼层</b>:<span name="floor"></span> 层 <span name="height"></span>总层数<br/>
|
||||
<b>所在楼层</b>:<span name="floor"></span> 层(共<span name="height"></span>层)<br/>
|
||||
<b>电梯配套</b>:<span name="hasLift"></span><br/>
|
||||
<b>装修情况</b>:<span name="fitment"></span><br/>
|
||||
<b>建筑年代</b>:<span name="buildYear"></span><br/>
|
||||
@@ -162,7 +162,7 @@
|
||||
<div>
|
||||
<div class="title1">8 周边同类小区租金</div>
|
||||
<div class="p table">
|
||||
<table class="inline" style="width: 300px">
|
||||
<table class="inline">
|
||||
<thead>
|
||||
<tr class="bg">
|
||||
<th class="th01">城市</th>
|
||||
@@ -186,67 +186,26 @@
|
||||
<script type='text/javascript' src='https://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='https://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
|
||||
<!-- 暂时注释 -->
|
||||
<script type="text/javascript" src="https://cdn.highcharts.com.cn/highcharts/9.0.1/highcharts.js"></script>
|
||||
<script type="text/javascript" src="https://code.highcharts.com.cn/highcharts/modules/exporting.js"></script>
|
||||
<#-- <script type="text/javascript" src="https://cdn.highcharts.com.cn/highcharts/9.0.1/highcharts.js"></script>-->
|
||||
<#-- <script type="text/javascript" src="https://code.highcharts.com.cn/highcharts/modules/exporting.js"></script>-->
|
||||
|
||||
<script src="https://cdn.highcharts.com.cn/highcharts/highcharts.js"></script>
|
||||
<script src="https://cdn.highcharts.com.cn/highcharts/modules/exporting.js"></script>
|
||||
<script src="https://cdn.highcharts.com.cn/highcharts/modules/series-label.js"></script>
|
||||
<script src="https://cdn.highcharts.com.cn/highcharts/modules/oldie.js"></script>
|
||||
<script src="https://code.highcharts.com.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
|
||||
|
||||
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
|
||||
<script type="text/javascript" src="../static/js/trend-charts.js"></script>
|
||||
<script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script>
|
||||
<#-- <script src="../static/js/purify.min.js"></script>-->
|
||||
<#-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"></script>-->
|
||||
<#-- <script src="../static/js/jspdf.umd.js"></script>-->
|
||||
<#-- <script src="../static/js/SourceHanSans-normal.js"></script>-->
|
||||
<#-- <script src="../static/js/simsun-normal.js"></script>-->
|
||||
<#-- <script type="text/javascript">-->
|
||||
<#-- $("#download").bind('click', function(){-->
|
||||
<#-- window.location.href = "download"-->
|
||||
<#-- // 打印所有可用的字体-->
|
||||
<#-- // jspdf.html(document.body, {-->
|
||||
<#-- // callback: function (doc) {-->
|
||||
<#-- // doc.save("租金报告.pdf");-->
|
||||
<#-- // },-->
|
||||
<#-- // x: 10,-->
|
||||
<#-- // y: 10-->
|
||||
<#-- // });-->
|
||||
<#-- // jspdf.html("test测试", {-->
|
||||
<#-- // callback: function (doc) {-->
|
||||
<#-- // doc.save("租金报告.pdf");-->
|
||||
<#-- // },-->
|
||||
<#-- // x: 10,-->
|
||||
<#-- // y: 10-->
|
||||
<#-- // });-->
|
||||
<#-- });-->
|
||||
<#-- $(function () {-->
|
||||
<#-- $('span[name="name"]').text('场中小区');-->
|
||||
<#-- });-->
|
||||
<#-- </script>-->
|
||||
<script type="text/javascript">
|
||||
// window.jsPDF = window.jspdf.jsPDF
|
||||
// var jspdf = new jsPDF();
|
||||
// jspdf.addFileToVFS('SourceHanSans-Normal.ttf',normalChinese);
|
||||
// jspdf.addFont('SourceHanSans-Normal.ttf', 'SourceHanSans-Normal', 'normal');
|
||||
// jspdf.setFont('SourceHanSans-Light');
|
||||
//console.log(jspdf.getFontList());
|
||||
var chart;
|
||||
let chart;
|
||||
$("#download").bind('click', function(){
|
||||
var chartImgUrl = $('#chartImgUrl').val();
|
||||
window.location.href = "download?city="+params.city+"&district="+params.district+"&name="+params.name+"&address="+params.address+"&size="+params.size+"&floor="+params.floor
|
||||
+"&height="+params.height+"&room="+params.room+"&hall="+params.hall+"&toilet="+params.toilet+"&direction="+params.direction+"&fitment="+params.fitment+"&chartImgUrl=" + chartImgUrl;
|
||||
// jspdf.html(document.body, {
|
||||
// callback: function (doc) {
|
||||
// doc.save("租金报告.pdf");
|
||||
// },
|
||||
// x: 0,
|
||||
// y: 0,
|
||||
// fontFaces: [{
|
||||
// family: 'SimSun',
|
||||
// weight: 'bold',
|
||||
// //style: style,
|
||||
// src: [{
|
||||
// format: "truetype",
|
||||
// url: "../static/fonts/SimSun.ttf"
|
||||
// }]
|
||||
// }]
|
||||
// });
|
||||
$.toast("报告下载中,请耐心等待");
|
||||
$("#download").css('color', 'blue')
|
||||
let chartImgUrl = $('#chartImgUrl').val();
|
||||
window.location.href = "download?city="+params.city+"&district="+params.district+"&name="+params.name+"&address="+params.address+"&addressDetail="+params.addressDetail+"&size="+params.size+"&floor="+params.floor
|
||||
+"&height="+params.height+"&room="+params.roomNumber+"&hall="+params.hall+"&toilet="+params.toilet+"&direction="+params.direction+"&fitment="+params.fitment+"&chartImgUrl=" + chartImgUrl + "&hasLift=" + (params.hasLift == 'true' ? '有' : '无');
|
||||
});
|
||||
|
||||
// 后台传参过来用
|
||||
@@ -262,10 +221,25 @@
|
||||
'hall': sessionStorage.hall,
|
||||
'toilet': sessionStorage.toilet,
|
||||
'direction': sessionStorage.direction,
|
||||
'fitment': sessionStorage.fitment
|
||||
'fitment': sessionStorage.fitment,
|
||||
'hasLift': sessionStorage.hasLift,
|
||||
'roomNumber': sessionStorage.roomNumber,
|
||||
'addressDetail': sessionStorage.addressDetail
|
||||
};
|
||||
|
||||
function init() {
|
||||
// let charts = {}
|
||||
// charts.xData = ["2020-08", "2020-09", "2020-10", "2020-11", "2020-12", "2021-01", "2021-02", "2021-03", "2021-04", "2021-05", "2021-06", "2021-07"]
|
||||
// charts.series = [{
|
||||
// name: '1居室',
|
||||
// data: [3800, 3900, 4000, 4100, 4200, 4200, 4200, 4200]
|
||||
// }];
|
||||
// createChartNow('districtRentTrendsChart', charts, true);
|
||||
// return false;
|
||||
|
||||
$('span[name="hasLift"]').text(params.hasLift == 'true' ? '有' : '无')
|
||||
$('span[name="roomNumber"]').text(params.roomNumber != '' ? params.roomNumber + '室' : '')
|
||||
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../property/rentReport',
|
||||
@@ -273,21 +247,45 @@
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
|
||||
if(data.code == 200){
|
||||
let result = data.result;
|
||||
// 评估时间
|
||||
$('span[name="cal_date"]').text(result.cal_date)
|
||||
$('span[name="name"]').text(result.name);
|
||||
$('span[name="address"]').text(result.address);
|
||||
$('span[name="addressDetail"]').text(params.addressDetail);
|
||||
$('span[name="totalPrice"]').text(result.totalPrice)
|
||||
$('span[name="totalPriceUpper"]').text(result.totalPriceUpper)
|
||||
|
||||
// 历史租金
|
||||
// 房产状况
|
||||
//$('span[name="room"]').text(result.room)
|
||||
$('span[name="floor"]').text(result.floor)
|
||||
$('span[name="buildYear"]').text(result.buildYear)
|
||||
$('span[name="direction"]').text(result.direction)
|
||||
$('span[name="size"]').text(result.size)
|
||||
$('span[name="height"]').text(result.height)
|
||||
$('span[name="fitment"]').text(result.fitment)
|
||||
}else{
|
||||
$.toast(data.msg);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../property/rentReport2',
|
||||
data: params,
|
||||
dataType: "json",
|
||||
type: "post",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
let result = data.result;
|
||||
//历史租金
|
||||
var charts = {}
|
||||
// charts.series = [{
|
||||
// name: '1居室',
|
||||
// data: [3800, 3900, 4000, 4100, 4200, 4200, 4200, 4200]
|
||||
// }];
|
||||
if (result.trends.distMap[params.room] == undefined) {
|
||||
console.log("返回历史租金,不存在" + params.room + "居室数据")
|
||||
$('#districtRentTrendsChart').empty();
|
||||
@@ -308,17 +306,8 @@
|
||||
charts.xData = result.trends.times; // 横坐标值
|
||||
createChartNow('districtRentTrendsChart', charts, true);
|
||||
}
|
||||
// 房产状况
|
||||
$('span[name="room"]').text(result.room)
|
||||
$('span[name="direction"]').text(result.direction)
|
||||
$('span[name="size"]').text(result.size)
|
||||
$('span[name="floor"]').text(result.floor)
|
||||
$('span[name="height"]').text(result.height)
|
||||
$('span[name="hasLift"]').text(result.hasLift)
|
||||
$('span[name="fitment"]').text(result.fitment)
|
||||
$('span[name="buildYear"]').text(result.buildYear)
|
||||
|
||||
// 已租房源
|
||||
//已租房源
|
||||
var trades = result.trades;
|
||||
if (trades && trades.length > 0) {
|
||||
$('#trades').empty();
|
||||
@@ -326,16 +315,16 @@
|
||||
var fitment = d.fitment != undefined ? d.fitment : '';
|
||||
var hall = d.hall != undefined ? d.hall : '';
|
||||
$('#trades').append('<tr class="bg"> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + (d.totalPrice != undefined ? d.totalPrice : '') + '</td> \
|
||||
<td>' + (d.area != undefined ? d.area : '') + '</td> \
|
||||
<td>' + (d.room != undefined ? d.room : '') + '</td> \
|
||||
<td>' + hall + '</td> \
|
||||
<td>' + fitment + '</td> \
|
||||
<td>' + formatDate(d.tradeDate) + '</td> \
|
||||
</tr>');
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + (d.totalPrice != undefined ? d.totalPrice : '') + '</td> \
|
||||
<td>' + (d.area != undefined ? d.area : '') + '</td> \
|
||||
<td>' + (d.room != undefined ? d.room : '') + '</td> \
|
||||
<td>' + hall + '</td> \
|
||||
<td>' + fitment + '</td> \
|
||||
<td>' + formatDate(d.tradeDate) + '</td> \
|
||||
</tr>');
|
||||
})
|
||||
}
|
||||
|
||||
@@ -347,16 +336,16 @@
|
||||
var fitment = d.fitment != undefined ? d.fitment : '';
|
||||
var date = (d.pDate + '').substring(0, 4) + "-" + (d.pDate + '').substring(4, 6) + "-" + (d.pDate + '').substring(6, 8)
|
||||
$('#referenceHouses').append('<tr class="bg"> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + (d.totalPrice != undefined ? d.totalPrice : '') + '</td> \
|
||||
<td>' + (d.area != undefined ? d.area : '') + '</td> \
|
||||
<td>' + (d.room != undefined ? d.room : '') + '</td> \
|
||||
<td>' + (d.hall != undefined ? d.hall : '')+ '</td> \
|
||||
<td>' + fitment + '</td> \
|
||||
<td>' + date + '</td> \
|
||||
</tr>');
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + d.districtName + '</td> \
|
||||
<td>' + (d.totalPrice != undefined ? d.totalPrice : '') + '</td> \
|
||||
<td>' + (d.area != undefined ? d.area : '') + '</td> \
|
||||
<td>' + (d.room != undefined ? d.room : '') + '</td> \
|
||||
<td>' + (d.hall != undefined ? d.hall : '')+ '</td> \
|
||||
<td>' + fitment + '</td> \
|
||||
<td>' + date + '</td> \
|
||||
</tr>');
|
||||
})
|
||||
|
||||
}
|
||||
@@ -366,24 +355,19 @@
|
||||
if (sameDistricts && sameDistricts.length > 0) {
|
||||
$('#sameDistricts').empty()
|
||||
sameDistricts.forEach(function(d){
|
||||
$('#sameDistricts').append('<tr class=""> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + (d.districtName != undefined ? d.districtName:'' ) + '</td> \
|
||||
<td>' + (d.roomPrice != undefined ? d.roomPrice:'') + '</td> \
|
||||
<td>' + (d.room != undefined ? d.room:'') + '</td> \
|
||||
<td>1</td> \
|
||||
</tr>');
|
||||
$('#sameDistricts').append('<tr class="bg"> \
|
||||
<td class="td01">' + d.city + '</td> \
|
||||
<td class="td02">' + d.region + '</td> \
|
||||
<td>' + (d.districtName != undefined ? d.districtName:'' ) + '</td> \
|
||||
<td>' + (d.sqAvgPrice != undefined ? d.sqAvgPrice:'') + '</td> \
|
||||
<td>' + (d.room != undefined ? d.room:'') + '</td> \
|
||||
<td>1</td> \
|
||||
</tr>');
|
||||
})
|
||||
}
|
||||
}else{
|
||||
$.toast(data.msg);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
var formatDate = function (dateStr) {
|
||||
var date = new Date(dateStr);
|
||||
@@ -485,11 +469,7 @@
|
||||
series: data.series,
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
if(this.series.name.indexOf('成交量') > -1) {
|
||||
return Highcharts.dateFormat('%Y年%m月', this.x) +" 成交: <span style='color:#F50;font-weight: bold;'>"+ this.y +'</span>套';
|
||||
}else {
|
||||
return Highcharts.dateFormat('%Y-%m-%d', this.x) +'<br/>'+ this.series.name+ ": <span style='color:#F50;font-weight: bold;'>"+ this.y +'</span>元/平米';
|
||||
}
|
||||
return this.x +'<br/>'+ this.series.name+ ": <span style='color:#F50;font-weight: bold;'>"+ this.y +'</span>元/平米';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="../static/style/wx.css"/>
|
||||
<link rel="stylesheet" href="../static/style/report.css"/>
|
||||
<style type="text/css">
|
||||
@@ -22,6 +22,9 @@
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<div class="t1" style="text-align:center;background:none">
|
||||
估值报告
|
||||
</div>
|
||||
<div class="t1">
|
||||
<em>1</em>估价结果
|
||||
</div>
|
||||
@@ -47,11 +50,11 @@
|
||||
<td class="textTd" style="width: 15%;">楼盘名称</td>
|
||||
<td class="textRight1" style="width: 35%;"><#if result.name??>${result.name}</#if></td>
|
||||
<td class="textTd" style="width: 15%;">地址</td>
|
||||
<td class="textRight2" colspan="3" style="width: 35%;"><#if result.address??>${result.address}</#if></td>
|
||||
<td class="textRight2" colspan="3" style="width: 35%;"><#if result.addressDetail??>${result.addressDetail}</#if></td>
|
||||
</tr>
|
||||
<tr class="tdbg">
|
||||
<td class="textTd">室号</td>
|
||||
<td class="textRight1"><#if result.room??>${result.room}</#if></td>
|
||||
<td class="textRight1"><#if result.room??>${result.room + '室'}</#if></td>
|
||||
<td class="textTd">朝向</td>
|
||||
<td class="textRight2" colspan="3"><#if result.direction??>${result.direction}</#if></td>
|
||||
</tr>
|
||||
@@ -59,7 +62,7 @@
|
||||
<td class="textTd" style="width: 15%;">建筑面积</td>
|
||||
<td class="textRight1" style="width: 35%;"><#if result.size??>${result.size}</#if>平米</td>
|
||||
<td class="textTd" style="width: 15%;">所在楼层</td>
|
||||
<td class="textRight2" colspan="3" style="width: 35%;"><#if result.floor??>${result.floor}</#if> 层 <#if result.height??>${result.height}</#if>总层数</td>
|
||||
<td class="textRight2" colspan="3" style="width: 35%;"><#if result.floor??>${result.floor}</#if> 层(共<#if result.height??>${result.height}</#if>层)</td>
|
||||
</tr>
|
||||
<tr class="tdbg">
|
||||
<td class="textTd">电梯配套</td>
|
||||
@@ -189,7 +192,7 @@
|
||||
<td class="td01"><#if bo.city??>${bo.city}</#if></td>
|
||||
<td class="td02"><#if bo.region??>${bo.region}</#if></td>
|
||||
<td><#if bo.districtName??>${bo.districtName}</#if></td>
|
||||
<td><#if bo.totalPrice??>${bo.totalPrice}</#if></td>
|
||||
<td><#if bo.sqAvgPrice??>${bo.sqAvgPrice}</#if></td>
|
||||
<td><#if bo.room??>${bo.room}</#if></td>
|
||||
<td><#if bo.hall??>${bo.hall}<#else>1</#if></td>
|
||||
</tr>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../static/style/wx.css">
|
||||
<style>
|
||||
.list-block .item-content .item-inner{margin-left:0;padding-left:0.75rem;}
|
||||
@@ -40,8 +40,9 @@
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">地址:</div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="请输入小区名或地址" id="districtSearch" name="name" class="search_input" required>
|
||||
<input type="hidden" name="address" />
|
||||
<input type="text" placeholder="请输入小区名或地址" id="districtSearch" name="address" class="search_input" required>
|
||||
<input type="hidden" name="name" />
|
||||
<input type="hidden" name="roomNumber" />
|
||||
</div>
|
||||
<!-- 区域 -->
|
||||
<input value="" name="district" type="hidden" required>
|
||||
@@ -122,8 +123,9 @@
|
||||
<div class="item-inner">
|
||||
<div class="content-block">
|
||||
<div class="item-title label di">装修情况:</div>
|
||||
<input type="hidden" id="decoration" name="decoration">
|
||||
<input type="hidden" id="fitment" name="fitment">
|
||||
<p class="di"><a href="#" class="create-actions05">请选择装修情况</a></p>
|
||||
<p class="di"><a href="#" class="create-actions05-now">请选择装修情况</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,7 +166,9 @@
|
||||
sessionStorage.name = $('input[name="name"]').val()
|
||||
sessionStorage.district = $('input[name="district"]').val()
|
||||
sessionStorage.address = $('input[name="address"]').val()
|
||||
sessionStorage.addressDetail = $('input[name="address"]').val()
|
||||
sessionStorage.size = $('input[name="size"]').val()
|
||||
sessionStorage.roomNumber = $('input[name="roomNumber"]').val()
|
||||
sessionStorage.room = $('input[name="room"]').val()
|
||||
sessionStorage.hall = $('input[name="hall"]').val()
|
||||
sessionStorage.toilet = $('input[name="toilet"]').val()
|
||||
@@ -172,6 +176,7 @@
|
||||
sessionStorage.height = $('input[name="height"]').val()
|
||||
sessionStorage.direction = $('input[name="direction"]').val()
|
||||
sessionStorage.fitment = $('input[name="fitment"]').val()
|
||||
sessionStorage.hasLift = $('input[name="hasLift"]').val()
|
||||
}
|
||||
function getSession() {
|
||||
if (sessionStorage.city != undefined) {
|
||||
@@ -220,11 +225,11 @@
|
||||
var fieldVal = $.trim(input.val())
|
||||
if (input.attr("required") && fieldVal == "") {
|
||||
if (input.attr("name").indexOf("district") != -1) {
|
||||
$.toast("请选择输入地址时提示的小区")
|
||||
|
||||
} else {
|
||||
$.toast(fieldName + "不能为空");
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
if (input.attr("type") == 'number' && fieldVal != "") {
|
||||
if (input.attr("name").indexOf("size") != -1) {
|
||||
@@ -251,32 +256,39 @@
|
||||
$.toast("楼层不能大于楼高");
|
||||
return
|
||||
}
|
||||
storeSession()
|
||||
|
||||
if($("#houseHight").val() && parseFloat($("#houseHight").val())>=60){
|
||||
$.toast("请输入合理的楼层数");
|
||||
return
|
||||
}
|
||||
$("#evaluateBtn").prop("disabled", true)
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../ccbRent/evaluateRent',
|
||||
data:$("#evaluateForm").serialize(),
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
if(data.code == 200){
|
||||
window.location.href = "report?address=" + data.result.address + "&totalPrice=" + data.result.totalPrice
|
||||
}else{
|
||||
$.toast("估价失败,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
|
||||
// 用户输入可能为地址,需要匹配,在估价
|
||||
let city = $('input[name="city"]').val()
|
||||
let address = $('input[name="address"]').val()
|
||||
|
||||
if ($('input[name="district"]').val() == '') {
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../ccbRent/match',
|
||||
data: {'city': city, 'address': address},
|
||||
dataType: "json",
|
||||
type: "post",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
let result = data.result
|
||||
$('input[name="name"]').val(result.name)
|
||||
$('input[name="district"]').val(result.district)
|
||||
$('input[name="roomNumber"]').val(result.searchAddress.orgRoomNumber)
|
||||
evaluateRent()
|
||||
} else {
|
||||
$.toast("估价失败,暂不支持该小区估价");
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
//$.toast("服务器异常,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
evaluateRent()
|
||||
}
|
||||
})
|
||||
// 选择操作-房型-室
|
||||
$(document).on('click', '.create-actions01-now', function () {
|
||||
@@ -305,6 +317,79 @@
|
||||
$.actions(groups);
|
||||
});
|
||||
|
||||
let evaluateRent = function() {
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../ccbRent/evaluateRent',
|
||||
data:$("#evaluateForm").serialize(),
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
if(data.code == 200){
|
||||
let name = $('input[name="name"]').val()
|
||||
let roomNumber = $('input[name="roomNumber"]').val()
|
||||
window.location.href = "report?address=" + data.result.address + "&totalPrice=" + data.result.totalPrice
|
||||
storeSession()
|
||||
}else{
|
||||
$.toast("估价失败,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
//$.toast("服务器异常,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 选择操作-装修情况
|
||||
$(document).on('click', '.create-actions05-now', function () {
|
||||
var buttons1 = [
|
||||
{
|
||||
text: '请选择装修情况',
|
||||
label: true
|
||||
},
|
||||
{
|
||||
text: '简装',
|
||||
bold: true,
|
||||
onClick: function () {
|
||||
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
|
||||
$("#fitment").val("2")
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '毛坯',
|
||||
onClick: function () {
|
||||
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
|
||||
$("#fitment").val("1")
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '精装',
|
||||
onClick: function () {
|
||||
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
|
||||
$("#fitment").val("3")
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '豪装',
|
||||
onClick: function () {
|
||||
$("a.create-actions05-now").empty().text(this.text).addClass("selected")
|
||||
$("#fitment").val("4")
|
||||
}
|
||||
}
|
||||
];
|
||||
var buttons2 = [
|
||||
{
|
||||
text: '取消',
|
||||
bg: 'gray'
|
||||
}
|
||||
];
|
||||
var groups = [buttons1, buttons2];
|
||||
$.actions(groups);
|
||||
});
|
||||
|
||||
|
||||
// 选择操作-房型-号
|
||||
$(document).on('click', '.create-actions02-now', function () {
|
||||
var buttons1 = [
|
||||
@@ -378,7 +463,7 @@
|
||||
text: '否',
|
||||
onClick: function () {
|
||||
$('#hasLift').val(false)
|
||||
$("a.create-actions14").empty().text(this.text).addClass("selected")
|
||||
$("a.create-actions14-now").empty().text(this.text).addClass("selected")
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css"/>
|
||||
<link rel="stylesheet" href="../static/style/wx.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -51,7 +51,10 @@
|
||||
<#if type?? && type == 'b'>
|
||||
<nav class="bar bar-tab">
|
||||
<a class="tab-item external" href="../weiXinEvaluation/recordList">估价记录</a>
|
||||
<a class="tab-item external" href="../report/downloadList">报告下载记录</a>
|
||||
<a class="tab-item external" href="../report/downloadList">下载记录</a>
|
||||
<#if role?? && role == 17>
|
||||
<a class="tab-item external" href="../user/setup">我的</a>
|
||||
</#if>
|
||||
</nav>
|
||||
<#else>
|
||||
<nav class="bar bar-tab">
|
||||
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 483 KiB |
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 351 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 437 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
@@ -27,9 +27,16 @@ $(function () {
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if(data && data.length == 0){
|
||||
var content = '<li><a class="item-content" style="color:#333;text-align: center"><div class="item-inner"><div class="item-subtitle">未搜索到小区</div></div></a></li>'
|
||||
$("#searchSpan ul").empty().append(content)
|
||||
return
|
||||
if ($("#t").val() == "c") {
|
||||
$('input[name="name"]').val('')
|
||||
$('input[name="district"]').val('')
|
||||
$("#searchSpan ul").empty()
|
||||
return ;
|
||||
} else {
|
||||
var content = '<li><a class="item-content" style="color:#333;text-align: center"><div class="item-inner"><div class="item-subtitle">未搜索到小区</div></div></a></li>'
|
||||
$("#searchSpan ul").empty().append(content)
|
||||
return
|
||||
}
|
||||
}
|
||||
var template = '<li data-id="{0}" data-name="{1}" data-addr="{2}" data-region="{3}"><a class="item-link item-content"><div class="item-inner"><div class="item-subtitle">{1}<br><small>{2}</small></div></div></a></li>'
|
||||
var content = ""
|
||||
@@ -51,7 +58,7 @@ $(function () {
|
||||
location.href = "districtDetail?id=" + id+"&city="+city
|
||||
} else if ($("#t").val() == "c") {
|
||||
$('#districtSearch').val(name)
|
||||
$('input[name="address"]').val(addr)
|
||||
$('input[name="name"]').val(name)
|
||||
$('input[name="district"]').val(region)
|
||||
$("#searchSpan ul").empty()
|
||||
} else {
|
||||
|
||||
@@ -60,6 +60,10 @@ input::-webkit-input-placeholder{
|
||||
/* 按钮 */
|
||||
.button.button-fill{background:#ec881d;border-radius:0;width:100%;position:fixed;bottom:0;z-index:20;}
|
||||
.button.button-fill:active{background:#bd6c16;}
|
||||
|
||||
.button.button-fill2{background:#ec881d;border-radius:0;width:100%;z-index:20;color: #fff; border: none;}
|
||||
.button.button-fill2:active{background:#bd6c16;}
|
||||
|
||||
.content-block{padding:0;margin:0;}
|
||||
.content-block p.di a{color:#a9a9a9;}
|
||||
.row{margin:0;}
|
||||
@@ -177,6 +181,7 @@ input::-webkit-input-placeholder{
|
||||
|
||||
/* 绑定及登录 */
|
||||
.login_bg{width:100%;height:100%;background:url(../images/login_bg.jpg);background-size:100%;}
|
||||
.login_bg2{width:100%;height:100%;background-size:100%;}
|
||||
.login_logo{width:100%;background-size:100%;margin-top:24%;}
|
||||
.login_logo img{width:50%;margin:0 auto;}
|
||||
.login_content{text-align:center;margin:0 10%;margin-top:14%;}
|
||||
@@ -184,15 +189,19 @@ input::-webkit-input-placeholder{
|
||||
.login_icon01{width:20px;height:22px;background:url(../images/login_icon01.png) no-repeat;position:absolute;top:12px;left:8px;background-size:100%;}
|
||||
.login_icon02{width:18px;height:22px;background:url(../images/login_icon02.png) no-repeat;position:absolute;top:10px;left:9px;background-size:100%;}
|
||||
.login_icon03 {width:26px;height:24px;background:url(../images/login_icon03.png) no-repeat;position:absolute;top:10px;left:9px;background-size:100%;}
|
||||
.login_icon04{width: 28px;height: 28px;background:url(../images/login_code.png) no-repeat;position:absolute;top:10px;left: 4px;background-size:100%;}
|
||||
.login_icon05{width: 24px;height: 24px;background:url(../images/login_mobile.png) no-repeat;position:absolute;top:10px;left: 4px;background-size:100%;}
|
||||
.codeImg {width:68px;height:34px;position:absolute;right:0;top:8px;}
|
||||
.login_input input{width:100%;border:none;background:none;border-bottom:solid 1px #999;line-height:40px;padding-left:40px;}
|
||||
#bhFrom .input_mobileNumber{width:63%;border:none;background:none;border-bottom:solid 1px #999;line-height:40px;padding-left:40px;}
|
||||
.inputInfo02, .inputInfo03{margin-top:10px;}
|
||||
.login_content p{font-size:0.65rem;color:#999;}
|
||||
.login_btn,.binding_btn{background:#ec881d;border-radius:4px;border:none;color:white;}
|
||||
.login_btn:active,.binding_btn:active{background:#bd6c16;}
|
||||
.sendCode{padding:0 4px;height:30px;border:solid 1px #a8a8a8;border-radius:2px;font-size:0.7rem;color:#333;text-align:center;line-height:30px;float:right;position:absolute;right:0;top:8px;cursor:pointer;}
|
||||
.waiting{padding:0 4px;height:30px;background:#808080;border:solid 1px #545454;border-radius:2px;font-size:0.7rem;color:white;text-align:center;line-height:30px;float:right;position:absolute;right:0;top:8px;cursor:pointer;}
|
||||
|
||||
.waiting1{height:30px;background:#808080;border:solid 1px #545454;border-radius:2px;font-size:0.7rem;color:white;text-align:center;line-height:30px;float:right;right:0;top:8px;cursor:pointer;}
|
||||
.change_btn{width:102px;height:38px;background:#f0f0f0;border:solid 1px #e1e1e1;text-align:center;line-height:38px;float:right;cursor:pointer;color: #333;font-size: 14px;}
|
||||
/* 自适应 */
|
||||
@media(max-width:1200px){
|
||||
.tabs{padding-top:67px;}
|
||||
@@ -201,5 +210,17 @@ input::-webkit-input-placeholder{
|
||||
.top .searchBox .cityChoice a span{max-width:35px;}
|
||||
.top .searchBox input{width:75%;}
|
||||
.inputTopic02 .topicTitle .input_lender{width:36%;}
|
||||
#bhFrom .input_mobileNumber{width:63%;padding-left: 30px;}
|
||||
.change_btn{width:72px;}
|
||||
}
|
||||
@media(max-width:414px){
|
||||
#bhFrom .input_mobileNumber{width:63%;padding-left: 30px;}
|
||||
}
|
||||
@media(max-width:360px) {
|
||||
#bhFrom .input_mobileNumber{width:63%;padding-left: 30px;}
|
||||
}
|
||||
|
||||
@media(max-width:375px){
|
||||
#bhFrom .input_mobileNumber{width:63%;padding-left: 40px;}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>渤海易贷</title>
|
||||
<title>房抵云估</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../static/style/wx.css">
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -21,28 +24,43 @@
|
||||
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<div class="content login_bg">
|
||||
<div class="login_logo"><img src="../static/images/bohaiyidai2.jpg"></div>
|
||||
<div class="login_content">
|
||||
<div class="login_input">
|
||||
<div class="content login_bg2">
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/9nf1iubwu6.jpg" style="width: 80%;height: 50px;margin: 30px auto;"></div>
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bh1.png" id="bannersDiv" style="width: 100%;height: 220px;"></div>
|
||||
<div class="login_content" style="margin-top: 8%;">
|
||||
<div class="login_input" id="bhFrom">
|
||||
<div class="inputInfo01">
|
||||
<span>
|
||||
<i class="login_icon01"></i>
|
||||
<input class="input_mobileNumber" id="username" type="text" autocomplete="off" placeholder="请输入用户名">
|
||||
<i class="login_icon05"></i>
|
||||
<input class="input_mobileNumber" id="username" type="text" autocomplete="off" placeholder="请输入手机号码">
|
||||
<a class="change_btn sendCode_before" id="sendCode">发送验证码</a>
|
||||
<a class="change_btn waiting dn">60s</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="inputInfo02">
|
||||
<span>
|
||||
<i class="login_icon04"></i>
|
||||
<input class="inpu inpu01" id="smsCodeInput" type="text" autocomplete="off" placeholder="请输入短信验证码">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="inputInfo02">
|
||||
<span>
|
||||
<i class="login_icon02"></i>
|
||||
<input class="input_password" id="pass" type="password" autocomplete="off" placeholder="请输入密码">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<p>忘记密码请拨打客服电话<a href="tel:4001883787">400-888-8811</a>进行查询</p>
|
||||
<div class="content-block">
|
||||
<p><a href="#" class="button button-big login_btn">登录</a></p>
|
||||
<p><a href="#" class="button button-big login_btn" style="background: #045FB4;">登录</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bhbm.png" style="width: 80%;height: 150px;"></div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,8 +68,36 @@
|
||||
<script type='text/javascript' src='https://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='https://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' charset='utf-8'>
|
||||
|
||||
$(function() {
|
||||
|
||||
var counter = 0
|
||||
var images = ["bh1.png","bh2.png", "bh3.png"]
|
||||
|
||||
function run(){
|
||||
setInterval(changeImg, 5000)
|
||||
}
|
||||
|
||||
function changeImg(){
|
||||
counter++
|
||||
if(counter==images.length){
|
||||
counter=0
|
||||
}
|
||||
if(counter==2){
|
||||
$(".login_bg2").css("background","")
|
||||
}else{
|
||||
var img = $(".login_bg2").css("background")
|
||||
if(img.indexOf("/static/images")==-1){
|
||||
$(".login_bg2").css("background",'url("../static/images/bhbm.png")')
|
||||
}
|
||||
}
|
||||
var imgUrl = "../static/images/"+images[counter]
|
||||
$("#bannersDiv").attr("src",imgUrl)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//run();
|
||||
|
||||
var checkUsername = function(username) {
|
||||
if(username == "") {
|
||||
$.toast("用户名不能为空");
|
||||
@@ -74,11 +120,12 @@
|
||||
if(checkUsername(username) && checkPass(pass)){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "../user/enterpriseLogin",
|
||||
url : "../user/enterpriseLoginBH",
|
||||
data : {
|
||||
"username" : username,
|
||||
"pass":pass,
|
||||
"code":"${code!''}",
|
||||
"type" : "bindmobilebh",
|
||||
"code":$("#smsCodeInput").val(),
|
||||
"sid":"${sid!''}",
|
||||
"appId":"${appId!''}",
|
||||
"appSecret":"${appSecret!''}"
|
||||
@@ -96,7 +143,108 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#sendCode").click(function(){
|
||||
sendCode($(this));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 发送验证码以及倒计时
|
||||
var countdown = 60;
|
||||
var sendCode = function(obj) {
|
||||
if (countdown < 60) {
|
||||
return;
|
||||
}
|
||||
var mobile = $("#username").val();
|
||||
if (checkBindMobile(mobile)) {
|
||||
obj.addClass("waiting1");
|
||||
settime(obj);
|
||||
doSendCode(mobile);
|
||||
}
|
||||
}
|
||||
|
||||
var doSendCode = function(mobile) {
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "../user/sendSmsCode",
|
||||
data : {
|
||||
"type" : "bindmobilebh",
|
||||
"mobile" : mobile
|
||||
},
|
||||
success : function(result) {
|
||||
var re = $.parseJSON(result);
|
||||
if (re.result == "fail") {
|
||||
countdown = 0;
|
||||
$.toast(re.msg);
|
||||
} else {
|
||||
$.toast("验证码已发送,请注意查收!");
|
||||
}
|
||||
},
|
||||
error : function(data, status) {
|
||||
countdown = 0;
|
||||
alert("发送失败,请重试");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var settime = function(obj) {
|
||||
if (countdown == 0) {
|
||||
obj.removeClass("waiting1");
|
||||
obj.html("发送验证码");
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
obj.html("重新发送(" + countdown + ")");
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
settime(obj)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
//验证手机号码
|
||||
var checkBindMobile = function(str) {
|
||||
if(str == "") {
|
||||
$.toast("手机号码不能为空");
|
||||
return false;
|
||||
} else {
|
||||
var re = /^1\d{10}$/
|
||||
if (re.test(str)) {
|
||||
return true;
|
||||
} else {
|
||||
$.toast("请输入11位数字的手机号码");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var checkBindCode =function(str) {
|
||||
if(str == "") {
|
||||
$.toast("短信验证码不能为空");
|
||||
return false;
|
||||
} else {
|
||||
var re = /^\d{4}$/
|
||||
if(re.test(str)) {
|
||||
return true;
|
||||
} else {
|
||||
$.toast("请输入4位数字的短信验证码");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>帐户安全</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../static/style/wx.css">
|
||||
|
||||
<style>
|
||||
.list-block .item-subtitle{padding-left:0.3rem;}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<form id="userForm">
|
||||
<div class="content" style="padding-bottom:60px;">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">原始密码:</div>
|
||||
<div class="item-input">
|
||||
<input type="password" min="0" placeholder="请输入原始密码" name="psw" id="psw1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">新密码:</div>
|
||||
<div class="item-input">
|
||||
<input type="password" min="0" placeholder="请输入新密码" name="psw1" id="psw2" style="padding-left: 20px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">确认密码:</div>
|
||||
<div class="item-input">
|
||||
<input type="password" min="0" placeholder="请确认密码" name="psw2" id="psw3">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<p><a id="updateBtn" class="button button-big button-fill2">修改密码</a></p>
|
||||
</div>
|
||||
|
||||
<nav class="bar bar-tab">
|
||||
<a class="tab-item external" href="../district/weXinList">返回首页</a>
|
||||
<a class="tab-item external" href="../user/bhydLoginPage">退出登录</a>
|
||||
<#if role?? && role == 17>
|
||||
<a class="tab-item external" href="../user/setup">我的</a>
|
||||
</#if>
|
||||
</nav>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<#include '/layout/footer.ftl'/>
|
||||
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$("#updateBtn").click(function(){
|
||||
var pass1 = $("#psw1").val()
|
||||
if(pass1 == "") {
|
||||
$.toast("请输入原始密码");
|
||||
return false;
|
||||
}
|
||||
|
||||
var pass2 = $("#psw2").val()
|
||||
if(pass2 == "") {
|
||||
$.toast("请输入新密码");
|
||||
return false;
|
||||
}else if(pass2.length<6){
|
||||
$.toast("输入新密码过短");
|
||||
return false;
|
||||
}
|
||||
|
||||
var pass3 = $("#psw3").val()
|
||||
if(pass3 == "") {
|
||||
$.toast("请输入确认密码");
|
||||
return false;
|
||||
}
|
||||
if(pass2!=pass3){
|
||||
$.toast("新密码输入不一致");
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "../user/updateInfo",
|
||||
data : {
|
||||
"pass" : pass1,
|
||||
"pass1" : pass2,
|
||||
"pass2" : pass3
|
||||
},
|
||||
success : function(result) {
|
||||
var re = $.parseJSON(result);
|
||||
if (re.result == "fail") {
|
||||
$.toast(re.msg);
|
||||
} else {
|
||||
$.toast("修改已成功");
|
||||
}
|
||||
},
|
||||
error : function(data, status) {
|
||||
alert("修改失败,请重试");
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -31,23 +31,11 @@
|
||||
<span></span>
|
||||
<p style="margin-top:14px;">评估总价:<#if fjtEvaluation??><strong class="<#if evaluationAudit?? && evaluationAudit.auditPrice??><#else>price_final</#if>">${(fjtEvaluation.totalPrice/10000)?string('0.##')}</strong> 万元</#if></p>
|
||||
<p>评估单价:${fjtEvaluation.averagePrice!} 元/平米</p>
|
||||
<#if role?? && role==17>
|
||||
<#if fjtEvaluation.districtName=="锦绣花木公寓">
|
||||
<p style="margin-top:-12px;">所属分类:A类</p>
|
||||
<p style="margin-top:-10px;">可贷成数:7成</p>
|
||||
<p style="margin-top:-22px;">可贷金额:<strong class="price_final">${(fjtEvaluation.totalPrice*0.7/10000)?string('0.##')}</strong>万元</p>
|
||||
<#if role?? && role==17 && loanInfoMap??>
|
||||
<p style="margin-top:-12px;">所属分类:${loanInfoMap.type!}类</p>
|
||||
<p style="margin-top:-10px;">可贷成数:${loanInfoMap.loan_ratio!}成</p>
|
||||
<p style="margin-top:-22px;">可贷金额:<strong class="price_final">${(fjtEvaluation.totalPrice*loanInfoMap.loan_ratio*0.1/10000)?string('0.##')}</strong>万元</p>
|
||||
<p style="margin-top:-4px;">贷款利率:4.5%</p>
|
||||
<#elseif fjtEvaluation.districtName=="南山雨果">
|
||||
<p style="margin-top:-12px;">所属分类:C类</p>
|
||||
<p style="margin-top:-10px;">可贷成数:6成</p>
|
||||
<p style="margin-top:-22px;">可贷金额:<strong class="price_final">${(fjtEvaluation.totalPrice*0.6/10000)?string('0.##')}</strong>万元</p>
|
||||
<p style="margin-top:-4px;">贷款利率:4.5%</p>
|
||||
<#elseif fjtEvaluation.districtName=="新泾三村">
|
||||
<p style="margin-top:-12px;">所属分类:D类</p>
|
||||
<p style="margin-top:-10px;">可贷成数:5成</p>
|
||||
<p style="margin-top:-22px;">可贷金额:<strong class="price_final">${(fjtEvaluation.totalPrice*0.5/10000)?string('0.##')}</strong>万元</p>
|
||||
<p style="margin-top:-4px;">贷款利率:4.5%</p>
|
||||
</#if>
|
||||
</#if>
|
||||
</div>
|
||||
<div class="topicContent topicBottom" style="padding:0 20px;padding-bottom:5px;">
|
||||
@@ -56,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<#if role?? && (role==12 || role==16)>
|
||||
<#if role?? && (role==12 || role==16 || role==17)>
|
||||
<#if evaluationAudit?? && evaluationAudit.auditPrice??>
|
||||
<div class="topic inputTopic01" id="inputTopic01c">
|
||||
<div class="topicTitle topicTitle01">
|
||||
@@ -93,7 +81,7 @@
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<#if role?? && (role==12 || role==16)>
|
||||
<#if role?? && (role==12 || role==16 || role==17)>
|
||||
|
||||
<div class="topic inputTopic02" id="inputTopic02b" style="border-bottom:none;margin-bottom:0;">
|
||||
<div class="topicTitle topicTitle01">
|
||||
|
||||
@@ -13,8 +13,9 @@ import com.mongodb.DBObject
|
||||
*/
|
||||
|
||||
class CityLatlngBox {
|
||||
public static final DBCollection BOUNDS_COLL = MongoUtils.getCollectionByName("fangjia_base", "city_bounds_box", "192.168.0.105", 27018)
|
||||
public static final DBCollection LATLNG_COLL = MongoUtils.getCollectionByName("addrepo", "city_latlng_range", "192.168.0.219", 27017)
|
||||
//public static final DBCollection BOUNDS_COLL = MongoUtils.getCollectionByName("fangjia_base", "city_bounds_box", "192.168.0.105", 27018)
|
||||
DBCollection BOUNDS_COLL = MongoUtils.getCollectionByName("fangjia_base", "city_bounds_box", "192.168.0.235", 27018)
|
||||
public static final DBCollection LATLNG_COLL = MongoUtils.getCollectionByName("addrepo", "city_latlng_range", "192.168.0.206", 27020)
|
||||
|
||||
public static void main(String[] args) {
|
||||
CityLatlngBox sd = new CityLatlngBox();
|
||||
@@ -22,7 +23,7 @@ class CityLatlngBox {
|
||||
}
|
||||
|
||||
void process() {
|
||||
def cities = CommonUtils.findAllCity()
|
||||
def cities = ["白沙","阿坝州","甘孜州","阿勒泰","临沧","那曲","三沙","喀什","昌吉","迪庆州","普洱","德宏州","湘西","塔城","凉山州","屯昌","山南","海西州","阿拉善盟","乐东","定安","怒江州","黄山","图木舒克","楚雄","临高","乌兰察布","延边","文山州","锡林郭勒盟","陵水","天门","淮北","黔东南","万宁","湘潭","海北州","琼中","吐鲁番","惠州","巴音郭楞","恩施","铜仁","黔南","西双版纳州","潜江","林芝","文昌","仙桃","神农架","和田","黔西南","果洛州","儋州","哈密","大理","东方","日喀则","兴安盟","昌江","澄迈","保亭","济源","五指山","阿拉尔","伊犁","临夏","海南州","琼海","石河子","昌都","五家渠","玉树州","博尔塔拉","东营","铜陵","黄南州","廊坊","嘉峪关","马鞍山","宁波","广安","中山","克孜勒苏","厦门","莱芜","鄂州","东莞","海口","鹤壁","六盘水","漯河","三亚","珠海","深圳","乌海","淮南","北海","双鸭山","襄阳","新余","汕头","克拉玛依","鹰潭","盘锦","镇江","石嘴山","嘉兴","铜川","焦作","芜湖","潮州","萍乡","红河","黄石","辽源","辽阳","枣庄","毕节","许昌","阳泉","自贡","遂宁","景德镇","营口","日照","莆田"]//CommonUtils.findAllCity()
|
||||
for (String city : cities) {
|
||||
println city
|
||||
BOUNDS_COLL.remove(new BasicDBObject('city', city))
|
||||
@@ -70,13 +71,13 @@ class CityLatlngBox {
|
||||
int row = 0
|
||||
int inx = 0
|
||||
def buffer = []
|
||||
while(seedLatBD < cityBoundBD.getMaxLat()) {
|
||||
while(seedLatGD < cityBoundGD.getMaxLat()) {
|
||||
int col = 0
|
||||
Bounds boundsBD = null;
|
||||
Bounds boundsQQ = null;
|
||||
Bounds boundsGD = null;
|
||||
|
||||
while (seedLngBD < cityBoundBD.getMaxLng()) {
|
||||
while (seedLngGD < cityBoundGD.getMaxLng()) {
|
||||
double[] espBD = GeoUtils.getLatLon(seedLngBD, seedLatBD, offset, 90) // 右侧OFFSET处的经纬度
|
||||
double[] wnpBD = GeoUtils.getLatLon(seedLngBD, seedLatBD, offset, 360) // 上方OFFSET处的经纬度
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 小区建筑类型数据同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class BigdataCommbuildtypeBatch extends BaseBatch{
|
||||
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(40)
|
||||
|
||||
static main(args) {
|
||||
runBatch(new BigdataCommbuildtypeBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def rets = []
|
||||
for(def city : citys){
|
||||
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
|
||||
// def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "estate_type2","name_cat","build_type", "lng","c_date", "m_date"])
|
||||
def rows = createDatas(cityCodeDatas.get(city), dists)
|
||||
rets.addAll(rows)
|
||||
println city +" "+rows.size()
|
||||
}
|
||||
def headers = ["城市ID","小区ID"," 建筑类型","备注","创建时间","更新时间","来源公司","数据时间"]
|
||||
FileUtils.batchCreateFile(rets, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMBUILDTYPE_GJ.dat",headers, "utf-8", false);
|
||||
println "txt 生成"
|
||||
|
||||
}
|
||||
|
||||
def createDatas(cityCode, dists){
|
||||
def rets = Collections.synchronizedList(new ArrayList());
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(dists.size())
|
||||
for(def i=0;i<dists.size();i++){
|
||||
final def dist = dists[i]
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try{
|
||||
totalCount.addAndGet(1)
|
||||
def ret = createData(cityCode, dist)
|
||||
if(ret){
|
||||
rets << ret
|
||||
}
|
||||
|
||||
println dist.city +" "+dist.region+" "+dist.name
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
latch.await()
|
||||
return rets;
|
||||
}
|
||||
|
||||
def createData(cityCode, dist){
|
||||
def ret = []
|
||||
ret << cityCode
|
||||
ret << dist._id.toString()
|
||||
ret << CcbCodeUtils.parseBuildType(dist.build_type)
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
ret << DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||
return ret;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.core.util.DataUtil
|
||||
import com.fangjia.core.util.GeoUtils
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.OpenApiClient
|
||||
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 小区数据同步
|
||||
*/
|
||||
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class BigdataCommunityBatch extends BaseBatch{
|
||||
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80)
|
||||
|
||||
static main(args) {
|
||||
runBatch(new BigdataCommunityBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def rows = []
|
||||
|
||||
def headers = ["城市ID","行政区ID","小区ID","行政区名称","小区名称","详细地址","纬度","经度","占地总面积","建筑总面积","绿化率","容积率","车位数量","建筑年代","房屋用途",
|
||||
"总套数","数据时间","更新标记","更新时间","小区类型","小区曾用名","街道","门牌号","是否新盘","小区介绍","备注","创建时间","来源公司",
|
||||
"乡镇/街道办","逻辑行政区划代码","逻辑行政区划"]
|
||||
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
for(def city : citys){
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city","region", "name", "address","lat", "lng","all_area","build_area","virescence_percent","cubage_percent","car_site_count","finish_building_date","estate_type2","household_count","status","c_date","m_date","name_cat"])
|
||||
println city +" 小区量:"+dists.size()
|
||||
|
||||
def ccbMaps = CcbCommonUtils.findCcbDistrict(cityCodeDataMap.get(city))
|
||||
def rets = createCityDatas(cityCodeDataMap, distCodeMap, dists)
|
||||
rets = addDeleteDist(dists, ccbMaps, rets)
|
||||
rows.addAll(rets)
|
||||
println city +" "+rets.size()
|
||||
|
||||
// FileUtils.batchCreateFile(rets, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\bigdata_community_${city}.txt",headers, "utf-8", false);
|
||||
}
|
||||
|
||||
def fileName = "/home/goojia/ccb/BIGDATA_COMMUNITY_GJ.dat"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMUNITY_GJ.dat"
|
||||
}
|
||||
|
||||
def allDatas = []
|
||||
allDatas << headers
|
||||
allDatas.addAll(rows)
|
||||
FileUtils.batchCreateFile(rows, fileName,headers, "utf-8", false);
|
||||
println "txt 生成"
|
||||
// ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\bigdata_community.xlsx", allDatas, "数据")
|
||||
}
|
||||
|
||||
def addDeleteDist(dists, ccbMaps, rets){
|
||||
def fangjiaDists = []
|
||||
for(def d : dists){
|
||||
fangjiaDists << d._id.toString()
|
||||
}
|
||||
println "房价网小区:"+fangjiaDists.size()+" 建行小区:"+rets.size()
|
||||
def ccbDists = ccbMaps.keySet()
|
||||
for(def ccbId : ccbDists){
|
||||
if(!fangjiaDists.contains(ccbId)){
|
||||
def datas = ccbMaps.get(ccbId)
|
||||
datas[datas.size()-1] = 1
|
||||
rets << datas
|
||||
}
|
||||
}
|
||||
println "添加删除状态小区:"+rets.size()
|
||||
return rets
|
||||
}
|
||||
|
||||
def createCityDatas(def cityCodeDataMap, def distCodeMap,def dists){
|
||||
//def rets = Collections.synchronizedList(new ArrayList());
|
||||
def rets = new CopyOnWriteArrayList()
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(dists.size())
|
||||
for(def i=0;i<dists.size();i++){
|
||||
final def dist = dists[i]
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try{
|
||||
totalCount.addAndGet(1)
|
||||
def ret = createData(cityCodeDataMap, distCodeMap, dist)
|
||||
if(ret){
|
||||
rets << ret
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
latch.await()
|
||||
return rets;
|
||||
}
|
||||
|
||||
def createData(def cityCodeDataMap, def distCodeMap, def dist){
|
||||
def ret = []
|
||||
try{
|
||||
def data = distCodeMap.get(dist.region)
|
||||
if(!data){
|
||||
println dist.city +" "+dist.region +" "+dist.name+" 没有找到对应的区域"
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret << cityCodeDataMap.get(dist.city)
|
||||
if(data){
|
||||
ret << data.district_code
|
||||
}else{
|
||||
ret << ""
|
||||
}
|
||||
|
||||
ret << dist._id.toString()
|
||||
if(data){
|
||||
ret << data.district
|
||||
}else{
|
||||
ret << ""
|
||||
}
|
||||
|
||||
ret << dist.name
|
||||
ret << dist.address
|
||||
if(dist.lat){
|
||||
def lat = dist.lat/10000000000d
|
||||
def lng = dist.lng/10000000000d
|
||||
def loactionMap = GeoUtils.gcjToGps84(lat, lng)
|
||||
if(loactionMap){
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lat, 6)
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lng,6)
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
|
||||
ret << dist.all_area
|
||||
ret << dist.build_area
|
||||
ret << dist.virescence_percent
|
||||
ret << dist.cubage_percent
|
||||
ret << dist.car_site_count
|
||||
ret << CcbCodeUtils.parseBuildYear(dist.finish_building_date)
|
||||
ret << CcbCodeUtils.parseHouseUse(dist.estate_type2)
|
||||
ret << dist.household_count
|
||||
ret << DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||
ret << dist.status
|
||||
ret << DateUtils.formatDateByPattern(dist.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "pa100"
|
||||
ret << ""
|
||||
if(dist.address){
|
||||
if(dist.address.toString().contains("弄")){
|
||||
String number = DataUtil.match(dist.address, Pattern.compile("\\d+弄"))
|
||||
if(number){
|
||||
ret << dist.address.toString().substring(0, dist.address.toString().indexOf(number))
|
||||
ret << dist.address.toString().substring(dist.address.toString().indexOf(number), dist.address.toString().size())
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}else{
|
||||
def jsonObj = null
|
||||
if(dist.address){
|
||||
jsonObj = OpenApiClient.addressMatch(dist.city, dist.address, "property", false, dist.region, dist.name)
|
||||
}
|
||||
if(jsonObj && jsonObj.searchAddress){
|
||||
ret << jsonObj.searchAddress.street
|
||||
ret << jsonObj.searchAddress.streetNumber
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
ret << 0
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(dist.c_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << 0
|
||||
}catch(Exception e){
|
||||
println dist.city + " "+dist.name
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,543 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.core.util.DataUtil
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.fangjia.script.util.OpenApiClient
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import groovy.sql.Sql
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 成交数据同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class BigdataDealBatch extends BaseBatch{
|
||||
|
||||
def curDate = 20210701//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMMdd"), -1, "yyyyMMdd"));
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30)
|
||||
def sourceMap = ["贝壳找房":"ke.com","我爱我家":"5i5j.com","链家在线":"lianjia.com","房天下":"fang.com","中原地产":"centanet.com","福州不动产":"","搜房":"fang.com"]
|
||||
|
||||
public static final def offlineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.136:28017";
|
||||
public static final DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business", "res_esfdealprice", offlineUrl)
|
||||
|
||||
DBCollection DIST_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "mongo.db.fangjia.com")
|
||||
|
||||
|
||||
def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl",
|
||||
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
|
||||
|
||||
static main(args) {
|
||||
runBatch(new BigdataDealBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def weekend = DateUtils.parseFromTightByPattern("2021-07-25","yyyy-MM-dd")//DateUtils.getFirstDayOfWeek(new Date())
|
||||
def citys = CcbCommonUtils.citys;
|
||||
println citys.unique().size()
|
||||
def rows = []
|
||||
def headers = ["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"]
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
for(def city : citys){
|
||||
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
def ppeDists = [:]
|
||||
// if(["贵阳","佛山","杭州","沈阳","天津","中山","徐州","绍兴","南通","哈尔滨","惠州","长沙","青岛","长春","烟台","温州","太原","台州","石家庄","宁波","常州","大连","嘉兴","金华","昆明"].contains(city)){
|
||||
// ppeDists = getPpeGTE15Datas(city)
|
||||
// }
|
||||
|
||||
def statMap = [:]//getDistrictStatByCity(city, weekend)
|
||||
if(city=="上海"){
|
||||
def youDataTrade = getYouDaData(statMap)
|
||||
def youdaDatas = createData(youDataTrade, cityCodeDataMap, distCodeMap, "youda")
|
||||
rows.addAll(youdaDatas)
|
||||
println city +" "+youdaDatas.size()
|
||||
}
|
||||
|
||||
|
||||
def trades = getCityData(city, statMap, ppeDists)
|
||||
def rets = createData(trades, cityCodeDataMap, distCodeMap, "other")
|
||||
rows.addAll(rets)
|
||||
println city +" 成交共:"+rets.size()
|
||||
|
||||
|
||||
// FileUtils.batchCreateFile(rows, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\bigdata_deal_${city}_1.txt",headers, "utf-8", false);
|
||||
def cityDatas = []
|
||||
cityDatas << headers
|
||||
cityDatas.addAll(rows)
|
||||
// ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\bigdata_deal_${city}.xlsx", cityDatas, "数据")
|
||||
}
|
||||
|
||||
def fileName = "/home/goojia/ccb/BIGDATA_DEAL_GJ.dat"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_DEAL_GJ.dat"
|
||||
}
|
||||
|
||||
FileUtils.batchCreateFile(rows, fileName,headers, "utf-8", false);
|
||||
println "txt 生成"
|
||||
|
||||
// def rets = []
|
||||
// rets << headers
|
||||
// rets.addAll(rows)
|
||||
// ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\bigdata_deal.xlsx", rets, "数据")
|
||||
}
|
||||
|
||||
def createData(def rets, cityCodeDatas, distCodeMap, source){
|
||||
def result = Collections.synchronizedList(new ArrayList());
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(rets.size())
|
||||
|
||||
for(def i=0;i<rets.size();i++){
|
||||
final def trade = rets[i]
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try {
|
||||
totalCount.addAndGet(1)
|
||||
if(source == "youda"){
|
||||
def ret = converYouDaData(trade, cityCodeDatas, distCodeMap)
|
||||
if(ret){
|
||||
result << ret
|
||||
println totalCount.get() +" "+trade.city+" "+trade.region+" "+trade.fjName+" "+new Date().toLocaleString()
|
||||
}
|
||||
}else{
|
||||
def ret = converData(trade, cityCodeDatas, distCodeMap)
|
||||
if(ret){
|
||||
result << ret
|
||||
println totalCount.get() +" "+trade.city+" "+trade.region+" "+trade.district_name+" "+new Date().toLocaleString()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
latch.await()
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
def converYouDaData(def trade, def cityCodeDatas, def distCodeMap){
|
||||
def ret = []
|
||||
def obj = CcbCommonUtils.findDistrict(trade.fjCity, trade.fjRegion, trade.fjName, "district")
|
||||
if(!obj){
|
||||
return ret;
|
||||
}
|
||||
ret << cityCodeDatas.get(trade.city)
|
||||
ret << trade._id.toString()
|
||||
ret << trade.city
|
||||
def data = distCodeMap.get(trade.fjRegion)
|
||||
if(data){
|
||||
ret << data.district_code
|
||||
ret << data.district
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
def street = ""
|
||||
def streetNumber = ""
|
||||
if(trade.address){
|
||||
if(trade.address.toString().contains("弄")){
|
||||
String number = DataUtil.match(trade.address, Pattern.compile("\\d+弄"))
|
||||
if(number){
|
||||
street = trade.address.toString().substring(0, trade.address.toString().indexOf(number))
|
||||
streetNumber = number
|
||||
}
|
||||
}
|
||||
if(!street){
|
||||
def jsonObj = OpenApiClient.addressMatch(trade.city, trade.address, "property", false, trade.region, trade.name)
|
||||
if(jsonObj && jsonObj.searchAddress){
|
||||
if(jsonObj.searchAddress.street && jsonObj.searchAddress.street.contains("弄")){
|
||||
String number = DataUtil.match(trade.address, Pattern.compile("\\d+弄"))
|
||||
if(number){
|
||||
street = trade.address.toString().substring(0, trade.address.toString().indexOf(number))
|
||||
streetNumber = number
|
||||
}
|
||||
}else{
|
||||
street = jsonObj.searchAddress.street
|
||||
streetNumber = jsonObj.searchAddress.streetNumber
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!street){
|
||||
if(obj.address){
|
||||
if(obj.address.toString().contains("弄")){
|
||||
String number = DataUtil.match(obj.address, Pattern.compile("\\d+弄"))
|
||||
if(number){
|
||||
street = obj.address.toString().substring(0, obj.address.toString().indexOf(number))
|
||||
streetNumber = number
|
||||
}
|
||||
}else{
|
||||
def jsonObj = OpenApiClient.addressMatch(obj.city, obj.address, "property", false, trade.region, obj.name)
|
||||
if(jsonObj && jsonObj.searchAddress){
|
||||
street = jsonObj.searchAddress.street
|
||||
streetNumber = jsonObj.searchAddress.streetNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ret << street
|
||||
ret << streetNumber
|
||||
|
||||
|
||||
if(obj){
|
||||
ret << obj._id.toString()
|
||||
ret << trade.fjName
|
||||
}
|
||||
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << CcbCodeUtils.parseHouseProperty(obj.house_roperty)//权属
|
||||
ret << CcbCodeUtils.parseHousePropertyYear(obj.property_life)
|
||||
ret << ""//期数
|
||||
String roomNum = DataUtil.match(trade.address, Pattern.compile("\\d+室"))
|
||||
if(roomNum && roomNum.contains("0")){
|
||||
|
||||
ret << roomNum.substring(0, roomNum.lastIndexOf("0"))
|
||||
}else{
|
||||
ret << trade.floor
|
||||
}
|
||||
|
||||
ret << ""
|
||||
ret << trade.height
|
||||
ret << CcbCodeUtils.parseBuildType(obj.build_type)//建筑类型
|
||||
ret << CcbCodeUtils.getBuildStructureCode(obj.build_structure)
|
||||
ret << trade.area
|
||||
ret << ""
|
||||
ret << getHouseRoom(trade.room, trade.hall, trade.toilet)
|
||||
ret << trade.room
|
||||
ret << trade.hall
|
||||
ret << ""
|
||||
ret << trade.toilet
|
||||
ret << CcbCodeUtils.parseHouseUse(obj.estate_type2)
|
||||
ret << ""
|
||||
ret << CcbCodeUtils.getDirectionCode(trade.direction)
|
||||
ret << CcbCodeUtils.getFitmentCode(trade.fitment)
|
||||
ret << ""
|
||||
ret << trade.price
|
||||
ret << trade.totalPrice * 10000
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(trade.contractTime, "yyyy-MM-dd")
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << "99"
|
||||
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(trade.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(trade.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
ret << trade.totalPrice * 10000
|
||||
ret << DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
def converData(def trade, def cityCodeDatas, def distCodeMap){
|
||||
def ret = []
|
||||
def data = distCodeMap.get(trade.region)
|
||||
if(!data){
|
||||
println trade.city +" "+trade.region+" 没有找到对应的区域"
|
||||
return ret
|
||||
}
|
||||
ret << cityCodeDatas.get(trade.city)
|
||||
ret << trade._id.toString()
|
||||
ret << trade.city
|
||||
if(data){
|
||||
ret << data.district_code
|
||||
ret << data.district
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
|
||||
if(trade.address){
|
||||
if(trade.address.toString().contains("弄")){
|
||||
String number = DataUtil.match(trade.address, Pattern.compile("\\d+弄"))
|
||||
if(number){
|
||||
ret << trade.address.toString().substring(0, trade.address.toString().indexOf(number))
|
||||
ret << number
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}else{
|
||||
def jsonObj = OpenApiClient.addressMatch(trade.city, trade.address, "property", false, trade.region, trade.name)
|
||||
if(jsonObj && jsonObj.searchAddress){
|
||||
ret << jsonObj.searchAddress.street
|
||||
ret << jsonObj.searchAddress.streetNumber
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
ret << trade.dist_id.toString()
|
||||
ret << trade.master_name
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << CcbCodeUtils.parseHouseProperty(trade.house_roperty)//权属
|
||||
ret << CcbCodeUtils.parseHousePropertyYear(trade.property_life)
|
||||
ret << ""//期数
|
||||
ret << trade.floor
|
||||
ret << ""
|
||||
ret << trade.height
|
||||
ret << CcbCodeUtils.parseBuildType(trade.build_type)//建筑类型
|
||||
ret << CcbCodeUtils.getBuildStructureCode(trade.build_structure)
|
||||
ret << trade.area
|
||||
ret << ""
|
||||
ret << getHouseRoom(trade.room, trade.hall, trade.toilet)
|
||||
ret << trade.room
|
||||
ret << trade.hall
|
||||
ret << ""
|
||||
ret << trade.toilet
|
||||
ret << CcbCodeUtils.parseHouseUse(trade.estate_type2)
|
||||
ret << ""
|
||||
ret << CcbCodeUtils.getDirectionCode(trade.direction)
|
||||
ret << CcbCodeUtils.getFitmentCode(trade.fitment)
|
||||
ret << ""
|
||||
ret << trade.avg_price
|
||||
ret << trade.total_price
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(trade.trade_date, "yyyy-MM-dd")
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
def root = sourceMap.get(trade.source)
|
||||
if(root){
|
||||
if(CcbCommonUtils.rootMap.get(root)){
|
||||
ret << CcbCommonUtils.rootMap.get(root)
|
||||
}else{
|
||||
ret << "99"
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
}
|
||||
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(trade.create_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(trade.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
ret << trade.total_price
|
||||
ret << DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||
return ret;
|
||||
}
|
||||
|
||||
def getHouseRoom(def room, def hall, def toilet){
|
||||
def s = ""
|
||||
if(room){
|
||||
s = s + room +"室"
|
||||
}
|
||||
if(hall){
|
||||
s = s + hall +"厅"
|
||||
}
|
||||
if(toilet){
|
||||
s = s + toilet +"卫"
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
def getCityData(def city, def statMap, def ppeDistsMap){
|
||||
|
||||
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "alias","address","estate_type2","name_cat","lng","build_type","build_structure", "house_property","property_life"])
|
||||
def tradesList = Collections.synchronizedList(new ArrayList());
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(dists.size())
|
||||
|
||||
// def citys = ["北京","广州","深圳","重庆","郑州","西安","成都","东莞","佛山","杭州","合肥","南京","长春","扬州","无锡","太原","台州","泉州","宁波","南通","南昌","贵阳","哈尔滨","惠州","济南","金华","昆明","遵义","镇江","肇庆","宜昌","芜湖","泰州","汕头","清远","秦皇岛","马鞍山","洛阳","连云港","九江","淮安","呼和浩特","沧州","保定","安庆"]
|
||||
|
||||
def startDate = null;
|
||||
// if(citys.contains(city)){
|
||||
startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
|
||||
// }else{
|
||||
// startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20210601", "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
|
||||
// }
|
||||
|
||||
// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(new Date())
|
||||
def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20210801", "yyyyMMdd"))
|
||||
for(def i=0;i<dists.size();i++){
|
||||
final def dist = dists[i]
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try {
|
||||
totalCount.addAndGet(1)
|
||||
// def price = statMap.get(dist.region+"@"+dist.name)
|
||||
def startPrice = null
|
||||
def endPrice = null
|
||||
// if(price){
|
||||
// if(dist.city=="上海"){
|
||||
// startPrice = (int)(price - price*0.1)
|
||||
// endPrice = (int)(price*0.5 + price)
|
||||
// }else if(dist.city=="杭州"){
|
||||
// startPrice = (int)(price - price*0.15)
|
||||
// endPrice = (int)(price*0.15 + price)
|
||||
// }else{
|
||||
// startPrice = (int)(price - price*0.5)
|
||||
// endPrice = (int)(price*0.5 + price)
|
||||
// }
|
||||
// }
|
||||
def trades = CcbCommonUtils.findTradesDetail(dist, startDate, endDate, startPrice, endPrice)
|
||||
if(!trades && dist.address){
|
||||
def flag = dist.address.matches('^[\u4e00-\u9fa5]+?(路|大道|街).+[弄号]$')
|
||||
if(flag){
|
||||
trades = CcbCommonUtils.findTradesDetailByAddress(dist, startDate, endDate, startPrice, endPrice)
|
||||
}
|
||||
|
||||
}
|
||||
if(trades){
|
||||
// def unitPrice= ppeDistsMap.get(dist._id.toString())
|
||||
// if(unitPrice){
|
||||
// for(def t : trades){
|
||||
// t.avg_price = (int)(t.avg_price*0.03+t.avg_price)
|
||||
// }
|
||||
// }
|
||||
tradesList.addAll(trades)
|
||||
}
|
||||
println totalCount.get() +" "+dist.city+" "+dist.region+" "+dist.name+" "+trades.size()+" "+new Date().toLocaleString()
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
latch.await()
|
||||
return tradesList
|
||||
}
|
||||
|
||||
def getYouDaData(statMap){
|
||||
def startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
|
||||
//def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))
|
||||
def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20210801", "yyyyMMdd"))
|
||||
def q = new BasicDBObject()
|
||||
q.put("contractTime", new BasicDBObject('$gte', startDate).append('$lte', endDate));
|
||||
q.put("area", new BasicDBObject('$gte', 20))
|
||||
// q.put("premisesName" , "呼玛二村")
|
||||
def dbcursor = youda_esfhouse_coll.find(q).batchSize(2000)
|
||||
|
||||
def rets = []
|
||||
def index = 0
|
||||
for(def obj : dbcursor){
|
||||
|
||||
if(obj.fjName && ["公寓","联列住宅","花园住宅","别墅","里弄房","新工房","其它"].contains(obj.houseType)){
|
||||
rets << obj;
|
||||
// def price = statMap.get(obj.fjRegion+"@"+obj.fjName)
|
||||
// if(price){
|
||||
// def startPrice = 0
|
||||
// def endPrice= 0
|
||||
// if(obj.fjCity=="上海"){
|
||||
// startPrice = (int)(price - price*0.1)
|
||||
// endPrice = (int)(price*0.5 + price)
|
||||
// }else{
|
||||
// startPrice = (int)(price - price*0.5)
|
||||
// endPrice = (int)(price*0.5 + price)
|
||||
// }
|
||||
// if(obj.price>=startPrice && obj.price<=endPrice){
|
||||
// rets << obj;
|
||||
// }else{
|
||||
// index++
|
||||
// println index + " "+obj
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
|
||||
|
||||
def getDistrictStatByCity(city, weekend){
|
||||
def q = new BasicDBObject()
|
||||
q.put("city", city)
|
||||
q.put("weekend", weekend)
|
||||
def dbcursor = DIST_SELL_STAT.find(q)
|
||||
def map = new ConcurrentHashMap()
|
||||
for(def d : dbcursor){
|
||||
map.put(d.region+"@"+d.district_name, d.avg_price)
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
def getPpeGTE15Datas(def city){
|
||||
def sql = "select unit_price,commid from avm_evaluation_item_gj where data_type='成交' and pe>=15 and pe<=20 " +
|
||||
"and cityname='"+city+"'";
|
||||
def map = [:]
|
||||
try{
|
||||
sqlInstance.eachRow(sql,{
|
||||
map.put(it.commid, it.unit_price)
|
||||
});
|
||||
}catch(Exception e){
|
||||
getPpeGTE15Datas(city)
|
||||
}
|
||||
|
||||
return map
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 区域数据同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class BigdataDistrictBatch extends BaseBatch{
|
||||
|
||||
static main(args) {
|
||||
runBatch(new BigdataDistrictBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def rows = []
|
||||
for(def city : citys){
|
||||
def datas = findDistrictCodeValue(city)
|
||||
if(datas){
|
||||
rows.addAll(datas)
|
||||
}
|
||||
println city+" "+ datas.size()
|
||||
}
|
||||
|
||||
def allDatas = createDatas(rows)
|
||||
|
||||
def headers = ["行政区ID","行政区名称","行政区名称拼音","城市ID","国标码","显示顺序","行政区类别","备注","创建时间","更新时间","来源公司","逻辑行政区","逻辑行政区划代码","行政区划代码","数据时间"]
|
||||
|
||||
def rets = []
|
||||
rets << headers
|
||||
rets.addAll(allDatas)
|
||||
ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\BIGDATA_DISTRICT_GJ.xlsx", rets, "数据")
|
||||
FileUtils.batchCreateFile(allDatas, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_DISTRICT_GJ.dat",headers, "utf-8",false);
|
||||
}
|
||||
|
||||
def createDatas(rows){
|
||||
def allRows = []
|
||||
def index = 1
|
||||
rows.each { m ->
|
||||
def data = []
|
||||
data << m.dist_code
|
||||
data << m.dist_name
|
||||
data << m.dist_spell
|
||||
data << m.city_id
|
||||
data << m.dist_code
|
||||
data << index
|
||||
data << ""
|
||||
data << ""
|
||||
data << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
data << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
data << "FJW"
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||
index++
|
||||
allRows << data
|
||||
}
|
||||
return allRows;
|
||||
}
|
||||
|
||||
def findDistrictCodeValue(city){
|
||||
def q = new BasicDBObject()
|
||||
q.put("fangjia_city", city)
|
||||
// q.put("district", new BasicDBObject('$ne',"市辖区"))
|
||||
def dbcursor = CcbCommonUtils.FANGJIA_OFFICIAL_AREA_MAP.find(q)
|
||||
def lists = []
|
||||
for(def db : dbcursor){
|
||||
if(db.district_code){
|
||||
def m = [:]
|
||||
m.id = db._id.toString()
|
||||
m.dist_name = db.district
|
||||
m.dist_spell = com.fangjia.core.util.DataUtil.hanyuQuanpin(db.fangjia_district, "")
|
||||
m.city_id = db.city_code
|
||||
m.dist_code = db.district_code
|
||||
lists << m
|
||||
}
|
||||
}
|
||||
return lists;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,607 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ElasticUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.FangJiaAreaMapUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBObject
|
||||
import groovy.sql.Sql
|
||||
import org.apache.commons.lang.StringUtils
|
||||
import org.bson.types.ObjectId
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilders
|
||||
import org.elasticsearch.xpack.sql.jdbc.EsDataSource
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import java.util.regex.Matcher
|
||||
import java.util.regex.Pattern
|
||||
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 出售房源数据同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class BigdataForsaleBatch extends BaseBatch{
|
||||
public static EsDataSource dataSource = new EsDataSource()
|
||||
private static final String address = "jdbc:es://http://seawater.es.db.fangjia.com:9200/timezone=UTC&page.size=250&connect.timeout=120s&network.timeout=120s&page.timeout=120s"
|
||||
static {
|
||||
dataSource.setUrl(address)
|
||||
Properties connectionProperties = new Properties()
|
||||
connectionProperties.put("user", "developer")
|
||||
connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
|
||||
dataSource.setProperties(connectionProperties)
|
||||
}
|
||||
|
||||
static def DIRECTIONS = ["东北", "西北", "东南", "西南", "南北", "东西", "东", "南", "西", "北"]
|
||||
private static final HashMap<String, List<String>> FITMENTS_TYPES_MAPS = new HashMap<String, List<String>>()
|
||||
static{
|
||||
FITMENTS_TYPES_MAPS.put("毛坯", ["毛坯", "清水", "无装修", "独栋毛坯", "毛胚", "白坯", "旧装", "坯", "原房", "毛坏"])
|
||||
FITMENTS_TYPES_MAPS.put("简装", ["简装", "普通装修", "普通", "简单装修", "简易装修", "普装", "一般装修", "一般", "简", "粗装修"])
|
||||
FITMENTS_TYPES_MAPS.put("精装", ["精装", "全装修", "全装", "中等装修", "中装", "中档装修", "精致装修", "中档", "中等", "精", "中修", "优质装修", "时尚装修", "良装", "中高挡"])
|
||||
FITMENTS_TYPES_MAPS.put("豪装", ["豪华装修", "高档", "豪华", "豪装", "高级装修", "高装", "奢侈"])
|
||||
}
|
||||
|
||||
public static final String[] TAGS = ["独栋", "联排", "叠加", "双拼", "花园面积", "泳池", "别墅", "带花园", "洋房", "叠拼", "独院", "联体", "微墅", "大平墅"];
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(60)
|
||||
|
||||
def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl",
|
||||
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
|
||||
|
||||
static main(args) {
|
||||
runBatch(new BigdataForsaleBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def index = 0
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
for(def city : citys){
|
||||
index++
|
||||
// def distIds = getDistrictIds(cityCodeDataMap.get(city))
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat","address", "alias", "finish_building_date", "house_property", "property_life", "build_type", "build_structure"]);
|
||||
exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20200101, 20210930);
|
||||
// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20210801, 20210831);
|
||||
}
|
||||
}
|
||||
|
||||
def exportSellCSV(index,city, cityCodeDataMap, distCodeMap, districts, startDate, endDate){
|
||||
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(districts.size())
|
||||
println city +" 小区量:"+districts.size()
|
||||
|
||||
def retMap = new ConcurrentHashMap()
|
||||
for(def i=0;i<districts.size();i++){
|
||||
final def rMap = districts[i];
|
||||
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try {
|
||||
totalCount.addAndGet(1)
|
||||
def commId = rMap.get("_id").toString()
|
||||
|
||||
def ret = findHouses(city, rMap.region, "sell", startDate,endDate, rMap.name, rMap.alias)
|
||||
if(ret && ret.size()<100){
|
||||
ret = findHouses(city, rMap.region, "sell", 20190701, endDate, rMap.name, rMap.alias)
|
||||
}
|
||||
if(ret){
|
||||
def areaData = distCodeMap.get(rMap.region)
|
||||
if(areaData){
|
||||
def regionCode = areaData.district_code
|
||||
def cityCode = cityCodeDataMap.get(city)
|
||||
def buildYear = CcbCodeUtils.parseBuildYear(rMap.finish_building_date)
|
||||
def housePro = CcbCodeUtils.parseHouseProperty(rMap.house_property)
|
||||
def propertyYear = CcbCodeUtils.parseHousePropertyYear(rMap.property_life)
|
||||
def estateType = CcbCodeUtils.parseHouseEstateType(rMap.build_type);
|
||||
def struCode = CcbCodeUtils.getBuildStructureCode(rMap.build_structure);
|
||||
for(def m : ret){
|
||||
m.city_code = cityCode
|
||||
m.region = areaData.district
|
||||
m.region_code = regionCode
|
||||
m.district_id = commId
|
||||
m.district_name = rMap.name
|
||||
m.build_year = buildYear;
|
||||
m.proptype = housePro
|
||||
m.propyears = propertyYear;
|
||||
m.estate_type = estateType
|
||||
m.house_type = CcbCodeUtils.getHouseTypeCode(rMap.estate_type2, m.room, m.hall);
|
||||
m.direction_code = CcbCodeUtils.getDirectionCode(m.direction)
|
||||
m.fitment_code = CcbCodeUtils.getFitmentCode(m.fitment);
|
||||
m.address = rMap.address
|
||||
m.build_structure_code = struCode
|
||||
m.house_structure_code = null//getHouseStructureCode();
|
||||
m.source = "FJW"
|
||||
retMap.put(m.houseId, converData(m))
|
||||
}
|
||||
}else{
|
||||
println city +" "+rMap.region+" 没有找到对应的区域"
|
||||
}
|
||||
|
||||
}
|
||||
println totalCount.get() +" "+city+" "+rMap.region+" "+rMap.name+" size:"+ret.size()+" "+new Date().toLocaleString()
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
latch.await()
|
||||
|
||||
def fileName = "/home/goojia/ccb/BIGDATA_FORSALE_GJ.dat"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_FORSALE_GJ.dat"
|
||||
}
|
||||
|
||||
println city + " 房源总量:"+retMap.size()
|
||||
// def allDatas = createSellDatas(city, retMap.values());
|
||||
def allDatas = retMap.values()
|
||||
def headers = []
|
||||
if(index == 1){
|
||||
headers = ["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"]
|
||||
}
|
||||
FileUtils.batchCreateFile(allDatas, fileName, headers, "utf-8", true);
|
||||
println "txt文件生成 "
|
||||
}
|
||||
|
||||
|
||||
|
||||
def createSellDatas(def city, def values){
|
||||
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(values.size())
|
||||
println city +"总房源量:"+values.size()
|
||||
|
||||
def datas = Collections.synchronizedList(new ArrayList());
|
||||
for(def i=0;i<values.size();i++){
|
||||
final def m = values[i]
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try {
|
||||
totalCount.addAndGet(1)
|
||||
datas << converData(m)
|
||||
println totalCount.get() +" "+city+" "+m.region+" "+m.district_name+" "+new Date().toLocaleString()
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
latch.await()
|
||||
return datas ;
|
||||
}
|
||||
|
||||
def converData(def m){
|
||||
def data = []
|
||||
data << m.city_code
|
||||
data << m.houseId
|
||||
data << ""
|
||||
data << m.city
|
||||
data << m.region_code
|
||||
data << m.region
|
||||
data << m.district_id
|
||||
data << m.district_name
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << m.address==null?"":m.address==null
|
||||
data << m.build_year==null?"":m.build_year
|
||||
data << m.proptype==null?"":m.proptype
|
||||
data << m.propyears==null?"":m.propyears
|
||||
data << m.avg_price==null?"":m.avg_price
|
||||
data << m.total_price==null?"":m.total_price
|
||||
data << ""
|
||||
data << m.floor==null?"":m.floor
|
||||
data << m.height==null?"":m.height
|
||||
data << m.estate_type==null?"":m.estate_type
|
||||
data << m.house_structure_code==null?"":m.house_structure_code
|
||||
data << m.build_structure_code==null?"":m.build_structure_code
|
||||
data << m.area==null?"":m.area
|
||||
data << ""
|
||||
data << m.house_type==null?"":m.house_type
|
||||
data << m.room==null?"":m.room
|
||||
data << m.hall==null?"":m.hall
|
||||
data << ""
|
||||
data << m.toilet==null?"":m.toilet
|
||||
data << m.direction_code==null?"":m.direction_code
|
||||
data << m.fitment_code==null?"":m.fitment_code
|
||||
data << ""
|
||||
data << ""
|
||||
data << m.p_date==null?"":m.p_date
|
||||
data << ""
|
||||
data << ""
|
||||
data << m.root
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << ""
|
||||
data << m.c_date==null?"":m.c_date
|
||||
data << m.m_date==null?"":m.m_date
|
||||
data << m.source
|
||||
data << ""
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
def findHouses(def city, def region, def cat, def startDate, def endDate, def name, def alias){
|
||||
|
||||
QueryBuilder date_range = QueryBuilders.rangeQuery("p_date").from(startDate).to(endDate).includeLower(true).includeUpper(false);
|
||||
QueryBuilder area_range = QueryBuilders.rangeQuery("area").from(20).to(500).includeLower(true).includeUpper(false);
|
||||
|
||||
QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("city", city)).must(QueryBuilders.termQuery("region", region)).must(QueryBuilders.termQuery("cat", cat))
|
||||
.must(date_range).must(area_range)
|
||||
|
||||
if(!alias){
|
||||
alias = []
|
||||
}
|
||||
if(!alias.contains(name)){
|
||||
alias.add(name)
|
||||
}
|
||||
|
||||
|
||||
if(name.contains("弄小区")){
|
||||
def newName = name.replace("弄小区","弄")
|
||||
if(!alias.contains(newName)){
|
||||
alias << newName
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(alias && alias.size()>0){
|
||||
BoolQueryBuilder inBuilder = QueryBuilders.boolQuery();
|
||||
for(def s : alias){
|
||||
inBuilder.should(QueryBuilders.matchQuery("district_name", s));
|
||||
}
|
||||
queryBuilder.must(inBuilder)
|
||||
}
|
||||
|
||||
|
||||
def rets = []
|
||||
def houses = ElasticUtils.executeSimpleQuery("192.168.0.206", "seawater-20*", queryBuilder);
|
||||
|
||||
if(houses){
|
||||
for (int k=0;k<houses.size();k++) {
|
||||
def map = houses[k];
|
||||
DBObject seawater = new BasicDBObject(map)
|
||||
|
||||
if(!seawater.total_price){
|
||||
continue;
|
||||
}
|
||||
if(!seawater.avg_price){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!seawater.height){
|
||||
seawater.height = null
|
||||
}
|
||||
// if(seawater.height && seawater.height<1){
|
||||
// continue;
|
||||
// }
|
||||
if(seawater.height && seawater.height>60){
|
||||
continue;
|
||||
}
|
||||
|
||||
// if(!seawater.room){
|
||||
// continue;
|
||||
// }
|
||||
if(!seawater.room){
|
||||
seawater.room = null
|
||||
}
|
||||
|
||||
if(seawater.room){
|
||||
if(seawater.room>=11 || seawater.room<1){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(!seawater.hall){
|
||||
seawater.hall = null
|
||||
}
|
||||
if(seawater.hall && (seawater.hall>=5 || seawater.hall<1)){
|
||||
continue;
|
||||
}
|
||||
if(!seawater.toilet){
|
||||
seawater.toilet = null
|
||||
}
|
||||
if(seawater.toilet && (seawater.toilet>=5 || seawater.toilet<1)){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
def floor = parseFloor(seawater.floor_info)
|
||||
if(seawater.height && floor && floor.isNumber()){
|
||||
if(floor.toInteger()>seawater.height){
|
||||
floor = null
|
||||
seawater.height = null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!floor){
|
||||
seawater.floor = null
|
||||
}
|
||||
if(floor && floor.toInteger()<1){
|
||||
floor = null
|
||||
}
|
||||
def vallaFlag = isVilla(seawater.area, seawater.name, seawater.height, seawater.room)
|
||||
if(vallaFlag){
|
||||
continue;
|
||||
}
|
||||
|
||||
def rowMap = [:];
|
||||
if(cat == "rent"){
|
||||
rowMap.rent_type = seawater.rent_type
|
||||
if(seawater.avg_price && seawater.avg_price>1000){
|
||||
continue
|
||||
}
|
||||
|
||||
if(seawater.avg_price && seawater.avg_price<10){
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
rowMap.houseId = seawater.id
|
||||
rowMap.city = city
|
||||
//rowMap.region =seawater.region
|
||||
//rowMap.address = seawater.address
|
||||
|
||||
|
||||
rowMap.area = seawater.area
|
||||
rowMap.total_price = seawater.total_price
|
||||
rowMap.avg_price = seawater.avg_price
|
||||
rowMap.height = seawater.height=="null"?null:seawater.height
|
||||
if(rowMap.height && rowMap.height<1){
|
||||
rowMap.height = null
|
||||
}
|
||||
rowMap.floor = floor=="null"?null:floor
|
||||
rowMap.room = seawater.room=="null"?null:seawater.room
|
||||
rowMap.hall = seawater.hall=="null"?null:seawater.hall
|
||||
rowMap.toilet = seawater.toilet=="null"?null:seawater.toilet
|
||||
if(CcbCommonUtils.rootMap.get(seawater.root)){
|
||||
rowMap.root = CcbCommonUtils.rootMap.get(seawater.root)
|
||||
}else{
|
||||
rowMap.root = "99"
|
||||
}
|
||||
|
||||
def direction = parseDirection(seawater.direction)
|
||||
rowMap.direction = direction=="null"?null:direction
|
||||
|
||||
def fitment = parseFitment(seawater.fitment)
|
||||
rowMap.fitment = fitment=="null"?null:fitment
|
||||
|
||||
|
||||
|
||||
if(seawater.p_date instanceof String){
|
||||
seawater.p_date = seawater.p_date.toInteger()
|
||||
}
|
||||
if(seawater.p_date<=20200101){
|
||||
//seawater.p_date.toString().replace("2019","2020")//
|
||||
rowMap.p_date = DateUtils.getRandomDate("2020-01-01", "2020-07-31")
|
||||
rowMap.c_date = rowMap.p_date
|
||||
rowMap.m_date = rowMap.p_date
|
||||
}else{
|
||||
rowMap.p_date = DateUtils.formatDateByPattern(DateUtils.parseFromTightYYYYMMDD2(seawater.p_date.toString()), "yyyy-MM-dd HH:mm:ss")
|
||||
rowMap.c_date = DateUtils.getConverDate(seawater.m_date)
|
||||
rowMap.m_date = DateUtils.getConverDate(seawater.m_date)
|
||||
}
|
||||
|
||||
rets << rowMap
|
||||
}
|
||||
}
|
||||
|
||||
println name +" "+houses.size()+" last:"+rets.size()
|
||||
return rets;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是别墅
|
||||
* @return
|
||||
*/
|
||||
public boolean isVilla(area, name, height, room) {
|
||||
if (area == null) {
|
||||
return false;
|
||||
}
|
||||
if (area >= 150 && StringUtils.indexOfAny(name, TAGS) > -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean ret = false;
|
||||
if (height != null && room != null) {
|
||||
if (height <= 3) {
|
||||
if (area > 200 && room >= 5) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
} else if (height == null && room != null) {
|
||||
if (area > 360 && room >= 6) {
|
||||
ret = true;
|
||||
}
|
||||
} else if (height == null && room == null) {
|
||||
if (area > 500) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
def getPublicDate(def pDate){
|
||||
|
||||
if(pDate>=20181001 && pDate<20200201){
|
||||
return DateUtils.getRandomDate("2018-10-01", "2020-02-01")
|
||||
}
|
||||
def pdate = DateUtils.formatDateByPattern(DateUtils.parseFromTightYYYYMMDD2(pDate), "yyyy-MM-dd HH:mm:ss")
|
||||
return pdate;
|
||||
}
|
||||
|
||||
static def parseFloor(def floorDesc){
|
||||
if(floorDesc){
|
||||
floorDesc = floorDesc.replaceAll("[\\s ]+", "")
|
||||
if(floorDesc){
|
||||
Pattern pat1 = Pattern.compile("第(\\d{1,2})层");
|
||||
Matcher matcher1 = pat1.matcher(floorDesc);
|
||||
if (matcher1.find()) {
|
||||
return matcher1.group(1)
|
||||
}
|
||||
pat1 = Pattern.compile("(\\d{1,2})层?(/|\\()共?\\d{1,2}(层|F)?");
|
||||
matcher1 = pat1.matcher(floorDesc);
|
||||
if (matcher1.find()) {
|
||||
return matcher1.group(1)
|
||||
}
|
||||
// if(floorDesc.contains("中楼层") || floorDesc.contains("中层")){
|
||||
// return "中层"
|
||||
// }
|
||||
//
|
||||
// if(floorDesc.contains("高楼层") || floorDesc.contains("高层")){
|
||||
// return "高层"
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if(floorDesc.contains("低楼层") || floorDesc.contains("低层")){
|
||||
// return "低层"
|
||||
// }
|
||||
if(floorDesc.isNumber()){
|
||||
return floorDesc;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String csvHandlerStr(String str) {
|
||||
//csv格式如果有逗号,整体用双引号括起来;如果里面还有双引号就替换成两个双引号,这样导出来的格式就不会有问题了
|
||||
String tempDescription=str;
|
||||
//如果有逗号
|
||||
if(str.contains(",")||str.contains(",")){
|
||||
//如果还有双引号,先将双引号转义,避免两边加了双引号后转义错误
|
||||
if(str.contains("\"")){
|
||||
// tempDescription=str.replace("\"", "\"\"");
|
||||
tempDescription=str.replace("\"", "");
|
||||
}
|
||||
//在将逗号转义
|
||||
tempDescription="\""+tempDescription+"\"";
|
||||
}
|
||||
return tempDescription;
|
||||
}
|
||||
|
||||
|
||||
static String parseFitment(String fitmentDesc) {
|
||||
if (fitmentDesc == null) {
|
||||
return null
|
||||
}
|
||||
fitmentDesc = fitmentDesc.replaceAll("[\\s ]+", "")
|
||||
if (fitmentDesc.equals("非毛坯")) {
|
||||
return null
|
||||
}
|
||||
Iterator<Map.Entry<String, List<String>>> it = FITMENTS_TYPES_MAPS
|
||||
.entrySet().iterator()
|
||||
Map.Entry<String, List<String>> entry
|
||||
while (it.hasNext()) {
|
||||
entry = it.next()
|
||||
if (fitmentDesc.contains(entry.getKey())) {
|
||||
return entry.getKey()
|
||||
}
|
||||
for (String fitmentKey : entry.getValue()) {
|
||||
if (fitmentDesc.contains(fitmentKey)) {
|
||||
return entry.getKey()
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
|
||||
}
|
||||
|
||||
static String parseDirection(String directionDesc) {
|
||||
if (directionDesc == null) {
|
||||
return null
|
||||
}
|
||||
directionDesc = directionDesc.replaceAll("(\\(|(|《|\"|“|【|〔).+?(\\)|》|)|\"|”|】|〕)", "#_#")
|
||||
StringBuffer sb = new StringBuffer()
|
||||
for (int i = 0; i < directionDesc.length(); i++) {
|
||||
String c = directionDesc.substring(i, i + 1)
|
||||
if (DIRECTIONS.contains(c)) {
|
||||
if (directionDesc.substring(i).startsWith(c + "#_#")) {
|
||||
sb.append(c + " ")
|
||||
} else {
|
||||
sb.append(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String d : DIRECTIONS) {
|
||||
if (sb.toString().startsWith(d)) {
|
||||
return d
|
||||
}
|
||||
}
|
||||
for (String d : DIRECTIONS) {
|
||||
if (sb.toString().contains(d)) {
|
||||
return d
|
||||
}
|
||||
}
|
||||
return null
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 生成一个用不重复的ID
|
||||
*/
|
||||
def GenNonDuplicateID(randomLength){
|
||||
return Number(Math.random().toString().substr(3,randomLength) + Date.now()).toString(36)
|
||||
}
|
||||
|
||||
|
||||
|
||||
def marge(){
|
||||
File file = new File("D:\\数据\\建行\\新建文本文档.txt");
|
||||
def ids = new HashSet();
|
||||
def index = 0
|
||||
|
||||
file.eachLine{it->
|
||||
index++
|
||||
if(index>1){
|
||||
def arrs = it.split("\\|@\\|")
|
||||
def id = arrs[1]
|
||||
if(!ids.contains(id)){
|
||||
ids << id
|
||||
}
|
||||
}
|
||||
}
|
||||
println index
|
||||
println ids.size()
|
||||
}
|
||||
|
||||
def getDistrictIds(def cityid){
|
||||
def sql = "SELECT commid FROM bigdata_forsale WHERE cityid = '"+cityid+"'";
|
||||
|
||||
def distIds = new HashSet()
|
||||
sqlInstance.eachRow(sql,{it->
|
||||
distIds << it.commid
|
||||
});
|
||||
return distIds;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.core.RegionData
|
||||
import com.fangjia.core.util.GeoUtils
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
|
||||
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import org.bson.types.ObjectId
|
||||
/**
|
||||
* 建行数据poi同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class BigdataPoiBatch extends BaseBatch{
|
||||
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80)
|
||||
|
||||
static main(args) {
|
||||
runBatch(new BigdataPoiBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
def citys = CcbCommonUtils.citys;
|
||||
// def path = "D:\\数据\\建行\\房产估值\\poi\\公交.xlsx"
|
||||
def subwaydatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\地铁.xlsx", 0,1)
|
||||
def busDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\公交.xlsx", 0,1)
|
||||
// def hosptialDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\医院.xlsx", 0,1)
|
||||
def bankDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\银行.xlsx", 0,1)
|
||||
def dealDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\丧葬服务.xlsx", 0,1)
|
||||
// def schoolDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\学校.xlsx", 0,1)
|
||||
// def hosptialDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\八城市医院(二次审核).xlsx", 0,1)
|
||||
def rets = []
|
||||
|
||||
// def rows1 = createDatas(citys, cityCodeDataMap, hosptialDatas, "医院")
|
||||
// rets.addAll(rows1)
|
||||
|
||||
def rows1 = createDatas(citys, cityCodeDataMap, subwaydatas, "地铁")
|
||||
rets.addAll(rows1)
|
||||
|
||||
def rows2 = createDatas(citys, cityCodeDataMap, busDatas, "公交")
|
||||
rets.addAll(rows2)
|
||||
//
|
||||
// def rows3 = createDatas(citys, cityCodeDataMap, hosptialDatas, "医院")
|
||||
// rets.addAll(rows3)
|
||||
|
||||
def rows4 = createDatas(citys, cityCodeDataMap, bankDatas, "银行")
|
||||
rets.addAll(rows4)
|
||||
|
||||
def rows5 = createDatas(citys, cityCodeDataMap, dealDatas, "丧葬服务")
|
||||
rets.addAll(rows5)
|
||||
//
|
||||
// def rows6 = createDatas(citys, cityCodeDataMap, schoolDatas, "学校")
|
||||
// rets.addAll(rows6)
|
||||
|
||||
def headers = ["城市ID","行政区ID","ID","Poi名称","类型","类型编码","纬度","经度","备注","创建时间","更新时间","性质","级别","来源公司"]
|
||||
|
||||
def fileName = "/home/goojia/ccb/BIGDATA_POI_GJ.dat"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_POI_GJ.dat"
|
||||
}
|
||||
FileUtils.batchCreateFile(rets, fileName, headers, "utf-8", false);
|
||||
println "txt 生成"
|
||||
|
||||
|
||||
// def headers1 = ["城市ID","城市","行政区ID","区域名称","经度","纬度","创建时间","来源公司"]
|
||||
// def regionCenterDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\poi\\行政区中心点经纬度.xlsx", 0,1)
|
||||
// def regionRets = createRegionCenters(regionCenterDatas)
|
||||
// FileUtils.batchCreateFile(regionRets, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\region_center.txt", headers1, "utf-8", false);
|
||||
// println "行政区域中心txt 生成"
|
||||
|
||||
}
|
||||
|
||||
def createRegionCenters(def datas){
|
||||
def rets = []
|
||||
for(def d : datas){
|
||||
def ret = []
|
||||
ret << d['A'].toInteger().toString()
|
||||
ret << d['B']
|
||||
ret << d['C'].toInteger().toString()
|
||||
ret << d['D']
|
||||
def loactionStr = d['E']
|
||||
if(loactionStr){
|
||||
def arrs = loactionStr.split(",")
|
||||
def loactionMap = GeoUtils.gcjToGps84(arrs[1].toDouble(), arrs[0].toDouble())
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lng,6)
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lat, 6)
|
||||
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
rets << ret
|
||||
}
|
||||
return rets;
|
||||
|
||||
}
|
||||
|
||||
def createDatas(citys, cityCodeDataMap, datas, type){
|
||||
def rets = Collections.synchronizedList(new ArrayList());
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(datas.size())
|
||||
def cityDistMap = CcbCommonUtils.findAllCityDistrictCodeValue()
|
||||
for(def i=0;i<datas.size();i++){
|
||||
final def d = datas[i]
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try{
|
||||
totalCount.addAndGet(1)
|
||||
if(citys.contains(d['D'])){
|
||||
def ret = addValue(d, cityCodeDataMap, cityDistMap, type)
|
||||
if(ret){
|
||||
rets << ret
|
||||
}
|
||||
}
|
||||
println totalCount.get()+" "+ d['D']+" "+d['F']
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
latch.await()
|
||||
|
||||
return rets;
|
||||
}
|
||||
|
||||
def getRegionByLocation(lng, lat){
|
||||
def jsonObject = GaoDeApiUtils.geocode(lng.toString()+","+lat.toString())
|
||||
|
||||
if(jsonObject && jsonObject.info=="OK"){
|
||||
def compent = jsonObject.regeocode.addressComponent
|
||||
if(compent){
|
||||
def district = compent.district
|
||||
return district;
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
def addValue2(d, cityCodeDataMap, cityDistMap, type){
|
||||
def ret = []
|
||||
def citycode = cityCodeDataMap.get(d['E'])
|
||||
ret << citycode
|
||||
|
||||
def region =getRegionByLocation(d['H'], d['I'])
|
||||
def distCodeMap = cityDistMap.get(d['E'])
|
||||
if(region){
|
||||
region = RegionData.formatRegion(d['E'], region)
|
||||
}
|
||||
if(region){
|
||||
def distObj = distCodeMap.get(region)
|
||||
if(distObj){
|
||||
ret << distObj.district_code
|
||||
}else{
|
||||
ret << ""
|
||||
println d['E']+" " + region+" 无对应的区域编码 "+d['F']
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
}
|
||||
|
||||
if(d['A']){
|
||||
ret << d['A']
|
||||
}else{
|
||||
ret << new ObjectId()
|
||||
|
||||
}
|
||||
|
||||
ret << d['G']
|
||||
ret << type
|
||||
|
||||
if(type=="地铁"){
|
||||
ret << "cz125"
|
||||
}else if(type=="公交"){
|
||||
ret << "cz123"
|
||||
}else if(type=="医院"){
|
||||
ret << "hp111"
|
||||
}else if(type == "银行"){
|
||||
ret << "se118"
|
||||
}else if(type =="丧葬服务"){
|
||||
ret << "ob101"
|
||||
}else if(type =="学校"){
|
||||
if(d['B'].contains("141202")){
|
||||
ret << "ed138"
|
||||
}else if(d['B'].contains("141203")){
|
||||
ret << "ed114"
|
||||
}
|
||||
}
|
||||
if(d['I']){
|
||||
def lat = d['I'].toDouble()
|
||||
def lng = d['H'].toDouble()
|
||||
def loactionMap = GeoUtils.gcjToGps84(lat, lng)
|
||||
if(loactionMap){
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lat, 6)
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lng,6)
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << d['C']
|
||||
ret << d['F']
|
||||
ret << "FJW"
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
def addValue(d, cityCodeDataMap, cityDistMap, type){
|
||||
def ret = []
|
||||
def citycode = cityCodeDataMap.get(d['D'])
|
||||
ret << citycode
|
||||
def distCodeMap = cityDistMap.get(d['D'])
|
||||
def region =RegionData.formatRegion(d['D'], d['E'])
|
||||
|
||||
if(region){
|
||||
|
||||
def distObj = distCodeMap.get(region)
|
||||
if(distObj){
|
||||
ret << distObj.district_code
|
||||
}else{
|
||||
ret << ""
|
||||
println d['D']+" " + d['E']+" 无对应的区域编码 "+d['F']
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
}
|
||||
ret << d['A']
|
||||
ret << d['F']
|
||||
ret << type
|
||||
|
||||
if(type=="地铁"){
|
||||
ret << "cz125"
|
||||
}else if(type=="公交"){
|
||||
ret << "cz123"
|
||||
}else if(type=="医院"){
|
||||
ret << "hp111"
|
||||
}else if(type == "银行"){
|
||||
ret << "se118"
|
||||
}else if(type =="丧葬服务"){
|
||||
ret << "ob101"
|
||||
}else if(type =="学校"){
|
||||
if(d['F'].contains("中学")){
|
||||
ret << "ed138"
|
||||
}else if(d['F'].contains("小学")){
|
||||
ret << "ed114"
|
||||
}
|
||||
}
|
||||
if(d['I']){
|
||||
def lat = d['I'].toDouble()
|
||||
def lng = d['H'].toDouble()
|
||||
def loactionMap = GeoUtils.gcjToGps84(lat, lng)
|
||||
if(loactionMap){
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lat, 6)
|
||||
ret << com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lng,6)
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
}else{
|
||||
ret << ""
|
||||
ret << ""
|
||||
}
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
ret << ""
|
||||
ret << ""
|
||||
ret << "FJW"
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.datastore.driver.DSCollection
|
||||
import com.fangjia.datastore.driver.DSCursor
|
||||
import com.fangjia.datastore.driver.DataStore
|
||||
import com.fangjia.script.util.DataUtil
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import com.mongodb.DBObject
|
||||
import groovy.sql.Sql
|
||||
|
||||
class CcbCommonUtils {
|
||||
|
||||
//
|
||||
public static def citys = ["扬州", "上海","北京","重庆","天津","成都","沈阳","大连","陵水","安庆","西宁","日照","长春","武汉","西安","苏州","广州","南京","青岛","济南","宁波","长沙","石家庄","佛山","嘉兴","银川","南通","廊坊","中山","郑州","哈尔滨","烟台","徐州","绍兴","厦门","昆明","南昌","贵阳","珠海","东莞","镇江","洛阳","温州","兰州","福州","惠州","呼和浩特","常州","唐山","淮安","湖州","九江","太原","北海","株洲","淄博","盐城","乌鲁木齐","海口","南宁","常德","台州","金华","吉林","岳阳","柳州","清远","湛江","张家口","保定","深圳","杭州","合肥","无锡","泉州","遵义","肇庆","漳州","宜昌","芜湖","泰州","汕头","三亚","秦皇岛","马鞍山","连云港","沧州","拉萨","锦州","大同","文昌","保亭"]
|
||||
// public static def citys = ["武汉"]
|
||||
|
||||
public static def provCityMap = ["河北":"石家庄" ,"山西":"太原" ,"陕西":"西安" ,"山东":"济南","河南":"郑州" ,"辽宁":"沈阳" ,"吉林":"长春" ,"黑龙江":"哈尔滨" ,"江苏":"南京" ,"浙江":"杭州" ,"安徽":"合肥","江西":"南昌" ,"福建":"福州" ,"湖北":"武汉","湖南":"长沙" ,"四川":"成都" ,"贵州":"贵阳" ,"云南":"昆明" ,"广东":"广州" ,"海南":"海口" ,"甘肃":"兰州" ,"青海":"西宁" ,"台湾":"台北","内蒙古":"呼和浩特" ,"新疆":"乌鲁木齐" ,"西藏":"拉萨","广西":"南宁","宁夏":"银川","香港":"香港","澳门":"澳门"]
|
||||
|
||||
public static final DBCollection FANGJIA_OFFICIAL_AREA_MAP = MongoUtils.getCollectionByName("business", "fangjia_official_area_map_2020", "mongo.db.fangjia.com")
|
||||
|
||||
public static final DBCollection SERVER_AREA_COLL = MongoUtils.getCollectionByName("fangjia", "server_area", "mongo.db.fangjia.com")
|
||||
|
||||
public static final DBCollection GUIDING_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "guiding_price", "mongo.db.fangjia.com")
|
||||
|
||||
|
||||
public static final DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "deal_price", "mongo.db.fangjia.com")
|
||||
|
||||
public static final DBCollection DISTRICT_GUIDE_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "district_guide_price", "mongo.db.fangjia.com", 28017)
|
||||
|
||||
public static def rootMap = ["lianjia.com":"1","anjuke.com":"2","fang.com":"3","ke.com":"4","58.com":"5","leju.com":"6","fccs.com":"7","c21.com.cn":"8","qfang.com":"9","ganji.com":"10","leyoujia.com":"11","fangdd.com":"12","5i5j.com":"13","centanet.com":"14","zhuge.com":"15","baixing.com":"16","house365.com":"17","izhiliao.com":"18","wkzf.com":"19","jiwu.com":"20","xyfcw.com":"21","917.com":"22","0597house.com":"23","xmfish.com":"24","rongyizhaofang.com":"25","rz0375.com":"26","596fc.com":"27","zhen22.com":"28","taotaoju.vip":"29","kaifc.cn":"30","zhongmou.cc":"31","0391fc.com":"32","hualongxiang.com":"33","fangtan007.com":"34","h0591.com":"35","0598yu.com":"36","zfgou.cn":"37","0597ok.com":"38","second.cc":"39","rent.cc":"40","ssfcw.net":"41","czfcw.com":"42"]
|
||||
|
||||
public static DSCollection dataStoreConnection = null;
|
||||
|
||||
public static def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl",
|
||||
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
|
||||
|
||||
public static def findCityCodeValue(){
|
||||
def cityCodeMap = ["武汉":"420100","西安":"610100","苏州":"320500","大连":"210200","广州":"440100","重庆":"500000","南京":"320100","沈阳":"210100","青岛":"370200","天津":"120000","济南":"370100","宁波":"330200","长沙":"430100","石家庄":"130100","佛山":"440600","嘉兴":"330400","银川":"640100","南通":"320600","长春":"220100","廊坊":"131000","中山":"442000","郑州":"410100","哈尔滨":"230100","烟台":"370600","徐州":"320300","绍兴":"330600","厦门":"350200","昆明":"530100","南昌":"360100","贵阳":"520100","珠海":"440400","东莞":"441900","镇江":"321100","洛阳":"410300","温州":"330300","兰州":"620100","福州":"350100","惠州":"441300","呼和浩特":"150100","常州":"320400","唐山":"130200","淮安":"320800","湖州":"330500","九江":"360400","太原":"140100","北海":"450500","株洲":"430200","淄博":"370300","盐城":"320900","乌鲁木齐":"650100","海口":"460100","南宁":"450100","常德":"430700","台州":"331000","金华":"330700","吉林":"220200","岳阳":"430600","柳州":"450200","清远":"441800","湛江":"440800","张家口":"130700","保定":"130600","北京":"110000","成都":"510100","深圳":"440300","上海":"310000","杭州":"330100","合肥":"340100","扬州":"321000","无锡":"320200","泉州":"350500","遵义":"520300","肇庆":"441200","漳州":"350600","宜昌":"420500","芜湖":"340200","泰州":"321200","汕头":"440500","三亚":"460200","秦皇岛":"130300","马鞍山":"340500","连云港":"320700","沧州":"130900","安庆":"340800","西宁":"630100","日照":"371100","拉萨":"540100","锦州":"210700","大同":"140200","文昌":"469005","陵水":"469028","保亭":"469029"]
|
||||
return cityCodeMap;
|
||||
}
|
||||
|
||||
public static def findAllDistrictCodeValue(city){
|
||||
def q = new BasicDBObject()
|
||||
q.put("fangjia_city", city)
|
||||
//q.put("district", new BasicDBObject('$ne',"市辖区"))
|
||||
def dbcursor = FANGJIA_OFFICIAL_AREA_MAP.find(q).sort(new BasicDBObject("_id", 1))
|
||||
def map = [:]
|
||||
for(def db : dbcursor){
|
||||
map.put(db.fangjia_district, db)
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static def findAllCityDistrictCodeValue(city){
|
||||
def q = new BasicDBObject()
|
||||
def dbcursor = FANGJIA_OFFICIAL_AREA_MAP.find(q).sort(new BasicDBObject("_id", 1))
|
||||
def map = [:]
|
||||
for(def db : dbcursor){
|
||||
def distMap = map.get(db.fangjia_city)
|
||||
if(!distMap){
|
||||
distMap = [:]
|
||||
map.put(db.fangjia_city, distMap)
|
||||
}
|
||||
distMap.put(db.fangjia_district, db)
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static def findPersonPrice(city, date){
|
||||
def q = new BasicDBObject()
|
||||
q.put("city", city)
|
||||
q.put('guiding_date', new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(date)));
|
||||
def dbcursor = GUIDING_PRICE_COLL.find(q)
|
||||
def rets = []
|
||||
for(def d : dbcursor){
|
||||
rets << d
|
||||
}
|
||||
return rets
|
||||
}
|
||||
|
||||
public static def findGuidePrice(city){
|
||||
def q = new BasicDBObject()
|
||||
q.put("city", city)
|
||||
def dbcursor = DISTRICT_GUIDE_PRICE_COLL.find(q)
|
||||
def rets = []
|
||||
for(def d : dbcursor){
|
||||
rets << d
|
||||
}
|
||||
return rets
|
||||
}
|
||||
|
||||
public static def findTradesDetail(dist, startDate, endDate, startPrice, endPrice){
|
||||
def q = new BasicDBObject()
|
||||
q.put("city", dist.city)
|
||||
q.put("region", dist.region)
|
||||
q.put("area", new BasicDBObject('$gte', 20))
|
||||
def alias = []
|
||||
if(dist.alias){
|
||||
if(!dist.alias.contains(dist.name)){
|
||||
dist.alias << dist.name
|
||||
}
|
||||
alias = dist.alias
|
||||
}else{
|
||||
alias << dist.name
|
||||
}
|
||||
|
||||
if(dist.name.endsWith("弄小区") || dist.name.endsWith("小区") ){
|
||||
def name = dist.name.replace("弄小区","弄").replace("小区","")
|
||||
if(!alias.contains(name)){
|
||||
alias << name
|
||||
}
|
||||
}
|
||||
|
||||
if(alias){
|
||||
q.put("district_name", new BasicDBObject('$in', alias))
|
||||
}
|
||||
q.put("trade_date", new BasicDBObject('$gte', startDate).append('$lte',endDate))
|
||||
def dbcursor = DEAL_PRICE_COLL.find(q)
|
||||
def total = dbcursor.count()
|
||||
def rets = new HashSet()
|
||||
def lists = []
|
||||
println dist.name +" "+total
|
||||
for(def d : dbcursor){
|
||||
// if(startPrice && d.avg_price>=startPrice && d.avg_price<=endPrice){
|
||||
def key=d.city+"##"+d.region+"##"+d.district_name+"##"+d.area+"##"+d.avg_price+"##"+DateUtils.formatDateByPattern(d.trade_date,"yyyy-MM-dd")
|
||||
if(!rets.contains(key)){
|
||||
rets << key
|
||||
d.dist_id = dist._id.toString()
|
||||
d.address = dist.address
|
||||
d.master_name = dist.name
|
||||
d.build_type = dist.build_type
|
||||
d.build_structure = dist.build_structure
|
||||
d.house_roperty = dist.house_roperty
|
||||
d.property_life = dist.property_life
|
||||
d.estate_type2 = dist.estate_type2
|
||||
lists << d
|
||||
}
|
||||
// }
|
||||
}
|
||||
return lists
|
||||
}
|
||||
|
||||
public static def findTradesDetailByAddress(dist, startDate, endDate, startPrice, endPrice){
|
||||
def q = new BasicDBObject()
|
||||
q.put("city", dist.city)
|
||||
q.put("region", dist.region)
|
||||
q.put("area", new BasicDBObject('$gte', 20))
|
||||
q.put("district_name", dist.address)
|
||||
q.put("trade_date", new BasicDBObject('$gte', startDate).append('$lt',endDate))
|
||||
def dbcursor = DEAL_PRICE_COLL.find(q)
|
||||
def total = dbcursor.count()
|
||||
def rets = new HashSet()
|
||||
def lists = []
|
||||
for(def d : dbcursor){
|
||||
if(startPrice && d.avg_price>=startPrice && d.avg_price<=endPrice){
|
||||
def key=d.city+"##"+d.region+"##"+d.district_name+"##"+d.area+"##"+d.avg_price+"##"+DateUtils.formatDateByPattern(d.trade_date,"yyyy-MM-dd")
|
||||
if(!rets.contains(key)){
|
||||
rets << key
|
||||
d.dist_id = dist._id.toString()
|
||||
d.address = dist.address
|
||||
d.master_name = dist.name
|
||||
d.build_type = dist.build_type
|
||||
d.build_structure = dist.build_structure
|
||||
d.house_roperty = dist.house_roperty
|
||||
d.property_life = dist.property_life
|
||||
d.estate_type2 = dist.estate_type2
|
||||
lists << d
|
||||
}
|
||||
}
|
||||
}
|
||||
return lists
|
||||
}
|
||||
|
||||
|
||||
public static def findTrades(dist, startDate, endDate){
|
||||
def q = new BasicDBObject()
|
||||
q.put("city", dist.city)
|
||||
q.put("region", dist.region)
|
||||
|
||||
if(dist.alias){
|
||||
if(!dist.alias.contains(dist.name)){
|
||||
dist.alias << dist.name
|
||||
}
|
||||
q.put("district_name", new BasicDBObject('$in', dist.alias))
|
||||
}else{
|
||||
q.put("district_name", dist.name)
|
||||
}
|
||||
|
||||
q.put("trade_date", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)).append('$lt',DateUtils.parseFromTightYYYYMMDD(endDate)))
|
||||
def dbcorsor = DEAL_PRICE_COLL.find(q)
|
||||
def avg_price = 0
|
||||
def total_price = 0
|
||||
def count = 0
|
||||
|
||||
|
||||
for(def d : dbcorsor){
|
||||
if(d.avg_price){
|
||||
total_price = total_price + d.avg_price
|
||||
count++
|
||||
}
|
||||
}
|
||||
if(count > 3){
|
||||
avg_price = total_price/count
|
||||
}
|
||||
|
||||
if(count && avg_price){
|
||||
def retMap = [:]
|
||||
retMap.count = count
|
||||
retMap.avg_price = avg_price
|
||||
return retMap
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
public static DSCollection getDataStoreConnection(){
|
||||
if(dataStoreConnection != null) {
|
||||
return dataStoreConnection
|
||||
}
|
||||
DataStore ds = new DataStore("seaweed.db.fangjia.com", 27007)
|
||||
dataStoreConnection = ds.getCollection("fangjia.seaweed")
|
||||
return dataStoreConnection
|
||||
}
|
||||
|
||||
public static def findAllDistrictByCity(def city, def cat, def fields){
|
||||
|
||||
DBObject q = new BasicDBObject();
|
||||
q.put("visible",0)
|
||||
q.put("cat", cat);
|
||||
q.put("city", city);
|
||||
// q.put("name","御海阳光")
|
||||
// q.put("name_cat", 0);
|
||||
// q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"]))
|
||||
|
||||
DBObject keys = new BasicDBObject();
|
||||
if(fields){
|
||||
for(def field : fields){
|
||||
keys.put(field, 1);
|
||||
}
|
||||
}
|
||||
def dbsour = getDataStoreConnection().find(q, keys).batchSize(2000)
|
||||
def rets = []
|
||||
for(def d : dbsour){
|
||||
if(d.name_cat == 0 && d.lng && ["普通住宅","商住"].contains(d.estate_type2) && !d.name.contains("洋房") && !d.name.contains("公房")){
|
||||
if(d.address){
|
||||
d.address = d.address.replaceAll("\r|\n|\\s", "");
|
||||
}
|
||||
rets << d
|
||||
}
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
|
||||
public static def findDistrict(String city, String region, String name, String cat){
|
||||
|
||||
DBObject q = new BasicDBObject();
|
||||
q.put("city", city);
|
||||
if(region){
|
||||
q.put("region", region);
|
||||
}
|
||||
q.put("name", name);
|
||||
q.put("cat", cat)
|
||||
q.put("status", 0)
|
||||
DSCursor cursor = getDataStoreConnection().find(q);
|
||||
if(cursor){
|
||||
for(def d : cursor){
|
||||
if(d.name_cat == 0 && ["普通住宅","商住"].contains(d.estate_type2)){
|
||||
if(d.address){
|
||||
d.address = d.address.replaceAll("\r|\n|\\s", "");
|
||||
}
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static def findCcbDistrict(cityid){
|
||||
def sql = "select CITYID, DISTID, COMMID, DISTNAME, COMMNAME, ADDRESS, LATITUDE, LONGITUDE, LANDAREA, BUILDAREA, GREENINGRATE, PLOTRATIO, PARKINGCNT, BUILDYEAR, HOUSEUSE, ZTS, WORKDATE, UPDATEFLAG, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,COMMTYPE, \n" +
|
||||
"\tCOMMALIAS, STREET, STREETNO, IFNEW, INTRODUCTION, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, SOURCECODE, XZJDB, LJXZQHDM, LJXZQH,STATUS from bigdata_community_gj where cityId=${cityid}";
|
||||
def map = [:]
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.CITYID
|
||||
data << r.DISTID
|
||||
data << r.COMMID
|
||||
data << r.DISTNAME
|
||||
data << r.COMMNAME
|
||||
data << r.ADDRESS
|
||||
data << r.LATITUDE
|
||||
data << r.LONGITUDE
|
||||
data << r.LANDAREA
|
||||
data << r.BUILDAREA
|
||||
data << r.GREENINGRATE
|
||||
data << r.PLOTRATIO
|
||||
data << r.PARKINGCNT
|
||||
data << r.BUILDYEAR
|
||||
data << r.HOUSEUSE
|
||||
data << r.ZTS
|
||||
data << r.WORKDATE
|
||||
data << r.UPDATEFLAG
|
||||
data << r.UPDATETIME
|
||||
data << r.COMMTYPE
|
||||
data << r.COMMALIAS
|
||||
data << r.STREET
|
||||
data << r.STREETNO
|
||||
data << r.IFNEW
|
||||
data << ""
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.SOURCECODE
|
||||
data << r.XZJDB
|
||||
data << r.LJXZQHDM
|
||||
data << r.LJXZQH
|
||||
data << r.STATUS
|
||||
map.put(r.COMMID, data)
|
||||
});
|
||||
return map
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.common.DataHandleUtils
|
||||
import com.fangjia.script.jiangnanblank.SFTP
|
||||
import com.jcraft.jsch.ChannelSftp
|
||||
import org.apache.commons.codec.digest.DigestUtils
|
||||
|
||||
class CcbFtpUtils {
|
||||
|
||||
static def ftpServer = "192.168.0.45"
|
||||
static def ftpPort = 17495
|
||||
static def ftpUser = "ccb"
|
||||
static def ftpPassword = "0I1k8EAM+O8iA"
|
||||
static def ftpPath = "/home/ccb/output/"
|
||||
|
||||
static SFTP sftp = new SFTP();
|
||||
static ChannelSftp sftpChannel = sftp.connect(ftpServer, ftpPort, ftpUser, ftpPassword);
|
||||
|
||||
|
||||
static def ftpUpload(outputPath_dist, month){
|
||||
//上传到ftp
|
||||
sftpChannel = reConnect();
|
||||
sftp.upload(ftpPath+ month+"/", outputPath_dist, sftpChannel);
|
||||
}
|
||||
|
||||
static def reConnect(){
|
||||
if(sftpChannel == null){
|
||||
println "sftpChannel 为空,需重连....."
|
||||
if(sftp == null){
|
||||
sftp = new SFTP();
|
||||
}
|
||||
sftpChannel = sftp.connect(ftpServer, ftpPort, ftpUser, ftpPassword);
|
||||
}else{
|
||||
println "sftpChannel 正常....."
|
||||
}
|
||||
return sftpChannel;
|
||||
}
|
||||
|
||||
static def uploadSha512Data(def sb, def dataCodeFileName, def charset){
|
||||
String sha512HexStr= DigestUtils.sha512Hex(sb.getBytes())//生成加密码码
|
||||
DataHandleUtils.outPutFile(dataCodeFileName, sha512HexStr,charset);//生成加密码文件
|
||||
ftpUpload(dataCodeFileName)//上传加密码文件到FTP
|
||||
}
|
||||
|
||||
static def uploadSha512Data2(def dataFileName, def dataCodeFileName, def charset){
|
||||
|
||||
def data = new FileInputStream(new File(dataFileName))
|
||||
String sha512HexStr= DigestUtils.sha512Hex(data)//生成加密码码
|
||||
DataHandleUtils.outPutFile(dataCodeFileName, sha512HexStr,charset);//生成加密码文件
|
||||
ftpUpload(dataCodeFileName)//上传加密码文件到FTP
|
||||
}
|
||||
|
||||
|
||||
static main(args) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 城市数据同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class CityBatch extends BaseBatch{
|
||||
|
||||
static main(args) {
|
||||
runBatch(new CityBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def rows = []
|
||||
def index = 1
|
||||
for(def city : citys){
|
||||
def data = CcbCommonUtils.findCityCodeValue()
|
||||
def map = [:]
|
||||
map.name = city
|
||||
if(data){
|
||||
map.city_code = data.city_code
|
||||
map.prov_code = data.province_code
|
||||
}
|
||||
def cityObj = findCityInfo(city)
|
||||
if(cityObj){
|
||||
map.city_spell = cityObj.spell
|
||||
map.city_level = cityObj.city_grade
|
||||
map.seq = index
|
||||
map.ifcapital = isCapital(cityObj.province, city)
|
||||
map.ifmunicipal = ifMunicipal(city)
|
||||
}
|
||||
index++
|
||||
rows << map
|
||||
}
|
||||
|
||||
def allDatas = createDatas(rows)
|
||||
def headers = ["城市ID","城市名称","城市名称拼音","省份ID","国标码","城市级别","显示顺序","是否省会","是否直辖市","备注","创建时间","更新时间","来源公司"]
|
||||
|
||||
def rets = []
|
||||
rets << headers
|
||||
rets.addAll(allDatas)
|
||||
ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\bigdata_city.xlsx", rets, "数据")
|
||||
FileUtils.batchCreateFile(allDatas, "d:\\数据\\建行\\房产估值\\数据文件\\bigdata_city.dat",headers, "utf-8", false);
|
||||
}
|
||||
|
||||
def createDatas(rows){
|
||||
def allRows = []
|
||||
rows.each { m ->
|
||||
def data = []
|
||||
data << m.city_code
|
||||
data << m.name
|
||||
data << m.city_spell
|
||||
data << m.prov_code
|
||||
data << m.city_code
|
||||
data << m.city_level
|
||||
data << m.seq
|
||||
data << CcbCodeUtils.parseFlag(m.ifcapital)
|
||||
data << CcbCodeUtils.parseFlag(m.ifmunicipal)
|
||||
data << ""
|
||||
data << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
data << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
data << "fjw"
|
||||
allRows << data
|
||||
}
|
||||
return allRows;
|
||||
}
|
||||
|
||||
def findCityInfo(city){
|
||||
def q = new BasicDBObject()
|
||||
q.put("display", city)
|
||||
return CcbCommonUtils.SERVER_AREA_COLL.findOne(q)
|
||||
}
|
||||
|
||||
def isCapital(def prov, def city){
|
||||
def provCity = CcbCommonUtils.provCityMap.get(prov)
|
||||
if(provCity && provCity==city){
|
||||
return "是"
|
||||
}
|
||||
return "否"
|
||||
}
|
||||
|
||||
def ifMunicipal(def city){
|
||||
if(["上海", "北京", "天津", "重庆"].contains(city)){
|
||||
return "是"
|
||||
}
|
||||
return "否"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.gj.district.FangjiaClientUtils
|
||||
import com.fangjia.script.lixue.util.DBUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.DbUtils
|
||||
import com.fangjia.script.util.ElasticUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBObject
|
||||
import groovy.sql.Sql
|
||||
import org.apache.lucene.queryparser.classic.QueryParser
|
||||
import org.bson.types.ObjectId
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilder
|
||||
import org.elasticsearch.index.query.QueryBuilders
|
||||
import org.elasticsearch.xpack.sql.jdbc.EsDataSource
|
||||
|
||||
import java.sql.ResultSet
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
class DistrictDelete {
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30)
|
||||
|
||||
|
||||
public static EsDataSource dataSource = new EsDataSource()
|
||||
private static final String address = "jdbc:es://http://seawater.es.db.fangjia.com:9200?timezone=UTC&page.size=240&connect.timeout=240000&network.timeout=60000&page.timeout=240000&query.timeout=90000"
|
||||
static {
|
||||
dataSource.setUrl(address)
|
||||
Properties connectionProperties = new Properties()
|
||||
connectionProperties.put("user", "developer")
|
||||
connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
|
||||
dataSource.setProperties(connectionProperties)
|
||||
}
|
||||
|
||||
def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl",
|
||||
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
|
||||
|
||||
static main(args) {
|
||||
def task = new DistrictDelete()
|
||||
// task.run()
|
||||
// task.gzRun();
|
||||
// task.deleteDistrict()
|
||||
task.deleteCommPrice()
|
||||
}
|
||||
|
||||
def run(){
|
||||
//"泉州","深圳", "重庆",
|
||||
def citys = ["广州"];//"广州",
|
||||
|
||||
def delIndex = 0
|
||||
for(def city : citys){
|
||||
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city","region", "name", "alias","address","lng","build_type","finish_building_date","estate_type2","name_cat"])
|
||||
|
||||
checkDist(city, dists)
|
||||
}
|
||||
}
|
||||
|
||||
def checkDist(city,dists){
|
||||
|
||||
def rets = Collections.synchronizedList(new ArrayList());
|
||||
def startDate = DateUtils.parseFromTightByPattern("2015-01-01","yyyy-MM-dd")
|
||||
def endDate = DateUtils.parseFromTightByPattern("2021-12-31","yyyy-MM-dd")
|
||||
|
||||
def totalCount = new AtomicLong()
|
||||
def delIndex = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(dists.size())
|
||||
println city +" 小区量:"+dists.size()
|
||||
|
||||
def keys = ["大厦","宿舍","宅","商住","广场","教师","工作站","学院", "SOLO", "时尚","大学","学员","职工","SOHO"]
|
||||
for(def i=0;i<dists.size();i++) {
|
||||
final def dist = dists[i];
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try {
|
||||
totalCount.addAndGet(1)
|
||||
// def count = findHouses(city, dist.region, "sell", 20190101,20211231, dist.name, dist.alias)
|
||||
def count = findHouseCount(city, dist.region, dist.name, dist.alias)
|
||||
def tradeCount = 0
|
||||
if(!count){
|
||||
tradeCount = CcbCommonUtils.findTradesDetail(dist, startDate, endDate, 0, 300000)
|
||||
if(!tradeCount){
|
||||
def nameFlag = false
|
||||
for(def key : keys){
|
||||
if(dist.name.contains(key)){
|
||||
nameFlag = true
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!nameFlag){
|
||||
if(dist.name.size()<=3 && (dist.name.contains("村") || dist.name.contains("楼") || dist.name.contains("居") )){
|
||||
nameFlag = true
|
||||
}
|
||||
}
|
||||
def fieldFlag = false
|
||||
if(dist.finish_building_date && dist.build_type){
|
||||
fieldFlag = true
|
||||
}
|
||||
|
||||
if(!tradeCount && !count && !fieldFlag){
|
||||
def rowCount = findCount(dist._id.toString())
|
||||
if(rowCount || nameFlag){
|
||||
delIndex.addAndGet(1)
|
||||
BasicDBObject q=new BasicDBObject('name_cat',1)
|
||||
q.put("m_date", new Date())
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id', dist._id),new BasicDBObject('$set',q))
|
||||
println "[ ${delIndex.get()}/${totalCount.get()} ] "+city +" "+dist.region + " "+dist.name + " house:"+count+" trade:"+tradeCount
|
||||
}else{
|
||||
println city +" "+dist.region + " "+dist.name + " house:"+count+" trade:"+tradeCount
|
||||
}
|
||||
|
||||
rets << [dist._id.toString(),dist.city, dist.region, dist.name, dist.address]
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
latch.await()
|
||||
|
||||
ExcelUtils.write("D:\\数据\\建行\\房产估值\\多余小区_${city}.xlsx",rets, "无房源")
|
||||
}
|
||||
|
||||
|
||||
def findCount(distId){
|
||||
def sql = "select count(*) as count from fjw_community_artifi_check where commid='${distId}'";
|
||||
def count = 0
|
||||
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
count = r.count
|
||||
});
|
||||
return count
|
||||
}
|
||||
|
||||
|
||||
|
||||
def findHouses(def city, def region, def cat, def startDate, def endDate, def name, def alias){
|
||||
|
||||
QueryBuilder date_range = QueryBuilders.rangeQuery("p_date").from(startDate).to(endDate).includeLower(true).includeUpper(false);
|
||||
QueryBuilder area_range = QueryBuilders.rangeQuery("area").from(20).to(500).includeLower(true).includeUpper(false);
|
||||
|
||||
QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("city", city)).must(QueryBuilders.termQuery("region", region)).must(QueryBuilders.termQuery("cat", cat))
|
||||
.must(date_range).must(area_range)
|
||||
|
||||
if(!alias){
|
||||
alias = []
|
||||
}
|
||||
if(!alias.contains(name)){
|
||||
alias.add(name)
|
||||
}
|
||||
if(name.contains("弄小区")){
|
||||
def newName = name.replace("弄小区","弄")
|
||||
if(!alias.contains(newName)){
|
||||
alias << newName
|
||||
}
|
||||
|
||||
}
|
||||
if(alias && alias.size()>0){
|
||||
BoolQueryBuilder inBuilder = QueryBuilders.boolQuery();
|
||||
for(def s : alias){
|
||||
inBuilder.should(QueryBuilders.matchQuery("district_name", s));
|
||||
}
|
||||
queryBuilder.must(inBuilder)
|
||||
}
|
||||
def houses = ElasticUtils.executeSimpleQuery("192.168.0.206", "seawater-20*", queryBuilder);
|
||||
return houses.size();
|
||||
}
|
||||
|
||||
|
||||
static def findHouseCount(def city, def region, def name, def alias){
|
||||
if(!alias){
|
||||
alias = []
|
||||
}
|
||||
if(!alias.contains(name)){
|
||||
alias.add(name)
|
||||
}
|
||||
if(name.contains("弄小区")){
|
||||
def newName = name.replace("弄小区","弄")
|
||||
if(!alias.contains(newName)){
|
||||
alias << newName
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def aliasStr = escapeExprSpecialWord(alias.join("','"))
|
||||
final StringBuffer sqlBuffer = new StringBuffer()
|
||||
sqlBuffer.append("SELECT count(*) as count FROM \"seawater-20*\" WHERE 1=1")
|
||||
sqlBuffer.append(" and city = '"+city+"'")
|
||||
sqlBuffer.append(" and region = '"+region+"'")
|
||||
sqlBuffer.append(" and district_name in ('${aliasStr}')")
|
||||
sqlBuffer.append(" and (cat = 'rent' or cat='sell')")
|
||||
ResultSet rs = dataSource.connection.createStatement().executeQuery(sqlBuffer.toString())
|
||||
def count = null
|
||||
while (rs.next()){
|
||||
count = rs.getInt("count")
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public static String escapeExprSpecialWord(String keyword) {
|
||||
return QueryParser.escape(keyword);
|
||||
}
|
||||
|
||||
def gzRun(){
|
||||
def index = 0
|
||||
ExcelUtils.modify("D:\\数据\\建行\\房产估值\\要删除小区 (5).xlsx",{d->
|
||||
if(d['G']){
|
||||
def id = d['G']
|
||||
BasicDBObject q=new BasicDBObject('name_cat',1)
|
||||
q.put("m_date", new Date())
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id',new ObjectId(id)),new BasicDBObject('$set',q))
|
||||
index++
|
||||
println index
|
||||
}
|
||||
},0)
|
||||
}
|
||||
|
||||
def deleteDistrict(){
|
||||
ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\要删除小区.xlsx",{d->
|
||||
if(d['G']){
|
||||
def id = d['G']
|
||||
BasicDBObject q=new BasicDBObject('name_cat',1)
|
||||
q.put("m_date", new Date())
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id',new ObjectId(id)),new BasicDBObject('$set',q))
|
||||
deleteAllRefDistrict(id)
|
||||
}
|
||||
},0)
|
||||
}
|
||||
|
||||
def deleteAllRefDistrict(id){
|
||||
def tables = ["bigdata_forsale_gj","avm_evaluation_item_gj","community_base_price_gj","community_poi_gj","community_sale_gj","community_sale_tmp","community_test_price_tmp"]
|
||||
for(def tableName : tables){
|
||||
deleteByCommid(tableName, id)
|
||||
}
|
||||
}
|
||||
|
||||
def deleteCommPrice(){
|
||||
ExcelUtils.modify("D:\\数据\\建行\\房产估值\\均价删除.xlsx",{d->
|
||||
if(d['B']){
|
||||
def id = d['B']
|
||||
println id
|
||||
deleteByCommid("community_base_price_gj",id)
|
||||
}
|
||||
},0)
|
||||
}
|
||||
|
||||
def deleteByCommid(tableName, commid){
|
||||
def sql = "delete from "+tableName+" where commid='${commid}'";
|
||||
sqlInstance.execute(sql)
|
||||
println "删除:"+tableName+" "+commid
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
|
||||
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class DistrictGuidePriceBatch extends BaseBatch{
|
||||
|
||||
|
||||
static main(args) {
|
||||
runBatch(new DistrictGuidePriceBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def rows = []
|
||||
|
||||
for (def city : citys) {
|
||||
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
|
||||
//添加自己库中的人工指导价
|
||||
def prices = CcbCommonUtils.findGuidePrice(city)
|
||||
if(prices){
|
||||
def distMap = getDistrictMap(city)
|
||||
def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, prices)
|
||||
rows.addAll(rets)
|
||||
println city + " " + rets.size()
|
||||
}
|
||||
}
|
||||
|
||||
def headers = ["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导价格","类型","备注","创建时间","更新时间","来源公司"]
|
||||
FileUtils.batchCreateFile(rows, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\COMMUNITY_GUIDE_PRICE_GJ.dat", headers, "utf-8", false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
def getDistrictMap(def city){
|
||||
def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat", "alias"]);
|
||||
def distMap = [:]
|
||||
for(def d : districts){
|
||||
distMap.put(d.region+"##"+d.name, d)
|
||||
}
|
||||
return distMap;
|
||||
}
|
||||
|
||||
def createCityDatas(cityCodeDatas, distCodeMap, distMap, prices){
|
||||
def rets = []
|
||||
if(prices){
|
||||
for(def ps : prices){
|
||||
def dist = distMap.get(ps.match_region+"##"+ps.match_name)
|
||||
if(dist){
|
||||
def ret = []
|
||||
def areaData = distCodeMap.get(dist.region)
|
||||
if(areaData){
|
||||
ret << ps._id.toString()
|
||||
ret << dist._id.toString()
|
||||
ret << dist.name
|
||||
ret << cityCodeDatas.get(dist.city)
|
||||
ret << dist.city
|
||||
ret << areaData.district_code
|
||||
ret << areaData.district
|
||||
ret << ps.avg_price
|
||||
ret << ps.source_type
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(ps.c_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(ps.c_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
rets << ret
|
||||
}
|
||||
}else{
|
||||
println ps.match_region+"##"+ps.match_name
|
||||
}
|
||||
}
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import groovy.sql.Sql
|
||||
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 估价系数数据同步
|
||||
*/
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class EvaluateRateBatch extends BaseBatch{
|
||||
|
||||
static final def sqlInstance = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/goojia_fangjia?&characterEncoding=utf8", "sa", "G00jia", "com.mysql.jdbc.Driver")
|
||||
|
||||
static main(args) {
|
||||
runBatch(new EvaluateRateBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
|
||||
def allDatas = createDatas(findEvaluationRate())
|
||||
def headers = ["系数ID","系数类型","系数","排序","城市","备注","创建时间","更新时间","来源公司"]
|
||||
def rets = []
|
||||
rets << headers
|
||||
rets.addAll(allDatas)
|
||||
ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\EVALUATE_RATE_GJ.xlsx", rets, "数据")
|
||||
FileUtils.batchCreateFile(allDatas, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\EVALUATE_RATE_GJ.dat",headers, "utf-8", false);
|
||||
}
|
||||
|
||||
def createDatas(def datas){
|
||||
def allRows = []
|
||||
datas.each { m ->
|
||||
if(m.rank_remark!="开发商装修"){
|
||||
def data = []
|
||||
data << m.id.toString()
|
||||
data << m.rate_type
|
||||
data << m.rate
|
||||
data << m.rank
|
||||
data << "全国"
|
||||
data << converFitment(m.rank_remark)
|
||||
data << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
data << DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
data << "FJW"
|
||||
allRows << data
|
||||
}
|
||||
}
|
||||
return allRows
|
||||
}
|
||||
|
||||
private def converFitment(rank_remark){
|
||||
if(rank_remark){
|
||||
if(rank_remark.contains("简单装修")){
|
||||
return "简装"
|
||||
}else if(rank_remark.contains("精装修")){
|
||||
return "精装"
|
||||
}else if(rank_remark.contains("豪华装修")){
|
||||
return "豪装"
|
||||
}
|
||||
}
|
||||
return rank_remark
|
||||
}
|
||||
|
||||
private def findEvaluationRate(){
|
||||
def sql = "SELECT id, rate_type, rate, rank, rank_remark,date_created, last_updated FROM rate WHERE TYPE = '小区'";
|
||||
def rets = []
|
||||
sqlInstance.eachRow(sql,{
|
||||
rets << ["id":it.id, "rate_type":it.rate_type, "rate":it.rate, "rank":it.rank,"rank_remark":it.rank_remark,"c_date":it.date_created, "m_date":it.last_updated]
|
||||
});
|
||||
return rets;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,819 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.core.RegionData
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.ccbevaluation.CcbFtpUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import groovy.sql.Sql
|
||||
|
||||
import java.sql.ResultSet
|
||||
|
||||
class ExportOracleData {
|
||||
|
||||
def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl",
|
||||
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
|
||||
|
||||
static main(args) {
|
||||
def task = new ExportOracleData()
|
||||
task.run()
|
||||
}
|
||||
def run(){
|
||||
// exportEvaluationRateData()
|
||||
// exportBigdataPoiData()
|
||||
// exportCommunityStaging()
|
||||
// exportCommunityBuileType()
|
||||
// exportBigdataDistrictData()
|
||||
// exportGuidedPrice()
|
||||
// exportCommunityGuidedPrice()
|
||||
// exportBigdataDeal()
|
||||
exportThirdPartyPrice()
|
||||
|
||||
// exportBigdataCommunity()
|
||||
// exportBigdataForsale()
|
||||
|
||||
// exportAvmEvaluationGJNB()
|
||||
// exportAVMEvaluationItemGJNB()
|
||||
// exportCommunityBasePrice()
|
||||
|
||||
// exportCommunityBasePriceGj()
|
||||
// exportCityPrice()
|
||||
// exportRegionPrice()
|
||||
// exportLastFile()
|
||||
}
|
||||
|
||||
|
||||
def exportEvaluationRateData(){
|
||||
def sql = "select ID,RATE_TYPE,RATE,RANK,CITY,REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from evaluate_rate_gj";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.RATE_TYPE
|
||||
data << r.RATE
|
||||
data << r.RANK
|
||||
data << r.CITY
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/output/MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/output/MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["系数ID","系数类型","系数","排序","城市","备注","创建时间","更新时间","来源公司"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "上传Ftp完成......"
|
||||
}
|
||||
|
||||
|
||||
def exportBigdataPoiData(){
|
||||
def sql = "select CITYID, DISTID, ID, POI_NAME, TYPE, TYPE_CODE, LATITUDE, LONGITUDE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from bigdata_poi_gj where cityId in (350200,150100)";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.CITYID
|
||||
data << r.DISTID
|
||||
data << r.ID
|
||||
data << r.POI_NAME
|
||||
data << r.TYPE
|
||||
data << r.TYPE_CODE
|
||||
data << r.LATITUDE
|
||||
data << r.LONGITUDE
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["城市ID","行政区ID","ID","Poi名称","类型","类型编码","纬度","经度","备注","创建时间","更新时间","来源公司"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "BIGDATA_POI_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "BIGDATA_POI_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportCommunityStaging(){
|
||||
def sql = "select ID,COMMID,MASTER_COMMID,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_staging_gj";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.COMMID
|
||||
data << r.MASTER_COMMID
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["分期ID","小区ID","小区主期ID","备注","创建时间","更新时间","来源公司"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "COMMUNITY_STAGING_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "COMMUNITY_STAGING_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportCommunityBuileType(){
|
||||
def sql = "select CITYID, COMMID, BUILDTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, WORKDATE from bigdata_commbuildtype_gj where CITYID in (350200,150100)";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.CITYID
|
||||
data << r.COMMID
|
||||
data << r.BUILDTYPE
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
data << r.WORKDATE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["城市ID","小区ID"," 建筑类型","备注","创建时间","更新时间","来源公司","数据时间"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "BIGDATA_COMMBUILDTYPE_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "BIGDATA_COMMBUILDTYPE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportBigdataDistrictData(){
|
||||
|
||||
def sql = "select DISTID, DISTNAME, DISTSPELL, CITYID, DISTCODE, SEQ, DISTTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE, LJXZQH, LJXZQHDM, XZQHDM, WORKDATE from bigdata_district_gj where cityId in (350200,150100)";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.DISTSPELL
|
||||
data << r.CITYID
|
||||
data << r.DISTCODE
|
||||
data << r.SEQ
|
||||
data << r.DISTTYPE
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
data << r.LJXZQH
|
||||
data << r.LJXZQHDM
|
||||
data << r.XZQHDM
|
||||
data << r.WORKDATE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["行政区ID","行政区名称","行政区名称拼音","城市ID","国标码","显示顺序","行政区类别","备注","创建时间","更新时间","来源公司","逻辑行政区","逻辑行政区划代码","行政区划代码","数据时间"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "BIGDATA_DISTRICT_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "BIGDATA_DISTRICT_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
|
||||
def exportGuidedPrice(){
|
||||
def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE,AVG_PRICE, GUIDING_PERSON, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE from guided_price_gj where dealdate>=TO_DATE('2021-08-01', 'yyyy-MM-dd') and dealdate<TO_DATE('2021-09-01', 'yyyy-MM-dd') and cityname='上海'";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.DEALDATE
|
||||
data << r.AVG_PRICE
|
||||
data << r.GUIDING_PERSON
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导日期","指导价格","添加人","备注","创建时间","更新时间","来源公司"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "GUIDED_PRICE_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "GUIDED_PRICE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportCommunityGuidedPrice(){
|
||||
def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, AVGPRICE, SOURCETYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME , SOURCECODE from community_guide_price_gj where cityname='西安'";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.AVGPRICE
|
||||
data << r.SOURCETYPE
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导价格","类型","备注","创建时间","更新时间","来源公司"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "COMMUNITY_GUIDE_PRICE_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202107")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202107")
|
||||
println "COMMUNITY_GUIDE_PRICE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportBigdataDeal(){
|
||||
def sql = "select CITYID, DEALID, CITYNAME, DISTID, DISTNAME, STREET, STREETNO, COMMID, COMMNAME, BUILDID, BUILDNO, BUILDNAME, UNITID, UNITNO, UNITNAME, \n" +
|
||||
"HOUSEID, ADDRESS, BUILDYEAR, PROPTYPE, PROPYEARS, PERIODNUM, FLOORNUM, FLOORTYPE, FLOORCNT, BUILDTYPE, BUILDSTRU, BUILDAREA, LIVINGAREA, HOUSESTYLE, ROOMCNT, LIVINGROOMCNT, KITCHENCNT, BATHROOMCNT, \n" +
|
||||
"HOUSEUSE, HOUSESTRU, HOUSEASPECT, FITMENT, EVALUATENO, DEALUNITPRICE, DEALTOTALPRICE, DECLAREPRICE, EVALUATEPRICE, CONTRACTNO, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE, DEALTYPE, \n" +
|
||||
"PAYTYPE, DEALPERIOD, IFELEVATOR, COMPAREAGARDEN, COMPAREATERRACE, COMPAREABALCONY, COMPAREABAYWINDOW, COMPAREAATTIC, COMPAREAGARAGE, COMPAREABASEMENT, COMPAREAOTHER, DATASOURCE, AGENCYID, AGENCYNAME, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, CJJE, WORKDATE\n" +
|
||||
"from bigdata_deal_gj where cityId in (350200,150100) and dealdate>=to_date('2021-08-01','yyyy-mm-dd')";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.CITYID
|
||||
data << r.DEALID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.STREET
|
||||
data << r.STREETNO
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.BUILDID
|
||||
data << r.BUILDNO
|
||||
data << r.BUILDNAME
|
||||
data << r.UNITID
|
||||
data << r.UNITNO
|
||||
data << r.UNITNAME
|
||||
data << r.HOUSEID
|
||||
data << r.ADDRESS
|
||||
data << r.BUILDYEAR
|
||||
data << r.PROPTYPE
|
||||
data << r.PROPYEARS
|
||||
data << r.PERIODNUM
|
||||
data << r.FLOORNUM
|
||||
data << r.FLOORTYPE
|
||||
data << r.FLOORCNT
|
||||
data << r.BUILDTYPE
|
||||
data << r.BUILDSTRU
|
||||
data << r.BUILDAREA
|
||||
data << r.LIVINGAREA
|
||||
data << r.HOUSESTYLE
|
||||
data << r.ROOMCNT
|
||||
data << r.LIVINGROOMCNT
|
||||
data << r.KITCHENCNT
|
||||
data << r.BATHROOMCNT
|
||||
data << r.HOUSEUSE
|
||||
data << r.HOUSESTRU
|
||||
data << r.HOUSEASPECT
|
||||
data << r.FITMENT
|
||||
data << r.EVALUATENO
|
||||
data << r.DEALUNITPRICE
|
||||
data << r.DEALTOTALPRICE
|
||||
data << r.DECLAREPRICE
|
||||
data << r.EVALUATEPRICE
|
||||
data << r.CONTRACTNO
|
||||
data << r.DEALDATE
|
||||
data << r.DEALTYPE
|
||||
data << r.PAYTYPE
|
||||
data << r.DEALPERIOD
|
||||
data << r.IFELEVATOR
|
||||
data << r.COMPAREAGARDEN
|
||||
data << r.COMPAREATERRACE
|
||||
data << r.COMPAREABALCONY
|
||||
data << r.COMPAREABAYWINDOW
|
||||
data << r.COMPAREAATTIC
|
||||
data << r.COMPAREAGARAGE
|
||||
data << r.COMPAREABASEMENT
|
||||
data << r.COMPAREAOTHER
|
||||
data << r.DATASOURCE
|
||||
data << r.AGENCYID
|
||||
data << r.AGENCYNAME
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
data << r.CJJE
|
||||
data << r.WORKDATE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "BIGDATA_DEAL_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "BIGDATA_DEAL_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
|
||||
def exportThirdPartyPrice(){
|
||||
def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, YEAR_MONTH, ZHUGE_AVG_PRICE, ANJUKE_AVG_PRICE, FANG_AVG_PRICE, LIANJIA_AVG_PRICE, CITYHOUSE_AVG_PRICE, MAITIAN_AVG_PRICE, KE_AVG_PRICE, \n" +
|
||||
"TAOFANG_AVG_PRICE, ZHONGYUAN_AVG_PRICE, TBS_AVG_PRICE, QFANG_AVG_PRICE, FANGTAN_AVG_PRICE, FANGDUODUO_AVG_PRICE, WIWJ_AVG_PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE\n" +
|
||||
"from third_party_price_gj";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.YEAR_MONTH
|
||||
data << r.ZHUGE_AVG_PRICE
|
||||
data << r.ANJUKE_AVG_PRICE
|
||||
data << r.FANG_AVG_PRICE
|
||||
data << r.LIANJIA_AVG_PRICE
|
||||
data << r.CITYHOUSE_AVG_PRICE
|
||||
data << r.MAITIAN_AVG_PRICE
|
||||
data << r.KE_AVG_PRICE
|
||||
data << r.TAOFANG_AVG_PRICE
|
||||
data << r.ZHONGYUAN_AVG_PRICE
|
||||
data << r.TBS_AVG_PRICE
|
||||
data << r.QFANG_AVG_PRICE
|
||||
data << r.FANGTAN_AVG_PRICE
|
||||
data << r.FANGDUODUO_AVG_PRICE
|
||||
data << r.WIWJ_AVG_PRICE
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","均价对应的月份","诸葛找房均价","安居客均价","房天下均价","链家均价","城市房产均价","麦田均价","贝壳均价","淘房365","中原均价","兔博士均价","Q房均价","房探均价","房多多均价","我爱我家均价","创建时间","更新时间","来源公司"]
|
||||
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "THIRD_PARTY_PRICE_GJ 数据文件输出完成......"
|
||||
// CcbFtpUtils.ftpUpload(fileName, "202107")
|
||||
// CcbFtpUtils.ftpUpload(dataCodeFileName, "202107")
|
||||
// println "THIRD_PARTY_PRICE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportBigdataCommunity(){
|
||||
def sql = "select CITYID, DISTID, COMMID, DISTNAME, COMMNAME, ADDRESS, LATITUDE, LONGITUDE, LANDAREA, BUILDAREA, GREENINGRATE, PLOTRATIO, PARKINGCNT, BUILDYEAR, HOUSEUSE, ZTS, WORKDATE, UPDATEFLAG, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,COMMTYPE, \n" +
|
||||
"\tCOMMALIAS, STREET, STREETNO, IFNEW, INTRODUCTION, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, SOURCECODE, XZJDB, LJXZQHDM, LJXZQH,STATUS from bigdata_community_gj ";//where cityId in (350200,150100)
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.CITYID
|
||||
data << r.DISTID
|
||||
data << r.COMMID
|
||||
data << r.DISTNAME
|
||||
data << r.COMMNAME
|
||||
data << r.ADDRESS
|
||||
data << r.LATITUDE
|
||||
data << r.LONGITUDE
|
||||
data << r.LANDAREA
|
||||
data << r.BUILDAREA
|
||||
data << r.GREENINGRATE
|
||||
data << r.PLOTRATIO
|
||||
data << r.PARKINGCNT
|
||||
data << r.BUILDYEAR
|
||||
data << r.HOUSEUSE
|
||||
data << r.ZTS
|
||||
data << r.WORKDATE
|
||||
data << r.UPDATEFLAG
|
||||
data << r.UPDATETIME
|
||||
data << r.COMMTYPE
|
||||
data << r.COMMALIAS
|
||||
data << r.STREET
|
||||
data << r.STREETNO
|
||||
data << r.IFNEW
|
||||
data << ""
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.SOURCECODE
|
||||
data << r.XZJDB
|
||||
data << r.LJXZQHDM
|
||||
data << r.LJXZQH
|
||||
data << r.STATUS
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMUNITY_GJ.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMUNITY_GJ.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_COMMUNITY_GJ_ALL_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_COMMUNITY_GJ_ALL_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["城市ID","行政区ID","小区ID","行政区名称","小区名称","详细地址","纬度","经度","占地总面积","建筑总面积","绿化率","容积率","车位数量","建筑年代","房屋用途",
|
||||
//"总套数","数据时间","更新标记","更新时间","小区类型","小区曾用名","街道","门牌号","是否新盘","小区介绍","备注","创建时间","来源公司",
|
||||
//"乡镇/街道办","逻辑行政区划代码","逻辑行政区划","状态"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "BIGDATA_COMMUNITY_GJ 数据文件输出完成......"
|
||||
// CcbFtpUtils.ftpUpload(fileName, "202109")
|
||||
// CcbFtpUtils.ftpUpload(dataCodeFileName, "202109")
|
||||
// println "BIGDATA_COMMUNITY_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportBigdataForsale(){
|
||||
def sql = "select CITYID,FORSALEID,PROPCODE,CITYNAME,DISTID,DISTNAME,COMMID,COMMNAME, BUILDID,BUILDNO, BUILDNAME,UNITID,UNITNO,UNITNAME,HOUSEID,ADDRESS,BUILDYEAR,PROPTYPE,PROPYEARS,UNITPRICE,TOTALPRICE,PAYTYPE,FLOORNUM,FLOORCNT,\n" +
|
||||
" BUILDTYPE, HOUSESTRU,BUILDSTRU,BUILDAREA,LIVINGAREA,HOUSESTYLE,ROOMCNT,LIVINGROOMCNT,KITCHENCNT, BATHROOMCNT,HOUSEASPECT,FITMENT,IFELEVATOR,ELEVATORHOUSE,to_char(PUBLISHTIME,'yyyy-mm-dd hh24:mi:ss') as PUBLISHTIME,to_char(EXPIRETIME,'yyyy-mm-dd hh24:mi:ss') as EXPIRETIME,\n" +
|
||||
" IFFIRST,DATASOURCE,AGENCYID,AGENCYNAME,PUBLISHER,PHONE,DESCRIPTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,ATTACH from bigdata_forsale_gj where PUBLISHTIME>=to_date('2021-09-01','yyyy-mm-dd')";//(cityId=350200 or cityId=150100) and
|
||||
def allRows = []
|
||||
def index = 0
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
index = index+1
|
||||
println index
|
||||
def data = []
|
||||
data << r.CITYID
|
||||
data << r.FORSALEID
|
||||
data << r.PROPCODE
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.BUILDID
|
||||
data << r.BUILDNO
|
||||
data << r.BUILDNAME
|
||||
data << r.UNITID
|
||||
data << r.UNITNO
|
||||
data << r.UNITNAME
|
||||
data << r.HOUSEID
|
||||
data << r.ADDRESS
|
||||
data << r.BUILDYEAR
|
||||
data << r.PROPTYPE
|
||||
data << r.PROPYEARS
|
||||
data << r.UNITPRICE
|
||||
data << r.TOTALPRICE
|
||||
data << r.PAYTYPE
|
||||
data << r.FLOORNUM
|
||||
data << r.FLOORCNT
|
||||
data << r.BUILDTYPE
|
||||
data << r.HOUSESTRU
|
||||
data << r.BUILDSTRU
|
||||
data << r.BUILDAREA
|
||||
data << r.LIVINGAREA
|
||||
data << r.HOUSESTYLE
|
||||
data << r.ROOMCNT
|
||||
data << r.LIVINGROOMCNT
|
||||
data << r.KITCHENCNT
|
||||
data << r.BATHROOMCNT
|
||||
data << r.HOUSEASPECT
|
||||
data << r.FITMENT
|
||||
data << r.IFELEVATOR
|
||||
data << r.ELEVATORHOUSE
|
||||
data << r.PUBLISHTIME
|
||||
data << r.EXPIRETIME
|
||||
data << r.IFFIRST
|
||||
data << r.DATASOURCE
|
||||
data << r.AGENCYID
|
||||
data << r.AGENCYNAME
|
||||
data << r.PUBLISHER
|
||||
data << r.PHONE
|
||||
data << ""
|
||||
data << r.REMARK
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
data << r.ATTACH
|
||||
allRows << data
|
||||
});
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "BIGDATA_FORSALE_GJ 数据文件输出完成......"
|
||||
// CcbFtpUtils.ftpUpload(fileName, "202107")
|
||||
// CcbFtpUtils.ftpUpload(dataCodeFileName, "202107")
|
||||
// println "BIGDATA_FORSALE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
|
||||
def exportAvmEvaluationGJNB(){
|
||||
def sql = "select ID,CITYID,CITYNAME, YEAR_MONTH, COMMUNITY_NUM, HAS_PRICE_COMMUNITY_NUM, PRICE_COVERAGE, ARTIFICIAL_CALC_NUM, ARTIFICIAL_CALC_COVERAGE, SAMPLE_CALC_NUM, SAMPLE_CALC_COVERAGE, \n" +
|
||||
"ANN_CALC_NUM, ANN_CALC_COVERAGE, TEST_NUM, TEST_COMM_NUM, TEST_COMM_COVERAGE, PPE15_COVERAGE, RATE_MEDIAN, COEFFICIENT,DEAL_TEST_CASE_NUM, DEAL_TEST_COMM_NUM, DEAL_TEST_COMM_COVERAGE, DEAL_PPE15_COVERAGE, \n" +
|
||||
"DEAL_COEFFICIENT, DEAL_RATE_MEDIAN, THIRD_TEST_CASE_NUM, THIRD_TEST_COMM_NUM, THIRD_TEST_COMM_COVERAGE, THIRD_PPE15_COVERAGE, THIRD_COEFFICIENT, THIRD_RATE_MEDIAN, \n" +
|
||||
"to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from avm_evaluation_gj where (cityId=350200 or cityId=150100) and year_month<202108 ";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.YEAR_MONTH
|
||||
data << r.COMMUNITY_NUM
|
||||
data << r.HAS_PRICE_COMMUNITY_NUM
|
||||
data << r.PRICE_COVERAGE
|
||||
data << r.ARTIFICIAL_CALC_NUM
|
||||
data << r.ARTIFICIAL_CALC_COVERAGE
|
||||
data << r.SAMPLE_CALC_NUM
|
||||
data << r.SAMPLE_CALC_COVERAGE
|
||||
data << r.ANN_CALC_NUM
|
||||
data << r.ANN_CALC_COVERAGE
|
||||
data << r.TEST_NUM
|
||||
data << r.TEST_COMM_NUM
|
||||
data << r.TEST_COMM_COVERAGE
|
||||
data << r.PPE15_COVERAGE
|
||||
data << r.RATE_MEDIAN
|
||||
data << r.COEFFICIENT
|
||||
data << r.DEAL_TEST_CASE_NUM
|
||||
data << r.DEAL_TEST_COMM_NUM
|
||||
data << r.DEAL_TEST_COMM_COVERAGE
|
||||
data << r.DEAL_PPE15_COVERAGE
|
||||
data << r.DEAL_COEFFICIENT
|
||||
data << r.DEAL_RATE_MEDIAN
|
||||
data << r.THIRD_TEST_CASE_NUM
|
||||
data << r.THIRD_TEST_COMM_NUM
|
||||
data << r.THIRD_TEST_COMM_COVERAGE
|
||||
data << r.THIRD_PPE15_COVERAGE
|
||||
data << r.THIRD_COEFFICIENT
|
||||
data << r.THIRD_RATE_MEDIAN
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["ID","CITYID","CITYNAME","YEAR_MONTH","COMMUNITY_NUM","HAS_PRICE_COMMUNITY_NUM","PRICE_COVERAGE","ARTIFICIAL_CALC_NUM","ARTIFICIAL_CALC_COVERAGE","SAMPLE_CALC_NUM","SAMPLE_CALC_COVERAGE",
|
||||
//"ANN_CALC_NUM","ANN_CALC_COVERAGE","TEST_NUM","TEST_COMM_NUM","TEST_COMM_COVERAGE","PPE15_COVERAGE","RATE_MEDIAN","COEFFICIENT","DEAL_TEST_CASE_NUM","DEAL_TEST_COMM_NUM","DEAL_TEST_COMM_COVERAGE","DEAL_PPE15_COVERAGE",
|
||||
//"DEAL_COEFFICIENT","DEAL_RATE_MEDIAN","THIRD_TEST_CASE_NUM","THIRD_TEST_COMM_NUM","THIRD_TEST_COMM_COVERAGE","THIRD_PPE15_COVERAGE","THIRD_COEFFICIENT","THIRD_RATE_MEDIAN","CREATETIME","UPDATETIME","SOURCECODE"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "AVM_EVALUATION_GJNB 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202107")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202107")
|
||||
println "AVM_EVALUATION_GJNB 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportAVMEvaluationItemGJNB(){
|
||||
def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, CONFIDENCE,TARGET_AVG_PRICE, \n" +
|
||||
"to_char(DEALDATE,'yyyy-mm-dd hh24:mi:ss') as DEALDATE, UNIT_PRICE, BUILDAREA, FITMENT, HOUSEASPECT, FLOORNUM, FLOORCNT, DATA_TYPE, RATE, PE, \n" +
|
||||
"to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME from avm_evaluation_item_gj where (cityId=350200 or cityId=150100) and year_month>=202108";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.YEAR_MONTH
|
||||
data << r.CALC_AVG_PRICE
|
||||
data << r.AVG_PRICE
|
||||
data << r.CALC_TYPE
|
||||
data << r.CONFIDENCE
|
||||
data << r.TARGET_AVG_PRICE
|
||||
data << r.DEALDATE
|
||||
data << r.UNIT_PRICE
|
||||
data << r.BUILDAREA
|
||||
data << r.FITMENT
|
||||
data << r.HOUSEASPECT
|
||||
data << r.FLOORNUM
|
||||
data << r.FLOORCNT
|
||||
data << r.DATA_TYPE
|
||||
data << r.RATE
|
||||
data << r.PE
|
||||
data << r.CREATETIME
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","CONFIDENCE","TARGET_AVG_PRICE","DEALDATE","UNIT_PRICE","BUILDAREA","FITMENT","HOUSEASPECT","FLOORNUM","FLOORCNT","DATA_TYPE","RATE","PE","CREATETIME"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "AVM_EVALUATION_ITEM_GJNB 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "AVM_EVALUATION_ITEM_GJNB 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportCommunityBasePrice(){
|
||||
def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, FAKE_RATE, DIFF_RATE, CONFI_RATE, CORR_RATE, CONFIDENCE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_base_price_gj where (cityId=350200 or cityId=150100) and year_month<202108";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.COMMID
|
||||
data << r.COMMNAME
|
||||
data << r.YEAR_MONTH
|
||||
data << r.CALC_AVG_PRICE
|
||||
data << r.AVG_PRICE
|
||||
data << r.CALC_TYPE
|
||||
data << r.FAKE_RATE
|
||||
data << r.DIFF_RATE
|
||||
data << r.CONFI_RATE
|
||||
data << r.CORR_RATE
|
||||
data << r.CONFIDENCE
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","FAKE_RATE","DIFF_RATE","CONFI_RATE","CORR_RATE","CONFIDENCE","CREATETIME","UPDATETIME","SOURCECODE"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "COMMUNITY_BASE_PRICE_GJNB 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202107")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202107")
|
||||
println "COMMUNITY_BASE_PRICE_GJNB 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportCommunityBasePriceGj(){
|
||||
|
||||
}
|
||||
|
||||
def exportCityPrice(){
|
||||
def sql = "select ID, CITYID, CITYNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from city_price_gj where (cityId=350200 or cityId=150100) and year_month>=202108";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.YEAR_MONTH
|
||||
data << r.CALC_AVG_PRICE
|
||||
data << r.PRICE
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_CITY_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","FAKE_RATE","DIFF_RATE","CONFI_RATE","CORR_RATE","CONFIDENCE","CREATETIME","UPDATETIME","SOURCECODE"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "CITY_PRICE_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "CITY_PRICE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportRegionPrice(){
|
||||
def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from DISTRICT_PRICE_GJ where (cityId=350200 or cityId=150100) and year_month>=202108";
|
||||
def allRows = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
def data = []
|
||||
data << r.ID
|
||||
data << r.CITYID
|
||||
data << r.CITYNAME
|
||||
data << r.DISTID
|
||||
data << r.DISTNAME
|
||||
data << r.YEAR_MONTH
|
||||
data << r.CALC_AVG_PRICE
|
||||
data << r.PRICE
|
||||
data << r.CREATETIME
|
||||
data << r.UPDATETIME
|
||||
data << r.SOURCECODE
|
||||
allRows << data
|
||||
});
|
||||
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
def fileName = "/ccb/MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
def dataCodeFileName = "/ccb/MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.dat"
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.ok"
|
||||
}
|
||||
def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","FAKE_RATE","DIFF_RATE","CONFI_RATE","CORR_RATE","CONFIDENCE","CREATETIME","UPDATETIME","SOURCECODE"]
|
||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||
FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false);
|
||||
println "DISTRICT_PRICE_GJ 数据文件输出完成......"
|
||||
CcbFtpUtils.ftpUpload(fileName, "202108")
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "202108")
|
||||
println "DISTRICT_PRICE_GJ 上传Ftp完成......"
|
||||
}
|
||||
|
||||
def exportLastFile(){
|
||||
def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd")
|
||||
|
||||
def curMonth = DateUtils.formatDateByPattern(new Date(), "yyyyMM")
|
||||
def dataCodeFileName = "/ccb/${curDate}.ok"
|
||||
if(CommonDatautils.isWindow()){
|
||||
dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curMonth}\\${curDate}.ok"
|
||||
}
|
||||
CcbFtpUtils.ftpUpload(dataCodeFileName, "${curMonth}")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||
import com.fangjia.script.gj.ccb.FileUtils
|
||||
import com.fangjia.script.thirdPriceCrawl.CrawalDBUtil
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import org.bson.types.ObjectId
|
||||
/**
|
||||
* 建行模型估值项目
|
||||
* 人工指导价同步
|
||||
*/
|
||||
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class GuiDingPriceBatch extends BaseBatch{
|
||||
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(40)
|
||||
def sDate= Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM"));
|
||||
def static final DBCollection dataProcessColl = CrawalDBUtil.getDataProcessCol();
|
||||
|
||||
static main(args) {
|
||||
runBatch(new GuiDingPriceBatch(), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(Object args) {
|
||||
def citys = CcbCommonUtils.citys;
|
||||
def rows = []
|
||||
|
||||
for (def city : citys) {
|
||||
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
|
||||
//添加自己库中的人工指导价
|
||||
def prices = CcbCommonUtils.findPersonPrice(city, DateUtils.addMonth(new Date(), -6))
|
||||
if(prices){
|
||||
def distMap = getDistrictMap(city)
|
||||
def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, prices)
|
||||
rows.addAll(rets)
|
||||
println city + " " + rets.size()
|
||||
}
|
||||
|
||||
//添加搜房的参考价
|
||||
def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat", "alias"]);
|
||||
// def datas = findFangDatas(districts)
|
||||
// def fangRets = createDatas(cityCodeDatas, distCodeMap, datas)
|
||||
// rows.addAll(fangRets)
|
||||
|
||||
//添加保亭文昌的指导价
|
||||
def cityDatas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\文昌-保亭待调查小区价格 - 210902(1).xlsx")
|
||||
def cityDataMap = [:]
|
||||
for(def d : cityDatas){
|
||||
cityDataMap.put(d['A'], d['E'])
|
||||
}
|
||||
def personDatas = findPersonDatas(districts, cityDataMap);
|
||||
def personRets = createDatas(cityCodeDatas, distCodeMap, personDatas)
|
||||
rows.addAll(personRets)
|
||||
|
||||
}
|
||||
|
||||
def headers = ["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导日期","指导价格","添加人","备注","创建时间","更新时间","来源公司"]
|
||||
FileUtils.batchCreateFile(rows, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\GUIDED_PRICE_GJ.dat", headers, "utf-8", false);
|
||||
|
||||
// def rets = []
|
||||
// rets << headers
|
||||
// rets.addAll(rows)
|
||||
// ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\guiding_price.xlsx", rets, "数据")
|
||||
|
||||
}
|
||||
|
||||
def findFangDatas(def districts){
|
||||
def totalCount = new AtomicLong()
|
||||
final CountDownLatch latch = new CountDownLatch(districts.size())
|
||||
println " 小区量:"+districts.size()
|
||||
def result = Collections.synchronizedList(new ArrayList());
|
||||
for(def i=0;i<districts.size();i++){
|
||||
final def dist = districts[i];
|
||||
fixedThreadPool.execute(new Runnable() {
|
||||
void run() {
|
||||
try {
|
||||
totalCount.addAndGet(1)
|
||||
def obj = findMatchThirdPrice(dist)
|
||||
if(obj && obj.avg_price){
|
||||
result << ["dist_id":dist._id.toString(),"city":dist.city, "region":dist.region, "name":dist.name, "avg_price":obj.avg_price,"row_id":obj._id.toString(), "m_date":obj.m_date]
|
||||
println totalCount.get() +" "+dist.city+" "+dist.region+" "+dist.name +" "+obj.avg_price
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
latch.countDown()
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
latch.await()
|
||||
return result
|
||||
}
|
||||
|
||||
def findPersonDatas(def districts, def dataMap){
|
||||
def result = []
|
||||
for(def i=0;i<districts.size();i++) {
|
||||
def dist = districts[i];
|
||||
def price = dataMap.get(dist._id.toString())
|
||||
if (price) {
|
||||
result << ["dist_id": dist._id.toString(), "city": dist.city, "region": dist.region, "name": dist.name, "avg_price": price.toInteger(), "row_id": new ObjectId(), "m_date": new Date()]
|
||||
println dist.city + " " + dist.region + " " + dist.name + " " + price
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
def findMatchThirdPrice(dist){
|
||||
def q = new BasicDBObject()
|
||||
q.put("match_city", dist.city)
|
||||
q.put("match_region", dist.region)
|
||||
q.put("match_name", dist.name)
|
||||
q.put("s_date", sDate)
|
||||
q.put("source","搜房")
|
||||
def obj = dataProcessColl.findOne(q)
|
||||
return obj
|
||||
}
|
||||
|
||||
def createCityDatas(cityCodeDatas, distCodeMap, distMap, prices){
|
||||
def rets = []
|
||||
if(prices){
|
||||
for(def ps : prices){
|
||||
def dist = distMap.get(ps.region+"##"+ps.name)
|
||||
if(dist){
|
||||
def ret = []
|
||||
def areaData = distCodeMap.get(dist.region)
|
||||
if(areaData){
|
||||
ret << ps._id.toString()
|
||||
ret << dist._id.toString()
|
||||
ret << dist.name
|
||||
ret << cityCodeDatas.get(dist.city)
|
||||
ret << dist.city
|
||||
ret << areaData.district_code
|
||||
ret << areaData.district
|
||||
ret << DateUtils.formatDateByPattern(ps.guiding_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << ps.guiding_value
|
||||
ret << "房价网"
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(ps.guiding_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(ps.guiding_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
rets << ret
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
|
||||
def createDatas(cityCodeDatas, distCodeMap, datas){
|
||||
def rets = []
|
||||
if(datas) {
|
||||
for (def ps : datas) {
|
||||
def ret = []
|
||||
def areaData = distCodeMap.get(ps.region)
|
||||
if (areaData) {
|
||||
ret << ps.row_id
|
||||
ret << ps.dist_id
|
||||
ret << ps.name
|
||||
ret << cityCodeDatas.get(ps.city)
|
||||
ret << ps.city
|
||||
ret << areaData.district_code
|
||||
ret << areaData.district
|
||||
ret << DateUtils.formatDateByPattern(ps.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << ps.avg_price
|
||||
ret << "房价网"
|
||||
ret << ""
|
||||
ret << DateUtils.formatDateByPattern(ps.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << DateUtils.formatDateByPattern(ps.m_date, "yyyy-MM-dd HH:mm:ss")
|
||||
ret << "FJW"
|
||||
rets << ret
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
|
||||
def createPersonDatas(cityCodeDatas, distCodeMap, dataMap){
|
||||
|
||||
}
|
||||
|
||||
def getDistrictMap(def city){
|
||||
def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat", "alias"]);
|
||||
def distMap = [:]
|
||||
for(def d : districts){
|
||||
distMap.put(d.region+"##"+d.name, d)
|
||||
}
|
||||
return distMap;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
|
||||
class LoadGuide {
|
||||
public static final DBCollection DISTRICT_GUIDE_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "district_guide_price", "mongo.db.fangjia.com", 28017)
|
||||
|
||||
static main(args) {
|
||||
def task = new LoadGuide()
|
||||
task.run()
|
||||
}
|
||||
|
||||
def run(){
|
||||
// saveDongGuangPrice("D:\\数据\\建行\\房产估值\\指导价\\东莞二手房政府指导价.xls")
|
||||
// saveChengduoPrice("D:\\数据\\建行\\房产估值\\指导价\\成都部分住宅小区二手房成交参考价格201-286-258.xlsx")
|
||||
// savePrice("D:\\数据\\建行\\房产估值\\指导价\\绍兴指导价小区_0909.xlsx")
|
||||
// savePrice("D:\\数据\\建行\\房产估值\\指导价\\宁波交易参考价格.xlsx")
|
||||
// savePrice("D:\\数据\\建行\\房产估值\\指导价\\西安成交参考价格.xlsx")
|
||||
// savePrice("D:\\数据\\建行\\房产估值\\指导价\\无锡100 广州96 二手住房成交参考价格表.xlsx")
|
||||
savePrice("D:\\数据\\建行\\房产估值\\指导价\\深圳指导价 - 210909 -.xlsx")
|
||||
|
||||
}
|
||||
|
||||
def savePrice(filePath){
|
||||
def datas = ExcelUtils.read(filePath,0, 1)
|
||||
def rets = []
|
||||
for(def d : datas){
|
||||
if(d['E']){
|
||||
def o = new BasicDBObject()
|
||||
o.city = d['E']
|
||||
o.region = d['A']
|
||||
o.name = d['C']
|
||||
o.avg_price = d['D'].toString().toDouble().toInteger()
|
||||
o.match_city = d['E']
|
||||
o.match_region = d['F']
|
||||
o.match_name = d['G']
|
||||
o.source_type = 1 //1:成交参考价 2:参考价
|
||||
o.c_date = new Date()
|
||||
rets << o
|
||||
}
|
||||
}
|
||||
if(rets){
|
||||
println rets.size()
|
||||
DISTRICT_GUIDE_PRICE_COLL.insert(rets)
|
||||
}
|
||||
}
|
||||
|
||||
def saveDongGuangPrice(def filePath){
|
||||
def datas = ExcelUtils.read(filePath,0, 0)
|
||||
def rets = []
|
||||
for(def d : datas){
|
||||
if(d['E']){
|
||||
def o = new BasicDBObject()
|
||||
o.city = d['E']
|
||||
o.region = d['A']
|
||||
o.name = d['B']
|
||||
o.avg_price = d['D'].toString().toDouble().toInteger()
|
||||
o.match_city = d['E']
|
||||
o.match_region = d['F']
|
||||
o.match_name = d['G']
|
||||
o.house_count = d['C'].toString().toDouble().toInteger()
|
||||
o.source_type = 1 //1:成交参考价 2:参考价
|
||||
o.c_date = new Date()
|
||||
rets << o
|
||||
}
|
||||
}
|
||||
if(rets){
|
||||
DISTRICT_GUIDE_PRICE_COLL.insert(rets)
|
||||
}
|
||||
}
|
||||
|
||||
def saveChengduoPrice(def filePath){
|
||||
def datas = ExcelUtils.read(filePath,2, 0)
|
||||
def rets = []
|
||||
for(def d : datas){
|
||||
if(d['E']){
|
||||
def o = new BasicDBObject()
|
||||
o.city = d['E']
|
||||
o.region = d['B']
|
||||
o.name = d['C']
|
||||
o.avg_price = d['D'].toString().toDouble().toInteger()
|
||||
o.match_city = d['E']
|
||||
o.match_region = d['F']
|
||||
o.match_name = d['G']
|
||||
o.source_type = 1 //1:成交参考价 2:参考价
|
||||
o.c_date = new Date()
|
||||
rets << o
|
||||
}
|
||||
}
|
||||
if(rets){
|
||||
DISTRICT_GUIDE_PRICE_COLL.insert(rets)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.core.RegionData
|
||||
import com.fangjia.core.util.GeocodeUtils
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.util.DbUtils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import org.bson.types.ObjectId
|
||||
|
||||
class LocationUpdate {
|
||||
|
||||
static main(args) {
|
||||
def task = new LocationUpdate();
|
||||
task.run()
|
||||
}
|
||||
|
||||
def run(){
|
||||
def index = 0
|
||||
ExcelUtils.modify("D:\\数据\\建行\\房产估值\\经纬度\\经纬度人工核实结果_0923.xlsx",{d->
|
||||
index++
|
||||
if(d['C']){
|
||||
|
||||
println index +" "+d['A']+" "+d['B']+" "+d['C']
|
||||
def region = RegionData.formatRegion(d['A'], d['B'])
|
||||
if(d['H']){
|
||||
def status = d['H'].toString().toDouble().toInteger()
|
||||
if(status==1){
|
||||
def obj = CommonDatautils.findDistrict(d['A'], region, d['C'], "district")
|
||||
if(obj){
|
||||
def gmap = GeocodeUtils.getGaodeToBaidu(d['F'].toString().toDouble(), d['G'].toString().toDouble())
|
||||
def lng2 = null
|
||||
def lat2 = null
|
||||
if(gmap){
|
||||
lng2 = (gmap.get("lng")*10000000000).longValue()
|
||||
lat2 = (gmap.get("lat")*10000000000).longValue()
|
||||
}
|
||||
|
||||
BasicDBObject q=new BasicDBObject()
|
||||
q.put("m_date", new Date())
|
||||
q.put("lat2", lat2)
|
||||
q.put("lng2", lng2)
|
||||
q.put("lng", (d['F'].toString().toDouble()*10000000000).longValue())
|
||||
q.put("lat", (d['G'].toString().toDouble()*10000000000).longValue())
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id',obj._id),new BasicDBObject('$set',q))
|
||||
|
||||
}else{
|
||||
println d['A']+" "+d['B']+" "+d['C']+" 没找到小区"
|
||||
}
|
||||
}else{
|
||||
def obj = CommonDatautils.findDistrict(d['A'], region, d['C'], "district")
|
||||
if(obj){
|
||||
BasicDBObject q=new BasicDBObject('name_cat',1)
|
||||
q.put("m_date", new Date())
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id',obj._id),new BasicDBObject('$set',q))
|
||||
}else{
|
||||
println d['A']+" "+d['B']+" "+d['C']+" 没找到小区"
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
def obj = CommonDatautils.findDistrict(d['A'], region, d['C'], "district")
|
||||
if(obj){
|
||||
BasicDBObject q=new BasicDBObject('name_cat',1)
|
||||
q.put("m_date", new Date())
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id',obj._id),new BasicDBObject('$set',q))
|
||||
}else{
|
||||
println d['A']+" "+d['B']+" "+d['C']+" 没找到小区"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||