Merge branch 'master' of http://gitlab.fangjia.com/dev0/main into script_gj

This commit is contained in:
2022-03-11 15:33:26 +08:00
11 changed files with 237 additions and 10 deletions
@@ -102,6 +102,8 @@ public class FjtEvaluation implements SqlEntity{
private String finishDateStr;//竣工时间 private String finishDateStr;//竣工时间
private String useType;//房屋用途 private String useType;//房屋用途
private Date downPdfDate;//下载报告时间
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
@Id @Id
@@ -750,6 +752,16 @@ public class FjtEvaluation implements SqlEntity{
this.useType = useType; this.useType = useType;
} }
@Column(name = "down_pdf_date")
public Date getDownPdfDate() {
return downPdfDate;
}
public void setDownPdfDate(Date downPdfDate) {
this.downPdfDate = downPdfDate;
}
@Override @Override
public String toString() { public String toString() {
return "FjtEvaluation{" + return "FjtEvaluation{" +
@@ -38,6 +38,7 @@ public class OpenConfig extends Configuration {
private final String ipdatfile; private final String ipdatfile;
private final String baiduAk; private final String baiduAk;
private final String defaultCity;
private final boolean isOpenAllAuthority; private final boolean isOpenAllAuthority;
@@ -54,6 +55,7 @@ public class OpenConfig extends Configuration {
baiduAk = configuration.get("fangjia.baidu.ak"); baiduAk = configuration.get("fangjia.baidu.ak");
isOpenAllAuthority = configuration.getBoolean("fangjia.isOpenAllAuthority", false); isOpenAllAuthority = configuration.getBoolean("fangjia.isOpenAllAuthority", false);
enabledAddressMatch = configuration.getBoolean("fangjia.addressMatch.enabled",false); enabledAddressMatch = configuration.getBoolean("fangjia.addressMatch.enabled",false);
defaultCity = configuration.get("fangjia.default.city");
} }
public static OpenConfig getConfig() { public static OpenConfig getConfig() {
@@ -134,4 +136,7 @@ public class OpenConfig extends Configuration {
return enabledAddressMatch; return enabledAddressMatch;
} }
public String getDefaultCity() {
return defaultCity;
}
} }
@@ -89,6 +89,7 @@ import com.fangjia.service.mongo.fangjia.ServerAreaService;
import com.fangjia.service.open.WaitCrawlKeywordsService; import com.fangjia.service.open.WaitCrawlKeywordsService;
import com.fangjia.service.sql.FjtEvaluationService; import com.fangjia.service.sql.FjtEvaluationService;
import com.fangjia.service.web.AddressService; import com.fangjia.service.web.AddressService;
import org.sothis.web.mvc.annotation.Param;
@Authority(role = Role.USER) @Authority(role = Role.USER)
public class AddressController { public class AddressController {
@@ -106,6 +107,7 @@ public class AddressController {
private HouseLoudongService houseLoudongService; private HouseLoudongService houseLoudongService;
private FjtEvaluationService fjtEvaluationService; private FjtEvaluationService fjtEvaluationService;
private AddressMatchProxyService addressMatchProxyService; private AddressMatchProxyService addressMatchProxyService;
private final static String AK = OpenConfig.getConfig().getBaiduAk(); private final static String AK = OpenConfig.getConfig().getBaiduAk();
private final static Logger LOGGER = LoggerFactory.getLogger(AddressController.class); private final static Logger LOGGER = LoggerFactory.getLogger(AddressController.class);
@@ -117,6 +119,8 @@ public class AddressController {
private static final String GRADE_NATION = "全国评分"; private static final String GRADE_NATION = "全国评分";
private static final String GRADE_CONSUME = "消费评分"; private static final String GRADE_CONSUME = "消费评分";
public final static OpenConfig CONFIG = OpenConfig.getConfig();
/** /**
* @deprecated see parse2Action * @deprecated see parse2Action
* @param model * @param model
@@ -1705,6 +1709,183 @@ public class AddressController {
return mav; return mav;
} }
/**
* 地址标准化接口V2
*
* @param model
* @return
*/
public Object standard2Action(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
params.put("address", model.getAddress());
try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch(Exception e){
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch(Exception ex){
ex.printStackTrace();
}
}
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if(json.containsKey("result")){
basicModel.setResult(json.get("result"));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 五级地址标准化接口
*
* @param model
* @return
*/
public Object fiveDivisionStructureAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
params.put("address", model.getAddress());
// 地址验证无效也输出标准化结果
params.put("flag", "true");
try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8");
} catch(Exception e){
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8");
} catch(Exception ex){
ex.printStackTrace();
}
}
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if(json.containsKey("result")){
basicModel.setResult(json.get("result"));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 详细地址标准化接口
*
* @param model
* @return
*/
public Object divisionStructureAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
params.put("address", model.getAddress());
// 地址验证无效也输出标准化结果
params.put("flag", "true");
try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/divisionStructure", params, "UTF-8");
} catch(Exception e){
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/divisionStructure", params, "UTF-8");
} catch(Exception ex){
ex.printStackTrace();
}
}
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if(json.containsKey("result")){
basicModel.setResult(json.get("result"));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
/**
* 地址标准化专用测试接口
* @param model
* @return
*/
public Object structureForTestAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
mav.setModel(BasicModel.buildBadRequestModel("地址不能为空"));
return mav;
}
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
params.put("address", model.getAddress());
// 地址验证无效也输出标准化结果
params.put("flag", "true");
try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureForTest", params, "UTF-8");
} catch(Exception e){
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureForTest", params, "UTF-8");
} catch(Exception ex){
ex.printStackTrace();
}
}
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if(json.containsKey("result")){
basicModel.setResult(json.get("result"));
}
mav.setModel(basicModel);
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
return mav;
}
public Object similarityAction(AddesssMatchModel model) { public Object similarityAction(AddesssMatchModel model) {
RestfulModelAndView mav = new RestfulModelAndView(); RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress_1()) || StringUtils.isBlank(model.getAddress_2())) { if (StringUtils.isBlank(model.getAddress_1()) || StringUtils.isBlank(model.getAddress_2())) {
@@ -2363,7 +2363,7 @@ public class PropertyController {
mav.setModel(BasicModel.buildBadRequestModel("size(面积)不能为空")); mav.setModel(BasicModel.buildBadRequestModel("size(面积)不能为空"));
return mav; return mav;
} }
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName().replace(" ",""),
"district"); "district");
if (null == district) { if (null == district) {
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在")); mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
@@ -462,8 +462,14 @@ public class WeiXinEvaluationController {
}else if(bhDists.size()>1){ }else if(bhDists.size()>1){
int mod = Integer.MAX_VALUE; int mod = Integer.MAX_VALUE;
for(JSONObject jo : bhDists){ for(JSONObject jo : bhDists){
double price = Double.valueOf((String)jo.get("price")); int bhprice = 0;
int bhprice = (int)price; if (jo.get("price") == null || jo.get("price").equals("null")) {
bhprice = 0;
} else {
double price = Double.valueOf((String)jo.get("price"));
bhprice = (int)price;
}
int bhmod = Math.abs(bhprice - avgPrice); int bhmod = Math.abs(bhprice - avgPrice);
if(bhmod<mod){ if(bhmod<mod){
mod = bhmod; mod = bhmod;
@@ -1025,6 +1031,7 @@ public class WeiXinEvaluationController {
String reporNum = "147698"+ String.valueOf(evaluation.getId()); String reporNum = "147698"+ String.valueOf(evaluation.getId());
evaluation.setReportNum(reporNum); evaluation.setReportNum(reporNum);
evaluation.setDownPdfDate(new Date());
fjtEvaluationService.updateEvaluation(evaluation); fjtEvaluationService.updateEvaluation(evaluation);
try { try {
@@ -441,7 +441,7 @@ public class BHBankUtils {
Map params = new HashMap(); Map params = new HashMap();
params.put("queryId",queryId); params.put("queryId",queryId);
if(StringUtils.isNotBlank(reportMsg)){ if(StringUtils.isNotBlank(reportMsg)){
params.put("reportMsg",reportMsg); params.put("reportMsg",reportMsg.replace(" ",""));
} }
@@ -100,4 +100,5 @@ fangjia.jms.email.queue=email.queue
fangjia.redis_nodes=192.168.0.79:6379,192.168.0.79:6380,192.168.0.79:6381,192.168.0.81:6382,192.168.0.81:6383,192.168.0.81:6384 fangjia.redis_nodes=192.168.0.79:6379,192.168.0.79:6380,192.168.0.79:6381,192.168.0.81:6382,192.168.0.81:6383,192.168.0.81:6384
fangjia.fangjiatong.url = http://user.fangjia.com/fangjiatong2 fangjia.fangjiatong.url = http://user.fangjia.com/fangjiatong2
fangjia.default.city = \u91CD\u5E86\u5E02
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<urlrewrite> <urlrewrite>
<global-params> <global-params>
<param value="st" name="sort" type="attach"/> <!-- <param value="st" name="sort" type="attach"/>-->
<param value="pn" name="pager.currentPage" type="attach"/> <!-- <param value="pn" name="pager.currentPage" type="attach"/>-->
</global-params> </global-params>
<rules> <rules>
<rule controller="city" action="condition2" channel="v2"> <rule controller="city" action="condition2" channel="v2">
@@ -33,5 +33,10 @@
<ladder>/property/avgPrice</ladder> <ladder>/property/avgPrice</ladder>
</ladders> </ladders>
</rule> </rule>
<rule controller="address" action="standard2" channel="v2">
<ladders>
<ladder>/address/standard</ladder>
</ladders>
</rule>
</rules> </rules>
</urlrewrite> </urlrewrite>
@@ -152,7 +152,8 @@ $(document).on('click', '.create-actions03', function () {
$("#buildType").val("8") $("#buildType").val("8")
$("#houseFloor").show() $("#houseFloor").show()
$("#floorDesc").hide() $("#floorDesc").hide()
$("#basementAreaLi").hide() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -163,6 +164,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").show() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -173,6 +175,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").show() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -183,6 +186,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").show() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -193,6 +197,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").show() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -203,6 +208,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").show() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -213,6 +219,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").show() $("#basementAreaLi").show()
$("#basementAreaLi_intr").show()
} }
}, },
{ {
@@ -223,6 +230,7 @@ $(document).on('click', '.create-actions03', function () {
$("#floorDesc").show() $("#floorDesc").show()
// $("#houseFloor").hide() // $("#houseFloor").hide()
$("#basementAreaLi").hide() $("#basementAreaLi").hide()
$("#basementAreaLi_intr").hide()
} }
}, },
{ {
@@ -233,6 +241,7 @@ $(document).on('click', '.create-actions03', function () {
$("#houseFloor").show() $("#houseFloor").show()
// $("#floorDesc").hide() // $("#floorDesc").hide()
$("#basementAreaLi").hide() $("#basementAreaLi").hide()
$("#basementAreaLi_intr").hide()
} }
} }
]; ];
@@ -172,6 +172,13 @@
</div> </div>
</div> </div>
</li> </li>
<li id="basementAreaLi_intr" style="color:#999;" class="dn">
<div class="item-content">
<div class="item-inner">
*建筑面积中含有地下附属面积
</div>
</div>
</li>
</ul> </ul>
@@ -44,7 +44,7 @@
<#if role?? && role==17 && loanInfoMap??> <#if role?? && role==17 && loanInfoMap??>
<p style="margin-top:-12px;">所属分类:${loanInfoMap.type!}类</p> <p style="margin-top:-12px;">所属分类:${loanInfoMap.type!}类</p>
<p style="margin-top:-10px;">可贷成数:${loanInfoMap.loan_ratio!}成</p> <p style="margin-top:-10px;">可贷成数:${loanInfoMap.loan_ratio!}成</p>
<p style="margin-top:-22px;">可贷金额:<strong class="price_final">${(fjtEvaluation.totalPrice*loanInfoMap.loan_ratio*0.1/10000)?string('0.##')}</strong>万元</p> <p style="margin-top:-22px;">可贷金额:<strong class="price_final">${(bohaiEvaluationAudit.inquirePrice*loanInfoMap.loan_ratio*0.1/10000)?string('0.##')}</strong>万元</p>
<p style="margin-top:-4px;">贷款利率:4.5%</p> <p style="margin-top:-4px;">贷款利率:4.5%</p>
</#if> </#if>
<#else> <#else>
@@ -88,7 +88,7 @@
<div class="topic inputTopic01" id="inputTopic01a"> <div class="topic inputTopic01" id="inputTopic01a">
<div class="topicTitle topicTitle01"> <div class="topicTitle topicTitle01">
<span>期望价:</span> <span>期望价:</span>
<input class="input_price" type="textArea" name="dealPrice">&nbsp;万元 <input class="input_price" type="textArea" name="dealPrice" <#if userTrades??>disabled</#if>>&nbsp;万元
<a class="submit_btn" id="submitbhPrice" style="border-left: none;">提交</a> <a class="submit_btn" id="submitbhPrice" style="border-left: none;">提交</a>
<a class="submit_btn dn" id="refreshbhPrice" style="border-left: none;">刷新</a> <a class="submit_btn dn" id="refreshbhPrice" style="border-left: none;">刷新</a>
</div> </div>