From 1648e753bdeb65fb08547c43191dcf4979374ff4 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 27 Oct 2021 14:36:25 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B9=B4=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/ExportOracleData.groovy | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy index 8903b149b..1401f34e8 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy @@ -27,21 +27,18 @@ class ExportOracleData { // exportBigdataDistrictData() // exportBigdataCommunity() // exportGuidedPrice() - exportBigdataForsale() +// exportBigdataForsale() // exportThirdPartyPrice() // exportBigdataDeal() // exportCommunityGuidedPrice() - - -// exportAvmEvaluationGJNB() -// exportAVMEvaluationItemGJNB() -// exportCommunityBasePrice() - -// exportCommunityBasePriceGj() + exportAvmEvaluationGJNB() + exportAVMEvaluationItemGJNB() + exportCommunityBasePrice() + exportCommunityBasePriceGj() // exportCityPrice() // exportRegionPrice() -// exportLastFile() + exportLastFile() } @@ -237,7 +234,7 @@ class ExportOracleData { } def exportCommunityGuidedPrice() { - def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, AVGPRICE, SOURCETYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME , SOURCECODE from community_guide_price_gj where cityname='西安'"; + def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, AVGPRICE, SOURCETYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME , SOURCECODE from community_guide_price_gj"; def allRows = [] sqlInstance.eachRow(sql, { r -> def data = [] @@ -404,7 +401,7 @@ class ExportOracleData { FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); println "THIRD_PARTY_PRICE_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, curDate) + //CcbFtpUtils.ftpUpload(fileName, curDate) } @@ -559,7 +556,7 @@ class ExportOracleData { def sql = "select ID,CITYID,CITYNAME, YEAR_MONTH, COMMUNITY_NUM, HAS_PRICE_COMMUNITY_NUM, PRICE_COVERAGE, ARTIFICIAL_CALC_NUM, ARTIFICIAL_CALC_COVERAGE, SAMPLE_CALC_NUM, SAMPLE_CALC_COVERAGE, \n" + "ANN_CALC_NUM, ANN_CALC_COVERAGE, TEST_NUM, TEST_COMM_NUM, TEST_COMM_COVERAGE, PPE15_COVERAGE, RATE_MEDIAN, COEFFICIENT,DEAL_TEST_CASE_NUM, DEAL_TEST_COMM_NUM, DEAL_TEST_COMM_COVERAGE, DEAL_PPE15_COVERAGE, \n" + "DEAL_COEFFICIENT, DEAL_RATE_MEDIAN, THIRD_TEST_CASE_NUM, THIRD_TEST_COMM_NUM, THIRD_TEST_COMM_COVERAGE, THIRD_PPE15_COVERAGE, THIRD_COEFFICIENT, THIRD_RATE_MEDIAN, \n" + - "to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from avm_evaluation_gj where (cityId=350200 or cityId=150100) and year_month<202108 "; + "to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from avm_evaluation_gj where YEAR_MONTH >= 202106"; def allRows = [] sqlInstance.eachRow(sql,{r-> def data = [] @@ -617,7 +614,7 @@ class ExportOracleData { def exportAVMEvaluationItemGJNB(){ def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, CONFIDENCE,TARGET_AVG_PRICE, \n" + "to_char(DEALDATE,'yyyy-mm-dd hh24:mi:ss') as DEALDATE, UNIT_PRICE, BUILDAREA, FITMENT, HOUSEASPECT, FLOORNUM, FLOORCNT, DATA_TYPE, RATE, PE, \n" + - "to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME from avm_evaluation_item_gj where (cityId=350200 or cityId=150100) and year_month>=202108"; + "to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME from avm_evaluation_item_gj where YEAR_MONTH >= 202106"; def allRows = [] sqlInstance.eachRow(sql,{r-> def data = [] @@ -661,7 +658,7 @@ class ExportOracleData { } def exportCommunityBasePrice(){ - def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, FAKE_RATE, DIFF_RATE, CONFI_RATE, CORR_RATE, CONFIDENCE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_base_price_gj where (cityId=350200 or cityId=150100) and year_month<202108"; + def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, COMMID, COMMNAME, YEAR_MONTH, CALC_AVG_PRICE, AVG_PRICE, CALC_TYPE, FAKE_RATE, DIFF_RATE, CONFI_RATE, CORR_RATE, CONFIDENCE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_base_price_gj"; def allRows = [] sqlInstance.eachRow(sql,{r-> def data = [] @@ -704,7 +701,7 @@ class ExportOracleData { } def exportCityPrice(){ - def sql = "select ID, CITYID, CITYNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from city_price_gj where (cityId=350200 or cityId=150100) and year_month>=202108"; + def sql = "select ID, CITYID, CITYNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from city_price_gj"; def allRows = [] sqlInstance.eachRow(sql,{r-> def data = [] @@ -733,7 +730,7 @@ class ExportOracleData { } def exportRegionPrice(){ - def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from DISTRICT_PRICE_GJ where (cityId=350200 or cityId=150100) and year_month>=202108"; + def sql = "select ID, CITYID, CITYNAME, DISTID, DISTNAME, YEAR_MONTH, CALC_AVG_PRICE, PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from DISTRICT_PRICE_GJ"; def allRows = [] sqlInstance.eachRow(sql,{r-> def data = [] @@ -764,12 +761,10 @@ class ExportOracleData { } def exportLastFile(){ - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") - - def curMonth = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28" def dataCodeFileName = "/ccb/${curDate}.ok" if(CommonDatautils.isWindow()){ - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curMonth}\\${curDate}.ok" + dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\${curDate}.ok" } CcbFtpUtils.ftpUpload(dataCodeFileName, curDate) } From bc87a186c55c6cc05ee43e1c59777f9d57f57bc6 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 28 Oct 2021 19:21:01 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/ccbevaluation/CcbFtpUtils.groovy | 2 +- .../script/ccbevaluation/ExportOracleData.groovy | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpUtils.groovy index 5e4c8766e..329c4e425 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbFtpUtils.groovy @@ -10,7 +10,7 @@ class CcbFtpUtils { static def ftpServer = "192.168.0.45" static def ftpPort = 17495 static def ftpUser = "ccb" - static def ftpPassword = "0I1k8EAM+O8iA" + static def ftpPassword = "ccb!@#" static def ftpPath = "/home/ccb/output/" static SFTP sftp = new SFTP(); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy index 1401f34e8..4f8f7d3b1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy @@ -29,16 +29,16 @@ class ExportOracleData { // exportGuidedPrice() // exportBigdataForsale() // exportThirdPartyPrice() -// exportBigdataDeal() + exportBigdataDeal() // exportCommunityGuidedPrice() - exportAvmEvaluationGJNB() - exportAVMEvaluationItemGJNB() - exportCommunityBasePrice() - exportCommunityBasePriceGj() +// exportAvmEvaluationGJNB() +// exportAVMEvaluationItemGJNB() +// exportCommunityBasePrice() +// exportCommunityBasePriceGj() // exportCityPrice() // exportRegionPrice() - exportLastFile() +// exportLastFile() } From adef6f1ca8dfb79bb39d04e8f382b1b52f2430f8 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 1 Nov 2021 12:00:09 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=AF=BC=E5=B0=8F=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy | 2 +- .../com/fangjia/script/ccbevaluation/ExportOracleData.groovy | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy index 147a34823..3e5b20fbb 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy @@ -281,7 +281,7 @@ class CcbCommonUtils { q.put("visible",0) q.put("cat", cat); q.put("city", city); -// q.put("name","御海阳光") +// q.put("name","江南人家") // q.put("name_cat", 0); // q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"])) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy index 4f8f7d3b1..30a10ae78 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy @@ -25,11 +25,11 @@ class ExportOracleData { // exportCommunityStaging() // exportCommunityBuileType() // exportBigdataDistrictData() -// exportBigdataCommunity() + exportBigdataCommunity() // exportGuidedPrice() // exportBigdataForsale() // exportThirdPartyPrice() - exportBigdataDeal() +// exportBigdataDeal() // exportCommunityGuidedPrice() // exportAvmEvaluationGJNB() From 4eb4476cfefff6ae5f04bf6261ea16681c8076ec Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 5 Nov 2021 18:03:40 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=88=BF=E6=BA=90=EF=BC=9A=E5=8C=97?= =?UTF-8?q?=E4=BA=AC=EF=BC=8C=E4=B8=8A=E6=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/ExportOracleData.groovy | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy index 30a10ae78..7b4b6d11d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy @@ -25,10 +25,12 @@ class ExportOracleData { // exportCommunityStaging() // exportCommunityBuileType() // exportBigdataDistrictData() - exportBigdataCommunity() +// exportBigdataCommunity() // exportGuidedPrice() -// exportBigdataForsale() + exportBigdataForsale() // exportThirdPartyPrice() + +// exportThirdPartyPrice2() // exportBigdataDeal() // exportCommunityGuidedPrice() @@ -405,6 +407,39 @@ class ExportOracleData { } + def exportThirdPartyPrice2() { + def sql = "select ID, CITYID, DISTID, COMMID, COMMNAME, DATA_SOURCE_ID, DATA_SOURCE, PRICE_DATE, COMMUNITY_PRICE, COMMUNITY_MAX_PRICE, COMMUNITY_MIN_PRICE, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME from third_party_price"; + def allRows = [] + sqlInstance.eachRow(sql, { r -> + def data = [] + data << r.ID + data << r.CITYID + data << r.DISTID + data << r.COMMID + data << r.COMMNAME + data << r.DATA_SOURCE_ID + data << r.DATA_SOURCE + data << r.PRICE_DATE + data << r.COMMUNITY_PRICE + data << r.COMMUNITY_MAX_PRICE + data << r.COMMUNITY_MIN_PRICE + data << r.UPDATETIME + allRows << data + }) + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; + def fileName = "/ccb/MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.dat" + if (CommonDatautils.isWindow()) { + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.dat" + } + def headers = [] +//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","均价对应的月份","诸葛找房均价","安居客均价","房天下均价","链家均价","城市房产均价","麦田均价","贝壳均价","淘房365","中原均价","兔博士均价","Q房均价","房探均价","房多多均价","我爱我家均价","创建时间","更新时间","来源公司"] + + FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); + println "THIRD_PARTY_PRICE_GJ 数据文件输出完成......" + //CcbFtpUtils.ftpUpload(fileName, curDate) + } + + def exportBigdataCommunity(){ def sql = "select CITYID, DISTID, COMMID, DISTNAME, COMMNAME, ADDRESS, LATITUDE, LONGITUDE, LANDAREA, BUILDAREA, GREENINGRATE, PLOTRATIO, PARKINGCNT, BUILDYEAR, HOUSEUSE, ZTS, WORKDATE, UPDATEFLAG, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,COMMTYPE, \n" + "\tCOMMALIAS, STREET, STREETNO, IFNEW, INTRODUCTION, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, SOURCECODE, XZJDB, LJXZQHDM, LJXZQH,STATUS from bigdata_community_gj ";//where cityId in (350200,150100) @@ -461,7 +496,7 @@ class ExportOracleData { def exportBigdataForsale(){ - def citys = CcbCommonUtils.citys; + def citys = ["北京","上海"]//CcbCommonUtils.citys; def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; From d26baea109c1b7e36e101dfca11ba06d12c640d2 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 5 Nov 2021 21:18:29 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=88=BF=E6=BA=90=20=2011=E4=B8=AA?= =?UTF-8?q?=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/ccbevaluation/ExportOracleData.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy index 7b4b6d11d..792374cd7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ExportOracleData.groovy @@ -495,14 +495,14 @@ class ExportOracleData { } def exportBigdataForsale(){ - - def citys = ["北京","上海"]//CcbCommonUtils.citys; + //["北京","上海"] + def citys = ["重庆","天津","成都","沈阳","大连","深圳","杭州","合肥","无锡","武汉","广州"]//CcbCommonUtils.citys; def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; - def fileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" + def fileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0002.dat" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0002.dat" } def headers = []//["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"] for(def city : citys){ From 0fd52bd622499578cd1662b778d0190e88171a01 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 9 Nov 2021 14:12:36 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E6=B8=A4=E6=B5=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/dao/BohaiEvaluationAuditDao.java | 7 + .../dao/BohaiEvaluationAuditDaoImpl.java | 7 + .../dal/sql/model/BohaiEvaluationAudit.java | 184 ++++++++ .../fangjia/dal/sql/model/FjtEvaluation.java | 21 + .../weixin/DistrictController.java | 20 +- .../controllers/weixin/ReportController.java | 59 ++- .../weixin/WeiXinEvaluationController.java | 312 ++++++++++++- .../open/model/weixin/DistrictModel.java | 36 ++ .../open/model/weixin/EvaluationModel.java | 64 +++ .../com/fangjia/open/util/BHBankUtils.java | 282 ++++++++++++ .../resources/persistence-goojia-fangjia.xml | 1 + .../src/main/webapp/district/weXinList.ftl | 7 +- .../src/main/webapp/report/downloadList.ftl | 22 +- .../src/main/webapp/static/js/report.js | 94 +++- .../src/main/webapp/static/js/select.js | 112 ++++- .../src/main/webapp/static/style/wx.css | 2 +- .../main/webapp/weiXinEvaluation/bhform.ftl | 265 +++++++++++ .../webapp/weiXinEvaluation/bhhistory.ftl | 177 +++++++ .../main/webapp/weiXinEvaluation/bhreport.ftl | 430 ++++++++++++++++++ .../sql/BohaiEvaluationAuditService.java | 16 + .../sql/BohaiEvaluationAuditServiceImpl.java | 46 ++ 21 files changed, 2111 insertions(+), 53 deletions(-) create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java create mode 100644 projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java create mode 100644 projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhform.ftl create mode 100644 projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhhistory.ftl create mode 100644 projects/fangjia-open/src/main/webapp/weiXinEvaluation/bhreport.ftl create mode 100644 projects/fangjia-service/src/main/java/com/fangjia/service/sql/BohaiEvaluationAuditService.java create mode 100644 projects/fangjia-service/src/main/java/com/fangjia/service/sql/BohaiEvaluationAuditServiceImpl.java diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java new file mode 100644 index 000000000..4f8c7d26b --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java @@ -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 { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java new file mode 100644 index 000000000..1035be137 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java @@ -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 implements BohaiEvaluationAuditDao{ +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java new file mode 100644 index 000000000..adb5b7be6 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java @@ -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; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java index 4ca4a7f59..c5991df90 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java @@ -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{" + diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java index a09518625..4cc728b6a 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java @@ -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 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 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; diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java index 3fdb01671..2c75d331e 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java @@ -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; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java index 7507185f8..6ed2a56fd 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java @@ -1,5 +1,6 @@ package com.fangjia.open.controllers.weixin; +import java.io.IOException; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -7,9 +8,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.fangjia.dal.sql.model.*; +import com.fangjia.open.util.BHBankUtils; import com.fangjia.open.util.InsidePolygon2; import com.fangjia.service.mongo.fangjia.PriceBorderService; +import com.fangjia.service.sql.*; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -28,12 +33,6 @@ 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; @@ -56,13 +55,6 @@ 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; @@ -107,6 +99,7 @@ public class WeiXinEvaluationController { private EvaluationService evaluationService; private GoldLogsService goldLogsService; private PriceBorderService priceBorderService; + private BohaiEvaluationAuditService bohaiEvaluationAuditService; private final static String DD_ID = "5938c43984aec20a36f474c5"; @@ -122,7 +115,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); @@ -130,9 +123,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 addrAlias = new ArrayList(); + 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 @@ -177,6 +194,108 @@ 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 fjtEvaluationList = fjtEvaluationService.findEvaluationsByUserId(userId, pager); + 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", "价格待审核"); + + //接入询价结果查询接口 + JSONObject obj = BHBankUtils.getInquireRecord(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", "价格已审核"); + } else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==2) { + jsonObject.put("shzt", "价格待审核"); + if(evaluationAudit.getHopePrice()>0){ + //接入反馈结果查询接口 + JSONObject object = BHBankUtils.inquireFeedbackCall(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", "审核完成"); + }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 @@ -243,6 +362,7 @@ public class WeiXinEvaluationController { return data; } + public Object inputAction(EvaluationModel model){ District district = districtService.findById(model.getId()); if(model.getEvaluation() == null){ @@ -277,7 +397,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()); @@ -294,14 +416,88 @@ 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) { + List bhDists = BHBankUtils.getDistrictByBhbank(evaluation.getAddress()); + if(bhDists.size()<1){ + bhDists = BHBankUtils.getDistrictByBhbank(district.getName()); + } + Map bhMatchMap = new HashMap(); + 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 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()); + } + JSONObject bhApiResult = BHBankUtils.getInquirePrice(model, bhMatchMap, usersDetail, evaluation.getTotalPrice()); + if(bhApiResult!=null){ + 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; + } + + 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); + } + } + Map data = new HashMap(); data.put("id", String.valueOf(evaluation.getId())); + data.put("role", String.valueOf(fjtUser.getRole())); JsonModel json = new JsonModel(); json.setJsonModel(data); return json; @@ -380,6 +576,8 @@ public class WeiXinEvaluationController { model.setEvaluationAudit(evaluationAudit); if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){ + + Map retMap = getLoanInfo(district, evaluation.getHouseArea()); if(retMap!=null && retMap.size()>0){ model.setLoanInfoMap(retMap); @@ -387,6 +585,34 @@ public class WeiXinEvaluationController { } 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(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("上海")){ + Map retMap = getLoanInfo(district, evaluation.getHouseArea()); + if(retMap!=null && retMap.size()>0){ + model.setLoanInfoMap(retMap); + } + } + return model; + } //To C 报告结果页 public Object resultAction(EvaluationModel model){ @@ -580,8 +806,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) { @@ -596,6 +820,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(); @@ -611,6 +869,22 @@ public class WeiXinEvaluationController { jsonMmodel.setJsonModel(dataMap); return jsonMmodel; } + + + public Object refreshBhAuditPriceAction(EvaluationModel model){ + JsonModel jsonMmodel = new JsonModel(); + Map dataMap = new HashMap(); + 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){ @@ -937,4 +1211,8 @@ public class WeiXinEvaluationController { public void setPriceBorderService(PriceBorderService priceBorderService) { this.priceBorderService = priceBorderService; } + + public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) { + this.bohaiEvaluationAuditService = bohaiEvaluationAuditService; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java index 3f0b81226..5f9c5a223 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java @@ -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; +// } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java index 1282b227f..f6cd5a7fd 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import com.fangjia.dal.seaweed.model.District; +import com.fangjia.dal.sql.model.BohaiEvaluationAudit; import com.fangjia.dal.sql.model.EvaluationAudit; import com.fangjia.dal.sql.model.FjtEvaluation; import com.fangjia.open.model.BaseModel; @@ -32,6 +33,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 evaluations; @@ -40,6 +42,12 @@ public class EvaluationModel extends BaseModel{ private Integer role; private String cardId; private Map loanInfoMap; + private Integer hopePrice; + private String remark; +// private String preCode;//渤海接口--楼盘编码 +// private String preName;//渤海接口--楼盘名称 +// private String countryCode;//渤海接口--区域编码 +// private String buildName;//渤海接口--地址 public void setId(String id) { @@ -196,4 +204,60 @@ public class EvaluationModel extends BaseModel{ public void setLoanInfoMap(Map 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; +// } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java new file mode 100644 index 000000000..06d9f05f6 --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java @@ -0,0 +1,282 @@ +package com.fangjia.open.util; + +import com.fangjia.core.util.HttpRequest; +import com.fangjia.core.util.MD5Util; +import com.fangjia.dal.sql.model.FjtEvaluation; +import com.fangjia.dal.sql.model.UsersDetail; +import com.fangjia.open.model.weixin.EvaluationModel; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.*; + +public class BHBankUtils { + +// public static String token = "bohaifangjiatest";//测试token + public static String token = "bohaifangjia";//正式token + public static String nonce = "818975"; +// public static String uri = "http://topen.shbrea.com.cn/API";//测试 + public static String uri ="https://open.shbrea.com.cn/API"; + + public static Map regionCodeMap = new HashMap(){{ + 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 getDistrictByBhbank(String address){ + + List list = new ArrayList(); + 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"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + JSONArray data = (JSONArray) jsonObj.get("data"); + if(data.size()>0){ + for(int i=0;i bhMatchMap, UsersDetail usersDetail, int fjwTotalPrice){ + List list = new ArrayList(); + 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 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 list = new ArrayList(); + 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"); + 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 list = new ArrayList(); + Map params = new HashMap(); + params.put("queryId",queryId); + params.put("userName",name); + params.put("feedbackMsg","期望价:"+hopePrice+"万"); + + List 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 list = new ArrayList(); + 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"); + 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; + } +} diff --git a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml index fea498f8a..a853e4c82 100644 --- a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml +++ b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml @@ -15,6 +15,7 @@ com.fangjia.dal.sql.model.UsersDetail com.fangjia.dal.sql.model.EvaluationAudit com.fangjia.dal.sql.model.GoldLogs + com.fangjia.dal.sql.model.BohaiEvaluationAudit true \ No newline at end of file diff --git a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl index 62e8a4f8d..3e07b5ef4 100644 --- a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl +++ b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl @@ -50,7 +50,12 @@ <#if type?? && type == 'b'>