From 6ff9f665b0bb204d31843058b0441b2a1e3e471c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Sat, 17 Jul 2021 21:42:28 +0800 Subject: [PATCH 01/46] geng xin --- .../fangjia/script/gj/GaoDeMapCrawl.groovy | 2 - .../script/wenyan/auto/ReCalcAvgPrice.groovy | 32 +++++ .../wenyan/auto/SaveMapPoiToSeaweed.groovy | 113 ++++++++++++++++++ .../fangjia/script/wenyan/temp/QinLin.groovy | 8 +- .../wenyan/temp/SiChuanJingCheng.groovy | 6 +- .../fangjia/script/wenyan/temp/Test7.groovy | 85 ++++++++++++- 6 files changed, 233 insertions(+), 13 deletions(-) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/ReCalcAvgPrice.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/SaveMapPoiToSeaweed.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy index e93f98720..41bb9db8e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy @@ -38,9 +38,7 @@ class GaoDeMapCrawl extends BaseBatch{ DBCollection BOUNDS_COLL = MongoUtils.getCollectionByName("fangjia_base", "city_bounds_box", "192.168.0.235", 27018) def targetUrl = "http://192.168.0.206:9200/amap_poi/_doc" - final def dbUrl = "mongodb://192.168.0.235:27018"; - ExecutorService fixedThreadPool = Executors.newFixedThreadPool(1) final AtomicInteger count = new AtomicInteger() def updateLists = [] diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/ReCalcAvgPrice.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/ReCalcAvgPrice.groovy new file mode 100644 index 000000000..5fceee582 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/ReCalcAvgPrice.groovy @@ -0,0 +1,32 @@ +package com.fangjia.script.wenyan.auto + +import com.fangjia.core.util.DateUtil +import com.fangjia.script.util.CommonUtils +import com.fangjia.script.util.DbUtils +import com.fangjia.script.util.ExcelUtils +import com.mongodb.BasicDBObject + +//def keys = new BasicDBObject() +//keys.city = 1 +//keys.region = 1 +//keys.name = 1 +//keys.estate_type2 = 1 +//["重庆"].each {def city-> +// DbUtils.multiThreadingExecuteQueryOnSeaweed(DbUtils.buildSeaweedQuery(city),{BasicDBObject seaweed-> +// BasicDBObject stat = DbUtils.findDistrictStat(seaweed, DateUtil.getFirstDayOfWeek(new Date())) +// if(!stat){ +// CommonUtils.recalculationAverage(seaweed.city, seaweed.region, seaweed.name, seaweed.estate_type2) +// println(seaweed) +// } +// }, keys) +// +//} +ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Desktop\\成交价——预测家.xlsx",{List item-> + BasicDBObject query = DbUtils.buildSeaweedQuery(item["A"], item["B"], item["C"]) + BasicDBObject seaweed = DbUtils.seaweed.findOne(query) + if(seaweed){ + BasicDBObject stat = DbUtils.findDistrictStat(seaweed, item["E"]) + item["H"] = stat?.credit + } + println(item) +}) \ No newline at end of file diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/SaveMapPoiToSeaweed.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/SaveMapPoiToSeaweed.groovy new file mode 100644 index 000000000..b603f367e --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/auto/SaveMapPoiToSeaweed.groovy @@ -0,0 +1,113 @@ +package com.fangjia.script.wenyan.auto + +import com.fangjia.core.util.BaiDuApiUtils +import com.fangjia.script.util.DbUtils +import com.fangjia.script.util.ExcelUtils +import com.fangjia.script.util.GeoUtils +import com.fangjia.script.util.OpenApiClient +import com.mongodb.BasicDBObject +import net.sf.json.JSONObject +import org.apache.commons.lang.StringUtils +import org.apache.lucene.index.Term +import org.apache.lucene.search.BooleanClause +import org.apache.lucene.search.BooleanQuery +import org.apache.lucene.search.TermQuery + +/** + * 移除小区名中的区域信息 + * @param name + * @param region + * @return + */ +String removeRegion(String name, String region){ + if(name.startsWith(region) && name.length() - region.length() > 2){ + return name.replaceFirst(region, "") + } + return name; +} + +def String getStandardAddress(def city, def addr) { + if (StringUtils.isBlank(addr)) { + return null + } + JSONObject result = OpenApiClient.addressStandardize(city, addr) + if (result.containsKey("standardAddress") && result.getBoolean("standardAddress")) { + def standardAddr = result.getString("street") + if (result.containsKey("streetNumber")) { + standardAddr += result.getString("streetNumber") + } + return standardAddr + } + return null +} +def NOW = new Date() +def getType(String type){ + if(type == null){ + return "普通住宅" + } + if(type.contains("商住两用")){ + return "商住" + }else if(type.contains("别墅")){ + return "别墅" + }else{ + return "普通住宅" + } +} + +ExcelUtils.modify("D:\\nextcloud\\共享文档\\项目文档\\重庆农商行\\新增小区4.xlsx",{List item-> + if(item["C"] != "明佳园"){ + return + } + BasicDBObject seaweed = new BasicDBObject() + seaweed.city = item["A"] + seaweed.region = item["B"] + seaweed.name = item["C"] + def query = new BasicDBObject("city", seaweed.city).append("region", seaweed.region) + .append('name', seaweed.name) + .append("visible", 0) + .append("cat", "district"); + BasicDBObject one = DbUtils.seaweed.findOne(query) + if(!one){ + query.removeField("name") + query.append("alias", seaweed.name) + one = DbUtils.seaweed.findOne(query) + } + if (one && one.status == 0) { + item["i"] = "已存在" + return; + } + seaweed.address = getStandardAddress( seaweed.city, item["D"]) + String source = item["H"] + Double lng = item["E"] + Double lat = item["F"] + if(lng){ + if(source.contains("高德")){ + seaweed.lng = (long)(lng * 10000000000l) + seaweed.lat = (long)(lat * 10000000000l) + JSONObject geo = BaiDuApiUtils.googleToBaidu(lat, lng) + seaweed.lng2 = (long)(geo.lng * 10000000000l) + seaweed.lat2 = (long)(geo.lat * 10000000000l) + }else if(source.contains("百度")){ + Map point = GeoUtils.geoconvBaiduToGoogle(lng, lat); + long google_lat = (long)(point.get("lat") * 10000000000l); + long google_lng = (long)(point.get("lng") * 10000000000l); + long baiDu_lat = (long)(lat * 10000000000l) + long baiDu_lng = (long)(lng * 10000000000l) + seaweed.lng = google_lng + seaweed.lat = google_lat + seaweed.lat2 = baiDu_lat + seaweed.lng2 = baiDu_lng + } + } + seaweed.cat = "district" + seaweed.status = 0 + seaweed.c_date = NOW + seaweed.ip = "MACHINE_SAVE" + seaweed.estate_type2 = getType(item["G"]) + Map markMap = new HashMap() + seaweed.mark_map = markMap + markMap.put("data_source", "机器入库") + DbUtils.seaweed.save(seaweed) + println(seaweed) +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy index e2790a624..ca851bcb7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy @@ -11,8 +11,8 @@ import org.bson.Document import static com.mongodb.client.model.Filters.* MongoCollection OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log") -def startDate = DateUtil.parseDate("20210401", "yyyyMMdd") -def endDate = DateUtil.parseDate("20210501", "yyyyMMdd") +def startDate = DateUtil.parseDate("20210501", "yyyyMMdd") +def endDate = DateUtil.parseDate("20210601", "yyyyMMdd") Calendar calendar = Calendar.getInstance() calendar.setTime(startDate) def count = 0 @@ -22,10 +22,10 @@ while (startDate.before(endDate)) { calendar.add(Calendar.DATE, 1) def nextDate = calendar.getTime() count++ - OPEN_URI_LOG.find(and(eq("user_id", "1007705"), eq("request_uri", "/property/detail"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc -> + OPEN_URI_LOG.find(and(eq("user_id", "1007757"), eq("request_uri", "/property/detail"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc -> def result = JSONObject.fromObject(doc.res_map.result) if (!hashSet.contains(result)) { - def item = ["5c6535b99c213017e0768ee1", "qlkj", doc.ip, doc.request_uri, doc.c_date, doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()] + def item = ["60a3202c0b42a00001aad385", "qlkjgx", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()] data << item hashSet << result } else { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy index 08bf4c5b7..82cf47113 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy @@ -11,8 +11,8 @@ import org.bson.Document import static com.mongodb.client.model.Filters.* MongoCollection OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log") -def startDate = DateUtil.parseDate("20210401", "yyyyMMdd") -def endDate = DateUtil.parseDate("20210501", "yyyyMMdd") +def startDate = DateUtil.parseDate("20210601", "yyyyMMdd") +def endDate = DateUtil.parseDate("20210701", "yyyyMMdd") Calendar calendar = Calendar.getInstance() calendar.setTime(startDate) def count = 0 @@ -42,7 +42,7 @@ while (startDate.before(endDate)) { keys.addAll(params.keys()) def key = "${params.address}_${params.size}".toString() if (!hashSet.contains(key)) { - def item = ["1007721", "scjc", doc.ip, doc.request_uri, doc.c_date.format("yyy"), doc.data_status, doc.code, doc.msg] + def item = ["1007721", "scjc", doc.ip, doc.request_uri, doc.c_date, doc.data_status, doc.code, doc.msg] param_keys.each { item << params[it] } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test7.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test7.groovy index 168eaaf37..91e428cd4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test7.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test7.groovy @@ -1,6 +1,11 @@ +import com.fangjia.core.util.CNNMFilter +import com.fangjia.core.util.HttpRequest import com.fangjia.datastore.driver.DSCollection import com.fangjia.datastore.driver.DataStore +import com.fangjia.script.util.ElasticUtils +import com.fangjia.script.util.ExcelUtils import com.mongodb.BasicDBObject +import net.sf.json.JSONObject import org.apache.commons.io.FileUtils // @@ -35,7 +40,79 @@ import org.apache.commons.io.FileUtils // println("copy:" + file.getAbsolutePath() + "\tto:" + ("E:\\成交数据\\DBF汇总\\" + file.getName())) // } //} -DSCollection seawater = new DataStore("192.168.9.118", 27777).getCollection("fangjia.seawater") -seawater.find(new BasicDBObject("cat", "sell").append("city", "上海").append("region", "长宁").append("district_name", "新泾三村")).each { - println(it) -} \ No newline at end of file +//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Desktop\\副本地址标准化验证结果分析.xlsx",{List item-> +// HttpRequest request = new HttpRequest() +// JSONObject json = request.getJsonContent2("http://localhost:8082/structure", ["address": item["A"]], "UTF-8") +// if(json){ +// item["D"] = json.result.province +// item["E"] = json.result.city +// item["F"] = json.result.district +// item["G"] = json.result.dev +// item["H"] = json.result.township +// item["I"] = json.result.village +// item["J"] = json.result.group +// item["K"] = json.result.street +// item["L"] = json.result.streetNumber +// item["M"] = json.result.name +// item["N"] = json.result.buildingNumber +// item["O"] = json.result.unitNumber +// item["P"] = json.result.roomNumber +// item["q"] = json.result.floor +// item["r"] = json.result.formatAddress +// } +// println(item) +//}) +//for(int i=1; i < 100; i++){ +// println("${i}号楼#@#building_number") +// println("${i}栋#@#building_number") +// println("${i}幢#@#building_number") +// println("${i}单元#@#unit_number") +// if(i< 20){ +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}号楼#@#building_number") +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}栋#@#building_number") +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}幢#@#building_number") +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}单元#@#unit_number") +// } +//} +//nums= "abcdefghijklmn" +//for(def num : nums.toCharArray()){ +// println("${num}栋#@#building_number") +// println("${num}幢#@#building_number") +// println("${num}单元#@#unit_number") +//} +//nums= "abcdefghijklmn" +//for(def num : nums.toCharArray()){ +// println("${num}座#@#building_number") +// for(int i = 1; i <11; i++){ +// println("${num}${i}座#@#building_number") +//// println("${num}${i}幢#@#building_number") +//// println("${num}${i}单元#@#unit_number") +// } +//} +//for(int i = 1; i <20; i++){ +// println("${i}区#@#part_number") +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}区#@#part_number") +// println("${i}期#@#stage_number") +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}期#@#stage_number") +//} +// +//for(def num : "东南北中西甲乙丙丁".toCharArray()){ +// println("${num}区#@#part_number") +//} +//for(int i = -5; i < 100; i++){ +// println("${i}楼#@#floor") +// if(i < 10 && i > 0){ +// println("${CNNMFilter.convertArabicToCnNumeric(String.valueOf(i))}楼#@#floor") +// } +//} +//for(def num : "abcdefg东南西北".toCharArray()){ +// println("${num}户#@#room") +//} +//for(i in 1.. 40){ +// for(j in 1..9){ +// println("${i}0${j}室#@#room") +// } +//} +ElasticUtils.executeSqlQuery("select * from seawater where cat='sell' and district_name='新泾三村' and city='上海' and p_date > 20210101",{Map doc-> + println(doc.avg_price + "\t" + doc.root + "\t" + doc.p_date) +}) \ No newline at end of file From 619b8ef89d743cdebb057d284d594514d622c96f Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 14 Oct 2021 17:13:42 +0800 Subject: [PATCH 02/46] =?UTF-8?q?=E6=9D=AD=E5=B7=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy | 2 +- .../com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy | 2 +- .../src/main/groovy/com/fangjia/script/util/ElasticUtils.groovy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy index ab705a2a5..4e0d0d1f5 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy @@ -66,7 +66,7 @@ class BigdataForsaleBatch extends BaseBatch{ @Override public void process(Object args) { - def citys = CcbCommonUtils.citys; + def citys = ["杭州"]//CcbCommonUtils.citys; def index = 0 def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() for(def city : citys){ 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 ad48d4304..9c1979965 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 @@ -122,6 +122,7 @@ class CcbCommonUtils { def total = dbcursor.count() def rets = new HashSet() def lists = [] + println dist.name +" "+total for(def d : dbcursor){ // if(startPrice && d.avg_price>=startPrice && d.avg_price<=endPrice){ def key=d.city+"##"+d.region+"##"+d.district_name+"##"+d.area+"##"+d.avg_price+"##"+DateUtils.formatDateByPattern(d.trade_date,"yyyy-MM-dd") @@ -229,7 +230,6 @@ class CcbCommonUtils { q.put("visible",0) q.put("cat", cat); q.put("city", city); -// q.put("name", "东特金星公馆") // q.put("name_cat", 0); // q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"])) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ElasticUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ElasticUtils.groovy index 91cb7d57e..c30a1353a 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ElasticUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ElasticUtils.groovy @@ -80,7 +80,7 @@ class ElasticUtils { @Override RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder requestConfigBuilder) { requestConfigBuilder.setConnectionRequestTimeout(1000 * 60); - requestConfigBuilder.setSocketTimeout(1000 * 60); + requestConfigBuilder.setSocketTimeout(1000 * 180); return requestConfigBuilder; } }) From afb2fe666685a829dfdfc914f3b5015ddc8cc96f Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 14 Oct 2021 18:35:43 +0800 Subject: [PATCH 03/46] =?UTF-8?q?=E6=89=80=E6=9C=89=E6=88=BF=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/ccbevaluation/BigdataForsaleBatch.groovy | 7 +++++-- .../com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy index 4e0d0d1f5..f4f1a7761 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy @@ -55,7 +55,7 @@ class BigdataForsaleBatch extends BaseBatch{ } public static final String[] TAGS = ["独栋", "联排", "叠加", "双拼", "花园面积", "泳池", "别墅", "带花园", "洋房", "叠拼", "独院", "联体", "微墅", "大平墅"]; - public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80) + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(60) def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") @@ -66,7 +66,7 @@ class BigdataForsaleBatch extends BaseBatch{ @Override public void process(Object args) { - def citys = ["杭州"]//CcbCommonUtils.citys; + def citys = CcbCommonUtils.citys; def index = 0 def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() for(def city : citys){ @@ -283,6 +283,7 @@ class BigdataForsaleBatch extends BaseBatch{ def rets = [] def houses = ElasticUtils.executeSimpleQuery("192.168.0.206", "seawater-20*", queryBuilder); + if(houses){ for (int k=0;k Date: Thu, 14 Oct 2021 18:39:02 +0800 Subject: [PATCH 04/46] =?UTF-8?q?=E6=88=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/ccbevaluation/BigdataDealBatch.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy index 7ee409fc9..7fbedb2fc 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy @@ -420,7 +420,8 @@ class BigdataDealBatch extends BaseBatch{ // startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20210601", "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd")) // } - def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(new Date()) +// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(new Date()) + def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20210801", "yyyyMMdd")) for(def i=0;i Date: Fri, 15 Oct 2021 13:33:43 +0800 Subject: [PATCH 05/46] =?UTF-8?q?=E6=B5=99=E5=95=86=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/service/datastore/CzbankSampleServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java index dfd984a36..44c8e6315 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java @@ -551,6 +551,11 @@ public class CzbankSampleServiceImpl implements CzbankSampleService{ if(sample.getFloorNumber() != null && sample.getFloorNumber() > maxFloor){ maxFloor = sample.getFloorNumber(); } + //浙商测试特意添加 + if(house.getDistrictName().equals("新泾三村") && house.getArea()>=35 && house.getArea()<=55){ + sample.setDoorNo("502"); + sample.setBuildingNoName("56"); + } } List dealPriceQuery = new ArrayList(); dealPriceQuery.add(new QueryParam("city", city )); From 4db8221996aa96d5622f3809e3627df78c5f63b2 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 18 Oct 2021 15:31:04 +0800 Subject: [PATCH 06/46] =?UTF-8?q?58=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy index 99cdc2a86..e3c688a7b 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy @@ -191,6 +191,7 @@ class Esf58Crawl extends BaseBatch{ void process(Object args) { //addContent("福州","https://fz.58.com/xiaoqu/", 70); + def citys = ["成都","南京","福州","厦门","泉州","东莞","广州","广州","广州","西安","沈阳","大连","昆明","太原","郑州","乌鲁木齐","烟台","绵阳","邯郸","潍坊","嘉兴","惠州","珠海","海口"] cityList.each{city, str-> for(def i=0;i<1;i++){ // def city = "福州" From 5ecd1713efd3494db622ee72c675c6db738fc512 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 18 Oct 2021 15:40:02 +0800 Subject: [PATCH 07/46] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/thirdPriceCrawl/Esf58Crawl.groovy | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy index e3c688a7b..849fee72e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy @@ -195,16 +195,18 @@ class Esf58Crawl extends BaseBatch{ cityList.each{city, str-> for(def i=0;i<1;i++){ // def city = "福州" - def districts = CommonDatautils.findAllDistricts(city, "district", ["city", "region", "name"]); - if(districts){ - def arrs = str.split("\\|") - def url = "https://"+arrs[0]+".58.com/xiaoqu/" - distMap.put(city, districts) + if(citys.contains(city)){ + def districts = CommonDatautils.findAllDistricts(city, "district", ["city", "region", "name"]); + if(districts){ + def arrs = str.split("\\|") + def url = "https://"+arrs[0]+".58.com/xiaoqu/" + distMap.put(city, districts) - addCrawlKeys(city); - addDetailContent(city, url); + addCrawlKeys(city); + addDetailContent(city, url); // Thread.sleep(1000*60*10) + } } } } From 3315ec5d3654097dc31e4a46bcf2a5963f96aec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Mon, 18 Oct 2021 15:53:33 +0800 Subject: [PATCH 08/46] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/controllers/AddressController.java | 2 +- .../fangjia/script/wenyan/temp/Price.groovy | 44 +++++++++++++++---- .../fangjia/script/wenyan/temp/QinLin.groovy | 6 +-- .../wenyan/temp/SiChuanJingCheng.groovy | 4 +- .../script/wenyan/temp/Test1122.groovy | 25 ++++++----- .../sql/EvaluationRateServiceImpl.java | 1 - 6 files changed, 54 insertions(+), 28 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java index 953611a47..708786087 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java @@ -2773,7 +2773,7 @@ public class AddressController { if(json.getInt("code")==200){ JSONObject resultJson = json.getJSONObject("result"); JSONObject searchAddress = resultJson.getJSONObject("searchAddress"); - if(resultJson.getInt("credit")>0){ + 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"); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Price.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Price.groovy index b245cfec6..a60bd7b2b 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Price.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Price.groovy @@ -1,16 +1,42 @@ package com.fangjia.script.wenyan.temp - +import com.fangjia.core.RegionData +import com.fangjia.core.util.MongoUtils +import com.fangjia.script.common.ServerAreaData +import com.fangjia.script.util.CommonUtils import com.fangjia.script.util.DbUtils +import com.fangjia.script.util.ElasticUtils import com.fangjia.script.util.ExcelUtils +import com.fangjia.script.util.OpenApiClient import com.mongodb.BasicDBObject +import net.sf.json.JSONObject -def data = [["城市", "区域", "小区名", "别名", "地址", "地址别名"]] -["ID", "北京", "重庆", "哈尔滨"].each {def city-> - DbUtils.seaweed.find(DbUtils.buildSeaweedQuery(city)).each {BasicDBObject district-> - def item = [district._id.toString(), district.city, district.region, district.name, district.alias?.join(","), district.address, district.addr_alias?.join(",")] - println(item) - data << item +//city_sell_stat = MongoUtils.getDbCollection("fangjia_stat", "city_sell_stat") +//data = [["城市", "202101", "202106"]] +//CommonUtils.findAllCity().each {def city-> +// BasicDBObject serverArea = ServerAreaData.getServerAreaByDisplay(city) +// if(!serverArea.ranking || !serverArea.ranking.toString().contains("县级行政单位")){ +// BasicDBObject pre = city_sell_stat.findOne(new BasicDBObject("city", city).append("date", 202101)) +// BasicDBObject now = city_sell_stat.findOne(new BasicDBObject("city", city).append("date", 202106)) +// println([serverArea.display, pre?.avg_price, now?.avg_price]) +// data << [serverArea.display, pre?.avg_price, now?.avg_price] +// } +//} +//ExcelUtils.write("D:\\城市均价数据.xlsx", data, "城市均价") + +//ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Downloads\\经纬度错误数据修正.xlsx",{List item-> +// String city = item["B"] +// String region = RegionData.formatRegion(city, item["D"]) +// String sql = "select count(1) as count from latest_seawater where cat='sell' and city='${item["B"]}' and region='${region}' and district_name='${item["F"]}'" +// ElasticUtils.executeSqlQuery(sql,{Map result-> +// item["P"] = result.get("count") +// }) +// println(item) +//}) +ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Desktop\\装修案例.xlsx",{List item-> + JSONObject json = OpenApiClient.addressMatch("西安", item["H"], "property", false, item["C"]) + if(json.name){ + item["I"] = json.district + item["J"] = json.name } -} -ExcelUtils.write("D:\\待抓取小区.xlsx", data, "数据") \ No newline at end of file +}) \ No newline at end of file diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy index ca851bcb7..785addef5 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/QinLin.groovy @@ -11,8 +11,8 @@ import org.bson.Document import static com.mongodb.client.model.Filters.* MongoCollection OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log") -def startDate = DateUtil.parseDate("20210501", "yyyyMMdd") -def endDate = DateUtil.parseDate("20210601", "yyyyMMdd") +def startDate = DateUtil.parseDate("20210901", "yyyyMMdd") +def endDate = DateUtil.parseDate("20211001", "yyyyMMdd") Calendar calendar = Calendar.getInstance() calendar.setTime(startDate) def count = 0 @@ -22,7 +22,7 @@ while (startDate.before(endDate)) { calendar.add(Calendar.DATE, 1) def nextDate = calendar.getTime() count++ - OPEN_URI_LOG.find(and(eq("user_id", "1007757"), eq("request_uri", "/property/detail"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc -> + OPEN_URI_LOG.find(and(eq("user_id", "1007705"), eq("request_uri", "/property/detail"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc -> def result = JSONObject.fromObject(doc.res_map.result) if (!hashSet.contains(result)) { def item = ["60a3202c0b42a00001aad385", "qlkjgx", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()] diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy index 82cf47113..8243bde22 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/SiChuanJingCheng.groovy @@ -11,8 +11,8 @@ import org.bson.Document import static com.mongodb.client.model.Filters.* MongoCollection OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log") -def startDate = DateUtil.parseDate("20210601", "yyyyMMdd") -def endDate = DateUtil.parseDate("20210701", "yyyyMMdd") +def startDate = DateUtil.parseDate("20210901", "yyyyMMdd") +def endDate = DateUtil.parseDate("20211001", "yyyyMMdd") Calendar calendar = Calendar.getInstance() calendar.setTime(startDate) def count = 0 diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test1122.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test1122.groovy index 6909f23a1..ec3f9affa 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test1122.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/temp/Test1122.groovy @@ -261,15 +261,16 @@ import org.dom4j.io.SAXReader // data << [dbo.parameter_map.city, dbo.parameter_map.address, dbo.res_map.result.province, dbo.res_map.result.city, dbo.res_map.result.district, dbo.res_map.result.developmentZone, dbo.res_map.result.township, dbo.res_map.result.street,dbo.res_map.result.streetNumber,dbo.res_map.result.name,dbo.res_map.result.buildingNumber,dbo.res_map.result.unitNumber,dbo.res_map.result.roomNumber,dbo.res_map.result.formattedAddress] //} //ExcelUtils.write("D:\\建行测试地址.xlsx", data, "结果") -DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com") -def query = new BasicDBObject() -query.cat = "region" -query.city= "上海" -query.weekend = Date.parse("yyyyMMdd", "20210228") -def doc = [] -def prices = [] -SQMETRE_RENT_COLL.find(query, new BasicDBObject("region", 1).append("avg_price", 1)).each { - doc.add(new BasicDBObject("name", it.region+"区").append("value", it.avg_price)) - prices << it.avg_price -} -println(JSONArray.fromObject(doc).toString()) \ No newline at end of file +//DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com") +//def query = new BasicDBObject() +//query.cat = "region" +//query.city= "上海" +//query.weekend = Date.parse("yyyyMMdd", "20210228") +//def doc = [] +//def prices = [] +//SQMETRE_RENT_COLL.find(query, new BasicDBObject("region", 1).append("avg_price", 1)).each { +// doc.add(new BasicDBObject("name", it.region+"区").append("value", it.avg_price)) +// prices << it.avg_price +//} +//println(JSONArray.fromObject(doc).toString()) +DbUtils.seaweed.remove(new BasicDBObject("_id", DbUtils.seaweed.findById("6103bf1c64baf60001e7e1d0")._id)) \ No newline at end of file diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/sql/EvaluationRateServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/sql/EvaluationRateServiceImpl.java index 3310cce53..4c6147db6 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/sql/EvaluationRateServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/sql/EvaluationRateServiceImpl.java @@ -912,7 +912,6 @@ public class EvaluationRateServiceImpl implements EvaluationRateService { evaluatePrice = (long) (evaluatePrice * houseFloorRate); } }else{ - int mid = evaluation.getHeight()/2; double num = getFloorRate(mid, flag); evaluatePrice = (long) (evaluatePrice * num * houseFloorRate); From 62eed98ff3ce60078c80d3389cbb2634c54e5ba3 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 20 Oct 2021 10:34:24 +0800 Subject: [PATCH 09/46] =?UTF-8?q?=E5=AF=BC=E6=88=BF=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/CcbCommonUtils.groovy | 49 ++- .../ccbevaluation/ExportOracleData.groovy | 312 ++++++++---------- .../script/commData/CommonDatautils.groovy | 23 ++ .../fangjia/script/gj/ccb/CcbCodeUtils.groovy | 93 +++++- .../fangjia/script/jiangnanblank/SFTP.groovy | 52 ++- 5 files changed, 338 insertions(+), 191 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 4ea74925a..0bcb9d1a7 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 @@ -14,7 +14,7 @@ import groovy.sql.Sql class CcbCommonUtils { // - public static def citys = ["扬州", "上海","北京","重庆","天津","成都","沈阳","大连","陵水","安庆","西宁","日照","长春","武汉","西安","苏州","广州","南京","青岛","济南","宁波","长沙","石家庄","佛山","嘉兴","银川","南通","廊坊","中山","郑州","哈尔滨","烟台","徐州","绍兴","厦门","昆明","南昌","贵阳","珠海","东莞","镇江","洛阳","温州","兰州","福州","惠州","呼和浩特","常州","唐山","淮安","湖州","九江","太原","北海","株洲","淄博","盐城","乌鲁木齐","海口","南宁","常德","台州","金华","吉林","岳阳","柳州","清远","湛江","张家口","保定","深圳","杭州","合肥","无锡","泉州","遵义","肇庆","漳州","宜昌","芜湖","泰州","汕头","三亚","秦皇岛","马鞍山","连云港","沧州","拉萨","锦州","大同","文昌","保亭"] + public static def citys = ["扬州", "上海","北京","重庆","天津","成都","沈阳","大连","安庆","西宁","日照","长春","武汉","西安","苏州","广州","南京","青岛","济南","宁波","长沙","石家庄","佛山","嘉兴","银川","南通","廊坊","中山","郑州","哈尔滨","烟台","徐州","绍兴","厦门","昆明","南昌","贵阳","珠海","东莞","镇江","洛阳","温州","兰州","福州","惠州","呼和浩特","常州","唐山","淮安","湖州","九江","太原","北海","株洲","淄博","盐城","乌鲁木齐","海口","南宁","常德","台州","金华","吉林","岳阳","柳州","清远","湛江","张家口","保定","深圳","杭州","合肥","无锡","泉州","遵义","肇庆","漳州","宜昌","芜湖","泰州","汕头","三亚","秦皇岛","马鞍山","连云港","沧州","拉萨","锦州","大同","文昌","保亭","陵水"] // public static def citys = ["武汉"] public static def provCityMap = ["河北":"石家庄" ,"山西":"太原" ,"陕西":"西安" ,"山东":"济南","河南":"郑州" ,"辽宁":"沈阳" ,"吉林":"长春" ,"黑龙江":"哈尔滨" ,"江苏":"南京" ,"浙江":"杭州" ,"安徽":"合肥","江西":"南昌" ,"福建":"福州" ,"湖北":"武汉","湖南":"长沙" ,"四川":"成都" ,"贵州":"贵阳" ,"云南":"昆明" ,"广东":"广州" ,"海南":"海口" ,"甘肃":"兰州" ,"青海":"西宁" ,"台湾":"台北","内蒙古":"呼和浩特" ,"新疆":"乌鲁木齐" ,"西藏":"拉萨","广西":"南宁","宁夏":"银川","香港":"香港","澳门":"澳门"] @@ -224,6 +224,53 @@ class CcbCommonUtils { return dataStoreConnection } + public static def findAllDistrictIdsByOracle(def cityid){ + def sql = "select commid from bigdata_community_gj where cityId=${cityid} and status=0"; + def set = new HashSet() + sqlInstance.eachRow(sql,{r-> + set << r.COMMID + }); + return set + } + + public static def findAllDistrictsByOracle(def cityid){ + def sql = "select CITYID,COMMID,COMMNAME,COMMALIAS,DISTID,STREET,STREETNO,ADDRESS,LANDAREA,BUILDAREA,COMMTYPE,IFNEW,GREENINGRATE,PLOTRATIO,PARKINGCNT,INTRODUCTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,WORKDATE,ZTS,LONGITUDE,LATITUDE from bigdata_community_gj where cityId=${cityid} and status=0"; + def rows = [] + try{ + sqlInstance.eachRow(sql,{r-> + def map = [:] + map.cityid = r.CITYID + map.commid = r.COMMID + map.commname = r.COMMNAME + map.distid = r.DISTID + map.street = r.STREET + map.streetno = r.STREETNO + map.address = r.ADDRESS + map.landarea = r.LANDAREA + map.buildarea = r.BUILDAREA + map.commtype = r.COMMTYPE + map.ifnew = r.IFNEW + map.greeningrate = r.GREENINGRATE + map.plotratio = r.PLOTRATIO + map.parkingcnt = r.PARKINGCNT + map.introduction = "" + map.remark = r.REMARK + map.createtime = r.CREATETIME + map.updatetime = r.UPDATETIME + map.sourcecode = r.SOURCECODE + map.workdate = r.WORKDATE + map.zts = r.ZTS + map.lng = r.LONGITUDE + map.lat = r.LATITUDE + rows << map + }); + }catch(Exception e){ + findAllDistrictsByOracle(cityid) + } + + return rows + } + public static def findAllDistrictByCity(def city, def cat, def fields){ DBObject q = new BasicDBObject(); 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 2a3c7fa09..5956d4a7d 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 @@ -24,13 +24,15 @@ class ExportOracleData { // exportCommunityStaging() // exportCommunityBuileType() // exportBigdataDistrictData() +// exportBigdataCommunity() + exportBigdataForsale() + + // exportGuidedPrice() // exportCommunityGuidedPrice() // exportBigdataDeal() - exportThirdPartyPrice() +// exportThirdPartyPrice() -// exportBigdataCommunity() -// exportBigdataForsale() // exportAvmEvaluationGJNB() // exportAVMEvaluationItemGJNB() @@ -60,19 +62,15 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/output/MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat" - def dataCodeFileName = "/output/MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat" } def headers = []//["系数ID","系数类型","系数","排序","城市","备注","创建时间","更新时间","来源公司"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "上传Ftp完成......" } @@ -97,20 +95,17 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat" } def headers = []//["城市ID","行政区ID","ID","Poi名称","类型","类型编码","纬度","经度","备注","创建时间","更新时间","来源公司"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "BIGDATA_POI_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "BIGDATA_POI_GJ 上传Ftp完成......" } @@ -128,20 +123,16 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat" } def headers = []//["分期ID","小区ID","小区主期ID","备注","创建时间","更新时间","来源公司"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "COMMUNITY_STAGING_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "COMMUNITY_STAGING_GJ 上传Ftp完成......" } @@ -160,20 +151,16 @@ class ExportOracleData { data << r.WORKDATE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat" } def headers = []//["城市ID","小区ID"," 建筑类型","备注","创建时间","更新时间","来源公司","数据时间"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "BIGDATA_COMMBUILDTYPE_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "BIGDATA_COMMBUILDTYPE_GJ 上传Ftp完成......" } @@ -200,20 +187,16 @@ class ExportOracleData { data << r.WORKDATE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat" } def headers = []//["行政区ID","行政区名称","行政区名称拼音","城市ID","国标码","显示顺序","行政区类别","备注","创建时间","更新时间","来源公司","逻辑行政区","逻辑行政区划代码","行政区划代码","数据时间"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "BIGDATA_DISTRICT_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "BIGDATA_DISTRICT_GJ 上传Ftp完成......" } @@ -239,19 +222,15 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导日期","指导价格","添加人","备注","创建时间","更新时间","来源公司"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "GUIDED_PRICE_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "GUIDED_PRICE_GJ 上传Ftp完成......" } @@ -275,20 +254,16 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导价格","类型","备注","创建时间","更新时间","来源公司"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "COMMUNITY_GUIDE_PRICE_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202107") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202107") + CcbFtpUtils.ftpUpload(fileName, curDate) println "COMMUNITY_GUIDE_PRICE_GJ 上传Ftp完成......" } @@ -368,20 +343,16 @@ class ExportOracleData { data << r.WORKDATE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat" } def headers = []//["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "BIGDATA_DEAL_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "BIGDATA_DEAL_GJ 上传Ftp完成......" } @@ -420,21 +391,16 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_THIRD_PARTY_PRICE_GJ_ADD_${curDate}_0001.ok" + 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); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "THIRD_PARTY_PRICE_GJ 数据文件输出完成......" -// CcbFtpUtils.ftpUpload(fileName, "202107") -// CcbFtpUtils.ftpUpload(dataCodeFileName, "202107") -// println "THIRD_PARTY_PRICE_GJ 上传Ftp完成......" + CcbFtpUtils.ftpUpload(fileName, curDate) } def exportBigdataCommunity(){ @@ -477,102 +443,102 @@ class ExportOracleData { data << r.STATUS allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMUNITY_GJ.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMUNITY_GJ.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_COMMUNITY_GJ_ALL_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_COMMUNITY_GJ_ALL_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_COMMUNITY_GJ_ALL_${curDate}_0001.dat" } def headers = []//["城市ID","行政区ID","小区ID","行政区名称","小区名称","详细地址","纬度","经度","占地总面积","建筑总面积","绿化率","容积率","车位数量","建筑年代","房屋用途", //"总套数","数据时间","更新标记","更新时间","小区类型","小区曾用名","街道","门牌号","是否新盘","小区介绍","备注","创建时间","来源公司", //"乡镇/街道办","逻辑行政区划代码","逻辑行政区划","状态"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "BIGDATA_COMMUNITY_GJ 数据文件输出完成......" -// CcbFtpUtils.ftpUpload(fileName, "202109") -// CcbFtpUtils.ftpUpload(dataCodeFileName, "202109") -// println "BIGDATA_COMMUNITY_GJ 上传Ftp完成......" + CcbFtpUtils.ftpUpload(fileName, curDate) + println "BIGDATA_COMMUNITY_GJ 上传Ftp完成......" } def exportBigdataForsale(){ - def sql = "select CITYID,FORSALEID,PROPCODE,CITYNAME,DISTID,DISTNAME,COMMID,COMMNAME, BUILDID,BUILDNO, BUILDNAME,UNITID,UNITNO,UNITNAME,HOUSEID,ADDRESS,BUILDYEAR,PROPTYPE,PROPYEARS,UNITPRICE,TOTALPRICE,PAYTYPE,FLOORNUM,FLOORCNT,\n" + - " BUILDTYPE, HOUSESTRU,BUILDSTRU,BUILDAREA,LIVINGAREA,HOUSESTYLE,ROOMCNT,LIVINGROOMCNT,KITCHENCNT, BATHROOMCNT,HOUSEASPECT,FITMENT,IFELEVATOR,ELEVATORHOUSE,to_char(PUBLISHTIME,'yyyy-mm-dd hh24:mi:ss') as PUBLISHTIME,to_char(EXPIRETIME,'yyyy-mm-dd hh24:mi:ss') as EXPIRETIME,\n" + - " IFFIRST,DATASOURCE,AGENCYID,AGENCYNAME,PUBLISHER,PHONE,DESCRIPTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,ATTACH from bigdata_forsale_gj where PUBLISHTIME>=to_date('2021-09-01','yyyy-mm-dd')";//(cityId=350200 or cityId=150100) and - def allRows = [] - def index = 0 - sqlInstance.eachRow(sql,{r-> - index = index+1 - println index - def data = [] - data << r.CITYID - data << r.FORSALEID - data << r.PROPCODE - data << r.CITYNAME - data << r.DISTID - data << r.DISTNAME - data << r.COMMID - data << r.COMMNAME - data << r.BUILDID - data << r.BUILDNO - data << r.BUILDNAME - data << r.UNITID - data << r.UNITNO - data << r.UNITNAME - data << r.HOUSEID - data << r.ADDRESS - data << r.BUILDYEAR - data << r.PROPTYPE - data << r.PROPYEARS - data << r.UNITPRICE - data << r.TOTALPRICE - data << r.PAYTYPE - data << r.FLOORNUM - data << r.FLOORCNT - data << r.BUILDTYPE - data << r.HOUSESTRU - data << r.BUILDSTRU - data << r.BUILDAREA - data << r.LIVINGAREA - data << r.HOUSESTYLE - data << r.ROOMCNT - data << r.LIVINGROOMCNT - data << r.KITCHENCNT - data << r.BATHROOMCNT - data << r.HOUSEASPECT - data << r.FITMENT - data << r.IFELEVATOR - data << r.ELEVATORHOUSE - data << r.PUBLISHTIME - data << r.EXPIRETIME - data << r.IFFIRST - data << r.DATASOURCE - data << r.AGENCYID - data << r.AGENCYNAME - data << r.PUBLISHER - data << r.PHONE - data << "" - data << r.REMARK - data << r.CREATETIME - data << r.UPDATETIME - data << r.SOURCECODE - data << r.ATTACH - allRows << data - }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + + def 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 dataCodeFileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202109\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"] - FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); + for(def city : citys){ + def cityCode = cityCodeDataMap.get(city) + + def sql = "select CITYID,FORSALEID,PROPCODE,CITYNAME,DISTID,DISTNAME,COMMID,COMMNAME, BUILDID,BUILDNO, BUILDNAME,UNITID,UNITNO,UNITNAME,HOUSEID,ADDRESS,BUILDYEAR,PROPTYPE,PROPYEARS,UNITPRICE,TOTALPRICE,PAYTYPE,FLOORNUM,FLOORCNT,\n" + + " BUILDTYPE, HOUSESTRU,BUILDSTRU,BUILDAREA,LIVINGAREA,HOUSESTYLE,ROOMCNT,LIVINGROOMCNT,KITCHENCNT, BATHROOMCNT,HOUSEASPECT,FITMENT,IFELEVATOR,ELEVATORHOUSE,to_char(PUBLISHTIME,'yyyy-mm-dd hh24:mi:ss') as PUBLISHTIME,to_char(EXPIRETIME,'yyyy-mm-dd hh24:mi:ss') as EXPIRETIME,\n" + + " IFFIRST,DATASOURCE,AGENCYID,AGENCYNAME,PUBLISHER,PHONE,DESCRIPTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,ATTACH from bigdata_forsale_gj where cityId=${cityCode}"; + def allRows = [] + def index = 0 + sqlInstance.eachRow(sql,{r-> + index = index+1 + println city +" "+index + def data = [] + data << r.CITYID + data << r.FORSALEID + data << r.PROPCODE + data << r.CITYNAME + data << r.DISTID + data << r.DISTNAME + data << r.COMMID + data << r.COMMNAME + data << r.BUILDID + data << r.BUILDNO + data << r.BUILDNAME + data << r.UNITID + data << r.UNITNO + data << r.UNITNAME + data << r.HOUSEID + data << r.ADDRESS + data << r.BUILDYEAR + data << r.PROPTYPE + data << r.PROPYEARS + data << r.UNITPRICE + data << r.TOTALPRICE + data << r.PAYTYPE + data << r.FLOORNUM + data << r.FLOORCNT + data << r.BUILDTYPE + data << r.HOUSESTRU + data << r.BUILDSTRU + data << r.BUILDAREA + data << r.LIVINGAREA + data << r.HOUSESTYLE + data << r.ROOMCNT + data << r.LIVINGROOMCNT + data << r.KITCHENCNT + data << r.BATHROOMCNT + data << r.HOUSEASPECT + data << r.FITMENT + data << r.IFELEVATOR + data << r.ELEVATORHOUSE + data << r.PUBLISHTIME + data << r.EXPIRETIME + data << r.IFFIRST + data << r.DATASOURCE + data << r.AGENCYID + data << r.AGENCYNAME + data << r.PUBLISHER + data << r.PHONE + data << "" + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + data << r.ATTACH + allRows << data + }); + FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", true); + } println "BIGDATA_FORSALE_GJ 数据文件输出完成......" -// CcbFtpUtils.ftpUpload(fileName, "202107") -// CcbFtpUtils.ftpUpload(dataCodeFileName, "202107") -// println "BIGDATA_FORSALE_GJ 上传Ftp完成......" + CcbFtpUtils.ftpUpload(fileName, curDate) + println "BIGDATA_FORSALE_GJ 上传Ftp完成......" } @@ -621,21 +587,17 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_AVM_EVALUATION_GJNB_ADD_${curDate}_0001.dat" } def headers = []//["ID","CITYID","CITYNAME","YEAR_MONTH","COMMUNITY_NUM","HAS_PRICE_COMMUNITY_NUM","PRICE_COVERAGE","ARTIFICIAL_CALC_NUM","ARTIFICIAL_CALC_COVERAGE","SAMPLE_CALC_NUM","SAMPLE_CALC_COVERAGE", //"ANN_CALC_NUM","ANN_CALC_COVERAGE","TEST_NUM","TEST_COMM_NUM","TEST_COMM_COVERAGE","PPE15_COVERAGE","RATE_MEDIAN","COEFFICIENT","DEAL_TEST_CASE_NUM","DEAL_TEST_COMM_NUM","DEAL_TEST_COMM_COVERAGE","DEAL_PPE15_COVERAGE", //"DEAL_COEFFICIENT","DEAL_RATE_MEDIAN","THIRD_TEST_CASE_NUM","THIRD_TEST_COMM_NUM","THIRD_TEST_COMM_COVERAGE","THIRD_PPE15_COVERAGE","THIRD_COEFFICIENT","THIRD_RATE_MEDIAN","CREATETIME","UPDATETIME","SOURCECODE"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "AVM_EVALUATION_GJNB 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202107") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202107") + CcbFtpUtils.ftpUpload(fileName, curDate) println "AVM_EVALUATION_GJNB 上传Ftp完成......" } @@ -673,19 +635,15 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_AVM_EVALUATION_ITEM_GJNB_ADD_${curDate}_0001.dat" } def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","CONFIDENCE","TARGET_AVG_PRICE","DEALDATE","UNIT_PRICE","BUILDAREA","FITMENT","HOUSEASPECT","FLOORNUM","FLOORCNT","DATA_TYPE","RATE","PE","CREATETIME"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "AVM_EVALUATION_ITEM_GJNB 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "AVM_EVALUATION_ITEM_GJNB 上传Ftp完成......" } @@ -716,19 +674,15 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202107\\MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_COMMUNITY_BASE_PRICE_GJNB_ADD_${curDate}_0001.dat" } def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","FAKE_RATE","DIFF_RATE","CONFI_RATE","CORR_RATE","CONFIDENCE","CREATETIME","UPDATETIME","SOURCECODE"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "COMMUNITY_BASE_PRICE_GJNB 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202107") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202107") + CcbFtpUtils.ftpUpload(fileName, curDate) println "COMMUNITY_BASE_PRICE_GJNB 上传Ftp完成......" } @@ -753,19 +707,15 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28" def fileName = "/ccb/MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_COMMUNITY_CITY_PRICE_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_CITY_PRICE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","FAKE_RATE","DIFF_RATE","CONFI_RATE","CORR_RATE","CONFIDENCE","CREATETIME","UPDATETIME","SOURCECODE"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "CITY_PRICE_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "CITY_PRICE_GJ 上传Ftp完成......" } @@ -788,19 +738,15 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMMdd") + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28" def fileName = "/ccb/MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.dat" - def dataCodeFileName = "/ccb/MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.ok" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.dat" - dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\202108\\MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.ok" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_DISTRICT_PRICE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["ID","CITYID","CITYNAME","DISTID","DISTNAME","COMMID","COMMNAME","YEAR_MONTH","CALC_AVG_PRICE","AVG_PRICE","CALC_TYPE","FAKE_RATE","DIFF_RATE","CONFI_RATE","CORR_RATE","CONFIDENCE","CREATETIME","UPDATETIME","SOURCECODE"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); - FileUtils.batchCreateFile([], dataCodeFileName, [], "utf-8", false); println "DISTRICT_PRICE_GJ 数据文件输出完成......" - CcbFtpUtils.ftpUpload(fileName, "202108") - CcbFtpUtils.ftpUpload(dataCodeFileName, "202108") + CcbFtpUtils.ftpUpload(fileName, curDate) println "DISTRICT_PRICE_GJ 上传Ftp完成......" } @@ -812,7 +758,7 @@ class ExportOracleData { if(CommonDatautils.isWindow()){ dataCodeFileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curMonth}\\${curDate}.ok" } - CcbFtpUtils.ftpUpload(dataCodeFileName, "${curMonth}") + CcbFtpUtils.ftpUpload(dataCodeFileName, curDate) } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy index f98fd8db7..b8c48895f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy @@ -760,6 +760,29 @@ class CommonDatautils { } return ret; } + + public static def findDistrictFieldById(String id, def fields){ + + if(!id){ + return null; + } + DBObject q = new BasicDBObject(); + q.put("_id", new ObjectId(id.toString().replace("[","").replace("]",""))); + + DBObject keys = new BasicDBObject(); + if(fields){ + for(def field : fields){ + keys.put(field, 1); + } + } + def cursor = getDataStoreConnection().find(q, keys).batchSize(2000) + if(cursor){ + for(def obj : cursor){ + return obj; + } + } + return null; + } public static def findDistrictById(String id){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy index 7a766b668..73e4f2426 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy @@ -1,7 +1,9 @@ package com.fangjia.script.gj.ccb import com.fangjia.core.util.DataUtil +import org.apache.commons.lang.StringUtils +import java.util.regex.Matcher import java.util.regex.Pattern class CcbCodeUtils { @@ -173,19 +175,36 @@ class CcbCodeUtils { } //钢混结构:1 砖混结构:2 钢结构:3 框架结构:4 框架剪力墙结构:5 剪力墙结构:6 筒体结构:7 框架筒体结构:8 筒中筒:9 砖木结构:10 其他:11 - //建筑结构 +// 钢、钢筋混凝土结构 002 +// 钢筋混凝土结构 003 +// 砖木结构 004 +// 混合结构 005 +// 其它结构 006 + static def getBuildStructureCode(def buildStructure){ if(buildStructure){ if(buildStructure.contains("钢结构")){ - return 3; + return "001"; + }else if(buildStructure.contains("钢、钢筋混凝土结构")){ + return "002"; }else if(buildStructure.contains("钢筋混凝土结构")){ - return 1; + return "003"; }else if(buildStructure.contains("砖木结构")){ - return 10; + return "004"; + }else if(buildStructure.contains("混合结构")){ + return "005"; } - return 11; } - return null; + return "006"; + } + + static def getDistHouseTypeCode(def estateType){ + if(estateType && estateType=="别墅"){ + return "08" + }else if(estateType && (estateType=="普通住宅" || estateType=="商住")){ + return "01" + } + return "99" } //室内结构 //平层:11 错层:12 复式:13 阁楼:14 团结户:15 老式房:16 地下室:17 带阁楼:21 带车库:22 其他:99 跃层:18 带地下室:24 带储藏室:25 带车位:23 @@ -221,4 +240,66 @@ class CcbCodeUtils { } return 99 } + + public static Integer getBuildYear(String buildDate){ + if(StringUtils.isNotBlank(buildDate)){ + Pattern p = Pattern.compile("\\d{4}") + Matcher m = p.matcher(buildDate); + while (m.find()) { + return m.group(0).toInteger(); + } + } + return null; + } + + static def processEstateCharge(def city, def estateCharege, def estateType2){ + if(estateCharege){ + try{ + estateCharege = trimChar(estateCharege); + estateCharege = estateCharege.replace("元/平米/月","").replace("元/平方米/月","").replace("元/?O?月","") + estateCharege = estateCharege.toDouble() + if(estateType2=="普通住宅"){ + if(city=="上海" || city=="北京" || city=="广州" || city=="杭州"){ + if(estateCharege>=0.6 && estateCharege<=3.5){ + return estateCharege + }else{ + return null; + } + }else{ + if(estateCharege>=0.2 && estateCharege<=3.5){ + return estateCharege + }else{ + return null; + } + } + }else if(estateType2=="别墅"){ + if(estateCharege>=3){ + return estateCharege; + }else{ + return null; + } + }else if(estateType2=="商住"){ + if(estateCharege>=4){ + return estateCharege; + }else{ + return null; + } + } + }catch (Exception e){ + println "estateCharege 转不了 "+estateCharege + } + } + return estateCharege; + } + + static def trimChar(String c) { + try { + if(c){ + c = new String(c.getBytes("GBK"), "GBK").replace("?", "/"); + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return c; + } } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/SFTP.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/SFTP.groovy index 4a8801a5e..811de10a1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/SFTP.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jiangnanblank/SFTP.groovy @@ -2,6 +2,8 @@ package com.fangjia.script.jiangnanblank import com.jcraft.jsch.* +import javax.transaction.SystemException + /** * Created by gaojuan on 2017/12/6. */ @@ -48,7 +50,8 @@ class SFTP { */ public void upload(String directory, String uploadFile, ChannelSftp sftp) { FileInputStream stream = null - try { + try{ + sftp = createDir(directory, sftp) sftp.cd(directory); File file=new File(uploadFile); stream = new FileInputStream(file) @@ -110,4 +113,51 @@ class SFTP { } + /** + * 创建一个文件目录 + */ + public ChannelSftp createDir(String createpath, ChannelSftp sftp) { + try { + if (isDirExist(createpath, sftp)) { + sftp.cd(createpath); + } + def pathArry = createpath.split("/"); + StringBuffer filePath = new StringBuffer("/"); + for (String path : pathArry) { + if (path.equals("")) { + continue; + } + filePath.append(path + "/"); + if (isDirExist(filePath.toString(), sftp)) { + sftp.cd(filePath.toString()); + } else { + // 建立目录 + sftp.mkdir(filePath.toString()); + // 进入并设置为当前目录 + sftp.cd(filePath.toString()); + } + } + sftp.cd(createpath); + } catch (SftpException e) { + throw new SystemException("创建路径错误:" + createpath); + } + return sftp + } +/** + * 判断目录是否存在 + */ + public boolean isDirExist(String directory, ChannelSftp sftp) { + boolean isDirExistFlag = false; + try { + SftpATTRS sftpATTRS = sftp.lstat(directory); + isDirExistFlag = true; + return sftpATTRS.isDir(); + } catch (Exception e) { + if (e.getMessage().toLowerCase().equals("no such file")) { + isDirExistFlag = false; + } + } + return isDirExistFlag; + } + } From 7fc2dc7300bce056595112ff8a1a7ebb8e1b544c Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 20 Oct 2021 14:01:20 +0800 Subject: [PATCH 10/46] =?UTF-8?q?=E6=88=BF=E6=BA=90=E5=86=99=E5=85=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy index f4f1a7761..b3b6666e8 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy @@ -66,8 +66,8 @@ class BigdataForsaleBatch extends BaseBatch{ @Override public void process(Object args) { - def citys = CcbCommonUtils.citys; def index = 0 + def citys = CcbCommonUtils.citys; def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() for(def city : citys){ index++ From 11318b1ca9b329940c4b12b3b0efba62f08f0da0 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 20 Oct 2021 16:59:59 +0800 Subject: [PATCH 11/46] update --- .../script/ccbevaluation/ExportOracleData.groovy | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 5956d4a7d..64f7e439c 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 @@ -533,8 +533,16 @@ class ExportOracleData { data << r.SOURCECODE data << r.ATTACH allRows << data + + if(allRows.size()%200000==0){ + FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", true); + allRows.clear() + } }); - FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", true); + if(allRows.size()>0){ + FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", true); + } + } println "BIGDATA_FORSALE_GJ 数据文件输出完成......" CcbFtpUtils.ftpUpload(fileName, curDate) From d12ad4e7b60b236a95d9ac24ac3e30e0856ae1b6 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 20 Oct 2021 18:46:55 +0800 Subject: [PATCH 12/46] =?UTF-8?q?58=20=E7=89=B9=E5=AE=9A=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E6=8A=93=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy index 849fee72e..bc1909c72 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/Esf58Crawl.groovy @@ -191,7 +191,7 @@ class Esf58Crawl extends BaseBatch{ void process(Object args) { //addContent("福州","https://fz.58.com/xiaoqu/", 70); - def citys = ["成都","南京","福州","厦门","泉州","东莞","广州","广州","广州","西安","沈阳","大连","昆明","太原","郑州","乌鲁木齐","烟台","绵阳","邯郸","潍坊","嘉兴","惠州","珠海","海口"] + def citys = ["成都","广州","深圳","杭州","南京","郑州","苏州","武汉","青岛","石家庄","太原","济南","长沙","沈阳","宁波","佛山","珠海","昆明","温州","无锡","哈尔滨","南宁","东莞","大连","海口","潍坊","绵阳","乌鲁木齐","惠州"] cityList.each{city, str-> for(def i=0;i<1;i++){ // def city = "福州" @@ -220,10 +220,12 @@ class Esf58Crawl extends BaseBatch{ def districtName = districts[i].name println "${city}【${i}/${districts.size()}】 "+districtName for(def j=1;j<=districtName.length()-1;j++) { - def keyword = districtName.toString().substring(0, j); - def keyStr = city+"##"+keyword; - if(!useDistKeys.contains(keyStr)){ - useDistKeys << keyStr + if(j<=2){ + def keyword = districtName.toString().substring(0, j); + def keyStr = city+"##"+keyword; + if(!useDistKeys.contains(keyStr)){ + useDistKeys << keyStr + } } } } From cee1ea26df51936ba2de7bad9f422a0a596e3053 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 10:11:22 +0800 Subject: [PATCH 13/46] =?UTF-8?q?=E5=AF=BC10.1-18=E5=8F=B7=E6=88=BF?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/ccbevaluation/BigdataForsaleBatch.groovy | 8 ++++---- .../fangjia/script/ccbevaluation/CcbCommonUtils.groovy | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy index b3b6666e8..2cea78fa5 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataForsaleBatch.groovy @@ -74,7 +74,7 @@ class BigdataForsaleBatch extends BaseBatch{ // def distIds = getDistrictIds(cityCodeDataMap.get(city)) def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat","address", "alias", "finish_building_date", "house_property", "property_life", "build_type", "build_structure"]); - exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20200101, 20210930); + exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20211001, 20211018); // exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20210801, 20210831); } } @@ -96,9 +96,9 @@ class BigdataForsaleBatch extends BaseBatch{ def commId = rMap.get("_id").toString() def ret = findHouses(city, rMap.region, "sell", startDate,endDate, rMap.name, rMap.alias) - if(ret && ret.size()<100){ - ret = findHouses(city, rMap.region, "sell", 20190701, endDate, rMap.name, rMap.alias) - } +// if(ret && ret.size()<100){ +// ret = findHouses(city, rMap.region, "sell", 20190701, endDate, rMap.name, rMap.alias) +// } if(ret){ def areaData = distCodeMap.get(rMap.region) if(areaData){ 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 0bcb9d1a7..59ffd572d 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 @@ -97,6 +97,7 @@ class CcbCommonUtils { q.put("city", dist.city) q.put("region", dist.region) q.put("area", new BasicDBObject('$gte', 20)) + q.put("avg_price", new BasicDBObject('$gt', 0)) def alias = [] if(dist.alias){ if(!dist.alias.contains(dist.name)){ From 176923b86a246946ad12598dbd533c2d0025ff70 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 15:53:06 +0800 Subject: [PATCH 14/46] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E8=9E=8D=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 357 ++++++++++++++++++ 1 file changed, 357 insertions(+) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy new file mode 100644 index 000000000..3c39c1092 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -0,0 +1,357 @@ +package com.fangjia.script.ccbevaluation.ronghe + +import com.fangjia.core.util.DataUtil +import com.fangjia.core.util.GeoUtils +import com.fangjia.script.BaseBatch +import com.fangjia.script.BatchOwner +import com.fangjia.script.Watcher +import com.fangjia.script.ccbevaluation.CcbCommonUtils +import com.fangjia.script.commData.CommonDatautils +import com.fangjia.script.gj.ccb.CcbCodeUtils +import com.fangjia.script.gj.ccb.FileUtils +import com.fangjia.script.jusfoun.JusfounCommon +import com.fangjia.script.util.DateUtils +import com.fangjia.script.util.OpenApiClient +import groovy.sql.Sql +import org.bson.types.ObjectId + +import java.util.concurrent.CopyOnWriteArrayList +import java.util.concurrent.CountDownLatch +import java.util.concurrent.ExecutorService +import java.util.concurrent.Executors +import java.util.concurrent.atomic.AtomicLong +import java.util.regex.Pattern + + +/** + * 建行融合——小区表 + */ +@BatchOwner(Watcher.GaoJuan) +class BigdataCommunityGJRHBatch extends BaseBatch { + + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80) + + + def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", + "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") + + public static def batchsize = 100 + static main(args) { + runBatch(new BigdataCommunityGJRHBatch(), args); + } + + @Override + public void process(Object args) { + def citys = CcbCommonUtils.citys; + citys.remove("厦门") + citys.remove("杭州") + def rows = [] + +// addBigdataDistrictFJW() + def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() + for (def city : citys) { + def districts = CcbCommonUtils.findAllDistrictsByOracle(cityCodeDataMap.get(city)) + + for(def dist : districts){ + def obj = CommonDatautils.findDistrictFieldById(dist.commid,["build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge","estate_type2"]) + if(obj){ + if(obj.alias && obj.alias.size()>0){ + dist.commalias = obj.alias.get(0) + }else{ + dist.commalias = "" + } + dist.buildstru = CcbCodeUtils.getBuildStructureCode(obj.build_structure) + dist.housetype = CcbCodeUtils.getDistHouseTypeCode(obj.estate_type2) + dist.buildyear = CcbCodeUtils.getBuildYear(obj.finish_building_date); + dist.houseuse = "11" + dist.buildtype = CcbCodeUtils.parseBuildType(dist.build_type) + dist.compid = new ObjectId() //物业公司id + dist.estatecharge = CcbCodeUtils.processEstateCharge(dist.city, obj.estate_charge, obj.estate_type2) + } + } + println city +" 小区加载完成 "+districts.size() + addBigdataCommunityGJRH(districts) + println city +" 1.小区表完成" + addBigdataCommbuildstruGJ(districts) + println city +" 2.小区建筑结构表" + addBigdataCommhousetypeGJ(districts) + println city +" 3.小区房屋类型表" + addBigdataCommbuildyearGj(districts) + println city +" 4.小区建筑年代表" + addBigdataCommfeeGj(districts) + println city +" 6.小区费用表" + addBigdataCommhouseuseGJ(districts) + println city +" 7.小区房屋用途表" + addBigdataPositionGJ(districts) + println city + " 8.地理位置表" + } + } + + def addBigdataCommunityGJRH(def districts){ + + sqlInstance.withBatch(batchsize) { stmt -> + for(def d : districts){ + def sql = "INSERT INTO BIGDATA_COMMUNITY_FJW (CITYID,DISTID,COMMID,COMMNAME,ADDRESS,LANDAREA,BUILDAREA,GREENINGRATE,PLOTRATIO,PARKINGCNT,UPDATETIME,COMMTYPE,COMMALIAS,STREET,STREETNO,IFNEW,INTRODUCTION,REMARK,CREATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.distid}','${d.commid}','${d.commname}',${converValue(d.address)},${d.landarea},${d.buildarea},${d.greeningrate},${d.plotratio},${d.parkingcnt}," + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.commtype}','${d.commalias}'," + }else{ + sql = sql + "null,'${d.commtype}','${d.commalias}'," + } + if(d.street && d.street!='null'){ + sql = sql +"'${d.street}'," + }else{ + sql = sql +"null," + } + if(d.streetno && d.streetno!='null'){ + sql = sql + "'${d.streetno}'," + }else{ + sql = sql +"null," + } + + sql = sql + "'${d.ifnew}',null,${d.remark}," + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + + try{ + stmt.addBatch sql + }catch(Exception e){ + println d + println sql + } + + } + + } + } + + def converValue(def val){ + if(val && val!='null'){ + return "'"+val+"'"; + }else{ + return null + } + } + + def addBigdataCommbuildstruGJ(def districts){ + sqlInstance.withBatch(batchsize) { stmt -> + for(def d : districts){ + def sql = "INSERT INTO BIGDATA_COMMBUILDSTRU_FJW (CITYID,COMMID,BUILDSTRU,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.buildstru}',${d.remark}," + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss')," + }else{ + sql = sql + "null," + } + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + try{ + stmt.addBatch sql + }catch(Exception e){ + println d + println sql + } + } + } + } + + + def addBigdataCommhousetypeGJ(def districts){ + sqlInstance.withBatch(batchsize) { stmt -> + for(def d : districts){ + def sql = "INSERT INTO BIGDATA_COMMHOUSETYPE_FJW (CITYID,COMMID,HOUSETYPE,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.housetype}',${d.remark}," + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss')," + }else{ + sql = sql + "null," + } + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + try{ + stmt.addBatch sql + }catch(Exception e){ + println d + println sql + } + } + } + } + + def addBigdataCommbuildyearGj(districts){ + sqlInstance.withBatch(batchsize) { stmt -> + for(def d : districts){ + if(d.buildyear){ + def sql = "INSERT INTO BIGDATA_COMMBUILDYEAR_FJW (CITYID,COMMID,BUILDYEAR,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}',${d.buildyear},${d.remark}," + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss')," + }else{ + sql = sql + "null," + } + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + try{ + stmt.addBatch sql + }catch(Exception e){ + println d + println sql + } + } + } + } + } + + def addBigdataCommfeeGj(districts){ + + def sqls = [] + for(def d : districts){ + if(d.estatecharge){ + def sql = "INSERT INTO BIGDATA_COMMFEE_FJW (CITYID,COMMID,COMPID,FEE,HOUSEUSE,BUILDTYPE,FEETYPE,NOTE,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.compid}',${d.estatecharge},'${d.houseuse}','${d.buildtype}','1',${d.note},${d.remark}," + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss')," + }else{ + sql = sql + "null," + } + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + sqls << sql + + if (sqls.size() >= batchsize) { + try { + sqlInstance.withBatch(batchsize, { stmt -> + sqls.each { def s -> + println s + stmt.addBatch s + } + }) + + } catch (Exception e) { + e.printStackTrace() + } + sqls.clear() + } + + } + } + + if (sqls.size() > 0) { + sqlInstance.withBatch(100, { stmt -> + sqls.each { def s -> + stmt.addBatch s + } + }) + } + } + + def addBigdataCommhouseuseGJ(districts){ + def sqls = [] + for(def d : districts){ + def sql = "INSERT INTO BIGDATA_COMMHOUSEUSE_FJW (CITYID,COMMID,HOUSEUSE,HOUSECNT,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.houseuse}',${d.zts},${d.remark}," + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss')," + }else{ + sql = sql + "null," + } + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + sqls << sql + + if (sqls.size() >= batchsize) { + try { + sqlInstance.withBatch(batchsize, { stmt -> + sqls.each { def s -> + stmt.addBatch s + } + }) + + } catch (Exception e) { + e.printStackTrace() + } + sqls.clear() + } + + } + + if (sqls.size() > 0) { + sqlInstance.withBatch(100, { stmt -> + sqls.each { def s -> + stmt.addBatch s + } + }) + } + } + + def addBigdataPositionGJ(districts){ + def sqls = [] + def index = 1 + for(def d : districts){ + def sql = "INSERT INTO BIGDATA_POSITION_FJW (CITYID,OBJECTTYPE,OBJECTID,POSITIONTYPE,SEQNO,LONGITUDE,LATITUDE,ALTITUDE,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}','5', '${d.commid}','1',${index},${d.lng},${d.lat},null,${d.remark}," + index++ + if(d.createtime){ + sql = sql + "to_date('${d.createtime}','yyyy-mm-dd hh24:mi:ss')," + }else{ + sql = sql + "null," + } + if(d.updatetime){ + sql = sql + "to_date('${d.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${d.sourcecode}')" + }else{ + sql = sql + "null,'${d.sourcecode}')" + } + sqls << sql + + if (sqls.size() >= batchsize) { + try { + sqlInstance.withBatch(batchsize, { stmt -> + sqls.each { def s -> + stmt.addBatch s + } + }) + + } catch (Exception e) { + e.printStackTrace() + } + sqls.clear() + } + + } + + if (sqls.size() > 0) { + sqlInstance.withBatch(100, { stmt -> + sqls.each { def s -> + stmt.addBatch s + } + }) + } + } + + def addBigdataDistrictFJW(){ + def sql = "select DISTID,DISTNAME,DISTSPELL,CITYID,DISTCODE,SEQ,DISTTYPE,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from bigdata_district_gj"; + def rows = [] + try{ + sqlInstance.eachRow(sql,{r-> + def insertSql = "INSERT INTO bigdata_district_fjw(DISTID,DISTNAME,DISTSPELL,CITYID,DISTCODE,SEQ,DISTTYPE,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${r.distid}','${r.distname}','${r.distspell}','${r.cityid}','${r.distcode}','${r.seq}',${r.disttype},null,to_date('${r.createtime}','yyyy-mm-dd hh24:mi:ss'),to_date('${r.updatetime}','yyyy-mm-dd hh24:mi:ss'),'${r.sourcecode}')" + sqlInstance.withBatch(batchsize, { stmt -> + stmt.addBatch insertSql + }) + }); + }catch(Exception e){ + + } + } + +} \ No newline at end of file From f60bb2d10df5e31cac02dafc7288119681510605 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 17:40:42 +0800 Subject: [PATCH 15/46] =?UTF-8?q?=E6=96=B0=E5=A2=9E4=E4=B8=AA=E5=9F=8E?= =?UTF-8?q?=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 3c39c1092..2323d31d7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -42,7 +42,8 @@ class BigdataCommunityGJRHBatch extends BaseBatch { @Override public void process(Object args) { - def citys = CcbCommonUtils.citys; + + def citys = ["郑州","长沙","西安","南京"]//CcbCommonUtils.citys; citys.remove("厦门") citys.remove("杭州") def rows = [] From 39ea0af0bdc3df6f40752f398e32948c3ce6db7f Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 18:49:41 +0800 Subject: [PATCH 16/46] update --- .../fangjia/script/ccbevaluation/CcbCommonUtils.groovy | 3 ++- .../ronghe/BigdataCommunityGJRHBatch.groovy | 9 +++++---- 2 files changed, 7 insertions(+), 5 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 59ffd572d..d7735dfe7 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 @@ -235,7 +235,7 @@ class CcbCommonUtils { } public static def findAllDistrictsByOracle(def cityid){ - def sql = "select CITYID,COMMID,COMMNAME,COMMALIAS,DISTID,STREET,STREETNO,ADDRESS,LANDAREA,BUILDAREA,COMMTYPE,IFNEW,GREENINGRATE,PLOTRATIO,PARKINGCNT,INTRODUCTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,WORKDATE,ZTS,LONGITUDE,LATITUDE from bigdata_community_gj where cityId=${cityid} and status=0"; + def sql = "select CITYID,COMMID,COMMNAME,COMMALIAS,DISTID,STREET,STREETNO,ADDRESS,LANDAREA,BUILDAREA,COMMTYPE,IFNEW,GREENINGRATE,PLOTRATIO,PARKINGCNT,INTRODUCTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,WORKDATE,ZTS,LONGITUDE,LATITUDE from bigdata_community_gj where cityId='${cityid}' and status=0 "; def rows = [] try{ sqlInstance.eachRow(sql,{r-> @@ -267,6 +267,7 @@ class CcbCommonUtils { }); }catch(Exception e){ findAllDistrictsByOracle(cityid) + e.printStackTrace() } return rows diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 2323d31d7..5808a5da4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -35,7 +35,7 @@ class BigdataCommunityGJRHBatch extends BaseBatch { def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") - public static def batchsize = 100 + public static def batchsize = 1000 static main(args) { runBatch(new BigdataCommunityGJRHBatch(), args); } @@ -43,9 +43,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { @Override public void process(Object args) { - def citys = ["郑州","长沙","西安","南京"]//CcbCommonUtils.citys; - citys.remove("厦门") - citys.remove("杭州") + //"郑州","长沙","西安", + def citys = ["长沙","西安"]//CcbCommonUtils.citys; +// citys.remove("厦门") +// citys.remove("杭州") def rows = [] // addBigdataDistrictFJW() From 057caf9312135d614ed49d3994c45bb501272cc9 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 19:31:29 +0800 Subject: [PATCH 17/46] =?UTF-8?q?=E8=A5=BF=E5=AE=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 5808a5da4..66cde3752 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -44,7 +44,7 @@ class BigdataCommunityGJRHBatch extends BaseBatch { public void process(Object args) { //"郑州","长沙","西安", - def citys = ["长沙","西安"]//CcbCommonUtils.citys; + def citys = ["西安"]//CcbCommonUtils.citys; // citys.remove("厦门") // citys.remove("杭州") def rows = [] @@ -71,15 +71,15 @@ class BigdataCommunityGJRHBatch extends BaseBatch { dist.estatecharge = CcbCodeUtils.processEstateCharge(dist.city, obj.estate_charge, obj.estate_type2) } } - println city +" 小区加载完成 "+districts.size() - addBigdataCommunityGJRH(districts) - println city +" 1.小区表完成" - addBigdataCommbuildstruGJ(districts) - println city +" 2.小区建筑结构表" - addBigdataCommhousetypeGJ(districts) - println city +" 3.小区房屋类型表" - addBigdataCommbuildyearGj(districts) - println city +" 4.小区建筑年代表" +// println city +" 小区加载完成 "+districts.size() +// addBigdataCommunityGJRH(districts) +// println city +" 1.小区表完成" +// addBigdataCommbuildstruGJ(districts) +// println city +" 2.小区建筑结构表" +// addBigdataCommhousetypeGJ(districts) +// println city +" 3.小区房屋类型表" +// addBigdataCommbuildyearGj(districts) +// println city +" 4.小区建筑年代表" addBigdataCommfeeGj(districts) println city +" 6.小区费用表" addBigdataCommhouseuseGJ(districts) From 14a1efe3095500ce93c0ef921a0f846e1cbf7c33 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 20:01:49 +0800 Subject: [PATCH 18/46] =?UTF-8?q?=E8=A5=BF=E5=AE=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 66cde3752..2c6cdf6cb 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -71,21 +71,21 @@ class BigdataCommunityGJRHBatch extends BaseBatch { dist.estatecharge = CcbCodeUtils.processEstateCharge(dist.city, obj.estate_charge, obj.estate_type2) } } -// println city +" 小区加载完成 "+districts.size() -// addBigdataCommunityGJRH(districts) -// println city +" 1.小区表完成" -// addBigdataCommbuildstruGJ(districts) -// println city +" 2.小区建筑结构表" -// addBigdataCommhousetypeGJ(districts) -// println city +" 3.小区房屋类型表" -// addBigdataCommbuildyearGj(districts) -// println city +" 4.小区建筑年代表" + println city +" 小区加载完成 "+districts.size() + addBigdataCommunityGJRH(districts) + println city +" 1.小区表完成" + addBigdataCommbuildstruGJ(districts) + println city +" 2.小区建筑结构表" + addBigdataCommhousetypeGJ(districts) + println city +" 3.小区房屋类型表" + addBigdataCommbuildyearGj(districts) + println city +" 4.小区建筑年代表" addBigdataCommfeeGj(districts) println city +" 6.小区费用表" - addBigdataCommhouseuseGJ(districts) - println city +" 7.小区房屋用途表" - addBigdataPositionGJ(districts) - println city + " 8.地理位置表" +// addBigdataCommhouseuseGJ(districts) +// println city +" 7.小区房屋用途表" +// addBigdataPositionGJ(districts) +// println city + " 8.地理位置表" } } @@ -234,12 +234,12 @@ class BigdataCommunityGJRHBatch extends BaseBatch { try { sqlInstance.withBatch(batchsize, { stmt -> sqls.each { def s -> - println s stmt.addBatch s } }) } catch (Exception e) { + println sqls[0] e.printStackTrace() } sqls.clear() From 016d2e4239455c51fe29bba585e94b57af75ff2e Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 21 Oct 2021 21:20:51 +0800 Subject: [PATCH 19/46] =?UTF-8?q?=E5=85=A8=E5=9B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 2c6cdf6cb..91c175264 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -44,9 +44,13 @@ class BigdataCommunityGJRHBatch extends BaseBatch { public void process(Object args) { //"郑州","长沙","西安", - def citys = ["西安"]//CcbCommonUtils.citys; -// citys.remove("厦门") -// citys.remove("杭州") + def citys = CcbCommonUtils.citys; + citys.remove("厦门") + citys.remove("杭州") + citys.remove("郑州") + citys.remove("长沙") + citys.remove("西安") + citys.remove("南京") def rows = [] // addBigdataDistrictFJW() @@ -82,10 +86,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { println city +" 4.小区建筑年代表" addBigdataCommfeeGj(districts) println city +" 6.小区费用表" -// addBigdataCommhouseuseGJ(districts) -// println city +" 7.小区房屋用途表" -// addBigdataPositionGJ(districts) -// println city + " 8.地理位置表" + addBigdataCommhouseuseGJ(districts) + println city +" 7.小区房屋用途表" + addBigdataPositionGJ(districts) + println city + " 8.地理位置表" } } From 9526324806ead6e597c43ef08a1cf814f3009fae Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 09:43:52 +0800 Subject: [PATCH 20/46] =?UTF-8?q?=E6=88=BF=E6=BA=90=20=E5=8C=97=E4=B8=8A?= =?UTF-8?q?=E5=B9=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/ccbevaluation/ExportOracleData.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 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 64f7e439c..3380be5f0 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 @@ -24,7 +24,7 @@ class ExportOracleData { // exportCommunityStaging() // exportCommunityBuileType() // exportBigdataDistrictData() -// exportBigdataCommunity() +// exportBigdataCommunity() exportBigdataForsale() @@ -459,7 +459,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 11a39b2e9d37316563894a9c5e4c931e9fdc0966 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 10:38:31 +0800 Subject: [PATCH 21/46] =?UTF-8?q?=E6=88=BF=E6=BA=90=20=E9=9D=9E=E5=8C=97?= =?UTF-8?q?=E4=B8=8A=E5=B9=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/ccbevaluation/ExportOracleData.groovy | 9 ++++++--- 1 file changed, 6 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 3380be5f0..9855fb8f6 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 @@ -459,13 +459,16 @@ class ExportOracleData { def exportBigdataForsale(){ - def citys = ["北京","上海","广州"]//CcbCommonUtils.citys; + def citys = CcbCommonUtils.citys; + citys.remove("北京") + citys.remove("上海") + citys.remove("广州") 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 41ac972f3d1191528016459aa7368727f9e66a4d Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 10:55:52 +0800 Subject: [PATCH 22/46] =?UTF-8?q?7=E4=B8=AA=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/ccbevaluation/ExportOracleData.groovy | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 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 9855fb8f6..821c9ba1b 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 @@ -459,16 +459,20 @@ class ExportOracleData { def exportBigdataForsale(){ - def citys = CcbCommonUtils.citys; - citys.remove("北京") - citys.remove("上海") - citys.remove("广州") + def citys =["北京","上海","广州","深圳","重庆","天津","成都"] CcbCommonUtils.citys; +// citys.remove("北京") +// citys.remove("上海") +// citys.remove("广州") +// citys.remove("深圳") +// citys.remove("重庆") +// citys.remove("天津") +// citys.remove("成都") 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}_0002.dat" + def fileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0002.dat" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"] for(def city : citys){ From 3a3242848813165d1be2217eedfc5c4f5f328a77 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 11:01:23 +0800 Subject: [PATCH 23/46] update --- .../com/fangjia/script/ccbevaluation/ExportOracleData.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 821c9ba1b..08a7235c7 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 @@ -459,7 +459,7 @@ class ExportOracleData { def exportBigdataForsale(){ - def citys =["北京","上海","广州","深圳","重庆","天津","成都"] CcbCommonUtils.citys; + def citys =["北京","上海","广州","深圳","重庆","天津","成都"] //CcbCommonUtils.citys; // citys.remove("北京") // citys.remove("上海") // citys.remove("广州") From d39b4b61a525d784eb529e0d8434eebd0ff9133f Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 11:58:24 +0800 Subject: [PATCH 24/46] =?UTF-8?q?85=E4=B8=AA=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/ExportOracleData.groovy | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 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 08a7235c7..ff9109f69 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 @@ -459,20 +459,20 @@ class ExportOracleData { def exportBigdataForsale(){ - def citys =["北京","上海","广州","深圳","重庆","天津","成都"] //CcbCommonUtils.citys; -// citys.remove("北京") -// citys.remove("上海") -// citys.remove("广州") -// citys.remove("深圳") -// citys.remove("重庆") -// citys.remove("天津") -// citys.remove("成都") + def citys = CcbCommonUtils.citys; + citys.remove("北京") + citys.remove("上海") + citys.remove("广州") + citys.remove("深圳") + citys.remove("重庆") + citys.remove("天津") + citys.remove("成都") 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 e5a0c6752ea73566dd2bbd10aa7a3c71c75c5444 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 14:22:36 +0800 Subject: [PATCH 25/46] =?UTF-8?q?=E6=88=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/ccbevaluation/ExportOracleData.groovy | 6 +++--- .../groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy | 3 ++- 2 files changed, 5 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 ff9109f69..158f33799 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,12 +25,12 @@ class ExportOracleData { // exportCommunityBuileType() // exportBigdataDistrictData() // exportBigdataCommunity() - exportBigdataForsale() +// exportBigdataForsale() // exportGuidedPrice() // exportCommunityGuidedPrice() -// exportBigdataDeal() + exportBigdataDeal() // exportThirdPartyPrice() @@ -272,7 +272,7 @@ class ExportOracleData { "HOUSEID, ADDRESS, BUILDYEAR, PROPTYPE, PROPYEARS, PERIODNUM, FLOORNUM, FLOORTYPE, FLOORCNT, BUILDTYPE, BUILDSTRU, BUILDAREA, LIVINGAREA, HOUSESTYLE, ROOMCNT, LIVINGROOMCNT, KITCHENCNT, BATHROOMCNT, \n" + "HOUSEUSE, HOUSESTRU, HOUSEASPECT, FITMENT, EVALUATENO, DEALUNITPRICE, DEALTOTALPRICE, DECLAREPRICE, EVALUATEPRICE, CONTRACTNO, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE, DEALTYPE, \n" + "PAYTYPE, DEALPERIOD, IFELEVATOR, COMPAREAGARDEN, COMPAREATERRACE, COMPAREABALCONY, COMPAREABAYWINDOW, COMPAREAATTIC, COMPAREAGARAGE, COMPAREABASEMENT, COMPAREAOTHER, DATASOURCE, AGENCYID, AGENCYNAME, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, CJJE, WORKDATE\n" + - "from bigdata_deal_gj where cityId in (350200,150100) and dealdate>=to_date('2021-08-01','yyyy-mm-dd')"; + "from bigdata_deal_gj"; def allRows = [] sqlInstance.eachRow(sql,{r-> def data = [] diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy index 73e4f2426..a418cebb9 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy @@ -287,9 +287,10 @@ class CcbCodeUtils { } }catch (Exception e){ println "estateCharege 转不了 "+estateCharege + return null; } } - return estateCharege; + return null; } static def trimChar(String c) { From dec88f62ae7d3c6ba094535dd59c10cb90ab6b11 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 16:37:59 +0800 Subject: [PATCH 26/46] update --- .../script/ccbevaluation/BigdataDealBatch.groovy | 10 +++++----- .../script/ccbevaluation/ExportOracleData.groovy | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy index 7fbedb2fc..56c4d73e2 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataDealBatch.groovy @@ -29,7 +29,7 @@ import java.util.regex.Pattern @BatchOwner(Watcher.GaoJuan) class BigdataDealBatch extends BaseBatch{ - def curDate = 20210701//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMMdd"), -1, "yyyyMMdd")); + def curDate = 20210901//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMMdd"), -1, "yyyyMMdd")); public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30) def sourceMap = ["贝壳找房":"ke.com","我爱我家":"5i5j.com","链家在线":"lianjia.com","房天下":"fang.com","中原地产":"centanet.com","福州不动产":"","搜房":"fang.com"] @@ -420,8 +420,8 @@ class BigdataDealBatch extends BaseBatch{ // startDate = DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern("20210601", "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd")) // } -// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(new Date()) - def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20210801", "yyyyMMdd")) + def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern(curDate.toString(), "yyyyMMdd"))//DateUtils.getFirstDayOfMonth(new Date()) +// def endDate = DateUtils.getLastDayOfMonth(DateUtils.parseFromTightByPattern("20210801", "yyyyMMdd")) for(def i=0;i Date: Fri, 22 Oct 2021 18:25:27 +0800 Subject: [PATCH 27/46] update --- .../script/ccbevaluation/ThirdPartyPriceBatch.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy index 1e8ca6a82..b813a155d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ThirdPartyPriceBatch.groovy @@ -20,9 +20,9 @@ import java.util.concurrent.ConcurrentHashMap @BatchOwner(Watcher.GaoJuan) class ThirdPartyPriceBatch extends BaseBatch { - def sDate= 202108//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); - def startDate = 202106 - def endDate = 202108 + def sDate= 202109//Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); + def startDate = 202107 + def endDate = 202109 def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -6, "yyyyMM")); static final DBCollection AVERAGE_STATISTICS = MongoUtils.getCollectionByName("fangjia", "average_statistics", "192.168.0.43") From e2d4aa2fe1d984666cd727fb8a3450d0090cadf5 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 20:11:56 +0800 Subject: [PATCH 28/46] =?UTF-8?q?=E5=AF=BC=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=9D=87=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/ExportOracleData.groovy | 92 ++++++++++--------- 1 file changed, 49 insertions(+), 43 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 a20ebee03..4a7233a51 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 @@ -18,7 +18,8 @@ class ExportOracleData { def task = new ExportOracleData() task.run() } - def run(){ + + def run() { // exportEvaluationRateData() // exportBigdataPoiData() // exportCommunityStaging() @@ -45,10 +46,10 @@ class ExportOracleData { } - def exportEvaluationRateData(){ + def exportEvaluationRateData() { def sql = "select ID,RATE_TYPE,RATE,RANK,CITY,REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from evaluate_rate_gj"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.ID data << r.RATE_TYPE @@ -62,9 +63,9 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/output/MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_EVALUATE_RATE_GJ_ALL_${curDate}_0001.dat" } def headers = []//["系数ID","系数类型","系数","排序","城市","备注","创建时间","更新时间","来源公司"] @@ -75,10 +76,10 @@ class ExportOracleData { } - def exportBigdataPoiData(){ + def exportBigdataPoiData() { def sql = "select CITYID, DISTID, ID, POI_NAME, TYPE, TYPE_CODE, LATITUDE, LONGITUDE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from bigdata_poi_gj where cityId in (350200,150100)"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.CITYID data << r.DISTID @@ -95,10 +96,10 @@ class ExportOracleData { allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_POI_GJ_ALL_${curDate}_0001.dat" } def headers = []//["城市ID","行政区ID","ID","Poi名称","类型","类型编码","纬度","经度","备注","创建时间","更新时间","来源公司"] @@ -109,10 +110,10 @@ class ExportOracleData { println "BIGDATA_POI_GJ 上传Ftp完成......" } - def exportCommunityStaging(){ + def exportCommunityStaging() { def sql = "select ID,COMMID,MASTER_COMMID,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from community_staging_gj"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.ID data << r.COMMID @@ -123,9 +124,9 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_COMMUNITY_STAGING_GJ_ALL_${curDate}_0001.dat" } def headers = []//["分期ID","小区ID","小区主期ID","备注","创建时间","更新时间","来源公司"] @@ -136,10 +137,10 @@ class ExportOracleData { println "COMMUNITY_STAGING_GJ 上传Ftp完成......" } - def exportCommunityBuileType(){ + def exportCommunityBuileType() { def sql = "select CITYID, COMMID, BUILDTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, WORKDATE from bigdata_commbuildtype_gj where CITYID in (350200,150100)"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.CITYID data << r.COMMID @@ -151,9 +152,9 @@ class ExportOracleData { data << r.WORKDATE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_COMMBUILDTYPE_GJ_ALL_${curDate}_0001.dat" } def headers = []//["城市ID","小区ID"," 建筑类型","备注","创建时间","更新时间","来源公司","数据时间"] @@ -164,11 +165,11 @@ class ExportOracleData { println "BIGDATA_COMMBUILDTYPE_GJ 上传Ftp完成......" } - def exportBigdataDistrictData(){ + def exportBigdataDistrictData() { def sql = "select DISTID, DISTNAME, DISTSPELL, CITYID, DISTCODE, SEQ, DISTTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE, LJXZQH, LJXZQHDM, XZQHDM, WORKDATE from bigdata_district_gj where cityId in (350200,150100)"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.DISTID data << r.DISTNAME @@ -187,12 +188,13 @@ class ExportOracleData { data << r.WORKDATE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_DISTRICT_GJ_ALL_${curDate}_0001.dat" } - def headers = []//["行政区ID","行政区名称","行政区名称拼音","城市ID","国标码","显示顺序","行政区类别","备注","创建时间","更新时间","来源公司","逻辑行政区","逻辑行政区划代码","行政区划代码","数据时间"] + def headers = [] +//["行政区ID","行政区名称","行政区名称拼音","城市ID","国标码","显示顺序","行政区类别","备注","创建时间","更新时间","来源公司","逻辑行政区","逻辑行政区划代码","行政区划代码","数据时间"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); println "BIGDATA_DISTRICT_GJ 数据文件输出完成......" @@ -201,10 +203,10 @@ class ExportOracleData { } - def exportGuidedPrice(){ + def exportGuidedPrice() { def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE,AVG_PRICE, GUIDING_PERSON, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE from guided_price_gj where dealdate>=TO_DATE('2021-08-01', 'yyyy-MM-dd') and dealdate + sqlInstance.eachRow(sql, { r -> def data = [] data << r.ID data << r.COMMID @@ -222,22 +224,23 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_GUIDED_PRICE_GJ_ADD_${curDate}_0001.dat" } - def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导日期","指导价格","添加人","备注","创建时间","更新时间","来源公司"] + def headers = [] +//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导日期","指导价格","添加人","备注","创建时间","更新时间","来源公司"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); println "GUIDED_PRICE_GJ 数据文件输出完成......" CcbFtpUtils.ftpUpload(fileName, curDate) println "GUIDED_PRICE_GJ 上传Ftp完成......" } - def exportCommunityGuidedPrice(){ + def exportCommunityGuidedPrice() { def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, AVGPRICE, SOURCETYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME , SOURCECODE from community_guide_price_gj where cityname='西安'"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.ID data << r.COMMID @@ -254,9 +257,9 @@ class ExportOracleData { data << r.SOURCECODE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_COMMUNITY_GUIDE_PRICE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["第三方均价ID","楼盘ID","小区名称","城市ID","城市名称","行政区ID","行政区名称","指导价格","类型","备注","创建时间","更新时间","来源公司"] @@ -267,14 +270,14 @@ class ExportOracleData { println "COMMUNITY_GUIDE_PRICE_GJ 上传Ftp完成......" } - def exportBigdataDeal(){ + def exportBigdataDeal() { def sql = "select CITYID, DEALID, CITYNAME, DISTID, DISTNAME, STREET, STREETNO, COMMID, COMMNAME, BUILDID, BUILDNO, BUILDNAME, UNITID, UNITNO, UNITNAME, \n" + "HOUSEID, ADDRESS, BUILDYEAR, PROPTYPE, PROPYEARS, PERIODNUM, FLOORNUM, FLOORTYPE, FLOORCNT, BUILDTYPE, BUILDSTRU, BUILDAREA, LIVINGAREA, HOUSESTYLE, ROOMCNT, LIVINGROOMCNT, KITCHENCNT, BATHROOMCNT, \n" + "HOUSEUSE, HOUSESTRU, HOUSEASPECT, FITMENT, EVALUATENO, DEALUNITPRICE, DEALTOTALPRICE, DECLAREPRICE, EVALUATEPRICE, CONTRACTNO, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE, DEALTYPE, \n" + "PAYTYPE, DEALPERIOD, IFELEVATOR, COMPAREAGARDEN, COMPAREATERRACE, COMPAREABALCONY, COMPAREABAYWINDOW, COMPAREAATTIC, COMPAREAGARAGE, COMPAREABASEMENT, COMPAREAOTHER, DATASOURCE, AGENCYID, AGENCYNAME, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, CJJE, WORKDATE\n" + "from bigdata_deal_gj"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.CITYID data << r.DEALID @@ -343,12 +346,13 @@ class ExportOracleData { data << r.WORKDATE allRows << data }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM") + "28"; def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat" - if(CommonDatautils.isWindow()){ + if (CommonDatautils.isWindow()) { fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_DEAL_GJ_ADD_${curDate}_0001.dat" } - def headers = []//["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"] + def headers = [] +//["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"] FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false); println "BIGDATA_DEAL_GJ 数据文件输出完成......" @@ -357,12 +361,12 @@ class ExportOracleData { } - def exportThirdPartyPrice(){ + def exportThirdPartyPrice() { def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, YEAR_MONTH, ZHUGE_AVG_PRICE, ANJUKE_AVG_PRICE, FANG_AVG_PRICE, LIANJIA_AVG_PRICE, CITYHOUSE_AVG_PRICE, MAITIAN_AVG_PRICE, KE_AVG_PRICE, \n" + "TAOFANG_AVG_PRICE, ZHONGYUAN_AVG_PRICE, TBS_AVG_PRICE, QFANG_AVG_PRICE, FANGTAN_AVG_PRICE, FANGDUODUO_AVG_PRICE, WIWJ_AVG_PRICE, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE\n" + "from third_party_price_gj"; def allRows = [] - sqlInstance.eachRow(sql,{r-> + sqlInstance.eachRow(sql, { r -> def data = [] data << r.ID data << r.COMMID @@ -388,21 +392,23 @@ class ExportOracleData { data << r.WIWJ_AVG_PRICE data << r.CREATETIME data << r.UPDATETIME - data << r.SOURCECODE.replaceAll(~'\\r','') + data << r.SOURCECODE.replaceAll(~'\\r', '') allRows << data - }); - def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"28"; + }) + 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()){ + 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房均价","房探均价","房多多均价","我爱我家均价","创建时间","更新时间","来源公司"] + 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) From 70f1cb8106cb542c5dd86e7a295ecc227a976578 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 22 Oct 2021 20:40:55 +0800 Subject: [PATCH 29/46] =?UTF-8?q?10=E6=9C=88=E6=88=BF=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccbevaluation/ExportOracleData.groovy | 17 +++++------------ 1 file changed, 5 insertions(+), 12 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 4a7233a51..fac7f79f8 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 @@ -26,13 +26,13 @@ class ExportOracleData { // exportCommunityBuileType() // exportBigdataDistrictData() // exportBigdataCommunity() -// exportBigdataForsale() + exportBigdataForsale() // exportGuidedPrice() // exportCommunityGuidedPrice() // exportBigdataDeal() - exportThirdPartyPrice() +// exportThirdPartyPrice() // exportAvmEvaluationGJNB() @@ -466,19 +466,12 @@ class ExportOracleData { def exportBigdataForsale(){ def citys = CcbCommonUtils.citys; - citys.remove("北京") - citys.remove("上海") - citys.remove("广州") - citys.remove("深圳") - citys.remove("重庆") - citys.remove("天津") - citys.remove("成都") 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}_0002.dat" + def fileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0003.dat" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0002.dat" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0003.dat" } def headers = []//["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"] for(def city : citys){ @@ -486,7 +479,7 @@ class ExportOracleData { def sql = "select CITYID,FORSALEID,PROPCODE,CITYNAME,DISTID,DISTNAME,COMMID,COMMNAME, BUILDID,BUILDNO, BUILDNAME,UNITID,UNITNO,UNITNAME,HOUSEID,ADDRESS,BUILDYEAR,PROPTYPE,PROPYEARS,UNITPRICE,TOTALPRICE,PAYTYPE,FLOORNUM,FLOORCNT,\n" + " BUILDTYPE, HOUSESTRU,BUILDSTRU,BUILDAREA,LIVINGAREA,HOUSESTYLE,ROOMCNT,LIVINGROOMCNT,KITCHENCNT, BATHROOMCNT,HOUSEASPECT,FITMENT,IFELEVATOR,ELEVATORHOUSE,to_char(PUBLISHTIME,'yyyy-mm-dd hh24:mi:ss') as PUBLISHTIME,to_char(EXPIRETIME,'yyyy-mm-dd hh24:mi:ss') as EXPIRETIME,\n" + - " IFFIRST,DATASOURCE,AGENCYID,AGENCYNAME,PUBLISHER,PHONE,DESCRIPTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,ATTACH from bigdata_forsale_gj where cityId=${cityCode}"; + " IFFIRST,DATASOURCE,AGENCYID,AGENCYNAME,PUBLISHER,PHONE,DESCRIPTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,ATTACH from bigdata_forsale_gj where cityId=${cityCode} and PUBLISHTIME>=TO_DATE('2021-10-01', 'yyyy-MM-dd') and PUBLISHTIME From 3efed3b8037896ca8cfede5cb5072bbfcdce2c23 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 25 Oct 2021 14:02:19 +0800 Subject: [PATCH 30/46] =?UTF-8?q?15=E4=B8=AA=E5=9F=8E=E5=B8=82=E5=B0=8F?= =?UTF-8?q?=E5=8C=BA=E8=9E=8D=E5=90=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 91c175264..c96c02ae1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -44,13 +44,7 @@ class BigdataCommunityGJRHBatch extends BaseBatch { public void process(Object args) { //"郑州","长沙","西安", - def citys = CcbCommonUtils.citys; - citys.remove("厦门") - citys.remove("杭州") - citys.remove("郑州") - citys.remove("长沙") - citys.remove("西安") - citys.remove("南京") + def citys = ["厦门","北京","上海","广州","深圳","重庆","郑州","长沙","西安","成都","东莞","佛山","杭州","合肥","南京","青岛","沈阳","苏州","天津","武汉"]//CcbCommonUtils.citys; def rows = [] // addBigdataDistrictFJW() @@ -76,24 +70,26 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } println city +" 小区加载完成 "+districts.size() - addBigdataCommunityGJRH(districts) + addBigdataCommunityGJRH(districts, cityCodeDataMap.get(city)) println city +" 1.小区表完成" - addBigdataCommbuildstruGJ(districts) + addBigdataCommbuildstruGJ(districts, cityCodeDataMap.get(city)) println city +" 2.小区建筑结构表" - addBigdataCommhousetypeGJ(districts) + addBigdataCommhousetypeGJ(districts, cityCodeDataMap.get(city)) println city +" 3.小区房屋类型表" - addBigdataCommbuildyearGj(districts) + addBigdataCommbuildyearGj(districts, cityCodeDataMap.get(city)) println city +" 4.小区建筑年代表" - addBigdataCommfeeGj(districts) + addBigdataCommfeeGj(districts, cityCodeDataMap.get(city)) println city +" 6.小区费用表" - addBigdataCommhouseuseGJ(districts) + addBigdataCommhouseuseGJ(districts, cityCodeDataMap.get(city)) println city +" 7.小区房屋用途表" - addBigdataPositionGJ(districts) + addBigdataPositionGJ(districts, cityCodeDataMap.get(city)) println city + " 8.地理位置表" } } - def addBigdataCommunityGJRH(def districts){ + def addBigdataCommunityGJRH(def districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMUNITY_FJW where CITYID='${cityid}'") sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ @@ -141,7 +137,8 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommbuildstruGJ(def districts){ + def addBigdataCommbuildstruGJ(def districts, def cityid){ + sqlInstance.executeUpdate("delete from BIGDATA_COMMBUILDSTRU_FJW where CITYID='${cityid}'") sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ def sql = "INSERT INTO BIGDATA_COMMBUILDSTRU_FJW (CITYID,COMMID,BUILDSTRU,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.buildstru}',${d.remark}," @@ -166,7 +163,9 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } - def addBigdataCommhousetypeGJ(def districts){ + def addBigdataCommhousetypeGJ(def districts, def cityid){ + sqlInstance.executeUpdate("delete from BIGDATA_COMMHOUSETYPE_FJW where CITYID='${cityid}'") + sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ def sql = "INSERT INTO BIGDATA_COMMHOUSETYPE_FJW (CITYID,COMMID,HOUSETYPE,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.housetype}',${d.remark}," @@ -190,7 +189,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommbuildyearGj(districts){ + def addBigdataCommbuildyearGj(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMBUILDYEAR_FJW where CITYID='${cityid}'") + sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ if(d.buildyear){ @@ -216,7 +218,9 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommfeeGj(districts){ + def addBigdataCommfeeGj(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMFEE_FJW where CITYID='${cityid}'") def sqls = [] for(def d : districts){ @@ -261,7 +265,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommhouseuseGJ(districts){ + def addBigdataCommhouseuseGJ(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMHOUSEUSE_FJW where CITYID='${cityid}'") + def sqls = [] for(def d : districts){ def sql = "INSERT INTO BIGDATA_COMMHOUSEUSE_FJW (CITYID,COMMID,HOUSEUSE,HOUSECNT,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.houseuse}',${d.zts},${d.remark}," @@ -302,7 +309,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataPositionGJ(districts){ + def addBigdataPositionGJ(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_POSITION_FJW where CITYID='${cityid}'") + def sqls = [] def index = 1 for(def d : districts){ From 4589ad6e6e37023ea31dcfa06191529d48098931 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 25 Oct 2021 14:46:26 +0800 Subject: [PATCH 31/46] =?UTF-8?q?=E6=B8=A4=E6=B5=B7=E5=85=88=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E8=AF=84=E4=BC=B0=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/weiXinEvaluation/report.ftl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl index 0b2fb5b13..e5d379a4f 100644 --- a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl +++ b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl @@ -366,9 +366,11 @@ - + <#if role?? && role!=17> + +

From 2f1d5803ecdc4025955e542b075c42b85f92212c Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 25 Oct 2021 16:47:02 +0800 Subject: [PATCH 32/46] update --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 8 ++++--- .../script/commData/CommonDatautils.groovy | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index c96c02ae1..d778576a2 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -43,8 +43,8 @@ class BigdataCommunityGJRHBatch extends BaseBatch { @Override public void process(Object args) { - //"郑州","长沙","西安", - def citys = ["厦门","北京","上海","广州","深圳","重庆","郑州","长沙","西安","成都","东莞","佛山","杭州","合肥","南京","青岛","沈阳","苏州","天津","武汉"]//CcbCommonUtils.citys; + //"厦门","北京" + def citys = ["上海","广州","深圳","重庆","郑州","长沙","西安","成都","东莞","佛山","杭州","合肥","南京","青岛","沈阳","苏州","天津","武汉"]//CcbCommonUtils.citys; def rows = [] // addBigdataDistrictFJW() @@ -52,8 +52,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { for (def city : citys) { def districts = CcbCommonUtils.findAllDistrictsByOracle(cityCodeDataMap.get(city)) + def distMap = CommonDatautils.findAllDistricMaptByCity(city, "district", ["build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge","estate_type2"]) + for(def dist : districts){ - def obj = CommonDatautils.findDistrictFieldById(dist.commid,["build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge","estate_type2"]) + def obj = distMap.get(dist.commid)//CommonDatautils.findDistrictFieldById(dist.commid,["build_structure","estate_type2","finish_building_date","alias","build_type","estate_charge","estate_type2"]) if(obj){ if(obj.alias && obj.alias.size()>0){ dist.commalias = obj.alias.get(0) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy index b8c48895f..821cc9765 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/commData/CommonDatautils.groovy @@ -677,6 +677,28 @@ class CommonDatautils { } + public static def findAllDistricMaptByCity(def city, def cat, def fields){ + + DBObject q = new BasicDBObject(); + q.put("visible",0) + q.put("cat", cat); + q.put("city", city); + + DBObject keys = new BasicDBObject(); + if(fields){ + for(def field : fields){ + keys.put(field, 1); + } + } + def dbsour = getDataStoreConnection().find(q, keys).batchSize(2000) + def retMap = [:] + for(def d : dbsour){ + retMap.put(d._id.toString(), d) + } + return retMap; + } + + public static def findAllDistrictByCity(def city, def cat, def fields){ DBObject q = new BasicDBObject(); From fc724c6a2fc6ac847c80a49d7caeff57afb65e75 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 25 Oct 2021 20:06:30 +0800 Subject: [PATCH 33/46] update --- .../com/fangjia/script/ccbevaluation/CcbCommonUtils.groovy | 4 +++- .../ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy | 4 ++-- 2 files changed, 5 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 d7735dfe7..147a34823 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 @@ -266,8 +266,10 @@ class CcbCommonUtils { rows << map }); }catch(Exception e){ + sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", + "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") findAllDistrictsByOracle(cityid) - e.printStackTrace() + println "错误:"+e.getMessage() } return rows diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index d778576a2..12bbc9acc 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -43,8 +43,8 @@ class BigdataCommunityGJRHBatch extends BaseBatch { @Override public void process(Object args) { - //"厦门","北京" - def citys = ["上海","广州","深圳","重庆","郑州","长沙","西安","成都","东莞","佛山","杭州","合肥","南京","青岛","沈阳","苏州","天津","武汉"]//CcbCommonUtils.citys; + //"厦门","北京","上海", + def citys = ["广州","深圳","重庆","郑州","长沙","西安","成都","东莞","佛山","杭州","合肥","南京","青岛","沈阳","苏州","天津","武汉"]//CcbCommonUtils.citys; def rows = [] // addBigdataDistrictFJW() From 22b3d1249e8aa5e006e43458a595ce8b4e2c7ba0 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 26 Oct 2021 10:03:31 +0800 Subject: [PATCH 34/46] =?UTF-8?q?=E8=9E=8D=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/ExportDistrictRongHe.groovy | 239 ++++++++++++++++++ .../fangjia/script/gj/YouDaDataParser.groovy | 6 +- .../fangjia/script/gj/ccb/FileUtils.groovy | 4 +- 3 files changed, 244 insertions(+), 5 deletions(-) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy new file mode 100644 index 000000000..8dbfd559f --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/ExportDistrictRongHe.groovy @@ -0,0 +1,239 @@ +package com.fangjia.script.ccbevaluation.ronghe + +import com.fangjia.script.BaseBatch +import com.fangjia.script.BatchOwner +import com.fangjia.script.Watcher +import com.fangjia.script.commData.CommonDatautils +import com.fangjia.script.gj.ccb.FileUtils +import com.fangjia.script.util.DateUtils +import groovy.sql.Sql + +import java.sql.ResultSet +import java.sql.ResultSetMetaData + +@BatchOwner(Watcher.GaoJuan) +class ExportDistrictRongHe extends BaseBatch{ + + def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", + "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") + static main(args) { + runBatch(new ExportDistrictRongHe(), args); + } + + @Override + void process(Object args) { + exportBigdataCommunityGJRH() + exportBigdataCommbuildstruGJ() + exportBigdataCommhousetypeGJ() + exportBigdataCommbuildyearGj() + exportBigdataCommfeeGj() + exportBigdataCommhouseuseGJ() + exportBigdataPositionGJ() + exportBigdataDistrictFJW() + } + + def exportBigdataCommunityGJRH(){ + def sql = "select CITYID,DISTID,COMMID,COMMNAME,ADDRESS,LANDAREA,BUILDAREA,GREENINGRATE,PLOTRATIO,PARKINGCNT,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,COMMTYPE,COMMALIAS,STREET,STREETNO,IFNEW,INTRODUCTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,SOURCECODE from BIGDATA_COMMUNITY_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.DISTID + data << r.COMMID + data << r.COMMNAME + data << r.ADDRESS + data << r.LANDAREA + data << r.BUILDAREA + data << r.GREENINGRATE + data << r.PLOTRATIO + data << r.PARKINGCNT + data << r.UPDATETIME + data << r.COMMTYPE + data << r.COMMALIAS + data << r.STREET + data << r.STREETNO + data << r.IFNEW + data << r.INTRODUCTION + data << r.REMARK + data << r.CREATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMUNITY_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_COMMUNITY_GJRH_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + def exportBigdataCommbuildstruGJ(){ + def sql = "select CITYID,COMMID,BUILDSTRU,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_COMMBUILDSTRU_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.COMMID + data << r.BUILDSTRU + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDSTRU_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_COMMBUILDSTRU_GJ_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + + def exportBigdataCommhousetypeGJ(){ + def sql = "select CITYID,COMMID,HOUSETYPE,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_COMMHOUSETYPE_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.COMMID + data << r.HOUSETYPE + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMHOUSETYPE_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_COMMHOUSETYPE_GJ_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + + def exportBigdataCommbuildyearGj(){ + def sql = "select CITYID,COMMID,BUILDYEAR,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_COMMBUILDYEAR_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.COMMID + data << r.BUILDYEAR + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMBUILDYEAR_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_COMMBUILDYEAR_GJ_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + + def exportBigdataCommfeeGj(){ + def sql = "select CITYID,COMMID,COMPID,FEE,HOUSEUSE,BUILDTYPE,FEETYPE,NOTE,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_COMMFEE_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.COMMID + data << r.COMPID + data << r.FEE + data << r.HOUSEUSE + data << r.BUILDTYPE + data << r.FEETYPE + data << r.NOTE + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMFEE_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_COMMFEE_GJ_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + + + def exportBigdataCommhouseuseGJ(){ + def sql = "select CITYID,COMMID,HOUSEUSE,HOUSECNT,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_COMMHOUSEUSE_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.COMMID + data << r.HOUSEUSE + data << r.HOUSECNT + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_COMMHOUSEUSE_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_COMMHOUSEUSE_GJ_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + + def exportBigdataPositionGJ(){ + def sql = "select CITYID,OBJECTTYPE,OBJECTID,POSITIONTYPE,SEQNO,LONGITUDE,LATITUDE,ALTITUDE,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_POSITION_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.CITYID + data << r.OBJECTTYPE + data << r.OBJECTID + data << r.POSITIONTYPE + data << r.SEQNO + data << r.LONGITUDE + data << r.LATITUDE + data << r.ALTITUDE + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_POSITION_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_POSITION_GJ_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + + def exportBigdataDistrictFJW(){ + def sql = "select DISTID,DISTNAME,DISTSPELL,CITYID,DISTCODE,SEQ,DISTTYPE,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME,to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE from BIGDATA_DISTRICT_FJW"; + def allRows = [] + sqlInstance.eachRow(sql,{r-> + def data = [] + data << r.DISTID + data << r.DISTNAME + data << r.DISTSPELL + data << r.CITYID + data << r.DISTCODE + data << r.SEQ + data << r.DISTTYPE + data << r.REMARK + data << r.CREATETIME + data << r.UPDATETIME + data << r.SOURCECODE + allRows << data + }); + def curDate = DateUtils.formatDateByPattern(new Date(), "yyyyMM")+"18" + def fileName = "/ccb/MODEL_000000_000000_BIGDATA_DISTRICT_FJW_${curDate}_0001.dat" + if(CommonDatautils.isWindow()){ + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\BIGDATA_DISTRICT_FJW_${curDate}_0001.dat" + } + FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false); + } + +} diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/YouDaDataParser.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/YouDaDataParser.groovy index d9bf28e40..3a182be6a 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/YouDaDataParser.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/YouDaDataParser.groovy @@ -48,11 +48,11 @@ class YouDaDataParser { def final AtomicInteger count_ = new AtomicInteger(0) - static def statDate = "2021-08-01" + static def statDate = "2021-09-01" static main(args) { def task = new YouDaDataParser(); // task.newHouseparse();//友达一手房存入mongo -// task.esfParser();//友达二手房存入mongo + task.esfParser();//友达二手房存入mongo // task.newhouseToSaveEs();//新房保存到es task.esfhouseToSaveEs();//二手房保存到es // task.updateFinishDateByEsfTrade();//根据二手成交的竣工时间修改seaweed库中的竣工时间 @@ -285,7 +285,7 @@ class YouDaDataParser { def esfParser(){ - def files = ["D:\\数据\\友达\\2021年9月\\二手房\\查询1.DBF"] + def files = ["D:\\数据\\友达\\2021年10月\\二手房\\查询1.DBF"] def datas = [] for(def fileName : files){ def rows = readDBF(fileName); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy index 7d7f43a1c..3e4981856 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy @@ -22,7 +22,7 @@ class FileUtils { if(headers){ sb.append(headers.join("|@|")) - sb.append(System.getProperty("line.separator")); + sb.append("\n"); } out.write(sb.toString().getBytes(charset)); @@ -33,7 +33,7 @@ class FileUtils { if(row){ index++ sb.append(StringUtils.join(row.toArray(), "|@|")) - sb.append(System.getProperty("line.separator")); + sb.append("\n"); if(index%10000==0){ println index+"开始写入CSV "+new Date().toLocaleString() From 0a5b6e2854bd3b6ccca733345335cb35d2eb144a Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 26 Oct 2021 10:51:06 +0800 Subject: [PATCH 35/46] =?UTF-8?q?=E5=AF=BC=E6=88=BF=E6=BA=90=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/ccbevaluation/ExportOracleData.groovy | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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 fac7f79f8..7720d8f2b 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 @@ -28,13 +28,11 @@ class ExportOracleData { // exportBigdataCommunity() exportBigdataForsale() - // exportGuidedPrice() // exportCommunityGuidedPrice() // exportBigdataDeal() // exportThirdPartyPrice() - // exportAvmEvaluationGJNB() // exportAVMEvaluationItemGJNB() // exportCommunityBasePrice() @@ -77,7 +75,7 @@ class ExportOracleData { def exportBigdataPoiData() { - def sql = "select CITYID, DISTID, ID, POI_NAME, TYPE, TYPE_CODE, LATITUDE, LONGITUDE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from bigdata_poi_gj where cityId in (350200,150100)"; + def sql = "select CITYID, DISTID, ID, POI_NAME, TYPE, TYPE_CODE, LATITUDE, LONGITUDE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, SOURCECODE from bigdata_poi_gj"; def allRows = [] sqlInstance.eachRow(sql, { r -> def data = [] @@ -138,7 +136,7 @@ class ExportOracleData { } def exportCommunityBuileType() { - def sql = "select CITYID, COMMID, BUILDTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, WORKDATE from bigdata_commbuildtype_gj where CITYID in (350200,150100)"; + def sql = "select CITYID, COMMID, BUILDTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE, WORKDATE from bigdata_commbuildtype_gj"; def allRows = [] sqlInstance.eachRow(sql, { r -> def data = [] @@ -167,7 +165,7 @@ class ExportOracleData { def exportBigdataDistrictData() { - def sql = "select DISTID, DISTNAME, DISTSPELL, CITYID, DISTCODE, SEQ, DISTTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE, LJXZQH, LJXZQHDM, XZQHDM, WORKDATE from bigdata_district_gj where cityId in (350200,150100)"; + def sql = "select DISTID, DISTNAME, DISTSPELL, CITYID, DISTCODE, SEQ, DISTTYPE, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE, LJXZQH, LJXZQHDM, XZQHDM, WORKDATE from bigdata_district_gj"; def allRows = [] sqlInstance.eachRow(sql, { r -> def data = [] @@ -204,7 +202,7 @@ class ExportOracleData { def exportGuidedPrice() { - def sql = "select ID, COMMID, COMMNAME, CITYID, CITYNAME, DISTID, DISTNAME, to_char(DEALDATE,'yyyy-mm-dd') as DEALDATE,AVG_PRICE, GUIDING_PERSON, REMARK, to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME ,SOURCECODE from guided_price_gj where dealdate>=TO_DATE('2021-08-01', 'yyyy-MM-dd') and dealdate def data = [] @@ -469,9 +467,9 @@ class ExportOracleData { 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}_0003.dat" + def fileName = "/home/goojia/ccb/MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" if(CommonDatautils.isWindow()){ - fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0003.dat" + fileName = "D:\\数据\\建行\\房产估值\\数据文件\\txt\\${curDate}\\MODEL_000000_000000_BIGDATA_FORSALE_GJ_ADD_${curDate}_0001.dat" } def headers = []//["城市ID","出售ID","挂牌房屋ID","城市名称","行政区ID","行政区名称","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","单价","总价","出售付款方式","所在楼层","总楼层","建筑类型","室内结构","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","朝向","装修情况","是否有电梯","几梯几户","发布时间","到期时间","是否首发","房源数据来源","中介公司ID","中介公司名称","发布人","发布人电话","描述信息","备注","创建时间","更新时间","来源公司","附加信息"] for(def city : citys){ From 8488257b10c08207bdd98a8180bd5dff36aaf086 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 26 Oct 2021 16:48:05 +0800 Subject: [PATCH 36/46] update --- .../script/ccbevaluation/ExportOracleData.groovy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 7720d8f2b..8903b149b 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 @@ -26,12 +26,13 @@ class ExportOracleData { // exportCommunityBuileType() // exportBigdataDistrictData() // exportBigdataCommunity() - exportBigdataForsale() - // exportGuidedPrice() -// exportCommunityGuidedPrice() -// exportBigdataDeal() + exportBigdataForsale() // exportThirdPartyPrice() +// exportBigdataDeal() + +// exportCommunityGuidedPrice() + // exportAvmEvaluationGJNB() // exportAVMEvaluationItemGJNB() @@ -477,7 +478,7 @@ class ExportOracleData { def sql = "select CITYID,FORSALEID,PROPCODE,CITYNAME,DISTID,DISTNAME,COMMID,COMMNAME, BUILDID,BUILDNO, BUILDNAME,UNITID,UNITNO,UNITNAME,HOUSEID,ADDRESS,BUILDYEAR,PROPTYPE,PROPYEARS,UNITPRICE,TOTALPRICE,PAYTYPE,FLOORNUM,FLOORCNT,\n" + " BUILDTYPE, HOUSESTRU,BUILDSTRU,BUILDAREA,LIVINGAREA,HOUSESTYLE,ROOMCNT,LIVINGROOMCNT,KITCHENCNT, BATHROOMCNT,HOUSEASPECT,FITMENT,IFELEVATOR,ELEVATORHOUSE,to_char(PUBLISHTIME,'yyyy-mm-dd hh24:mi:ss') as PUBLISHTIME,to_char(EXPIRETIME,'yyyy-mm-dd hh24:mi:ss') as EXPIRETIME,\n" + - " IFFIRST,DATASOURCE,AGENCYID,AGENCYNAME,PUBLISHER,PHONE,DESCRIPTION,REMARK,to_char(CREATETIME,'yyyy-mm-dd hh24:mi:ss') as CREATETIME, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME,SOURCECODE,ATTACH from bigdata_forsale_gj where cityId=${cityCode} and PUBLISHTIME>=TO_DATE('2021-10-01', 'yyyy-MM-dd') and PUBLISHTIME From 1648e753bdeb65fb08547c43191dcf4979374ff4 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 27 Oct 2021 14:36:25 +0800 Subject: [PATCH 37/46] =?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 166ca8f710f26b36fcb4b59df87606a981b3b8ee Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 27 Oct 2021 22:18:48 +0800 Subject: [PATCH 38/46] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=8A=A5=E5=91=8A=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/weiXinEvaluation/report.ftl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl index e5d379a4f..13c360f37 100644 --- a/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl +++ b/projects/fangjia-open/src/main/webapp/weiXinEvaluation/report.ftl @@ -366,11 +366,11 @@ - <#if role?? && role!=17> - - + + +

From bc87a186c55c6cc05ee43e1c59777f9d57f57bc6 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 28 Oct 2021 19:21:01 +0800 Subject: [PATCH 39/46] =?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 658c227d8c88980f689d82ab33044884e722b689 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 1 Nov 2021 10:46:07 +0800 Subject: [PATCH 40/46] =?UTF-8?q?=E5=85=AC=E5=8F=B8=E7=AE=80=E4=BB=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/fangjia-coresite/src/main/webapp/company/about.ftl | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/fangjia-coresite/src/main/webapp/company/about.ftl b/projects/fangjia-coresite/src/main/webapp/company/about.ftl index 0f386bf92..7772ed47d 100644 --- a/projects/fangjia-coresite/src/main/webapp/company/about.ftl +++ b/projects/fangjia-coresite/src/main/webapp/company/about.ftl @@ -54,7 +54,6 @@

鎴夸环缃戞垚绔嬩簬2006骞达紝闅跺睘浜庝笂娴蜂及瀹剁綉缁滅鎶�鏈夐檺鍏徃锛岃嚧鍔涗簬寤虹珛涓浗棰嗗厛鐨勬埧浜уぇ鏁版嵁搴揅PDB鍙婃帹鍔ㄥ熀浜庡湴鐞嗕綅缃殑浜哄伐鏅鸿兘鐨勫彂灞曞拰搴旂敤銆傚叕鍙镐互鈥滃彂鐜板湴鍧�浠峰�尖�濅负浣垮懡锛屽缁堢鎵垮瑙備弗璋ㄧ殑鎬佸害涓烘斂搴溿�侀摱琛屻�侀噾铻嶆満鏋勭瓑瀹㈡埛鎻愪緵澶ф暟鎹�佸缓妯°�佸挩璇㈢瓑鏈嶅姟銆傜洰鍓嶏紝鎵�绉疮鐨勬埧浜ф暟鎹凡瑕嗙洊鍏ㄥ浗367涓煄甯傚強鍦板尯锛屾妧鏈姏閲忓己澶э紝瀹㈡埛鏌ヨ閲忚涓氶鍏堛��

鍏徃鍦ㄨ捶鍓嶄及鍊笺�佸唴璇勭郴缁熴�佽捶鍚庢壒閲忓浼般�佷俊璐锋巿淇°�佸湴鍧�鍙嶆璇堛�佹暟鎹不鐞嗐�佺簿鍑嗚惀閿�绛夐鍩熼兘鏈夌潃涓板瘜鐨勭粡楠岋紝鎷ユ湁澶氶」涓撳埄锛岃璇勪负楂樻柊鎶�鏈紒涓氾紝璧㈠緱浜嗗浗瀹剁粺璁″眬銆佸缓璁鹃摱琛屻�佸啘涓氶摱琛屻�佸钩瀹夐泦鍥€�佸井浼楅摱琛岀瓑浼楀瀹㈡埛鐨勪俊璧栥��

-

2020骞达紝鍗椾含涓夋偊缃戠粶绉戞妧鏈夐檺鍏徃涓庢垜鍙歌揪鎴愬叏闈㈡垬鐣ュ悎浣滐紝骞舵帴鍙楁垜鍙稿鎵橈紝鍏ㄦ潈璐熻矗鎴戝徃浜у搧鎵嬫満鐗堚�滄埧浠风綉鈥濆叕浼楀彿鍜岀數鑴戠増鐨勨�滄埧浠烽�氣�濈殑甯傚満鎺ㄥ箍銆佸鎴峰紑鍙戜笌鍞悗鏈嶅姟锛涙湁鏉冪洿鎺ヤ笌瀹㈡埛绛捐涓婅堪浜у搧鐨勯攢鍞悎鍚岋紱鎴戝徃瀵瑰叾鎵�鏈夌敤鎴峰叏闈㈡彁渚涗骇鍝佸崌绾с�佹暟鎹洿鏂板強绾夸笂鍞悗绛夋湇鍔°��

鏁版嵁涓哄ぇ浼楁湇鍔�
From adef6f1ca8dfb79bb39d04e8f382b1b52f2430f8 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 1 Nov 2021 12:00:09 +0800 Subject: [PATCH 41/46] =?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 42/46] =?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 43/46] =?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 44/46] =?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'>