This commit is contained in:
2021-11-20 23:44:54 +08:00
291 changed files with 23730 additions and 1177 deletions
@@ -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());
@@ -0,0 +1,28 @@
package com.fangjia.bkoff.controllers;
/**
* 房价网后台存活监控
*
* @author shenjian
* @since 2021/6/7
*/
public class K8sController {
/**
* 存活检查
*
* @return
*/
public Object livenessAction() {
return "liveness";
}
/**
* 就绪检查
*
* @return
*/
public Object readinessAction() {
return "readiness";
}
}
@@ -40,7 +40,8 @@ public class AuthInterceptor implements Interceptor {
request.setAttribute("__resources", request.getSession().getAttribute(userId + "_resources"));
if (invocation.getAction().getController().getName().equals("login")
|| invocation.getAction().getController().getName().equals("")) {
|| invocation.getAction().getController().getName().equals("")
|| invocation.getAction().getController().getName().equals("k8s")) {
return invocation.invoke();
}
@@ -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) {
@@ -1339,7 +1339,7 @@
<td class = "t1">室号</td>
<td>
<#if evaluation.buildType!=3 && evaluation.buildType!=8 && evaluation.buildType!=0>
<#if evaluation.floorDesc!="">
<#if evaluation.floorDesc?? && evaluation.floorDesc!="">
<span class="labelModel2">${evaluation.floorDesc!}</span>
<span class="editModel2 hide"><input type="text" name="floorDesc" value="${evaluation.floorDesc!}" /> </span>
</#if>
@@ -167,9 +167,9 @@ public class RegionData implements PriorityOrdered {
ret = format(cityRegionMap, region);
}
if (null == ret) {
return region;
}
// if (null == ret) {
// return region;
// }
return ret;
}
@@ -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;
}
}
@@ -37,5 +37,9 @@ public class TermsController {
public Object ydinfoAction(ResourceModel model){
return model;
}
public Object ydintrAction(ResourceModel model){
return model;
}
}
@@ -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>电&nbsp;&nbsp;话</b>: 4001883787(周一至周五 09:00-18:00)<br>
<b>邮&nbsp;&nbsp;箱</b>: <a href="mailto:service@fangjia.com">service@fangjia.com</a><br>
<b>邮&nbsp;&nbsp;箱</b>: <a href="mailto:gujia@fangjia.com">gujia@fangjia.com</a><br>
<b>地&nbsp;&nbsp;址</b>: 上海市长宁区协和路1033号文洋大厦B座10楼<br>
<b>邮&nbsp;&nbsp;编</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>,百度&nbsp;</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>
@@ -54,7 +54,6 @@
<div class="main_content">
<p>房价网成立于2006年,隶属于上海估家网络科技有限公司,致力于建立中国领先的房产大数据库CPDB及推动基于地理位置的人工智能的发展和应用。公司以“发现地址价值”为使命,始终秉承客观严谨的态度为政府、银行、金融机构等客户提供大数据、建模、咨询等服务。目前,所积累的房产数据已覆盖全国367个城市及地区,技术力量强大,客户查询量行业领先。</p>
<p>公司在贷前估值、内评系统、贷后批量复估、信贷授信、地址反欺诈、数据治理、精准营销等领域都有着丰富的经验,拥有多项专利,被评为高新技术企业,赢得了国家统计局、建设银行、农业银行、平安集团、微众银行等众多客户的信赖。</p>
<p>2020年,南京三悦网络科技有限公司与我司达成全面战略合作,并接受我司委托,全权负责我司产品手机版“房价网”公众号和电脑版的“房价通”的市场推广、客户开发与售后服务;有权直接与客户签订上述产品的销售合同;我司对其所有用户全面提供产品升级、数据更新及线上售后等服务。</p>
</div>
<div class="main_title"><small>数据为大众服务</small></div>
<div class="main_content">
@@ -77,15 +76,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 +103,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>
&nbsp;&nbsp;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>&nbsp;&nbsp;关注官方微信公众号</span><br>
<span>&nbsp;&nbsp;Follow us on WeChat</span>
</div>-->
<!-- <div class="officeMap" id="officeMap02"></div>
<div class="officeMap" id="officeMap03"></div> -->
</div>
@@ -111,13 +129,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>&nbsp;&nbsp;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>&nbsp;&nbsp;关注官方微信公众号</span><br>
<span>&nbsp;&nbsp;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>,百度&nbsp;</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>,百度&nbsp;</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 />
&copy;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">
@@ -212,7 +212,7 @@
<p><img src="${imgUrl}/images/fangjia/v5/diamond.png"><label>合作伙伴</label></p>
</div>
<div class="contentBox">
<a class="content" href="${basePath}/terms/ydinfo">
<a class="content" href="${basePath}/terms/ydinfo" style="border-bottom:none;">
<img src="${imgUrl}/images/fangjia/v5/youda.jpeg">
<div>
<p><em>房价网合作伙伴-上海友达土地房地产评估有限公司简介</em></p>
@@ -220,11 +220,21 @@
<p><small>上海房产门户&nbsp;&nbsp;&nbsp;&nbsp;</small></p>
</div>
</a>
<a class="content" href="${basePath}/terms/ydintr">
<img src="${imgUrl}/images/fangjia/v5/youda.jpeg">
<div>
<p><em>上海友达土地房地产评估有限公司-企业内部培训</em></p>
<p><span>2021年8月9日,上海友达土地房地产评估有限公司就房地产征收业务中遇到的诸多问题开展了企业内部培训。本次培训的宗旨是为了进一步提高员工技术水平和工作效率,强化团队合作意识,为公司的可持续性发展奠定良好基础。</span></p>
<p><small>上海房产门户&nbsp;&nbsp;&nbsp;&nbsp;</small></p>
</div>
</a>
</div>
</div>
<div class="list">
<div class="listTop">
<p><img src="${imgUrl}/images/fangjia/v5/diamond.png"><label>商务合作</label></p>
@@ -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>,百度&nbsp;</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>,百度&nbsp;</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>,百度&nbsp;</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>,百度&nbsp;</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>,百度&nbsp;</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>,百度&nbsp;</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>,百度&nbsp;</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>
@@ -0,0 +1,61 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>合作伙伴 - 房价网 fangjia.com</title>
<meta name="keywords" content="上海友达土地房地产评估有限公司,合作伙伴,房价网">
<meta name="description" content="房价网合作伙伴上海友达土地房地产评估有限公司">
<#include "../jsconstants.ftl" />
<link href="${staticUrl}/style/fangjia/v5/common.css?v=${version}" rel="stylesheet">
<link href="${staticUrl}/style/fangjia/v5/main.css?v=${version}" rel="stylesheet">
<script src="${staticUrl}/js/fangjia/v5/jquery-1.7.2.min.js?v=${version}"></script>
<script>
if((navigator.userAgent.match(/(iPad|iPhone|iPod|Android|ios)/i))){
document.write("<link href='${staticUrl}/style/fangjia/v5/mobile.css?v=${version}' rel='stylesheet'>");
}
</script>
<style>
@media(max-device-width:768px){
.main{padding:1rem;padding-top:0;}
}
</style>
</head>
</head>
<body>
<#include "/header/v5/_header.ftl"/>
<div class="main" style="margin-top:150px;">
<div class="main_title"><small>上海友达土地房地产评估有限公司</small></div>
<div class="main_small">企业内部培训</div>
<div class="main_content">
<p>2021年8月9日,上海友达土地房地产评估有限公司就房地产征收业务中遇到的诸多问题开展了企业内部培训。本次培训的宗旨是为了进一步提高员工技术水平和工作效率,强化团队合作意识,为公司的可持续性发展奠定良好基础。整个培训分为二大内容,首先由公司总估价师为大家进行专业讲解征收评估业务中的技术难点及处理方法;二是开展员工自由交流,公司领导层听取各部门建议,做到集思广益,有效沟通。通过本次培训活动,公司员工的专业技术水平得到了很大提高,同时促进了各部门之间的协调合作能力,圆满达成了预期目的。</p>
<img src="${staticUrl}/images/fangjia/v5/ydpx.png" class="mobile01" style="margin-bottom:50px;margin: 0 auto;width: 60%;">
<br>
<br>
<p>
青春因梦想而弥足珍贵,人生因拼搏才愈显真实。公司上下满怀工作热情,无惧困难,立志为友达的发展贡献自己的力量。愿友达每位员工的人生因踏入这个集体而精彩纷呈!
</p>
<br>
<br>
<div style="float: right;">
上海友达土地房地产评估有限公司<br/>
<p style="text-align: center;">2021年8月10日</p>
</div>
</div>
</div>
<#include "/header/v5/_footer.ftl"/>
<script src="${staticUrl}/js/fangjia/v5/main.js?v=${version}"></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>,百度&nbsp;</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>,百度&nbsp;</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>,百度&nbsp;</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>
&copy;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;
}
}
@@ -237,7 +237,8 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
}
private JSONObject query(String id,String category, String city, String region, String name, List<String> alias,
List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){
List<String> regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice,
Integer room, String root,String sort, boolean order, int start, int limit,String table){
long time1 = System.currentTimeMillis();
JSONObject reqBody = new JSONObject();
JSONObject q = new JSONObject();
@@ -351,7 +352,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
if(endPrice != null){
temp2.put("lte", endPrice);
}
param.put("total_price", temp2);
param.put("avg_price", temp2);
temp.put("range", param);
jsonList.add(temp);
}
@@ -122,10 +122,8 @@ public class District implements SeaweedEntity {
private String houseStructure; //·¿Îݽṹ
private String source;
private String propertyLife;
//
// //ÏçÕò½ÖµÀ
// private String township;
//
//ÏçÕò½ÖµÀ
private String township;
private String pinyin;
@@ -236,6 +234,8 @@ public class District implements SeaweedEntity {
private String mainTypeArea;
private String createYear;
private Integer nameCat;
@Column(name = "source_web")
public String getSourceWeb() {
@@ -1873,17 +1873,21 @@ public class District implements SeaweedEntity {
this.mappingAlias = mappingAlias;
}
// @Column(name = "township")
// public String getTownship() {
// return township;
// }
//
// public void setTownship(String township) {
// this.township = township;
// }
@Column(name = "township")
public String getTownship() {
return township;
}
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;
}
}
@@ -0,0 +1,7 @@
package com.fangjia.dal.sql.fangjia.dao;
import com.fangjia.dal.SqlDao;
import com.fangjia.dal.sql.model.BohaiEvaluationAudit;
public interface BohaiEvaluationAuditDao extends SqlDao<BohaiEvaluationAudit> {
}
@@ -0,0 +1,7 @@
package com.fangjia.dal.sql.fangjia.dao;
import com.fangjia.dal.GoojiaFangjiaSqlDao;
import com.fangjia.dal.sql.model.BohaiEvaluationAudit;
public class BohaiEvaluationAuditDaoImpl extends GoojiaFangjiaSqlDao<BohaiEvaluationAudit> implements BohaiEvaluationAuditDao{
}
@@ -0,0 +1,7 @@
package com.fangjia.dal.sql.fangjia.dao;
import com.fangjia.dal.SqlDao;
import com.fangjia.dal.sql.model.FormalReport;
public interface FormalReportDao extends SqlDao<FormalReport> {
}
@@ -0,0 +1,7 @@
package com.fangjia.dal.sql.fangjia.dao;
import com.fangjia.dal.GoojiaFangjiaSqlDao;
import com.fangjia.dal.sql.model.FormalReport;
public class FormalReportDaoImpl extends GoojiaFangjiaSqlDao<FormalReport> implements FormalReportDao {
}
@@ -0,0 +1,10 @@
package com.fangjia.dal.sql.fangjia.dao;
import com.fangjia.dal.SqlDao;
import com.fangjia.dal.sql.model.ReportFileAttach;
import com.fangjia.dal.sql.model.UserCity;
public interface ReportFileAttachDao extends SqlDao<ReportFileAttach>{
}
@@ -0,0 +1,7 @@
package com.fangjia.dal.sql.fangjia.dao;
import com.fangjia.dal.GoojiaFangjiaSqlDao;
import com.fangjia.dal.sql.model.ReportFileAttach;
public class ReportFileAttachDaoImpl extends GoojiaFangjiaSqlDao<ReportFileAttach> implements ReportFileAttachDao{
}
@@ -0,0 +1,184 @@
package com.fangjia.dal.sql.model;
import java.util.Date;
import java.util.HashMap;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.fangjia.dal.SqlEntity;
@Entity
@Table(name = "bohai_evaluation_audit")
public class BohaiEvaluationAudit implements SqlEntity{
long id;
long evaluationId;
String queryId;
Integer backStatus;
Integer inquirePrice;
Integer auditStatus;//
long userId;
Integer hopePrice;
Integer lastPrice;
String remark;
String inquireRemark;
String feedbackId;
Integer feedbackStatus;
String feedbackMsg;
Date dateCreated;
Date lastUpdated;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
@Override
public void setId(long id) {
this.id = id;
}
@Column(name = "evaluation_id")
public long getEvaluationId() {
return evaluationId;
}
public void setEvaluationId(long evaluationId) {
this.evaluationId = evaluationId;
}
@Column(name = "query_id")
public String getQueryId() {
return queryId;
}
public void setQueryId(String queryId) {
this.queryId = queryId;
}
@Column(name = "back_status")
public Integer getBackStatus() {
return backStatus;
}
public void setBackStatus(Integer backStatus) {
this.backStatus = backStatus;
}
@Column(name = "inquire_price")
public Integer getInquirePrice() {
return inquirePrice;
}
public void setInquirePrice(Integer inquirePrice) {
this.inquirePrice = inquirePrice;
}
@Column(name = "audit_status")
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
@Column(name = "user_id")
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
@Column(name = "hope_price")
public Integer getHopePrice() {
return hopePrice;
}
public void setHopePrice(Integer hopePrice) {
this.hopePrice = hopePrice;
}
@Column(name = "last_price")
public Integer getLastPrice() {
return lastPrice;
}
public void setLastPrice(Integer lastPrice) {
this.lastPrice = lastPrice;
}
@Column(name = "remark")
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Column(name = "c_date")
public Date getDateCreated() {
return dateCreated;
}
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}
@Column(name = "m_date")
public Date getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
@Column(name = "feedback_id")
public String getFeedbackId() {
return feedbackId;
}
public void setFeedbackId(String feedbackId) {
this.feedbackId = feedbackId;
}
@Column(name = "feedback_status")
public Integer getFeedbackStatus() {
return feedbackStatus;
}
public void setFeedbackStatus(Integer feedbackStatus) {
this.feedbackStatus = feedbackStatus;
}
@Column(name = "feedback_msg")
public String getFeedbackMsg() {
return feedbackMsg;
}
public void setFeedbackMsg(String feedbackMsg) {
this.feedbackMsg = feedbackMsg;
}
@Column(name = "inquire_remark")
public String getInquireRemark() {
return inquireRemark;
}
public void setInquireRemark(String inquireRemark) {
this.inquireRemark = inquireRemark;
}
}
@@ -99,6 +99,9 @@ public class FjtEvaluation implements SqlEntity{
private Integer buyYear; //是否满五
private Integer onlyOne; //是否唯一
private Double registerPrice; //深圳 登记价
private String finishDateStr;//竣工时间
private String useType;//房屋用途
@GeneratedValue(strategy = GenerationType.AUTO)
@Id
@@ -729,6 +732,24 @@ public class FjtEvaluation implements SqlEntity{
this.registerPrice = registerPrice;
}
@Column(name = "finish_date_str")
public String getFinishDateStr() {
return finishDateStr;
}
public void setFinishDateStr(String finishDateStr) {
this.finishDateStr = finishDateStr;
}
@Column(name = "use_type")
public String getUseType() {
return useType;
}
public void setUseType(String useType) {
this.useType = useType;
}
@Override
public String toString() {
return "FjtEvaluation{" +
@@ -0,0 +1,75 @@
package com.fangjia.dal.sql.model;
import com.fangjia.dal.SqlEntity;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name = "formal_report")
public class FormalReport implements SqlEntity {
long id;
long evaluationId;
String queryId;
long userId;
String address;
Date dateCreated;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
@Override
public void setId(long id) {
this.id = id;
}
@Column(name = "evaluation_id")
public long getEvaluationId() {
return evaluationId;
}
public void setEvaluationId(long evaluationId) {
this.evaluationId = evaluationId;
}
@Column(name = "query_id")
public String getQueryId() {
return queryId;
}
public void setQueryId(String queryId) {
this.queryId = queryId;
}
@Column(name = "user_id")
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
@Column(name = "address")
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Column(name = "c_date")
public Date getDateCreated() {
return dateCreated;
}
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}
}
@@ -0,0 +1,82 @@
package com.fangjia.dal.sql.model;
import com.fangjia.dal.SqlEntity;
import javax.persistence.*;
@Entity
@Table(name = "report_file_attach")
public class ReportFileAttach implements SqlEntity {
private long id;
private Integer userId;
private Integer evaluationId;
private String queryId;
private Integer fileClass;
private String fileName;
private String fileId;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "user_id")
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
@Column(name = "evaluation_id")
public Integer getEvaluationId() {
return evaluationId;
}
public void setEvaluationId(Integer evaluationId) {
this.evaluationId = evaluationId;
}
@Column(name = "query_id")
public String getQueryId() {
return queryId;
}
public void setQueryId(String queryId) {
this.queryId = queryId;
}
@Column(name = "file_class")
public Integer getFileClass() {
return fileClass;
}
public void setFileClass(Integer fileClass) {
this.fileClass = fileClass;
}
@Column(name = "file_name")
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
@Column(name = "file_id")
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
}
@@ -1768,7 +1768,7 @@ public class AddressController {
matchParams.setProvince(model.getProvince());
// matchParams.setUseMap(true);
matchParams.setUseAliyunApi(true);
matchParams.setUseAliyunApi(false);
// matchParams.setUseCrf(true);
matchParams.setContainsLocation(model.isContainsLocation());
Building building = addressParserService.standard(matchParams);
@@ -2751,64 +2751,68 @@ 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;
}
BasicModel resultModel = new BasicModel(HttpStatusCodeEnum.OK);
Map<String,String> resultMap = new HashMap<String, String>();
Map<String, Object> params = new HashMap<String, Object>();
if(StringUtils.isNotBlank(model.getCity())){
params.put("city", model.getCity());
}
params.put("address", model.getAddress());
params.put("useMap", "false");
String result = addressMatchProxyService.parser(params);
if (result != null) {
JSONObject json = JSONObject.fromObject(result);
if(json.getInt("code")==200){
JSONObject resultJson = json.getJSONObject("result");
JSONObject searchAddress = resultJson.getJSONObject("searchAddress");
if(resultJson.getInt("credit")>0){
District district = districtService.findByNameAndAlias(resultJson.getString("city"), resultJson.getString("district"), resultJson.getString("name"), "district");
if(district != null){
resultMap.put("riskLevel","A");
Map<String, String> resultMap = new HashMap<String, String>();
try {
Map<String, Object> params = new HashMap<String, Object>();
if (StringUtils.isNotBlank(model.getCity())) {
params.put("city", model.getCity());
}
params.put("address", model.getAddress());
params.put("useMap", "false");
String result = addressMatchProxyService.parser(params);
if (result != null) {
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("code") == 200) {
JSONObject resultJson = json.getJSONObject("result");
JSONObject searchAddress = resultJson.getJSONObject("searchAddress");
if (resultJson.getDouble("credit") > 0) {
District district = districtService.findByNameAndAlias(resultJson.getString("city"), resultJson.getString("district"), resultJson.getString("name"), "district");
if (district != null) {
resultMap.put("riskLevel", "A");
resultModel.setResult(resultMap);
mav.setModel(resultModel);
return mav;
}
}
StringBuffer searchKey = new StringBuffer();
if (searchAddress.containsKey("street")) {
searchKey.append(searchAddress.getString("street"));
}
if (searchAddress.containsKey("streetNumber")) {
searchKey.append(searchAddress.getString("streetNumber"));
}
if (StringUtils.isNotBlank(searchKey.toString()) && searchAddress.has("city") && StringUtils.isNotBlank(searchAddress.getString("city"))) {
JSONObject jsonObject = addressMatchProxyService.searchByAmap(searchAddress.getString("city"), model.getAddress());
JSONArray poisData = jsonObject.getJSONArray("pois");
for (int i = 0; i < poisData.size(); i++) {
String address = poisData.getJSONObject(i).getString("address");
if (address.contains(searchKey.toString())) {
resultMap.put("riskLevel", "A");
resultModel.setResult(resultMap);
mav.setModel(resultModel);
return mav;
} else {
continue;
}
}
resultMap.put("riskLevel", "B");
resultModel.setResult(resultMap);
mav.setModel(resultModel);
return mav;
}
}
StringBuffer searchKey = new StringBuffer();
if(searchAddress.containsKey("street")){
searchKey.append(searchAddress.getString("street"));
}
if(searchAddress.containsKey("streetNumber")){
searchKey.append(searchAddress.getString("streetNumber"));
}
if(StringUtils.isNotBlank(searchKey.toString()) && StringUtils.isNotBlank(searchAddress.getString("city"))){
JSONObject jsonObject = addressMatchProxyService.searchByAmap(searchAddress.getString("city"), model.getAddress());
JSONArray poisData = jsonObject.getJSONArray("pois");
for (int i = 0; i < poisData.size(); i++) {
String address = poisData.getJSONObject(i).getString("address");
if(address.contains(searchKey.toString())){
resultMap.put("riskLevel","A");
resultModel.setResult(resultMap);
mav.setModel(resultModel);
return mav;
}else{
continue;
}
}
resultMap.put("riskLevel","B");
resultModel.setResult(resultMap);
mav.setModel(resultModel);
return mav;
}
}
} catch (Exception ex) {
LOGGER.error("风险识别出错:" + ex.getMessage(), ex);
}
resultMap.put("riskLevel","C");
@@ -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;
}
}
@@ -156,12 +156,12 @@ public class GuzhiController {
return mv;
}
//福州农商行人工录入
public Object checkAction(@Valid GuzhiCheckModel model){
RestfulModelAndView mv = new RestfulModelAndView();
mv.setModel(BasicModel.buildOKModel());
String msg = "【房价网-人工审查地址】接收到新的人工审查地址信息,请求请及时处理!城市:" + model.getCity()
String msg = "【房价网-人工审查地址】接收到新的人工审查地址信息,请求请及时处理!城市:" + model.getCity()+" 区域:"+model.getDistrict() +" 小区名称:"+(model.getName()!=null?model.getName():"")
+ " ²úÖ¤µØÖ·£º" + model.getAddress();
DingDingMessageUtil.sendTextMessage("065f4a05d5f87eb39a9f9e048eeefb80c1f7560446f8926441de80453c160c60", msg);
return mv;
@@ -671,7 +671,7 @@ public class PropertyController {
&& !"1007486".equals(userId) && !"1007533".equals(userId) && !"1007630".equals(userId)
&& !"1007705".equals(userId) && !"1007739".equals(userId) && !"1007736".equals(userId)
&& !"1007741".equals(userId) && !"1007742".equals(userId) && !"1007743".equals(userId)
&& !"1007747".equals(userId)
&& !"1007747".equals(userId) && !"1007757".equals(userId)
&& model.getDetailLevel() != null && model.getDetailLevel() != 0) {// 临时权限控制
mav.setModel(BasicModel.buildUnAuthorizedModel());
return mav;
@@ -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;
}
}
@@ -6,16 +6,12 @@ import com.fangjia.dal.QueryParam;
import com.fangjia.dal.SdQuery;
import com.fangjia.dal.SrQuery;
import com.fangjia.dal.common.DistrictKey;
import com.fangjia.dal.mongo.model.DistrictStat;
import com.fangjia.dal.seaweed.model.District;
import com.fangjia.dal.sql.model.FjtUsers;
import com.fangjia.dal.sql.model.UserCity;
import com.fangjia.open.compatible.model.JsonModel;
import com.fangjia.open.model.BaseModel;
import com.fangjia.open.model.FangjiaApiModel;
import com.fangjia.open.model.weixin.DistrictModel;
import com.fangjia.open.model.weixin.DistrictSearchModel;
import com.fangjia.open.model.weixin.UserModel;
import com.fangjia.open.util.BHBankUtils;
import com.fangjia.service.api.AutoCompleteBo;
import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.bo.DistrictStatRentBo;
@@ -27,8 +23,8 @@ import com.fangjia.service.sql.UserCityService;
import com.fangjia.service.user.UsersInfoService;
import com.fangjia.service.util.CookieUtils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
@@ -40,7 +36,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.*;
public class DistrictController {
@@ -151,6 +146,7 @@ public class DistrictController {
districtModel.setMsg("参数错误");
return districtModel;
}
District district = null;
if(StringUtils.isNotBlank(districtModel.getId())) {
district = districtService.findById(districtModel.getId());
@@ -162,8 +158,14 @@ public class DistrictController {
} else {
district = districtService.findByKeyMiniModel(districtModel.getCityName(), districtModel.getRegion(), districtModel.getName(), "district");
}
//小区价格
DistrictStatBo districtStatBo = getDistrictStat(new DistrictKey(district));
String userId = CookieUtils.getCookieValue(request, "login_user_id");
//小区租金
List<DistrictStatRentBo> districtStatRentBos = districtStatRentService.findAllHouseTypeByDistrictStatRent(new DistrictKey(district));
//处理图片链接
@@ -183,7 +185,7 @@ public class DistrictController {
boolean is=true;
if (null != districtStatBo && null != districtStatBo.getDefaultDistrictStat()) {
double credit = districtStatBo.getDefaultDistrictStat().getCredit();
String userId = CookieUtils.getCookieValue(request, "login_user_id");
Map<String, String> map = userCityService.FindCreditByUserId(Long.parseLong(userId));
String creditStr = map.get(city);
if (StringUtils.isNotBlank(creditStr)) {
@@ -208,6 +210,8 @@ public class DistrictController {
return districtModel;
}
private DistrictStatBo getDistrictStat(DistrictKey districtKey) {
District district = districtService.findDistrict(districtKey, true);
DistrictStatBo statBo = null;
@@ -1,16 +1,10 @@
package com.fangjia.open.controllers.weixin;
import com.fangjia.core.util.StringUtil;
import com.fangjia.dal.sql.model.EvaluationAudit;
import com.fangjia.dal.sql.model.FjtEvaluation;
import com.fangjia.dal.sql.model.FjtUsers;
import com.fangjia.dal.sql.model.UserTrades;
import com.fangjia.dal.sql.model.*;
import com.fangjia.open.model.RestfulModelAndView;
import com.fangjia.open.model.weixin.ReportModel;
import com.fangjia.service.sql.EvaluationAuditService;
import com.fangjia.service.sql.FjtEvaluationService;
import com.fangjia.service.sql.FjtUsersService;
import com.fangjia.service.sql.UserTradesService;
import com.fangjia.service.sql.*;
import com.fangjia.service.util.CookieUtils;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -32,6 +26,7 @@ public class ReportController {
private FjtEvaluationService fjtEvaluationService;
private EvaluationAuditService evaluationAuditService;
private FjtUsersService fjtUsersService;
private BohaiEvaluationAuditService bohaiEvaluationAuditService;
public Object downloadListAction(HttpServletRequest req, ReportModel model, @Param(name = "page") String page) {
if(req.getMethod()==null || "GET".equalsIgnoreCase(req.getMethod())) {
@@ -68,7 +63,7 @@ public class ReportController {
jsonObject.put("bgsf", userTrades.getCharge()+"");
if(StringUtils.isNotBlank(evaluationId)) {
FjtEvaluation fjtEvaluation = fjtEvaluationService.findEvaluationById(NumberUtils.toLong(evaluationId));
EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId);
if(fjtEvaluation != null) {
jsonObject.put("eid", fjtEvaluation.getId());
jsonObject.put("dz", fjtEvaluation.getAddress());
@@ -76,11 +71,40 @@ public class ReportController {
jsonObject.put("rn", fjtEvaluation.getRoomNum());
jsonObject.put("zdr", StringUtils.isBlank(fjtEvaluation.getLender()) ? "-" : fjtEvaluation.getLender());
jsonObject.put("mj", fjtEvaluation.getHouseArea());
jsonObject.put("zj", df.format(fjtEvaluation.getTotalPrice() / 10000.0));
}
if(evaluationAudit != null) {
jsonObject.put("ckj", (evaluationAudit.getDealPrice()==null) ? "-" : df.format(evaluationAudit.getDealPrice())+"");//²Î¿¼¼Û
jsonObject.put("zsj", (evaluationAudit.getAuditPrice()==null) ? "-" : df.format(evaluationAudit.getAuditPrice())+"");//ÖÕÉó¼Û
if(fjtEvaluation != null && fjtUsers.getRole()==17){
BohaiEvaluationAudit bhEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(fjtEvaluation.getId());
String zj = "-";
String qwj = "-";
String zsj = "-";
if(bhEvaluationAudit != null){
if(bhEvaluationAudit.getInquirePrice()!=null && bhEvaluationAudit.getInquirePrice() > 0){
zj = String.valueOf((int)(bhEvaluationAudit.getInquirePrice() / 10000));
}
if(bhEvaluationAudit.getHopePrice()!=null && bhEvaluationAudit.getHopePrice()>0){
qwj = String.valueOf((int)(bhEvaluationAudit.getHopePrice() / 10000));
}
if(bhEvaluationAudit.getLastPrice()!=null && bhEvaluationAudit.getLastPrice()>0){
zsj = String.valueOf((int)(bhEvaluationAudit.getLastPrice() / 10000));
}
}
jsonObject.put("zj", zj);//总价
jsonObject.put("qwj", qwj);//期望价
jsonObject.put("zsj", zsj);//终审价
}else{
EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId);
if(fjtEvaluation != null) {
jsonObject.put("zj", df.format(fjtEvaluation.getTotalPrice() / 10000.0));
}
if(evaluationAudit != null) {
jsonObject.put("ckj", (evaluationAudit.getDealPrice()==null) ? "-" : df.format(evaluationAudit.getDealPrice())+"");//参考价
jsonObject.put("zsj", (evaluationAudit.getAuditPrice()==null) ? "-" : df.format(evaluationAudit.getAuditPrice())+"");//终审价
}
}
}
ja.add(jsonObject);
@@ -106,4 +130,13 @@ public class ReportController {
public void setFjtUsersService(FjtUsersService fjtUsersService) {
this.fjtUsersService = fjtUsersService;
}
public BohaiEvaluationAuditService getBohaiEvaluationAuditService() {
return bohaiEvaluationAuditService;
}
public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) {
this.bohaiEvaluationAuditService = bohaiEvaluationAuditService;
}
}
@@ -10,10 +10,15 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
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;
@@ -37,6 +42,7 @@ public class UserController {
private UserCityService userCityService;
private FjtUsersService fjtUsersService;
private WeChatAuthService weChatAuthService;
private XcxUserInfoService xcxUserInfoService;
public void setUserCityService(UserCityService userCityService) {
this.userCityService = userCityService;
@@ -58,7 +64,37 @@ public class UserController {
public Object reqLoginPageAction(UserModel model) {
return 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;
}
public void setXcxUserInfoService(XcxUserInfoService xcxUserInfoService) {
this.xcxUserInfoService = xcxUserInfoService;
}
public Object reqCityChoicePageAction(UserModel model, HttpServletResponse response, HttpServletRequest request) {
String type = StringUtils.trimToNull(model.getType());
if(!StringUtils.isBlank(type)){
@@ -217,6 +253,25 @@ public class UserController {
String username = StringUtils.trimToNull(model.getUsername());
String pass = StringUtils.trimToNull(model.getPass());
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);
@@ -241,6 +296,99 @@ public class UserController {
return resultModel;
}
}
/**
* 渤海
* @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)){
System.out.println(sid+"houqi");
sessionValue = new XcxKey();
sessionValue.setSid(sid);
sessionValue.setOpenId(sid);
}
//缓存中没有登陆信息
if(sessionValue==null){
//获取openid信息
sessionValue = xcxUserInfoService.getOpenId(code, appId, secret);
XcxUserInfo user = null;
if(sessionValue!=null&&StringUtils.isNotBlank(sessionValue.getOpenId())){
//根据是否是第一次使用,保存并查询除用户信息
user = xcxUserInfoService.save(sessionValue.getOpenId(), null);
sessionValue.setSid(sessionValue.getOpenId());
}
}
return sessionValue;
}
/**
* 获取缓存的验证码
@@ -270,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);
}
}
/**
@@ -322,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;
}
@@ -339,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;
}
}
@@ -1,22 +1,36 @@
package com.fangjia.open.controllers.weixin;
import java.io.*;
import java.net.URLDecoder;
import java.net.URLEncoder;
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 javax.servlet.http.HttpServletResponse;
import com.fangjia.core.util.HttpRequest;
import com.fangjia.dal.sql.model.*;
import com.fangjia.open.OpenConfig;
import com.fangjia.open.dto.UniversalDto;
import com.fangjia.open.model.BasicModel;
import com.fangjia.open.model.FilesModel;
import com.fangjia.open.util.*;
import com.fangjia.service.mongo.fangjia.*;
import com.fangjia.service.sql.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.tools.ant.util.DateUtils;
import org.bson.types.ObjectId;
import org.sothis.core.util.Pager;
import org.sothis.web.mvc.ActionContext;
import org.sothis.web.mvc.annotation.Param;
import com.fangjia.core.util.DataUtil;
@@ -25,19 +39,12 @@ 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;
import com.fangjia.dal.sql.model.FjtEvaluation;
import com.fangjia.dal.sql.model.FjtUsers;
import com.fangjia.dal.sql.model.GoldLogs;
import com.fangjia.dal.sql.model.UserTrades;
import com.fangjia.dal.sql.model.UsersDetail;
import com.fangjia.open.compatible.model.JsonModel;
import com.fangjia.open.model.RestfulModelAndView;
import com.fangjia.open.model.weixin.EvaluationModel;
import com.fangjia.open.util.InsidePolygon;
import com.fangjia.open.util.Point;
import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.bo.HouseBo;
import com.fangjia.service.datastore.DistrictService;
@@ -50,21 +57,12 @@ import com.fangjia.service.email.EmailService;
import com.fangjia.service.email.Mail;
import com.fangjia.service.email.MailUser;
import com.fangjia.service.mongo.bkoff.DistrictHouseStatService;
import com.fangjia.service.mongo.fangjia.AverageStatisticsService;
import com.fangjia.service.mongo.fangjia.DealPriceService;
import com.fangjia.service.mongo.fangjia.LatlngPolygonService;
import com.fangjia.service.sms.SmsException;
import com.fangjia.service.sms.SmsService;
import com.fangjia.service.sql.EvaluationAuditService;
import com.fangjia.service.sql.EvaluationRateService;
import com.fangjia.service.sql.FjtEvaluationService;
import com.fangjia.service.sql.FjtUsersService;
import com.fangjia.service.sql.GoldLogsService;
import com.fangjia.service.sql.UserTradesService;
import com.fangjia.service.sql.UsersDetailService;
import com.fangjia.service.user.UsersInfoService;
import com.fangjia.service.util.CookieUtils;
import com.google.common.collect.ImmutableMap;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
/**
* Created by wenyan on 2016/7/15.
@@ -105,11 +103,19 @@ public class WeiXinEvaluationController {
private EvaluationRateService evaluationRateService;
private EvaluationService evaluationService;
private GoldLogsService goldLogsService;
private PriceBorderService priceBorderService;
private BohaiEvaluationAuditService bohaiEvaluationAuditService;
private FormalReportService formalReportService;
private FileService fileService;
private ReportFileAttachService reportFileAttachService;
private final static String DD_ID = "5938c43984aec20a36f474c5";
private static List<String> MOBILES = new ArrayList<String>();
private static long MAX_FILE_BYTES_SIZE = 1024 * 1024 * 5;
private FileDao fileDao = FileDao.getInstance();
static {
MOBILES.add("13916992399");
MOBILES.add("15201904147");
@@ -120,7 +126,7 @@ public class WeiXinEvaluationController {
//MOBILES.add("13681915777");//13774361275
}
public Object formAction(HttpServletRequest req, EvaluationModel model){
public Object formAction(HttpServletRequest req, EvaluationModel model, HttpServletResponse response){
District district = districtService.findById(model.getId());
model.setDistrict(district);
@@ -128,9 +134,33 @@ public class WeiXinEvaluationController {
long userId = Long.valueOf(cookieUserId);
FjtUsers fjtUsers = fjtUsersService.findById(userId);
model.setRole(fjtUsers.getRole());
if(fjtUsers.getRole()==17){
try {
response.sendRedirect("bhform?id="+model.getId());
} catch (IOException e) {
}
}
return model;
}
public Object bhformAction(EvaluationModel model) {
District district = districtService.findById(model.getId());
List<String> addrAlias = new ArrayList<String>();
if(StringUtils.isNotBlank(district.getAddress())){
addrAlias.add(district.getAddress());
if(district.getAddrAlias()!=null && !district.getAddrAlias().contains(district.getAddress())){
addrAlias.addAll(district.getAddrAlias());
}
district.setAddrAlias(addrAlias);
}
model.setDistrict(district);
return model;
}
/**
* 微信小程序:小区详情获取
* @return
@@ -175,6 +205,122 @@ public class WeiXinEvaluationController {
return jsonModel;
}
public Object bhhistoryAction(HttpServletRequest req, EvaluationModel model, @Param(name = "page") String page) {
if (req.getMethod() == null || "GET".equalsIgnoreCase(req.getMethod())) {
return model;
}
String cookieUserId = CookieUtils.getCookieValue(req, "login_user_id");
long userId = Long.valueOf(cookieUserId);
FjtUsers fjtUsers = fjtUsersService.findById(userId);
RestfulModelAndView data = new RestfulModelAndView();
JSONObject result = new JSONObject();
//最多10页
if (NumberUtils.toInt(page) > 10) {
result.put("result", new JSONArray().toString());
data.setModel(result);
return data;
}
Pager pager = new Pager(10);
pager.setCurrentPage(NumberUtils.toInt(page));
List<FjtEvaluation> fjtEvaluationList = fjtEvaluationService.findEvaluationsByUserId(userId, pager);
System.out.println("估价记录:"+fjtEvaluationList.size());
JSONArray ja = new JSONArray();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
for (int i = 0; i < fjtEvaluationList.size(); ++i) {
FjtEvaluation fjtEvaluation = fjtEvaluationList.get(i);
BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(fjtEvaluation.getId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("eid", fjtEvaluation.getId());
jsonObject.put("pgrq", sdf.format(fjtEvaluation.getDateCreated()));//评估日期
jsonObject.put("tjrq", (evaluationAudit == null || evaluationAudit.getAuditStatus() != 4) ? "-" : sdf.format(evaluationAudit.getLastUpdated()));//调价日期
jsonObject.put("dz", fjtEvaluation.getAddress());//地址
jsonObject.put("hn", fjtEvaluation.getHouseNum());
jsonObject.put("rn", fjtEvaluation.getRoomNum());
jsonObject.put("wylx", StringUtils.isBlank(BUILDTYPE_MAP.get(fjtEvaluation.getBuildType())) ? "-" : BUILDTYPE_MAP.get(fjtEvaluation.getBuildType()));//物业类型
jsonObject.put("mj", fjtEvaluation.getHouseArea());//面积
String zj = "-";
if(evaluationAudit != null && evaluationAudit.getInquirePrice() > 0){
zj = String.valueOf((int)(evaluationAudit.getInquirePrice() / 10000));
}
jsonObject.put("zj", zj);//总价
jsonObject.put("ckj", (evaluationAudit == null || evaluationAudit.getHopePrice() == null) ? "-" : (int)(evaluationAudit.getHopePrice()/ 10000));//期望价
jsonObject.put("zsj", (evaluationAudit == null || evaluationAudit.getLastPrice() == null) ? "-" : (int)(evaluationAudit.getLastPrice()/ 10000));//终审价
jsonObject.put("zdr", StringUtils.isBlank(fjtEvaluation.getLender()) ? "-" : fjtEvaluation.getLender());//主贷人
if(evaluationAudit==null || (evaluationAudit!=null && StringUtils.isBlank(evaluationAudit.getInquireRemark()))){
jsonObject.put("pgsm","");//评估说明
}else{
jsonObject.put("pgsm",evaluationAudit.getInquireRemark());//评估说明
}
if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==0) {
jsonObject.put("shzt", "价格待审核");
//接入询价结果查询接口
System.out.println("开始接入询价结果查询接口......"+evaluationAudit.getQueryId());
JSONObject obj = BHBankUtils.getInquireRecord(evaluationAudit.getQueryId());
System.out.println("接入询价结果查询接口完成......"+evaluationAudit.getQueryId());
if(obj!=null){
Integer totalPrice = (Integer) obj.get("inquirePrice");
if(totalPrice>0){
evaluationAudit.setAuditStatus(1);
evaluationAudit.setInquirePrice(totalPrice);
jsonObject.put("zj", (int)(totalPrice/10000));
bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
jsonObject.put("shzt", "价格已审核");
}
}
} else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==1) {
jsonObject.put("shzt", "价格已审核");
FormalReport report = formalReportService.findFormalReportById(evaluationAudit.getEvaluationId());
if(report != null){
jsonObject.put("shzt", "已申请正式报告");
}
} else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==2) {
jsonObject.put("shzt", "价格待审核");
if(evaluationAudit.getHopePrice()>0){
//接入反馈结果查询接口
System.out.println("开始接入反馈结果查询接口......"+evaluationAudit.getFeedbackId());
JSONObject object = BHBankUtils.inquireFeedbackCall(evaluationAudit.getFeedbackId());
System.out.println("完成接入反馈结果查询接口......"+evaluationAudit.getFeedbackId());
if(object!=null){
Integer feedbackStatus = (Integer) object.get("feedbackStatus");
if(feedbackStatus!=0){
int inquirePrice = (Integer) object.get("inquirePrice");
evaluationAudit.setAuditStatus(3);
evaluationAudit.setLastPrice(inquirePrice);
evaluationAudit.setFeedbackStatus(feedbackStatus);
evaluationAudit.setFeedbackMsg((String)object.get("feedbackCallMsg"));
jsonObject.put("zsj",(int)(inquirePrice/ 10000));//终审价
bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
jsonObject.put("shzt", "审核完成");
}
}
}
}else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==3) {
jsonObject.put("shzt", "审核完成");
FormalReport report = formalReportService.findFormalReportById(evaluationAudit.getEvaluationId());
if(report != null){
jsonObject.put("shzt", "已申请正式报告");
}
}else{
jsonObject.put("shzt", "-");
}
UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(String.valueOf(fjtEvaluation.getId()));
if(userTrade!=null){
jsonObject.put("down", 1);
}
ja.add(jsonObject);
}
result.put("result", ja.toString());
result.put("role", fjtUsers!=null? fjtUsers.getRole(): 0);
data.setModel(result);
return data;
}
/**
* 估价记录列表
* @param model
@@ -241,6 +387,7 @@ public class WeiXinEvaluationController {
return data;
}
public Object inputAction(EvaluationModel model){
District district = districtService.findById(model.getId());
if(model.getEvaluation() == null){
@@ -275,7 +422,9 @@ public class WeiXinEvaluationController {
evaluation.setCity(district.getCity());
evaluation.setRegion(district.getRegion());
evaluation.setDistrictName(district.getName());
evaluation.setAddress(district.getAddress());
if(StringUtils.isBlank(evaluation.getAddress())){
evaluation.setAddress(district.getAddress());
}
evaluation.setUserId(userId);
evaluation.setDateCreated(new Date());
evaluation.setLastUpdated(new Date());
@@ -292,14 +441,97 @@ public class WeiXinEvaluationController {
}
int avgPrice = districtStatService.findLatestDistrictAvgPrice(new DistrictKey(district), null);
FjtUsers fjtUser = fjtUsersService.findById(Long.valueOf(userId));
if(fjtUser!=null && fjtUser.getRole()==17) {
evaluation.setDirection(3);//渤海朝向默认南
if(StringUtils.isBlank(evaluation.getUseType())){
evaluation.setUseType("居住");
}
// BHBankUtils.getInquirePrice(model);
}
if(avgPrice > 0){
long totalPrice = evaluationRateService.evaluation(avgPrice, evaluation);
evaluation.setTotalPrice(Integer.valueOf(totalPrice+""));
evaluation.setAveragePrice((int)(totalPrice/evaluation.getHouseArea()));
}
fjtEvaluationService.saveEvaluation(evaluation);
if(fjtUser!=null && fjtUser.getRole()==17) {
System.out.println("渤海地址搜索 "+evaluation.getAddress());
List<JSONObject> bhDists = BHBankUtils.getDistrictByBhbank(evaluation.getAddress());
if(bhDists.size()<1){
bhDists = BHBankUtils.getDistrictByBhbank(district.getName());
}
Map<String, String> bhMatchMap = new HashMap<String, String>();
if(bhDists.size()==1){
JSONObject o = bhDists.get(0);
String bhDistName = (String)o.get("name");
String regionCode = String.valueOf((Long)o.get("country"));
String bhRegion = BHBankUtils.regionCodeMap.get(regionCode);
bhMatchMap.put("preCode", (String)o.get("code"));
bhMatchMap.put("preName", bhDistName);
bhMatchMap.put("countryCode",regionCode);
// bhMatchMap.put("buildName",(String)o.get("address"));
}else{
Map<String,String> regionCodeMap = BHBankUtils.regionCodeMap;
String regionCode = null;
for(String key : regionCodeMap.keySet()){
String value = regionCodeMap.get(key);
if(value.equals(district.getRegion())){
regionCode = key;
break;
}
}
bhMatchMap.put("preName", district.getName());
bhMatchMap.put("countryCode",regionCode);
System.out.println("【渤海银行】地址查询返回结果"+bhDists.size()+"个");
}
UsersDetail usersDetail = usersDetailService.findById(Long.valueOf(userId));
if(StringUtils.isBlank(usersDetail.getMobile())){
usersDetail.setMobile(fjtUser.getEmail());
}
System.out.println("渤海询价搜索 "+evaluation.getAddress());
JSONObject bhApiResult = BHBankUtils.getInquirePrice(model, bhMatchMap, usersDetail, evaluation.getTotalPrice());
if(bhApiResult!=null){
System.out.println("渤海询价搜索结果 "+bhApiResult.toString());
JSONObject dataObj = (JSONObject) bhApiResult.get("data");
String queryId = (String) dataObj.get("queryId");
Integer inquirePrice = (Integer) dataObj.get("inquirePrice");
Integer auditStatus = null;
String inquireRemark = (String) dataObj.get("remark");
if((Integer) bhApiResult.get("errCode") == 1){//待人工核验
auditStatus = 0;
}else if((Integer) bhApiResult.get("errCode") == 0){//正常返回
auditStatus = 1;
}
fjtEvaluationService.saveEvaluation(evaluation);
System.out.println("保存评估记录成功 "+evaluation.getDistrictName());
BohaiEvaluationAudit audit = new BohaiEvaluationAudit();
audit.setEvaluationId(evaluation.getId());
audit.setQueryId(queryId);
audit.setBackStatus((Integer) bhApiResult.get("errCode") );
audit.setUserId(userId);
audit.setInquirePrice(inquirePrice);
audit.setAuditStatus(auditStatus);//0:价格待审核 1:价格已审核 2:有期望价 3:价格确认
if(StringUtils.isNotBlank(inquireRemark) && !inquireRemark.equals("None")){
audit.setInquireRemark(inquireRemark);
}
audit.setDateCreated(new Date());
audit.setDateCreated(new Date());
bohaiEvaluationAuditService.saveBohaiEvaluationAudit(audit);
}
}else{
fjtEvaluationService.saveEvaluation(evaluation);
System.out.println("保存评估记录成功 "+evaluation.getDistrictName());
}
Map<String, String> data = new HashMap<String, String>();
data.put("id", String.valueOf(evaluation.getId()));
data.put("role", String.valueOf(fjtUser.getRole()));
JsonModel json = new JsonModel();
json.setJsonModel(data);
return json;
@@ -369,17 +601,69 @@ 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;
}
public Object bhreportAction(EvaluationModel model){
String evaluationId = model.getEvaluationId();
FjtEvaluation evaluation = fjtEvaluationService.findEvaluationById(Long.valueOf(evaluationId));
model.setFjtEvaluation(evaluation);
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()));
model.setDistrictStatBo(districtStatBo);
FjtUsers fjtUser = fjtUsersService.findById(evaluation.getUserId());
model.setRole(fjtUser.getRole());
District district = districtService.findDistrict(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()), "district");
model.setId(district.getId());
//参考价
BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(evaluationId));
model.setBohaiEvaluationAudit(bohaiEvaluationAudit);
if(bohaiEvaluationAudit != null){
List<ReportFileAttach> reportFiles = reportFileAttachService.findAllByParams(Integer.valueOf(evaluationId), bohaiEvaluationAudit.getQueryId(), (int)fjtUser.getId());
if(reportFiles != null && reportFiles.size()>0){
Map<String, List<ReportFileAttach>> reportFileMap = new HashMap<String, List<ReportFileAttach>>();
for(ReportFileAttach rfa : reportFiles){
List<ReportFileAttach> list = reportFileMap.get(rfa.getFileClass().toString());
if(list == null){
list = new ArrayList<ReportFileAttach>();
reportFileMap.put(rfa.getFileClass().toString(), list);
}
list.add(rfa);
}
model.setReportFileMap(reportFileMap);
}
}
UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(model.getEvaluationId());
model.setUserTrades(userTrade);
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;
}
//To C 报告结果页
public Object resultAction(EvaluationModel model){
@@ -573,8 +857,6 @@ public class WeiXinEvaluationController {
evaluationAudit.setVersion(1);
evaluationAuditService.save(evaluationAudit);
}
String smsContent = "【房价网】微信端调价地址:"+evaluationAudit.getCity()+" "+evaluationAudit.getInput()+",成交价:"+evaluationAudit.getDealPrice()+"万,请及时审核!用户邮箱: "+evaluationAudit.getUserName();
try {
for (String mobile : MOBILES) {
@@ -589,6 +871,40 @@ public class WeiXinEvaluationController {
return jsonMmodel;
}
public Object saveHopePriceAction(EvaluationModel model){
JsonModel jsonMmodel = new JsonModel();
if(StringUtils.isNotBlank(model.getEvaluationId()) && model.getHopePrice()!=null){
BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
if(evaluationAudit != null){
evaluationAudit.setHopePrice(model.getHopePrice()*10000);
evaluationAudit.setLastUpdated(new Date());
evaluationAudit.setAuditStatus(2);
//期望价反馈接口
UsersDetail usersDetail = usersDetailService.findById(evaluationAudit.getUserId());
String feedbackId = BHBankUtils.inquireFeedback(usersDetail.getName(), evaluationAudit.getQueryId(), model.getHopePrice());
if(StringUtils.isNotBlank(feedbackId)){
evaluationAudit.setFeedbackId(feedbackId);
}
bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
}
}
return jsonMmodel;
}
public Object saveBhRemarkAction(EvaluationModel model){
JsonModel jsonMmodel = new JsonModel();
if(StringUtils.isNotBlank(model.getEvaluationId()) && StringUtils.isNotBlank(model.getRemark())){
BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
if(evaluationAudit != null){
evaluationAudit.setRemark(model.getRemark());
evaluationAudit.setLastUpdated(new Date());
bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit);
}
}
return jsonMmodel;
}
//刷新审核价
public Object refreshAuditPriceAction(EvaluationModel model){
JsonModel jsonMmodel = new JsonModel();
@@ -604,6 +920,22 @@ public class WeiXinEvaluationController {
jsonMmodel.setJsonModel(dataMap);
return jsonMmodel;
}
public Object refreshBhAuditPriceAction(EvaluationModel model){
JsonModel jsonMmodel = new JsonModel();
Map<String, Integer> dataMap = new HashMap<String, Integer>();
if(StringUtils.isNotBlank(model.getEvaluationId()) ){
BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
if(bohaiEvaluationAudit != null){
dataMap.put("lastPrice", bohaiEvaluationAudit.getLastPrice());
dataMap.put("hopePrice", bohaiEvaluationAudit.getHopePrice());
}
}
jsonMmodel.setJsonModel(dataMap);
return jsonMmodel;
}
public Object collectsAction(EvaluationModel model, HttpServletRequest req, @Param(name = "page") String page){
@@ -702,6 +1034,49 @@ public class WeiXinEvaluationController {
}
return jsonMmodel;
}
public Object sendFormalReportApplyAction(EvaluationModel model) {
JsonModel jsonModel = new JsonModel();
if (StringUtils.isNotBlank(model.getEvaluationId()) && StringUtils.isNotBlank(model.getAddress())) {
BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId()));
if(bohaiEvaluationAudit!=null){
FormalReport formalReport = formalReportService.findFormalReportById(Long.valueOf(model.getEvaluationId()));
if(formalReport == null){
formalReport = new FormalReport();
formalReport.setEvaluationId(Long.valueOf(model.getEvaluationId()));
formalReport.setQueryId(bohaiEvaluationAudit.getQueryId());
formalReport.setUserId(bohaiEvaluationAudit.getUserId());
formalReport.setAddress(model.getAddress());
formalReport.setDateCreated(new Date());
formalReportService.save(formalReport);
// UsersDetail usersDetail = usersDetailService.findById(bohaiEvaluationAudit.getUserId());
}else{
if(!model.getAddress().equals(formalReport.getAddress())){
formalReport.setAddress(model.getAddress());
formalReportService.update(formalReport);
}
}
Integer code = BHBankUtils.inquireToReport(bohaiEvaluationAudit.getQueryId(), model.getAddress());
Map<String, Integer> data = new HashMap<String, Integer>();
data.put("code", code);
jsonModel.setJsonModel(data);
}
}
return jsonModel;
}
public Object checkImageAction(EvaluationModel model){
JsonModel jsonModel = new JsonModel();
if (StringUtils.isNotBlank(model.getEvaluationId())){
List<ReportFileAttach> datas = reportFileAttachService.findHouseImage(Integer.valueOf(model.getEvaluationId()), 3);
Map<String, Integer> data = new HashMap<String, Integer>();
data.put("count", datas.size());
jsonModel.setJsonModel(data);
}
return jsonModel;
}
private void sendToEmail(String fjtUrl, String evaluationId, String email){
try {
@@ -790,7 +1165,254 @@ 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 Object upLoadEvaluationFileAction(EvaluationModel model, HttpServletRequest request){
RestfulModelAndView mav = new RestfulModelAndView();
List<CommonsMultipartFile> files = model.getReportFiles();
if(files == null || files.size()<=1){
mav.setModel(BasicModel.buildBadRequestModel("请选择要上传的文件"));
return mav;
}
if(model.getEvaluationId()==null || model.getQueryId()==null){
mav.setModel(BasicModel.buildBadRequestModel("评估编号或查询编号为空"));
return mav;
}
if(model.getFileClass()==3 && files.size()<7){
mav.setModel(BasicModel.buildBadRequestModel("上传图片不能少于6张"));
return mav;
}
String cookieUserId = CookieUtils.getCookieValue(request, "login_user_id");
long userId = Long.valueOf(cookieUserId);
FjtUsers fjtUser = fjtUsersService.findById(Long.valueOf(userId));
UsersDetail usersDetail = usersDetailService.findById(fjtUser.getId());
try {
String id = new ObjectId().toString();
List<File> uploadfiles = new ArrayList<File>();
for (CommonsMultipartFile file : files) {
if (file.getSize() == 0 ) {
continue;
}
String contentType = file.getContentType();//getPicContentType(file);
if (StringUtils.isBlank(contentType)) {
continue;
}
ReportFileAttach reportFileAttach = reportFileAttachService.findFirstByParams(Integer.valueOf(model.getEvaluationId()), model.getQueryId(), (int)fjtUser.getId(), model.getFileClass(), file.getOriginalFilename());
if(reportFileAttach != null){
continue;
}
String converFileName = new String(file.getOriginalFilename().getBytes(), "UTF-8");
String fontUrl = ActionContext.getContext().getServletContext().getRealPath("/") + "files" + File.separator + model.getEvaluationId() + File.separator+converFileName;
System.out.println(fontUrl);
createFile(fontUrl);
File tempFile = new File(fontUrl);
try {
tempFile.createNewFile();
} catch (IOException e) {
//处理异常信息
}
try {
inputStreamToFile(file.getInputStream(), tempFile);
uploadfiles.add(tempFile);
} catch (IOException e) {
//处理异常信息
}
reportFileAttach = new ReportFileAttach();
reportFileAttach.setEvaluationId(Integer.valueOf(model.getEvaluationId()));
reportFileAttach.setQueryId(model.getQueryId());
reportFileAttach.setUserId((int)fjtUser.getId());
reportFileAttach.setFileClass(model.getFileClass());
reportFileAttach.setFileName(file.getOriginalFilename());
reportFileAttach.setFileId(id);
reportFileAttachService.save(reportFileAttach);
fileDao.save(id,"upload","o", file.getBytes(), contentType);
String href = DataUtil.encodePicUrl(id, "o", "upload");
String link = "http://static.fangjia.com/stc/fs/"+href;
System.out.println(link);
}
if(uploadfiles.size()>0){
BHBankUtils.inquireUploadFiles2(usersDetail.getName(),model.getQueryId(), model.getFileClass(), uploadfiles);
}
} catch (Exception e) {
e.printStackTrace();
mav.setModel(BasicModel.buildServerErrorModel().setMsg("文件上传失败!"));
}
return mav;
}
private void createFile(String path) throws IOException {
if (StringUtils.isNotEmpty(path)) {
File file = new File(path);
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
file.createNewFile();
}
}
//将InputStream类型转化为File类型
private static void inputStreamToFile(InputStream ins, File file) {
//将输出流转化为文件即可
FileOutputStream os = null;
try {
os = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new byte[1024];
while ((bytesRead = ins.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
} catch (Exception e) {
throw new RuntimeException("调用inputStreamToFile产生异常:" + e.getMessage());
} finally {
try {
if (os != null) {
os.close();
}
if (ins != null) {
ins.close();
}
} catch (IOException e) {
throw new RuntimeException("inputStreamToFile关闭io时产生异常:" + e.getMessage());
}
}
}
/**
* 保存图片到FS
*/
private List<String> savePics(String districtId, List<File> pics) {
List<String> ret = new ArrayList<String>(pics.size());
for (File pic : pics) {
if (pic.length() == 0 || pic.length() > MAX_FILE_BYTES_SIZE) {
continue;
}
String contentType = getPicContentType(pic);
if (StringUtils.isBlank(contentType)) {
continue;
}
String picName = districtId + "/" + pic.getName();
try {
fileService.save(picName, FileServiceImpl.SIZE_ORIGINAL, IOUtils.toByteArray(new FileInputStream(pic)),
contentType);
fileService.save(picName, FileServiceImpl.SIZE_SUMMERY, IOUtils.toByteArray(new FileInputStream(pic)),
contentType);
fileService.save(picName, FileServiceImpl.SIZE_MEDIUM, IOUtils.toByteArray(new FileInputStream(pic)),
contentType);
} catch (IOException e) {
e.printStackTrace();
}
ret.add(picName);
}
return ret;
}
/**
* 验证图片文件类型,目前支持gif、jpg
*
* @param pic
* @return
*/
private String getPicContentType(File pic) {
byte[] b = new byte[4];
FileInputStream is = null;
try {
is = new FileInputStream(pic);
is.read(b, 0, b.length);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (null != is) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
String type = DataUtil.byte2hex(b).toUpperCase();
if (type.contains("FFD8FF") || type.contains("89504E47")) {
return "image/jpeg";
}
if (type.contains("47494638")) {
return "image/gif";
}
if (type.contains("424D")) {
return "image/bmp";
}
return null;
}
public void setFjtEvaluationService(FjtEvaluationService fjtEvaluationService) {
this.fjtEvaluationService = fjtEvaluationService;
@@ -868,6 +1490,24 @@ public class WeiXinEvaluationController {
public void setEmailService(EmailService emailService) {
this.emailService = emailService;
}
public void setPriceBorderService(PriceBorderService priceBorderService) {
this.priceBorderService = priceBorderService;
}
public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) {
this.bohaiEvaluationAuditService = bohaiEvaluationAuditService;
}
public void setFileService(FileService fileService) {
this.fileService = fileService;
}
public void setReportFileAttachService(ReportFileAttachService reportFileAttachService) {
this.reportFileAttachService = reportFileAttachService;
}
public void setFormalReportService(FormalReportService formalReportService) {
this.formalReportService = formalReportService;
}
}
@@ -191,6 +191,8 @@ public class XcxInfoController {
}
return sessionValue;
}
/**
* 小程序估价接口
@@ -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;
}
}
@@ -284,6 +284,8 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
private String user;
private Integer avgPrice;
public void setDecorationAge(int decorationAge) {
this.decorationAge = decorationAge;
@@ -895,4 +897,12 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
public void setAtticSize(Double atticSize) {
this.atticSize = atticSize;
}
public Integer getAvgPrice() {
return avgPrice;
}
public void setAvgPrice(Integer avgPrice) {
this.avgPrice = avgPrice;
}
}
@@ -47,6 +47,11 @@ public class DistrictModel extends BaseModel {
// 判断是否需要查询均价,false则调用方自己去组装价格
private Boolean showPrice = true;
// private String preCode;//眾漆諉諳--瞼攫晤鎢
// private String preName;//眾漆諉諳--瞼攫靡備
// private String countryCode;//眾漆諉諳--Е郖晤鎢
// private String buildName;//眾漆諉諳--華硊
/**
* 判断是不是友达
@@ -205,4 +210,35 @@ public class DistrictModel extends BaseModel {
this.isYouDa = isYouDa;
}
// public String getPreCode() {
// return preCode;
// }
//
// public void setPreCode(String preCode) {
// this.preCode = preCode;
// }
//
// public String getPreName() {
// return preName;
// }
//
// public void setPreName(String preName) {
// this.preName = preName;
// }
//
// public String getCountryCode() {
// return countryCode;
// }
//
// public void setCountryCode(String countryCode) {
// this.countryCode = countryCode;
// }
//
// public String getBuildName() {
// return buildName;
// }
//
// public void setBuildName(String buildName) {
// this.buildName = buildName;
// }
}
@@ -1,13 +1,16 @@
package com.fangjia.open.model.weixin;
import com.fangjia.dal.mongo.model.Evaluation;
import java.io.File;
import java.util.List;
import java.util.Map;
import com.fangjia.dal.seaweed.model.District;
import com.fangjia.dal.sql.model.EvaluationAudit;
import com.fangjia.dal.sql.model.FjtEvaluation;
import com.fangjia.dal.sql.model.*;
import com.fangjia.open.model.BaseModel;
import com.fangjia.service.bo.DistrictStatBo;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
/**
@@ -31,6 +34,7 @@ public class EvaluationModel extends BaseModel{
private long sellHouseCount;
private long rentHouseCount;
private EvaluationAudit evaluationAudit;
private BohaiEvaluationAudit bohaiEvaluationAudit;
private String lender;
private Double dealPrice;
private List<FjtEvaluation> evaluations;
@@ -38,6 +42,20 @@ public class EvaluationModel extends BaseModel{
private String userType;
private Integer role;
private String cardId;
private Map<String, Object> loanInfoMap;
private Integer hopePrice;
private String remark;
// private String preCode;//眾漆諉諳--瞼攫晤鎢
// private String preName;//眾漆諉諳--瞼攫靡備
// private String countryCode;//眾漆諉諳--Е郖晤鎢
// private String buildName;//眾漆諉諳--華硊
private List<CommonsMultipartFile> reportFiles;
private String queryId;
private Integer fileClass;
private Map<String, List<ReportFileAttach>> reportFileMap;
private UserTrades userTrades;
private String address;
public void setId(String id) {
@@ -186,6 +204,117 @@ 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;
}
public BohaiEvaluationAudit getBohaiEvaluationAudit() {
return bohaiEvaluationAudit;
}
public void setBohaiEvaluationAudit(BohaiEvaluationAudit bohaiEvaluationAudit) {
this.bohaiEvaluationAudit = bohaiEvaluationAudit;
}
public Integer getHopePrice() {
return hopePrice;
}
public void setHopePrice(Integer hopePrice) {
this.hopePrice = hopePrice;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
// public String getPreCode() {
// return preCode;
// }
//
// public void setPreCode(String preCode) {
// this.preCode = preCode;
// }
//
// public String getPreName() {
// return preName;
// }
//
// public void setPreName(String preName) {
// this.preName = preName;
// }
//
// public String getCountryCode() {
// return countryCode;
// }
//
// public void setCountryCode(String countryCode) {
// this.countryCode = countryCode;
// }
//
// public String getBuildName() {
// return buildName;
// }
//
// public void setBuildName(String buildName) {
// this.buildName = buildName;
// }
public List<CommonsMultipartFile> getReportFiles() {
return reportFiles;
}
public void setReportFiles(List<CommonsMultipartFile> reportFiles) {
this.reportFiles = reportFiles;
}
public String getQueryId() {
return queryId;
}
public void setQueryId(String queryId) {
this.queryId = queryId;
}
public Integer getFileClass() {
return fileClass;
}
public void setFileClass(Integer fileClass) {
this.fileClass = fileClass;
}
public Map<String, List<ReportFileAttach>> getReportFileMap() {
return reportFileMap;
}
public void setReportFileMap(Map<String, List<ReportFileAttach>> reportFileMap) {
this.reportFileMap = reportFileMap;
}
public UserTrades getUserTrades() {
return userTrades;
}
public void setUserTrades(UserTrades userTrades) {
this.userTrades = userTrades;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
@@ -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,8 +14,14 @@ 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;
private String appId;//²âÊÔ
private String appSecret;//²âÊÔ
private String sid;//²âÊÔ
public List<String> getCitys() {
return citys;
@@ -80,4 +86,44 @@ public class UserModel extends BaseModel {
public void setCode(String code) {
this.code = code;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getAppSecret() {
return appSecret;
}
public void setAppSecret(String appSecret) {
this.appSecret = appSecret;
}
public String getSid() {
return sid;
}
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;
}
}
@@ -0,0 +1,491 @@
package com.fangjia.open.util;
import com.fangjia.core.util.HttpRequest;
import com.fangjia.core.util.MD5Util;
import com.fangjia.core.util.MultipartUtility;
import com.fangjia.dal.sql.model.FjtEvaluation;
import com.fangjia.dal.sql.model.UsersDetail;
import com.fangjia.open.model.weixin.EvaluationModel;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.request.HttpRequestWithBody;
import com.yeepay.shade.org.apache.http.entity.mime.MultipartEntityBuilder;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import okhttp3.*;
import org.apache.commons.collections.map.MultiValueMap;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpHeaders;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.http.ResponseEntity;
import java.io.File;
import java.io.FileInputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
public class BHBankUtils {
// public static String token = "bohaifangjiatest";//测试token
// public static String uri = "http://topen.shbrea.com.cn/API";//测试
public static String token = "bohaifangjia";//正式token
public static String uri ="https://open.shbrea.com.cn/API";
public static String nonce = "818975";
public static Map<String, String > regionCodeMap = new HashMap<String, String>(){{
put("310101000000","黄浦");
put("310104000000","徐汇");
put("310105000000","长宁");
put("310106000000","静安");
put("310107000000","普陀");
put("310109000000","虹口");
put("310110000000","杨浦");
put("310112000000","闵行");
put("310113000000","宝山");
put("310114000000","嘉定");
put("310115000000","浦东");
put("310116000000","金山");
put("310117000000","松江");
put("310118000000","青浦");
put("310120000000","奉贤");
put("310230000000","崇明");
}};
public static List<JSONObject> getDistrictByBhbank(String address){
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
params.put("keyword",address);
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
content = request.get(uri +"/searchAddr/bh/", params, headers, "utf-8");
System.out.println("/searchAddr/bh/ :"+content);
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
JSONArray data = (JSONArray) jsonObj.get("data");
if(data.size()>0){
for(int i=0;i<data.size();i++){
JSONObject obj = (JSONObject) data.get(i);
list.add(obj);
}
}
}
}catch (Exception e){
e.printStackTrace();
}
return list;
}
public static JSONObject getInquirePrice(EvaluationModel model, Map<String, String> bhMatchMap, UsersDetail usersDetail, int fjwTotalPrice){
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
FjtEvaluation ev = model.getFjtEvaluation();
String queryFullAddr = ev.getAddress();
if(StringUtils.isNotBlank(ev.getHouseNum())){
queryFullAddr = queryFullAddr + ev.getHouseNum()+"号";
}
if(StringUtils.isNotBlank(ev.getRoomNum())){
queryFullAddr = queryFullAddr + ev.getRoomNum()+"室";
}
params.put("queryFullAddr",queryFullAddr);//加了楼栋号和室号403
if(bhMatchMap.containsKey("preCode")){
params.put("preCode", bhMatchMap.get("preCode"));
}
if(bhMatchMap.containsKey("preName")){
params.put("preName", bhMatchMap.get("preName"));
}
if(bhMatchMap.containsKey("countryCode")){
params.put("countryCode", bhMatchMap.get("countryCode"));
}
if(StringUtils.isNotBlank(ev.getAddress())){
params.put("buildName", ev.getAddress());
}
if(StringUtils.isNotBlank(ev.getUnitNum())){
params.put("unitCode", ev.getUnitNum());
}
if(ev.getHouseFloor()>0){
params.put("floor", String.valueOf(ev.getHouseFloor()));
}
if(ev.getHouseHight()>0){
params.put("totalFloor", String.valueOf(ev.getHouseHight()));
}
if(StringUtils.isNotBlank(ev.getRoomNum())){
params.put("houseNo",ev.getRoomNum());
}
if(ev.getHouseArea()>0){
params.put("groundArea", String.valueOf(ev.getHouseArea()));
}
params.put("orientName", "南");
params.put("buildYear", ev.getFinishDateStr());
fjwTotalPrice= (int)(fjwTotalPrice/10000) * 10000;
params.put("dealPriceTotal", String.valueOf(fjwTotalPrice));
params.put("userName", usersDetail.getName());
params.put("userPhone", usersDetail.getPhone());
// params.put("userMail", "");
params.put("groupName", usersDetail.getOrgName());
List<String> lists = Arrays.asList("queryFullAddr", "preCode", "preName", "countryCode", "buildName", "unitCode","floor","totalFloor","houseNo","groundArea","undergroundArea","orientName","buildYear","dealPriceTotal","specialNo","userName","userPhone","userMail","groupName");
String s = "";
for(String key : lists){
String value = (String)params.get(key);
if(StringUtils.isNotBlank(value)){
s = s + value;
}
}
String s1 = null;
try {
s1 = URLEncoder.encode(s,"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce+ s1;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
content = request.post(uri +"/inquirePrice/bh/", params, headers, "utf-8");
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
return jsonObj;
}
}catch (Exception e){
e.printStackTrace();
}
return null;
}
public static JSONObject getInquireRecord(String queryId){
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
params.put("queryId",queryId);
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
content = request.get(uri + "/inquireRecord/bh/", params, headers, "utf-8");
System.out.println("/inquireRecord/bh/ "+content);
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
JSONObject data = (JSONObject) jsonObj.get("data");
if(data.size()>0){
return data;
}
}
}catch (Exception e){
e.printStackTrace();
}
return null;
}
public static String inquireFeedback(String name, String queryId, Integer hopePrice){
String feedbackId = null;
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
params.put("queryId",queryId);
params.put("userName",name);
params.put("feedbackMsg","期望价:"+hopePrice+"万");
List<String> lists = Arrays.asList("queryId", "userName", "feedbackMsg");
String s = "";
for(String key : lists){
String value = (String)params.get(key);
if(StringUtils.isNotBlank(value)){
s = s + value;
}
}
String s1 = null;
try {
s1 = URLEncoder.encode(s,"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce+ s1;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
content = request.post(uri+"/inquireFeedback/bh/", params, headers, "utf-8");
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
Integer code = (Integer) jsonObj.get("errCode");
if (code == 0) {
JSONObject data = (JSONObject) jsonObj.get("data");
if(data.size()>0){
feedbackId = (String) data.get("feedbackId");
}
}
}
}catch (Exception e){
e.printStackTrace();
}
return feedbackId;
}
public static JSONObject inquireFeedbackCall(String feedbackId){
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
params.put("feedbackId",feedbackId);
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
content = request.get(uri+"/inquireFeedbackCall/bh/", params, headers, "utf-8");
System.out.println("/inquireFeedbackCall/bh/:"+content);
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
Integer code = (Integer) jsonObj.get("errCode");
if(code == 0){
JSONObject data = (JSONObject) jsonObj.get("data");
return data;
}
}
}catch (Exception e){
e.printStackTrace();
}
return null;
}
public static void inquireUploadFiles(String name, String queryId, Integer fileClass){
String feedbackId = null;
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
params.put("queryId",queryId);
params.put("userName",name);
params.put("fileClass", fileClass.toString());
List<String> lists = Arrays.asList("queryId", "userName", "fileClass");
String s = "";
for(String key : lists){
String value = (String)params.get(key);
if(StringUtils.isNotBlank(value)){
s = s + value;
}
}
String s1 = null;
try {
s1 = URLEncoder.encode(s,"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
// params.put("file", new File("d:/a.jpg") );
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce+ s1;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
content = request.post(uri+"/inquireUploadFiles/bh/", params, headers, "utf-8");
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
System.out.println(jsonObj.toString());
}
}catch (Exception e){
e.printStackTrace();
}
}
public static Integer inquireUploadFiles2(String name, String queryId, Integer fileClass , List<File> uploadfiles){
Map params = new HashMap();
params.put("queryId",queryId);
params.put("userName",name);
params.put("fileClass", fileClass.toString());
List<String> lists = Arrays.asList("queryId", "userName", "fileClass");
String s = "";
for(String key : lists){
String value = (String)params.get(key);
if(StringUtils.isNotBlank(value)){
s = s + value;
}
}
String s1 = null;
try {
s1 = URLEncoder.encode(s,"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce+ s1;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
String url = uri+"/inquireUploadFiles/bh/";
try{
// HttpResponse<String> response= Unirest.post(url).header("sign",md5str2)
// .header("timestamp",date1.toString())
// .header("nonce",nonce.toString())
// .field("queryId",queryId)
// .field("fileClass",fileClass.toString())
// .field("file", new File("d:\\a.jpg"))
// .field("userName",name).asString();
// MultipartBody responseBody = Unirest.post(url).header("sign",md5str2)
// .header("timestamp",date1.toString())
// .header("nonce",nonce.toString())
// .field("queryId",queryId)
// .field("fileClass",fileClass.toString())
// .field("userName",name);
//
// for(File file : uploadfiles){
// responseBody.field("file", file);
// }
// HttpResponse<String> response = responseBody.asString();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MultipartBody.Builder builder = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("queryId",queryId)
.addFormDataPart("fileClass",fileClass.toString())
.addFormDataPart("userName",name);
for(File file : uploadfiles){
builder.addFormDataPart("file",file.getPath(), RequestBody.create(MediaType.parse("application/octet-stream"), file));
}
RequestBody body = builder.build();
Request request = new Request.Builder().url(url).method("POST",body)
.addHeader("sign",md5str2)
.addHeader("timestamp",date1.toString())
.addHeader("nonce", nonce.toString())
.build();
Response response = client.newCall(request).execute();
String content = response.body().string();
JSONObject jsonObj = JSONObject.fromObject(content);
System.out.println("上传接口返回:"+jsonObj.toString());
Integer code = (Integer) jsonObj.get("errCode");
if(code == 0){
return code;
}
}catch (Exception e){
e.printStackTrace();
}
return null;
}
public static Integer inquireToReport(String queryId, String reportMsg){
String feedbackId = null;
List<JSONObject> list = new ArrayList<JSONObject>();
Map params = new HashMap();
params.put("queryId",queryId);
if(StringUtils.isNotBlank(reportMsg)){
params.put("reportMsg",reportMsg);
}
List<String> lists = Arrays.asList("queryId", "reportMsg");
String s = "";
for(String key : lists){
String value = (String)params.get(key);
if(StringUtils.isNotBlank(value)){
s = s + value;
}
}
String s1 = null;
try {
s1 = URLEncoder.encode(s,"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Integer date1 = (int)(new Date().getTime()/1000);
String str = token + date1.toString()+nonce+ s1;
String md5str2 = MD5Util.encrypt(str,"utf-8");
Map headers = new HashMap();
headers.put("timestamp", date1.toString());
headers.put("sign", md5str2);
headers.put("nonce", nonce.toString());
HttpRequest request = new HttpRequest();
String content = null;
try {
System.out.println("调用渤海转评估报告 "+queryId);
content = request.post(uri+"/inquireToReport/bh/", params, headers, "utf-8");
System.out.println("完成调用渤海转评估报告 "+content);
if(StringUtils.isNotBlank(content)){
JSONObject jsonObj = JSONObject.fromObject(content);
Integer code = (Integer) jsonObj.get("errCode");
if (code == 0) {
return code;
}
}
}catch (Exception e){
e.printStackTrace();
}
return null;
}
}
@@ -36,7 +36,7 @@ public class FileDao {
try {
filesCollection = new Mongo("fs.mongo.db.fangjia.com", 27000).getDB("fangjia_fs").getCollection("files");
gridFs = new GridFS(filesCollection.getDB(), "fangjia_fs");
cappedCollection = new Mongo("capped.mongo.db.fangjia.com", Integer.getInteger("capped.mongo.port", 27017)).getDB("fangjia_fs").getCollection("files_capped");
cappedCollection = new Mongo("capped.mongo.db.fangjia.com", Integer.getInteger("capped.mongo.port", 27000)).getDB("fangjia_fs").getCollection("files_capped");
} catch (Exception e) {
e.printStackTrace();
}
@@ -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());
@@ -15,6 +15,9 @@
<class>com.fangjia.dal.sql.model.UsersDetail</class>
<class>com.fangjia.dal.sql.model.EvaluationAudit</class>
<class>com.fangjia.dal.sql.model.GoldLogs</class>
<class>com.fangjia.dal.sql.model.BohaiEvaluationAudit</class>
<class>com.fangjia.dal.sql.model.ReportFileAttach</class>
<class>com.fangjia.dal.sql.model.FormalReport</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
</persistence>
@@ -0,0 +1 @@
374548aec5ca5d3cde89978570a9627c
@@ -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>
@@ -183,70 +183,29 @@
</div>
</div>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
<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="http://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>
@@ -152,8 +154,8 @@
</div>
</div>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
<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='../static/js/select.js' charset='utf-8'></script>
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
<script type='text/javascript' src='../static/js/autoCompletion.js' charset='utf-8'></script>
@@ -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>
@@ -50,8 +50,8 @@
</div>
</div>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
<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='../static/js/wx.js' charset='utf-8'></script>
<script type="text/javascript">
$("#evaluateBtn").on('click', function(){
@@ -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">
</head>
@@ -12,7 +12,7 @@
<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">
</head>
@@ -117,10 +117,10 @@
</div>
</div>
<#include '/layout/footer.ftl'/>
<script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
<script type="text/javascript" src="https://cdn.hcharts.cn/highcharts/highcharts.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 type="text/javascript" src="http://api.map.baidu.com/api?ak=0a7eM0lkIvpKGPiq1bMCfeH7&v=2.0&callback=initMap"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?ak=0a7eM0lkIvpKGPiq1bMCfeH7&v=2.0&callback=initMap"></script>
<script type="text/javascript">
var Constants = {
wwwUrl : '${wwwUrl}',
@@ -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>
@@ -50,8 +50,16 @@
</div>
<#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>
<#if role?? && role == 17>
<a class="tab-item external" href="../weiXinEvaluation/bhhistory">估价记录</a>
<#else>
<a class="tab-item external" href="../weiXinEvaluation/recordList">估价记录</a>
</#if>
<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">
@@ -63,7 +71,7 @@
<#include '/layout/footer.ftl'/>
<script type='text/javascript' src='../static/js/jquery.cookie.js' charset='utf-8'></script>
<#if !(cityName??) || cityName ==''>
<script src="http://api.map.baidu.com/api?ak=0a7eM0lkIvpKGPiq1bMCfeH7&v=2.0&services=false"></script>
<script src="https://api.map.baidu.com/api?ak=0a7eM0lkIvpKGPiq1bMCfeH7&v=2.0&services=false"></script>
<script type='text/javascript'>
Array.prototype.contains = function(item){
return RegExp(item).test(this);
@@ -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">
<style>
@@ -42,8 +42,8 @@
</div>
</div>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
<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='js/wx.js' charset='utf-8'></script>
</body>
@@ -1,6 +1,6 @@
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='https://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type="text/javascript" >
$.config = {router: false}
</script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.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>var jQuery = Zepto</script>
@@ -21,9 +21,9 @@
float: left;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZzX6mRFfE5GKn4cpUp24Q3OyUIHnfQAR"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/GeoUtils/1.2/src/GeoUtils_min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay_min.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZzX6mRFfE5GKn4cpUp24Q3OyUIHnfQAR"></script>
<script type="text/javascript" src="https://api.map.baidu.com/library/GeoUtils/1.2/src/GeoUtils_min.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay_min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
@@ -35,8 +35,8 @@
</div>
</div>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
<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>
</body>
</html>
@@ -59,8 +59,8 @@
</div>
</div>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
<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">
$.init()
// 加载flag
@@ -32,9 +32,14 @@
</div>
<#include '/layout/footer.ftl'/>
<script type="text/javascript">
function showDetail(id, obj) {
function showDetail(id, role, obj) {
$(obj).css("background", "#d9d9d9")
window.location.href = "../weiXinEvaluation/report?evaluationId="+id;
if(role == 17){
window.location.href = "../weiXinEvaluation/bhreport?evaluationId="+id;
}else{
window.location.href = "../weiXinEvaluation/report?evaluationId="+id;
}
}
$.init()
@@ -59,6 +64,9 @@
// 生成新条目的HTML
var html = '';
$.each(data['result'], function(i){
var role = data['role'];
var address = this.dz;
if(this.hn){
address = address + this.hn + "栋";
@@ -67,7 +75,7 @@
address = address + this.rn + "室";
}
if(data.role==12) {
html += "<div class='topic topic01' onclick='showDetail("+this.eid+", this)'><div class='topicContent topicContent01'><div class='left'><p><label>下载日期:</label><span>" + this.xzrq +
html += "<div class='topic topic01' onclick='showDetail("+this.eid+","+role+", this)'><div class='topicContent topicContent01'><div class='left'><p><label>下载日期:</label><span>" + this.xzrq +
"</span></p><p><label>地址:</label><span>" + address + "</span></p><p><label>主贷人:</label><span>" + this.zdr + "</span></p><p><label>面积:</label><span>" + this.mj;
if (this.mj == "-") {
html += "</span></p></div><div class='right'><p><label>总价:</label><span>" + this.zj;
@@ -94,6 +102,54 @@
} else {
html += ("<em>" + this.zsj + "</em>&nbsp;万元</span></p><p><label>报告收费:</label><span>" + (this.bgsf!=null?this.bgsf+"&nbsp;元":'-') + "</span></p></div></div></div>");
}
}else if(data.role==17) {
html += "<div class='topic topic01' onclick='showDetail("+this.eid+","+role+", this)'><div class='topicContent topicContent01'><div class='left'><p><label>下载日期:</label><span>" + this.xzrq +
"</span></p><p><label>地址:</label><span>" + address + "</span></p><p><label>主贷人:</label><span>" + this.zdr + "</span></p><p><label>面积:</label><span>" + this.mj;
if (this.mj == "-") {
html += "</span></p></div><div class='right'><p><label>总价:</label><span>" + this.zj;
} else {
if (this.zsj == "-") {
html += "&nbsp;平米</span></p></div><div class='right'><p><label>总价:</label><span><em>" + this.zj + "</em>";
} else {
html += "&nbsp;平米</span></p></div><div class='right'><p><label>总价:</label><span>" + this.zj;
}
}
if (this.zj == "-") {
if(this.qwj!=undefined) {
html += "</span></p><p><label>期望价:</label><span>" + this.qwj
}else{
html += "</span></p><p><label>期望价:</label><span>-"
}
} else {
if(this.qwj!=undefined){
html += "&nbsp;万元</span></p><p><label>期望价:</label><span>" + this.qwj;
}else{
html += "</span></p><p><label>期望价:</label><span>-";
}
}
if (this.qwj == "-") {
html += "</span></p><p><label>终审价:</label><span>";
} else {
if(this.qwj!=undefined){
html += "&nbsp;万元</span></p><p><label>终审价:</label><span>";
}else{
html += "</span></p><p><label>终审价:</label><span>";
}
}
if (this.zsj == "-") {
html += ("-</span></p></div></div></div>");
} else {
if(this.zsj!=undefined){
html += ("<em>" + this.zsj + "</em>&nbsp;万元</span></p></div></div></div>");
}else{
html += ("<em></em></span></p></div></div></div>");
}
}
} else {
html += "<div class='topic topic01'><div class='topicContent topicContent01'><div class='left'><p><label>下载日期:</label><span>" + this.xzrq +
"</span></p><p><label>地址:</label><span>" + address + "</span></p></div><div class='right'><p><label>总价:</label><span>";
@@ -111,6 +167,13 @@
});
$('.infinite-scroll-bottom .list-container').append(html);
if(data['result'].length<itemsPerLoad){
// 加载完毕,则注销无限加载事件,以防不必要的加载
$.detachInfiniteScroll($('.infinite-scroll'));
// 删除加载提示符
$('.infinite-scroll-preloader').remove();
}
}, "json");
// 添加新条目
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 KiB

Some files were not shown because too many files have changed in this diff Show More