diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java b/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java
index a24864225..509490d97 100644
--- a/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java
+++ b/projects/fangjia-core/src/main/java/com/fangjia/core/util/ExcelUtil.java
@@ -58,7 +58,7 @@ public class ExcelUtil {
row.setHeightInPoints(35);
Font font = workBook.createFont();
font.setFontName("宋体");
- font.setBoldweight(Font.BOLDWEIGHT_BOLD);
+ // font.setBoldweight(Font.BOLDWEIGHT_BOLD);
font.setFontHeightInPoints((short) 12);
CellStyle cellStyle = workBook.createCellStyle();
cellStyle.setFont(font);
diff --git a/projects/fangjia-script/pom.xml b/projects/fangjia-script/pom.xml
index bcebb2b2b..c71006bb8 100644
--- a/projects/fangjia-script/pom.xml
+++ b/projects/fangjia-script/pom.xml
@@ -366,14 +366,14 @@
org.apache.poi
poi
- 3.17
-
+
+ 3.10-FINAL
org.apache.poi
poi-ooxml
- 3.17
-
+
+ 3.10-FINAL
xml-apis
diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy
index a9ea036ef..29e3ac2a4 100644
--- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy
+++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataBuildingBatch.groovy
@@ -22,7 +22,8 @@ class BigdataBuildingBatch extends BaseBatch{
@Override
public void process(Object args) {
- def citys = CcbCommonUtils.citys;
+ //def citys = CcbCommonUtils.citys;
+ def citys = ["苏州","北京","广州","杭州","合肥","深圳","石家庄","武汉","西安","重庆"]
def rows = []
def headers = []
for (def city : citys) {
diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommbuildtypeBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommbuildtypeBatch.groovy
index 172aa4c7a..b59fe435b 100644
--- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommbuildtypeBatch.groovy
+++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommbuildtypeBatch.groovy
@@ -41,7 +41,7 @@ class BigdataCommbuildtypeBatch extends BaseBatch{
rets.addAll(rows)
println city +" "+rows.size()
}
- def headers = ["城市ID","小区ID"," 建筑类型","备注","创建时间","更新时间","来源公司","数据时间"]
+ def headers = []//["城市ID","小区ID"," 建筑类型","备注","创建时间","更新时间","来源公司","数据时间"]
FileUtils.batchCreateFile(rets, "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMBUILDTYPE_GJ.dat",headers, "utf-8", false);
println "txt 生成"
diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommunityBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommunityBatch.groovy
index 6e470ce2c..6241cc73b 100644
--- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommunityBatch.groovy
+++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/BigdataCommunityBatch.groovy
@@ -35,7 +35,7 @@ class BigdataCommunityBatch extends BaseBatch{
@Override
public void process(Object args) {
- def citys = CcbCommonUtils.citys;
+ def citys = ["苏州","北京","广州","杭州","合肥","深圳","石家庄","武汉","西安","重庆"]// CcbCommonUtils.citys;
def rows = []
def headers = []//["城市ID","行政区ID","小区ID","行政区名称","小区名称","详细地址","纬度","经度","占地总面积","建筑总面积","绿化率","容积率","车位数量","建筑年代","房屋用途",
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 dd5cb0d0b..421c1caa8 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
@@ -67,17 +67,17 @@ class BigdataForsaleBatch extends BaseBatch{
@Override
public void process(Object args) {
def index = 0
- def citys = ["苏州","杭州"]//CcbCommonUtils.citys;
+ def citys = CcbCommonUtils.citys;
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
for(def city : citys){
index++
// def distIds = getDistrictIds(cityCodeDataMap.get(city))
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
def districts = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "lng","estate_type2","name_cat","address", "alias", "finish_building_date", "house_property", "property_life", "build_type", "build_structure"]);
-// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20211019, 20211118);
- // exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20210801, 20210831);
+ exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20211118, 20211219);
+// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20210801, 20210831);
//测试通过匹配接口配房源效果
- exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118)
+// exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118)
}
}
@@ -97,8 +97,8 @@ class BigdataForsaleBatch extends BaseBatch{
totalCount.addAndGet(1)
def commId = rMap.get("_id").toString()
- //def ret = findHouses(city, rMap.region, "sell", startDate,endDate, rMap.name, rMap.alias)
- def ret = findHousesByDistId(city, commId, "sell", startDate,endDate)
+ def ret = findHouses(city, rMap.region, "sell", startDate,endDate, rMap.name, rMap.alias)
+ //def ret = findHousesByDistId(city, commId, "sell", startDate,endDate)
// if(ret && ret.size()<100){//导历史房源需要,以后不需要
// ret = findHouses(city, rMap.region, "sell", 20190701, endDate, rMap.name, rMap.alias)
// }
diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy
index 6aabf6064..0564c1f41 100644
--- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy
+++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/Test.groovy
@@ -267,18 +267,20 @@ def youdaDeal(youda_esfhouse_coll, def city, def region, def name, def area, def
// }
//},0)
-
-ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\分期数据删除_3144.xlsx",{d->
- if(d['A']){
- def udata = new BasicDBObject()
- udata.put("name_cat", 9)
- udata.put("m_date",new Date())
-
- def q = new BasicDBObject()
- q.put("_id", new ObjectId(d['A']))
- DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
- }
-},0)
+//def index = 0
+//ExcelUtils.modify("D:\\数据\\建行\\房产估值\\小区\\第四批需要删除的数据.xlsx",{d->
+// if(d['A']){
+// def udata = new BasicDBObject()
+// udata.put("name_cat", 11)
+// udata.put("m_date",new Date())
+//
+// def q = new BasicDBObject()
+// q.put("_id", new ObjectId(d['A']))
+// DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
+// index++
+// println index
+// }
+//},0)
//ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\价格过滤的小区.xlsx",{d->
@@ -298,79 +300,79 @@ ExcelUtils.multiThreadingModify("D:\\
//},0)
-//def index = 0
-//ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\新增别名数据_3788.xlsx",{d->
-// if(d['A']){
-// def dist = CommonDatautils.findDistrictById(d['A'])
-// if(dist){
-//
-// def alias = []
-// if(d['H'] && d['H']!=dist.name){
-// alias << d['H']
-// if(d['H'].contains("·")){
-// alias << d['H'].replace("·", "")
-// }
-// if(dist.alias){
-// for(def aliasName : dist.alias){
-// if(!alias.contains(aliasName)){
-// alias << aliasName
-// }
-// }
-// }
-// }
-//
-// def address = null
-// if(d['I']){
-// address = AddressUtil.formatAddress(dist.city, d['I'])
-// }
-//
-// Long lng = null
-// Long lat = null
-// Long lat2 = null
-// Long lng2 = null
-// if(d['J']){
-// lng = d['J'].toString().toDouble() * 10000000000l;
-// lat = d['K'].toString().toDouble() * 10000000000l;
-// def json = BaiDuApiUtils.geoconv(d['J'].toString().toDouble(), d['K'].toString().toDouble(), 3)
-// if(json != null && json.containsKey("x")) {
-// lat2 = json.get("y") * 10000000000l
-// lng2 = json.get("x") * 10000000000l
-// }
-// }
-//
-// def region = null
-// if(dist.region!=d['F']){
-// region = dist.region
-// }
-//
-// def udata = new BasicDBObject()
-// if(region){
-// udata.put("region", region)
-// }
-//
-// if(address){
-// udata.put("address", address)
-// }
-// if(lat2){
-// udata.put("lng", lng)
-// udata.put("lat", lat)
-// udata.put("lng2", lng2)
-// udata.put("lat2", lat2)
-// }
-//
-// if(alias){
-// udata.put("alias", alias)
-// }
-// if(udata){
-// index++
-// DbUtils.seaweed.update(new BasicDBObject("_id", dist._id), new BasicDBObject('$set', udata))
-// println index+ " "+dist.city +" "+dist.name+" "+udata
-// }
-//
-// }
-// }
-//
-//},0)
+def index = 0
+ExcelUtils.multiThreadingModify("D:\\数据\\建行\\房产估值\\小区\\重庆反查数据_669(审核完毕).xlsx",{d->
+ if(d['A']){
+ def dist = CommonDatautils.findDistrictById(d['A'])
+ if(dist){
+
+ def alias = []
+ if(d['H'] && d['H']!=dist.name){
+ alias << d['H']
+ if(d['H'].contains("·")){
+ alias << d['H'].replace("·", "")
+ }
+ if(dist.alias){
+ for(def aliasName : dist.alias){
+ if(!alias.contains(aliasName)){
+ alias << aliasName
+ }
+ }
+ }
+ }
+
+ def address = null
+ if(d['I']){
+ address = AddressUtil.formatAddress(dist.city, d['I'])
+ }
+
+ Long lng = null
+ Long lat = null
+ Long lat2 = null
+ Long lng2 = null
+ if(d['J']){
+ lng = d['J'].toString().toDouble() * 10000000000l;
+ lat = d['K'].toString().toDouble() * 10000000000l;
+ def json = BaiDuApiUtils.geoconv(d['J'].toString().toDouble(), d['K'].toString().toDouble(), 3)
+ if(json != null && json.containsKey("x")) {
+ lat2 = json.get("y") * 10000000000l
+ lng2 = json.get("x") * 10000000000l
+ }
+ }
+
+ def region = null
+ if(dist.region!=d['F']){
+ region = dist.region
+ }
+
+ def udata = new BasicDBObject()
+ if(region){
+ udata.put("region", region)
+ }
+
+ if(address){
+ udata.put("address", address)
+ }
+ if(lat2){
+ udata.put("lng", lng)
+ udata.put("lat", lat)
+ udata.put("lng2", lng2)
+ udata.put("lat2", lat2)
+ }
+
+ if(alias){
+ udata.put("alias", alias)
+ }
+ if(udata){
+ index++
+ DbUtils.seaweed.update(new BasicDBObject("_id", dist._id), new BasicDBObject('$set', udata))
+ println index+ " "+dist.city +" "+dist.name+" "+udata
+ }
+
+ }
+ }
+
+},0)
diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/CcbDistrictToDB.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/CcbDistrictToDB.groovy
new file mode 100644
index 000000000..6ee9f1f56
--- /dev/null
+++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/CcbDistrictToDB.groovy
@@ -0,0 +1,137 @@
+package com.fangjia.script.ccbevaluation.data
+
+import com.fangjia.core.RegionData
+import com.fangjia.core.util.BaiDuApiUtils
+import com.fangjia.core.util.GeoUtils
+import com.fangjia.script.commData.CommonDatautils
+import com.fangjia.script.linxsh.util.AddressUtil
+import com.fangjia.script.util.ABuYunUtil
+import com.fangjia.script.util.DbUtils
+import com.fangjia.script.util.ExcelUtils
+import com.fangjia.script.util.GeoHelper
+import com.mongodb.BasicDBObject
+
+class CcbDistrictToDB {
+
+ static main(args) {
+ def task = new CcbDistrictToDB();
+ task.run()
+ }
+
+ def run(){
+ def files = ["北京融合匹配_1215.xlsx","广州融合匹配_1215.xlsx","杭州融合匹配_1216.xlsx","合肥融合匹配_1216.xlsx","深圳融合匹配_1215.xlsx","石家庄融合匹配_1216.xlsx","苏州融合匹配_1216.xlsx","武汉融合匹配_1216.xlsx","西安融合匹配_1216.xlsx","重庆融合匹配_1215.xlsx"]
+ def index = 0
+ for(def f : files){
+ ExcelUtils.modify("D:\\数据\\建行\\房产估值\\小区\\融合\\10个城市新增小区\\" + f, { d ->
+// if(d['I']=="棠德花苑新社区"){
+ def city = d['A']
+ def region = d['C']
+ def newRegion = RegionData.formatRegion(city, region)
+ if(newRegion){
+
+ def name = ""
+ def alias = []
+ if(d['I']){
+ name = nameFileter(d['I'])
+ if(name != d['I']){
+ alias << d['I']
+ }
+ }
+ if(name){
+ if(d['D']!=name && !alias.contains(d['D'])){
+ alias << d['D']
+ }
+ }else{
+ name = d['D']
+ }
+
+ def formatAddress = null
+ if(d['J']){
+ formatAddress = AddressUtil.formatAddress(d['A'], d['J'])
+ }
+ if(!formatAddress && d['E']){
+ formatAddress = AddressUtil.formatAddress(d['A'], d['E'])
+ }
+
+ Long glat = null
+ Long glng = null
+ Long blat = null
+ Long blng = null
+ if(d['K']){
+ glat = d['K'].toString().toDouble() * 10000000000L
+ glng = d['L'].toString().toDouble() * 10000000000L
+ def baidu = BaiDuApiUtils.geoconv(d['L'].toString().toDouble(), d['K'].toString().toDouble(), 3)
+ blng = baidu.x * 10000000000L
+ blat = baidu.y * 10000000000L
+ }else{
+ if(d['F']){
+ def loactionMap = GeoUtils.gps84ToGcj02(d['F'], d['G'])
+ def lat = null
+ def lng = null
+ if(loactionMap){
+ lng = com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lng,6)
+ lat = com.fangjia.core.util.DataUtil.roundDouble(loactionMap.lat, 6)
+ }
+ def LatLon = GeoHelper.GetLatLon(lat, lng, 0.01, 180);
+ def distance = GeoHelper.GetDistance(lat, lng, LatLon.Lat, LatLon.Lon)
+
+ glat = com.fangjia.core.util.DataUtil.roundDouble(LatLon.Lat, 6) * 10000000000L
+ glng = com.fangjia.core.util.DataUtil.roundDouble(LatLon.Lon, 6) * 10000000000L
+ def baidu = BaiDuApiUtils.geoconv(LatLon.Lon, LatLon.Lat, 3)
+ blng = baidu.x * 10000000000L
+ blat = baidu.y * 10000000000L
+ }
+ }
+
+ def estateType2 = "普通住宅"
+ if(name.contains("别墅")){
+ estateType2 = "别墅"
+ }else if(name.contains("商住")){
+ estateType2 = "商住"
+ }
+
+ if(name){
+ def dist = CommonDatautils.findDistrict(d['A'], newRegion, name, "district")
+ if(!dist){
+ def data = new BasicDBObject();
+ data.put("name_cat",0)
+ data.put("status",0)
+ data.put("cat","district")
+ data.put("c_date", new Date())
+ data.put("m_date", new Date())
+ data.put("city", d['A'])
+ data.put("region",newRegion)
+ data.put("name", name)
+ data.put("estate_type2",estateType2)
+ data.put("address", formatAddress)
+ if(glat){
+ data.put("lat",glat)
+ data.put("lng",glng)
+ data.put("lat2",blat)
+ data.put("lng2",blng)
+ }
+ if(alias){
+ data.put("alias",alias)
+ }
+
+ def markMap = [:]
+ markMap.put("data_source", "机器入库")
+ data.put("mark_map",markMap)
+ index++
+ DbUtils.seaweed.save(data);
+ println index+" "+data
+ }
+ }
+ }
+// }
+ },0);
+ }
+ }
+
+ def nameFileter(def name){
+ name = name.replace("·","").replace(".","").replace("|","")
+ name = name.replace("1期","一期").replace("2期","二期").replace("3期","三期").replace("4期","四期").replace("5期","五期").replace("6期","6期")
+ name = name.replace("1区","一区").replace("2区","二区").replace("3区","三区").replace("4区","四区").replace("5区","五区").replace("6区","六区")
+ return name;
+ }
+}
diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy
new file mode 100644
index 000000000..88156feec
--- /dev/null
+++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/data/DistrictMarge.groovy
@@ -0,0 +1,150 @@
+package com.fangjia.script.ccbevaluation.data
+
+import com.fangjia.script.commData.CommonDatautils
+import com.fangjia.script.linxsh.util.AddressUtil
+import com.fangjia.script.util.DbUtils
+import com.fangjia.script.util.ExcelUtils
+import com.mongodb.BasicDBObject
+import org.apache.poi.ss.util.RegionUtil
+import org.bson.types.ObjectId
+import com.fangjia.core.util.BaiDuApiUtils
+
+class DistrictMarge {
+ static main(args) {
+ def task = new DistrictMarge()
+ task.run()
+ }
+
+ def run(){
+ def rets = getDatas()
+ def deleteIndex = 0
+ def updateIndex = 0
+ rets.each{amap_id, valus->
+ def updateObj = null
+ def addAlias = []
+ String formatAddress = null
+ Long lat2 = null
+ Long lng2 = null
+ Long lat = null
+ Long lng = null
+ def amapName = null
+ for(def i=0;i
+ Collections.sort(v,new Comparator