From 21c6acfeb0d807ffdc304a3ec43c98a77994a3c9 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 14 Jul 2023 13:23:21 +0800 Subject: [PATCH 01/19] 200-100 --- .../main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy index ec8b35d44..c315c404e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy @@ -29,7 +29,7 @@ class RemoveHouse extends BaseBatch{ def rets = [] for(def d : dbcursor){ rets << d._id - if(rets.size()==200){ + if(rets.size()==100){ def delquery = new BasicDBObject() delquery.put("_id", new BasicDBObject('$in', rets)) SEABIRD_COLL.remove(delquery) From d87b14e611e34f6af983bf734ac059ae657f9dcb Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 14 Jul 2023 15:07:15 +0800 Subject: [PATCH 02/19] update bug --- .../fangjia/script/fuzhou/DistrictPriceExportBatch.groovy | 1 + .../src/main/groovy/com/fangjia/script/fuzhou/Test1.groovy | 2 +- .../fangjia/script/gj/district/OfficeFieldCleanBatch.groovy | 4 ++-- .../fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy index dd6f1e2dc..2dbc3b908 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy @@ -291,6 +291,7 @@ class DistrictPriceExportBatch extends BaseBatch{ o.put("name", r[4]) o.put("avg_price", r[5].toInteger()) o.put("month", r[6].toInteger()) + o.put("c_date", new Date()) FZ_DISTRICT_STAT_COLL.save(o) } } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test1.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test1.groovy index 63211976b..2220e87ab 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test1.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test1.groovy @@ -14,7 +14,7 @@ import com.mongodb.DBCollection //福州第三方均价统计,发送钉钉消息 //def datas = ExcelUtils.read("d:\\数据\\福州\\福州4月2.xlsx",0,1) //def datas = CsvUtils.read("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202105.csv"); -def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202305.csv") +def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202306.csv") def count0 = 0 def count1 = 0 def count2 = 0 diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy index af011e88f..1db9e589e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy @@ -73,7 +73,7 @@ class OfficeFieldCleanBatch extends BaseBatch{ // addFieldValue() -// updateErrorField() + updateErrorField() export() test() // addOffice() @@ -214,7 +214,7 @@ class OfficeFieldCleanBatch extends BaseBatch{ // if(o.estate_charge && !o.estate_charge.isNumber()){ //// def val = o.estate_charge.toString().toDouble() -//// if(val>40 || val < 0.01){ +//// if(val>60 || val < 0.35){ //// println val // udata.put("estate_charge", null) //// } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy index 8379df446..f79d9ac1a 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy @@ -92,7 +92,7 @@ class DataStandardBatch extends BaseBatch{ cityMap.each{city,alias-> println "开始加载【${city}】" -// if(city == "广州"){ +// if(city == "福州"){ def detailMap = CommonDatautils.findAllCityDistrictNameAndAlias(city, "district", ["city","region","name","address","alias","addr_alias","mapping_alias","estate_type2"]) districtMap.putAll(detailMap) // } @@ -159,6 +159,7 @@ class DataStandardBatch extends BaseBatch{ count++; }catch (Exception e){ + e.printStackTrace() println "处理:【${dbo.city}-${dbo.region}-${dbo.name}-${dbo.address}】发生异常,异常信息为:"+e.getMessage() }finally { @@ -835,7 +836,7 @@ class DataStandardBatch extends BaseBatch{ } } } - if(!dbo && isStandardRoad(copyObj.address)){ + if(!dbo && copyObj.address && isStandardRoad(copyObj.address)){ result = findAddrAliasFromMap(copyObj.city, copyObj.region, copyObj.address); if(result.size()==1){ dbo = result[0]; From e04fbd86fe13a4ffb2a3db459943cb2bf2f2fdaa Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 14 Jul 2023 16:09:12 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/open/controllers/GuzhiController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GuzhiController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GuzhiController.java index 870dda5e3..d4f0a3311 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GuzhiController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GuzhiController.java @@ -4,6 +4,8 @@ import java.util.Date; import javax.validation.Valid; +import com.fangjia.dal.sql.model.User; +import com.fangjia.service.sql.UserService; import org.apache.commons.lang.StringUtils; import org.bson.types.ObjectId; @@ -39,6 +41,7 @@ public class GuzhiController { private EvaluationService evaluationService; private SmsService smsService; private DistrictService districtService; + private UserService userService; private static final String DING_MSG_ROBOT_ID = "58c62a54d92790b58177c6d6"; @@ -150,7 +153,9 @@ public class GuzhiController { UniversalDto dto = UniversalDto.newDto(); dto.append("caseId", model.getCaseId()); mv.setModel(BasicModel.buildOKModel().setResult(dto)); - String msg = "【房价网-人工估值】接收到新的人工询价,请求请及时处理!城市:" + evaluation.getCity() + + User user = userService.findById(token.getUserId()); + String msg = "【房价网-人工估值】客户: "+user.getDisplayName()+" 提交新的人工询价,请求请及时处理!城市:" + evaluation.getCity() + " 区域:" + evaluation.getRegion() + " 小区名:" + evaluation.getDistrictName(); DingDingMessageUtil.sendTextMessage("065f4a05d5f87eb39a9f9e048eeefb80c1f7560446f8926441de80453c160c60", msg); return mv; @@ -183,4 +188,8 @@ public class GuzhiController { public void setDistrictService(DistrictService districtService) { this.districtService = districtService; } + + public void setUserService(UserService userService) { + this.userService = userService; + } } From 7d1ee1a59ce2925c1d753198a3335541aa0426ef Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 14 Jul 2023 18:43:22 +0800 Subject: [PATCH 04/19] update --- .../fangjia/script/fuzhou/DistrictSellStatBatch.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy index 644156419..cce1de4df 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy @@ -62,7 +62,7 @@ class DistrictSellStatBatch extends BaseBatch { def calcMonthlyPrice(){ //只有福州使用tob价格 def citys = CommonUtils.findAllCity() - def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1) + def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1).append("status", 1) def lastMonthWeekend = DateUtils.truncateDay(DateUtils.getLastSundayInWeekOfLastMonth(new Date())) @@ -169,6 +169,10 @@ class DistrictSellStatBatch extends BaseBatch { if(lastYearPriceObj){ yoy = DataUtil.roundDouble(((curPrice - lastYearPriceObj.avg_price)/(double)lastYearPriceObj.avg_price),4) } + + if(dist.status==1){ + curPrice = 0 + } if(curPriceObj){ if(curPrice!=weekendPriceObj.avg_price){ def data = new BasicDBObject() @@ -232,7 +236,7 @@ class DistrictSellStatBatch extends BaseBatch { def priceMap = [:] for(def d : dbcursor){ if(city == "福州"){ - if(d.avg_price_2b){ + if(d.avg_price_2b && d.value_type!=1){ d.avg_price = d.avg_price_2b } } From 834c271b7d7ba2839384dce0d581df55b8b303c5 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 14 Jul 2023 22:19:33 +0800 Subject: [PATCH 05/19] 100-50 --- .../src/main/groovy/com/fangjia/script/fuzhou/Test.groovy | 5 ++++- .../fangjia/script/gj/district/OfficeFieldCleanBatch.groovy | 4 ++-- .../groovy/com/fangjia/script/gj/house/RemoveHouse.groovy | 2 +- .../com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy | 4 ++-- .../com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test.groovy index aa277adde..b0ce64f12 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/Test.groovy @@ -239,7 +239,10 @@ def findThirdPrice(city, region, name, AVERAGE_STATISTICS){ def files = CommonDatautils.getAllFiles("D:\\数据\\福州\\原始数据") if(files){ for(def filepath : files){ - def rets = read(filepath); + def filename = filepath.getPath() + def rets = read(filename); + def date = filename.substring(filename.toString().lastIndexOf("_")+1, filename.toString().indexOf(".")) + println date +" "+rets.size() } } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy index 1db9e589e..44e6641d4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy @@ -73,7 +73,7 @@ class OfficeFieldCleanBatch extends BaseBatch{ // addFieldValue() - updateErrorField() +// updateErrorField() export() test() // addOffice() @@ -120,7 +120,7 @@ class OfficeFieldCleanBatch extends BaseBatch{ } def test(){ - def datas = ExcelUtils.read("D:\\数据\\写字楼\\写字楼价格租金.xlsx",0 , 1) + def datas = ExcelUtils.read("D:\\数据\\写字楼\\写字楼价格 (2).xlsx",0 , 1) def map = [:] for(def d : datas){ map.put(d['A']+"#"+d['B']+'#'+d['C'], d) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy index c315c404e..315821223 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/house/RemoveHouse.groovy @@ -29,7 +29,7 @@ class RemoveHouse extends BaseBatch{ def rets = [] for(def d : dbcursor){ rets << d._id - if(rets.size()==100){ + if(rets.size()==50){ def delquery = new BasicDBObject() delquery.put("_id", new BasicDBObject('$in', rets)) SEABIRD_COLL.remove(delquery) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy index 788d1703e..0d031c591 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy @@ -465,9 +465,9 @@ public class BeiKeCrawlByChrome { if(cityEles){ for(def e : cityEles){ def href = "https:"+e.attr("href") - if (citys.contains(e.text())){ +// if (citys.contains(e.text())){ list << [e.text(), href] - } +// } } } return list diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy index 6c0ce91f3..c87a55634 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy @@ -570,7 +570,7 @@ public class LianjiaCrawlByChrome { if(cityEles){ for(def e : cityEles) { def href = e.attr("href") - if (!href.contains("fang.lianjia") && citys.contains(e.text())){ + if (!href.contains("fang.lianjia")){ cityList << [e.text(), href] } } From 329bd3665e920a7b1d8a381634de3dedf782a781 Mon Sep 17 00:00:00 2001 From: "zhaojixiang@fangjia.com" Date: Mon, 17 Jul 2023 11:39:09 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E5=BA=93=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B0=8F=E5=8C=BA=E5=8A=9F=E8=83=BD=EF=BC=9A=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=88=9B=E5=BB=BA=E4=B8=8E=E5=88=AB=E5=90=8D?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E4=B8=80=E8=87=B4=E7=9A=84=E5=B0=8F=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bkoff/controllers/DistrictController.java | 30 +++++++++ .../src/main/webapp/district/add.ftl | 56 +++++++++++----- .../src/main/webapp/district/edit.ftl | 64 +++++++++++++++---- 3 files changed, 121 insertions(+), 29 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java index 659fe43c9..1a233c2de 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java @@ -1185,6 +1185,36 @@ public class DistrictController { model.setJsonModel(data); return model; } + /** + * 校验小区名是否为其他小区的别名 + */ + public Object checkDistrictNameAction(@Param(name = "city") String city, @Param(name = "region") String region, + @Param(name = "name") String name, @Param(name = "cat") String cat, @Param(name = "id") String id) { + JsonModel model = new JsonModel(); + boolean exist = false; + + List list = new ArrayList(); + list.add(name); + List params = new ArrayList(); + params.add(new QueryParam("category", cat)); + params.add(new QueryParam("city", city)); + params.add(new QueryParam("region", region)); + params.add(new QueryParam("alias", name)); + + List ds = districtService.findAllByParams(params); + if (CollectionUtils.isNotEmpty(ds)) { + for (District d : ds) { + if (!d.getId().equals(id)) { + exist = true; + break; + } + } + } + Map data = new HashMap(); + data.put("exist", exist); + model.setJsonModel(data); + return model; + } /** * 保存新增小区 diff --git a/projects/fangjia-bkoff/src/main/webapp/district/add.ftl b/projects/fangjia-bkoff/src/main/webapp/district/add.ftl index 1691f1e94..141a2e8ee 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district/add.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district/add.ftl @@ -851,20 +851,20 @@ function add(){ } } - var mappingAlias = $("#mappingAlias").val(); - if(mappingAlias){ - var aliasArr=alias.toString().split("\n"); - var set=[]; - for(var i=0;i <#assign markMap = district.markMap! />
- + @@ -1116,20 +1116,18 @@ $(document).ready(function(){ alert('鍖哄煙涓嶈兘涓虹┖锛�'); return false; } - - /* + var dLat = $("#dLat").val(); if (dLat == '') { alert('缁忕含搴︿笉鑳戒负绌猴紒'); return false; } - + var dLng = $("#dLng").val(); if (dLng == '') { alert('缁忕含搴︿笉鑳戒负绌猴紒'); return false; } - */ var name = $("#districtName").val(); if (name == '') { @@ -1169,14 +1167,56 @@ $(document).ready(function(){ } } - - /* var address = $("#address").val(); if (address == '') { alert('灏忓尯鍦板潃涓嶈兘涓虹┖锛�'); return false; } - */ + + var id = $("#districtId").val(); + + var flg = false; + jQuery.ajax({ + type: 'POST', + async: false, + url: '../district/validateDistrictName', + data: {city:city,region:region,name:name,cat:"district", id:id}, + dataType: 'json', + timeout: 100000, + success: function(model) { + if(model.exist){ + alert("灏忓尯鍚嶅凡瀛樺湪"); + flg = true; + } + }, + error : function() { + + } + }); + + if(flg){ + return false; + } + + jQuery.ajax({ + type: 'POST', + async: false, + url: '../district/checkDistrictName', + data: {city:city,region:region,name:name,cat:"district",id:id}, + dataType: 'json', + timeout: 100000, + success: function(model) { + if(model.exist){ + alert("灏忓尯鍚嶆槸鍏朵粬灏忓尯鐨勫埆鍚�"); + flg = true; + } + }, + error : function() { + } + }); + if(flg){ + return false; + } jQuery.ajax({ type: 'POST', @@ -1188,15 +1228,15 @@ $(document).ready(function(){ success: function(model) { if (model.msg) { alert('鍒悕涓� "' + model.msg + '" 宸茬粡鏄叾浠栧皬鍖虹殑灏忓尯鍚嶏紝涓嶈兘浣滀负鍒悕浣跨敤锛�'); - return false; - } else { - return true; + flg = true; } }, error : function() { } }); - + if(flg){ + return false; + } return true; }); From 5f51a6f0d76df9d3406dadc2fe78595ca5f8d83c Mon Sep 17 00:00:00 2001 From: "zhaojixiang@fangjia.com" Date: Mon, 17 Jul 2023 13:48:08 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E5=86=99=E5=AD=97=E6=A5=BC=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/district2/addOffice.ftl | 88 +++++----- .../src/main/webapp/district2/editOffice.ftl | 156 +++++++++--------- .../src/main/webapp/district2/officelist.ftl | 9 +- 3 files changed, 131 insertions(+), 122 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/district2/addOffice.ftl b/projects/fangjia-bkoff/src/main/webapp/district2/addOffice.ftl index 207cd11ae..1fc1c9200 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district2/addOffice.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district2/addOffice.ftl @@ -121,28 +121,30 @@ + + - - 寤虹瓚绫诲瀷 - - -
- 绾啓瀛楁ゼ   - 鍟嗗姟涓績   - 閰掑簵鍐欏瓧妤�   - 鍟嗕綇妤�   - 鍟嗗姟缁煎悎浣�   - 鍟嗕笟缁煎悎浣�   -
-
- 鍒涙剰鍥尯   - 鍒涙剰浜т笟鍥尯   - 鐙爧鍐欏瓧妤�   -
- - +<#-- --> +<#-- 寤虹瓚绫诲瀷--> +<#-- --> +<#-- --> +<#--
--> +<#-- 绾啓瀛楁ゼ  --> +<#-- 鍟嗗姟涓績  --> +<#-- 閰掑簵鍐欏瓧妤�  --> +<#-- 鍟嗕綇妤�  --> +<#-- 鍟嗗姟缁煎悎浣�  --> +<#-- 鍟嗕笟缁煎悎浣�  --> +<#--
--> +<#--
--> +<#-- 鍒涙剰鍥尯  --> +<#-- 鍒涙剰浜т笟鍥尯  --> +<#-- 鐙爧鍐欏瓧妤�  --> +<#--
--> +<#-- --> +<#-- --> 鏉垮潡 @@ -150,12 +152,12 @@ - - 鍟嗗湀 - - - - +<#-- --> +<#-- 鍟嗗湀--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 鐜嚎浣嶇疆 @@ -278,12 +280,12 @@ 涓� - - 杞︿綅鎻忚堪 - - - - +<#-- --> +<#-- 杞︿綅鎻忚堪--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 鍦颁笂杞︿綅鏁� @@ -315,12 +317,12 @@ - - 妤煎眰鎯呭喌 - - - - +<#-- --> +<#-- 妤煎眰鎯呭喌--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 鍑�楂� @@ -427,12 +429,12 @@ - - 寮�鐩樻椂闂� - - - - +<#-- --> +<#-- 寮�鐩樻椂闂�--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 绔e伐鏃堕棿 diff --git a/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl b/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl index 8dd9ca8ee..8106e70df 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl @@ -203,36 +203,38 @@ + + - - - <#if markMap?? && markMap["build_type"]?? && markMap["build_type"] == 1> - - <#else> - - - 寤虹瓚绫诲瀷 - - -
- checked >绾啓瀛楁ゼ   - checked>鍟嗗姟涓績   - checked>閰掑簵鍐欏瓧妤�   - checked>鍟嗕綇妤�   - checked>鍟嗗姟缁煎悎浣�   - checked>鍟嗕笟缁煎悎浣�   -
-
- checked>鍒涙剰鍥尯   - checked>鍒涙剰浜т笟鍥尯   - checked>鐙爧鍐欏瓧妤�   -
-
-
- - +<#-- --> +<#-- --> +<#-- <#if markMap?? && markMap["build_type"]?? && markMap["build_type"] == 1>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- 寤虹瓚绫诲瀷--> +<#-- --> +<#-- --> +<#--
--> +<#-- checked >绾啓瀛楁ゼ  --> +<#-- checked>鍟嗗姟涓績  --> +<#-- checked>閰掑簵鍐欏瓧妤�  --> +<#-- checked>鍟嗕綇妤�  --> +<#-- checked>鍟嗗姟缁煎悎浣�  --> +<#-- checked>鍟嗕笟缁煎悎浣�  --> +<#--
--> +<#--
--> +<#-- checked>鍒涙剰鍥尯  --> +<#-- checked>鍒涙剰浜т笟鍥尯  --> +<#-- checked>鐙爧鍐欏瓧妤�  --> +<#--
--> +<#--
--> +<#--
--> +<#-- --> +<#-- --> <#if markMap?? && markMap["block"]?? && markMap["block"] == 1> @@ -246,19 +248,19 @@ - - - <#if markMap?? && markMap["business_quarter"]?? && markMap["business_quarter"] == 1> - - <#else> - - - 鍟嗗湀 - - - - - +<#-- --> +<#-- --> +<#-- <#if markMap?? && markMap["business_quarter"]?? && markMap["business_quarter"] == 1>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- 鍟嗗湀--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> <#if markMap?? && markMap["loop_line_info"]?? && markMap["loop_line_info"] == 1> @@ -499,19 +501,19 @@ - - - <#if markMap?? && markMap["car_site"]?? && markMap["car_site"] == 1> - - <#else> - - - 杞︿綅鎻忚堪 - - - - - +<#-- --> +<#-- --> +<#-- <#if markMap?? && markMap["car_site"]?? && markMap["car_site"] == 1>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- 杞︿綅鎻忚堪--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> <#if markMap?? && markMap["land_car_site"]?? && markMap["land_car_site"] == 1> @@ -581,18 +583,18 @@ - - - <#if markMap?? && markMap["floor_info"]?? && markMap["floor_info"] == 1> - - <#else> - - - 妤煎眰鎯呭喌 - - - - +<#-- --> +<#-- --> +<#-- <#if markMap?? && markMap["floor_info"]?? && markMap["floor_info"] == 1>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- 妤煎眰鎯呭喌--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> <#if markMap?? && markMap["clear_height"]?? && markMap["clear_height"] == 1> @@ -816,18 +818,18 @@ - - - <#if markMap?? && markMap["open_date"]?? && markMap["open_date"] == 1> - - <#else> - - - 寮�鐩樻椂闂� - - - - +<#-- --> +<#-- --> +<#-- <#if markMap?? && markMap["open_date"]?? && markMap["open_date"] == 1>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- 寮�鐩樻椂闂�--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> <#if markMap?? && markMap["finish_building_date"]?? && markMap["finish_building_date"] == 1> diff --git a/projects/fangjia-bkoff/src/main/webapp/district2/officelist.ftl b/projects/fangjia-bkoff/src/main/webapp/district2/officelist.ftl index 961807a3d..5ca872b27 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district2/officelist.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district2/officelist.ftl @@ -42,20 +42,23 @@ <#include "officeHeader.ftl"/>
+ 鍩庡競: <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay" showCountry = "1" /> + 鍖哄煙: - - 绫诲瀷锛� + 绫诲瀷: @@ -345,6 +348,8 @@ + + From 58d62ca674078e19ac71a649a468a1d5b8110d91 Mon Sep 17 00:00:00 2001 From: "zhaojixiang@fangjia.com" Date: Mon, 17 Jul 2023 18:04:35 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E5=86=99=E5=AD=97=E6=A5=BC=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E4=BF=AE=E6=94=B9=20=20=E2=80=9C=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E2=80=9D=E9=87=8C=E9=9D=A2=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bkoff/controllers/DataController.java | 409 +++++++++++------- .../src/main/webapp/data/cityShow.ftl | 35 +- 2 files changed, 278 insertions(+), 166 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DataController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DataController.java index 3d55ac818..7628d085f 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DataController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DataController.java @@ -618,8 +618,9 @@ public class DataController { System.out.println ( "IOException." + e ); } finally { try { - if (os != null) + if(os != null) { os.close(); + } if(fos != null){ fos.close(); } @@ -840,21 +841,40 @@ public class DataController { HSSFRow onerow = s.createRow(0); int oneRowIndex = 0; - Map displayMap = getFliedDisplay(); - for(String key : outfields){ - if(cat.equals("商铺")){ - if(key.equals("bedKind")){ - continue; - } - } - String display = (String) displayMap.get(key); - if(StringUtils.isNotBlank(display)){ - onerow.createCell((short)oneRowIndex).setCellValue(display); - }else{ - onerow.createCell((short)oneRowIndex).setCellValue(key); - } - oneRowIndex ++; - } + Map displayMap = getFliedDisplay(cat); + + /* + 以displayMap为准 移除outfields中多余字段 + */ + Iterator it = outfields.iterator(); + while(it.hasNext()) { + + String key = it.next(); + + String display = (String) displayMap.get(key); + + if (StringUtils.isNotBlank(display)) { + onerow.createCell((short)oneRowIndex).setCellValue(display); + oneRowIndex ++; + }else{ + it.remove(); + } + } +//因 写字楼导出仅展示写字楼后台的字段需求 改动 +// for(String key : outfields){ +// if(cat.equals("商铺")){ +// if(key.equals("bedKind")){ +// continue; +// } +// } +// String display = (String) displayMap.get(key); +// if(StringUtils.isNotBlank(display)){ +// onerow.createCell((short)oneRowIndex).setCellValue(display); +// }else{ +// onerow.createCell((short)oneRowIndex).setCellValue(key); +// } +// oneRowIndex ++; +// } for(Map map : list){ HSSFRow row = s.createRow(s.getPhysicalNumberOfRows()); @@ -891,151 +911,236 @@ public class DataController { return wb; } - public Map getFliedDisplay(){ + public Map getFliedDisplay(String cat){ Map map = new HashMap(){ { put( "province" , "省份" ); put( "city" , "城市" ); put( "cityLevel" , "城市等级" ); put( "rankingLevel" , "行政区划" ); - put( "existingDistrictCount" , "小区数量" ); - put( "districtsHasLoudong" , "有楼栋的小区数量" ); - put( "districtsHasFanghao" , "有房号的小区数量" ); - put( "existingOfficeCount" , "写字楼数量" ); - put( "existingShopCount" , "商铺数量" ); - put( "priceCoverage" , "价格覆盖率" ); - put( "priceCreditGte80Coverage", "0.8≤价格可信度"); - put( "priceCreditGte66Coverage", "0.66≤价格可信度<0.8"); - put( "priceCreditGte60Coverage", "0.6≤价格可信度<0.66"); - put( "priceCreditGte00Coverage", "价格可信度<0.6"); - put( "name" , "名称" ); - put( "region" , "区域" ); - put( "block" , "板块" ); - put( "address" , "地址" ); - put( "estateType" , "物业类型" ); - put( "householdCount" , "户数" ); - put( "openDate" , "开盘时间" ); - put( "latLng" , "mapabc经纬度" ); - put( "latLng2" , "百度经纬度" ); - put( "allArea" , "占地面积" ); - put( "buildArea" , "建筑面积" ); - put( "buildType" , "建筑类型" ); - put( "developer" , "开发商" ); - put( "estateCompany" , "物业公司" ); - put( "cubagePercent" , "容积率" ); - put( "virescencePercent" , "绿化率" ); - put( "carSite" , "停车位" ); - put( "carSiteCount" , "停车位描述" ); - put( "estateCharge" , "物业费" ); - put( "floorplanPics" , "楼层平面图" ); - put( "outPics" , "外景图" ); - put( "rentPrice" , "租金" ); - put( "bedKind" , "写字楼等级" ); - put( "houseFloor" , "楼层" ); - put( "houseHeight" , "楼高" ); - put( "houseArea" , "面积" ); - put( "room" , "室" ); - put( "hall" , "厅" ); - put( "direction" , "朝向" ); - put( "toilet" , "卫" ); - put( "noise" , "噪音" ); - put( "fitmentRank" , "装修" ); - put( "fitmentAge" , "装修年限" ); - put( "leaseTerm","租赁年限"); - put( "paymentPattern","付款方式"); - put( "rentPrice","出租价格"); - put( "sellPrice","出售价格"); - put( "mobile","电话"); - put( "floor","建筑楼层"); - put( "floorInfo","楼层状况"); - put( "bayArea","开间面积"); - put( "finishBuildingDate","竣工时间"); - put( "liveDate","开业时间"); - put( "divisible","是否可分割"); - put( "unifiedManage","是否统一管理"); - put( "metroInfo","地铁沿线"); - put( "metroNames","地铁站名"); - put( "facilities","配套设施"); - put( "propertyInfo","物业概况"); - put( "traffic","交通情况"); - put( "surrounding","周边情况"); - put( "businessStatus","经营业态"); - put( "rentType","租售类型"); - put( "price","价格"); - put( "businessQuarter","商圈"); - put( "startBuildingDate","开工时间"); - put( "liveDate","交房时间"); - put( "loopLineInfo","环线"); - put( "propertyLife","产权年限"); - put( "houseProperty","产权性质"); - put( "licence","预售许可证"); - put( "buildStructure","建筑结构"); - put( "house_count","房号总量"); - put( "exists_house_dis_count","有房号的小区数量"); - put( "house_num_rate","楼号覆盖率"); - put( "unit_num_rate","单元覆盖率"); - put( "room_num_rate","室号覆盖率"); - put( "area_rate","面积覆盖率"); - put( "room_info_rate","户型覆盖率"); - put( "hourse_structure_rate","户型结构覆盖率"); - put( "actualFloor","实际层覆盖率"); - put( "nominalFloor","名义层覆盖率"); - put( "build_type","建筑类型覆盖率"); - put( "loudong_count","楼栋总量"); - put( "exists_loudong_dis_count","有楼栋的小区数量"); - put( "loudong_num_rate","楼栋号覆盖率"); - put( "loudong_height_rate","总楼层覆盖率"); - put( "elevatornumber_rate","电梯数覆盖率"); - put( "households_rate","户数覆盖率"); - put( "address_rate","地址覆盖率"); - put( "structure_rate","建筑结构覆盖率"); - put( "build_year_rate","建筑年代覆盖率"); - put( "usage_rate","楼栋用途覆盖率"); - put( "loudong_type_rate","楼栋类型覆盖率"); - put( "floor_type_reate","建筑类型(按楼层)覆盖率"); - put( "archiNature_rate","建筑性质覆盖率"); - put( "totalAreas_rate","建筑总面积覆盖率"); - put("streetCommunity","街道社区"); - put("committee","居委会"); - put("schools","对口学校"); - put("houseStructure","房屋结构"); - put("estateType2","物业类型"); - put("buildDate","建筑年代"); - put("alias","别名"); - put("addrAlias","地址别名"); - put("mainTypeArea","主力面积"); - put("loudongCount","楼栋数"); - put("township","乡镇街道"); - put("schools","对口小学"); - put("kindergartens","对口幼儿园"); - put("elevator","电梯"); - put("landProperty","权属类别"); - put("usageCard","土地使用权证号"); - put("landUsageStart","土地使用年限"); - put("occupancyRate","入住率"); - put("mainType","主力户型"); - put("mappingAlias","映射别名"); - put("districtAliasTotalCount", "别名总量"); + put( "latLng" , "mapabc经纬度" ); + put( "latLng2" , "百度经纬度" ); - put("undergroundCarSite", "地下车位数"); - put("landCarSite", "地上车位数"); - put("parkingFee", "车位月租金"); - put("sight", "开间面积"); - put("lobbyHeight", "大堂层高"); - put("standardHeight", "标准层高"); - put("clearHeight", "净高"); - put("standardArea", "标准层面积"); - put("foreign", "是否涉外"); - put("register", "是否可注册"); - put("divisible", "是否可分割"); - put("elevatorsCount","电梯数量"); - put("personElevatorsCount","客梯数"); - put("goodsElevatorCount","货梯数"); - put("realUsePercent","得房率"); - put("landFloor","地上层数"); - put("undergroundFloor","地下层数"); +// put( "floorplanPics" , "楼层平面图" ); +// put( "outPics" , "外景图" ); +// put( "rentPrice" , "租金" ); +// put( "houseFloor" , "楼层" ); +// put( "houseHeight" , "楼高" ); +// put( "houseArea" , "面积" ); +// put( "room" , "室" ); +// put( "hall" , "厅" ); +// put( "direction" , "朝向" ); +// put( "toilet" , "卫" ); +// put( "noise" , "噪音" ); +// put( "fitmentRank" , "装修" ); +// put( "fitmentAge" , "装修年限" ); +// put( "leaseTerm","租赁年限"); +// put( "paymentPattern","付款方式"); +// put( "sellPrice","出售价格"); +// put( "mobile","电话"); +// put( "liveDate","开业时间"); +// put( "divisible","是否可分割"); +// put( "unifiedManage","是否统一管理"); +// put( "metroInfo","地铁沿线"); +// put( "metroNames","地铁站名"); +// put( "facilities","配套设施"); +// put( "propertyInfo","物业概况"); +// put( "traffic","交通情况"); +// put( "surrounding","周边情况"); +// put( "rentType","租售类型"); +// put( "price","价格"); +// put("schools","对口学校"); +// put("estateType" , "物业类型" ); +// put("estateType2","物业类型"); +// put("buildDate","建筑年代"); } };// + + if(cat.equals("小区")){ + map = setDistrictFields(map); + }else if(cat.equals("写字楼")){ + map = setOfficeFields(map); + }else if(cat.equals("房号")){ + map = setRoomNumberFields(map); + }else if(cat.equals("商铺")){ + map = setShopsFields(map); + }else if(cat.equals("楼栋")){ + map = setBuildingFields(map); + } + return map; } + private Map setDistrictFields (Map map){ + map.put( "existingDistrictCount" , "小区数量" ); + map.put( "districtsHasLoudong" , "有楼栋的小区数量" ); + map.put( "districtsHasFanghao" , "有房号的小区数量" ); + map.put( "priceCoverage" , "价格覆盖率" ); + map.put("districtAliasTotalCount", "别名总量"); + map.put( "priceCreditGte80Coverage", "0.8≤价格可信度"); + map.put( "priceCreditGte66Coverage", "0.66≤价格可信度<0.8"); + map.put( "priceCreditGte60Coverage", "0.6≤价格可信度<0.66"); + map.put( "priceCreditGte00Coverage", "价格可信度<0.6"); + map.put( "businessQuarter","商圈"); + map.put( "startBuildingDate","开工时间"); + map.put( "liveDate","交房时间"); + map.put( "loopLineInfo","环线"); + map.put( "propertyLife","产权年限"); + map.put( "houseProperty","产权性质"); + map.put( "licence","预售许可证"); + map.put( "buildStructure","建筑结构"); + map.put( "name" , "名称" ); + map.put( "region" , "区域" ); + map.put( "block" , "板块" ); + map.put( "address" , "地址" ); + map.put( "estateType2" , "物业类型" ); + map.put( "householdCount" , "户数" ); + map.put( "openDate" , "开盘时间" ); + map.put("buildDate","建筑年代"); + map.put( "allArea" , "占地面积" ); + map.put( "buildArea" , "建筑面积" ); + map.put( "buildType" , "建筑类型" ); + map.put( "developer" , "开发商" ); + map.put( "estateCompany" , "物业公司" ); + map.put( "cubagePercent" , "容积率" ); + map.put( "virescencePercent" , "绿化率" ); + map.put( "carSite" , "停车位" ); + map.put( "estateCharge" , "物业费" ); + map.put( "finishBuildingDate","竣工时间"); + map.put("streetCommunity","街道社区"); + map.put("committee","居委会"); + map.put("schools","对口小学"); + map.put("houseStructure","房屋结构"); + map.put("alias","别名"); + map.put("addrAlias","地址别名"); + map.put("mainTypeArea","主力面积"); + map.put("loudongCount","楼栋数"); + map.put( "carSiteCount" , "停车位描述" ); + map.put("mappingAlias","映射别名"); + map.put("elevator","电梯"); + map.put("township","乡镇街道"); + map.put("kindergartens","对口幼儿园"); + map.put("mainType","主力户型"); + map.put("landProperty","权属类别"); + map.put("usageCard","土地使用权证号"); + map.put("occupancyRate","入住率"); + map.put("landUsageStart","土地使用年限"); + map.put( "rentPrice","出租价格"); + map.put("realUsePercent","得房率"); + return map; + } + private Map setOfficeFields (Map map){ + map.put( "existingOfficeCount" , "写字楼数量" ); + map.put( "name" , "名称" ); + map.put( "region" , "区域" ); + map.put( "block" , "板块" ); + map.put( "address" , "地址" ); +// map.put( "estateType2" , "物业类型" ); +// map.put( "openDate" , "开盘时间" ); +// map.put( "liveDate","交房时间"); + map.put( "allArea" , "占地面积" ); + map.put( "buildArea" , "建筑面积" ); +// map.put( "buildType" , "建筑类型" ); + map.put( "developer" , "开发商" ); + map.put( "estateCompany" , "物业公司" ); + map.put( "cubagePercent" , "容积率" ); + map.put( "virescencePercent" , "绿化率" ); + map.put( "carSite" , "停车位" ); + map.put( "estateCharge" , "物业费" ); + map.put( "finishBuildingDate","竣工时间"); +// map.put( "startBuildingDate","开工时间"); +// map.put( "carSiteCount" , "停车位描述" ); + map.put( "bedKind" , "写字楼等级" ); + map.put("alias","别名"); + map.put("addrAlias","地址别名"); +// map.put( "businessQuarter","商圈"); + map.put( "loopLineInfo","环线"); +// map.put( "floorInfo","楼层状况"); + map.put("undergroundCarSite", "地下车位数"); + map.put("landCarSite", "地上车位数"); + map.put("parkingFee", "车位月租金"); + map.put( "bayArea","开间面积"); + map.put( "propertyLife","产权年限"); + map.put("elevatorsCount","电梯数量"); + map.put("personElevatorsCount","客梯数"); + map.put("goodsElevatorCount","货梯数"); + map.put("standardHeight", "标准层高"); + map.put("clearHeight", "净高"); + map.put("standardArea", "标准层面积"); + map.put("foreign", "是否涉外"); + map.put("register", "是否可注册"); + map.put("lobbyHeight", "大堂层高"); +// map.put("township","乡镇街道"); + map.put("divisible", "是否可分割"); + map.put("landFloor","地上层数"); + map.put("undergroundFloor","地下层数"); + + return map; + } + + private Map setRoomNumberFields (Map map){ + map.put( "house_count","房号总量"); + map.put( "exists_house_dis_count","有房号的小区数量"); + map.put( "house_num_rate","楼号覆盖率"); + map.put( "unit_num_rate","单元覆盖率"); + map.put( "room_num_rate","室号覆盖率"); + map.put( "area_rate","面积覆盖率"); + map.put( "room_info_rate","户型覆盖率"); + map.put( "hourse_structure_rate","户型结构覆盖率"); + map.put( "actualFloor","实际层覆盖率"); + map.put( "nominalFloor","名义层覆盖率"); + map.put( "build_type","建筑类型覆盖率"); + return map; + } + + private Map setShopsFields (Map map){ + map.put( "existingShopCount" , "商铺数量" ); + map.put( "name" , "名称" ); + map.put( "region" , "区域" ); + map.put( "block" , "板块" ); + map.put( "address" , "地址" ); + map.put("alias","别名"); + map.put("addrAlias","地址别名"); + map.put( "estateType2" , "物业类型" ); + map.put( "openDate" , "开盘时间" ); + map.put( "liveDate","交房时间"); + map.put( "allArea" , "占地面积" ); + map.put( "buildArea" , "建筑面积" ); + map.put( "buildType" , "建筑类型" ); + map.put( "developer" , "开发商" ); + map.put( "estateCompany" , "物业公司" ); + map.put( "carSite" , "停车位" ); + map.put( "estateCharge" , "物业费" ); + map.put( "floor","建筑楼层"); + map.put( "finishBuildingDate","竣工时间"); + map.put( "businessQuarter","商圈"); + map.put( "startBuildingDate","开工时间"); + map.put("sight", "开间面积"); + map.put( "propertyLife","产权年限"); + map.put( "businessStatus","经营业态"); + map.put("parkingFee", "车位月租金"); + map.put("township","乡镇街道"); + map.put( "loopLineInfo","环线"); + map.put("landFloor","地上层数"); + map.put("undergroundFloor","地下层数"); + return map; + } + private Map setBuildingFields (Map map){ + map.put( "loudong_count","楼栋总量"); + map.put( "exists_loudong_dis_count","有楼栋的小区数量"); + map.put( "unit_num_rate","单元覆盖率"); + map.put( "loudong_num_rate","楼栋号覆盖率"); + map.put( "loudong_height_rate","总楼层覆盖率"); + map.put( "elevatornumber_rate","电梯数覆盖率"); + map.put( "households_rate","户数覆盖率"); + map.put( "address_rate","地址覆盖率"); + map.put( "structure_rate","建筑结构覆盖率"); + map.put( "build_year_rate","建筑年代覆盖率"); + map.put( "usage_rate","楼栋用途覆盖率"); + map.put( "loudong_type_rate","楼栋类型覆盖率"); + map.put( "floor_type_reate","建筑类型(按楼层)覆盖率"); + map.put( "archiNature_rate","建筑性质覆盖率"); + map.put( "totalAreas_rate","建筑总面积覆盖率"); + return map; + } + public Object houseAction(DataModel model) { if (StringUtils.isBlank(model.getCityDisplay())) { diff --git a/projects/fangjia-bkoff/src/main/webapp/data/cityShow.ftl b/projects/fangjia-bkoff/src/main/webapp/data/cityShow.ftl index b46fd9431..f625ee581 100644 --- a/projects/fangjia-bkoff/src/main/webapp/data/cityShow.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/data/cityShow.ftl @@ -196,49 +196,55 @@ 绛夌骇 <#if officeDetail.bedKind??>${officeDetail.bedKind * 100}%<#else>鏈煡 - 寤虹瓚绫诲瀷 + <#--寤虹瓚绫诲瀷 <#if officeDetail.buildType??>${officeDetail.buildType * 100}%<#else>鏈煡 + --> 缁忕含搴�-mapabc <#if officeDetail.latLng??>${officeDetail.latLng * 100}%<#else>鏈煡 缁忕含搴�-鐧惧害 <#if officeDetail.latLng2??>${officeDetail.latLng2 * 100}%<#else>鏈煡 - - + 寮�鍙戝晢 + <#if officeDetail.developer??>${officeDetail.developer * 100}%<#else>鏈煡 寤虹瓚闈㈢Н <#if officeDetail.buildArea??>${officeDetail.buildArea * 100}%<#else>鏈煡 鍗犲湴闈㈢Н <#if officeDetail.allArea??>${officeDetail.allArea * 100}%<#else>鏈煡 - 鍏ヤ綇鏃堕棿 + <#--鍏ヤ綇鏃堕棿 <#if officeDetail.liveDate??>${officeDetail.liveDate * 100}%<#else>鏈煡 澶栨櫙鍥� <#if officeDetail.outPics??>${officeDetail.outPics * 100}%<#else>鏈煡 + --> + 瀹圭Н鐜� + <#if officeDetail.cubagePercent??>${officeDetail.cubagePercent * 100}%<#else>鏈煡 + 缁垮寲鐜� + <#if officeDetail.virescencePercent??>${officeDetail.virescencePercent * 100}%<#else>鏈煡 - 寮�鍙戝晢 - <#if officeDetail.developer??>${officeDetail.developer * 100}%<#else>鏈煡 鐗╀笟鍏徃 <#if officeDetail.estateCompany??>${officeDetail.estateCompany * 100}%<#else>鏈煡 - 瀹圭Н鐜� - <#if officeDetail.cubagePercent??>${officeDetail.cubagePercent * 100}%<#else>鏈煡 - 缁垮寲鐜� - <#if officeDetail.virescencePercent??>${officeDetail.virescencePercent * 100}%<#else>鏈煡 + 鐗╀笟璐� + <#if officeDetail.estateCharge??>${officeDetail.estateCharge * 100}%<#else>鏈煡 +   +   +   +   - 鐗╀笟璐� - <#if officeDetail.estateCharge??>${officeDetail.estateCharge * 100}%<#else>鏈煡 - 鐗╀笟绫诲瀷 + + <#--鐗╀笟绫诲瀷 <#if officeDetail.estateType2??>${officeDetail.estateType2 * 100}%<#else>鏈煡 鍛ㄨ竟閰嶅 <#if officeDetail.facilities??>${officeDetail.facilities * 100}%<#else>鏈煡 椤圭洰鐗硅壊 <#if officeDetail.characteristic??>${officeDetail.characteristic * 100}%<#else>鏈煡 + --> - 鍧囦环 + <#--鍧囦环 <#if officeDetail.price??>${officeDetail.price * 100}%<#else>鏈煡 绉熼噾 <#if officeDetail.rentPrice??>${officeDetail.rentPrice * 100}%<#else>鏈煡 @@ -246,6 +252,7 @@       + --> From 0b57dfa51769d878dc51ac744d5a0491340c130a Mon Sep 17 00:00:00 2001 From: "zhaojixiang@fangjia.com" Date: Tue, 18 Jul 2023 17:37:02 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E9=9A=90=E8=97=8F=E8=A3=85=E4=BF=AE?= =?UTF-8?q?=E6=83=85=E5=86=B5=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/district2/editOffice.ftl | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl b/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl index 65f9f3a44..1e011a489 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl @@ -838,18 +838,18 @@ - - - - +<#-- --> +<#-- --> +<#-- --> +<#-- --> <#-- --> <#-- --> <#-- --> -<#-- --> + + + + +
- <#if markMap?? && markMap["fitment"]?? && markMap["fitment"] == 1> - - <#else> - - - 瑁呬慨鎯呭喌 - -
--> +<#-- <#if markMap?? && markMap["fitment"]?? && markMap["fitment"] == 1>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- 瑁呬慨鎯呭喌--> +<#-- --> +<#--
--> <#-- <#if markMap?? && markMap["open_date"]?? && markMap["open_date"] == 1>--> From 3d40f2be78cef391607c441ecb342a65bf80c4e8 Mon Sep 17 00:00:00 2001 From: "zhaojixiang@fangjia.com" Date: Wed, 19 Jul 2023 13:28:47 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=B0=8F=E5=8C=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=88=AB=E5=90=8D=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=97=A0=E6=95=88=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bkoff/controllers/DistrictController.java | 2 ++ .../src/main/webapp/district2/editOffice.ftl | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java index 63339af65..7879767cc 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/DistrictController.java @@ -1215,6 +1215,7 @@ public class DistrictController { params.add(new QueryParam("city", city)); params.add(new QueryParam("region", region)); params.add(new QueryParam("alias", name)); + params.add(new QueryParam("visible", 0)); List ds = districtService.findAllByParams(params); if (CollectionUtils.isNotEmpty(ds)) { @@ -2350,6 +2351,7 @@ public class DistrictController { params = new ArrayList(2); params.add(new QueryParam("category", "district,new_district")); params.add(new QueryParam("name", a)); + params.add(new QueryParam("visible", 0)); ds = districtService.findAllByParams(params); diff --git a/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl b/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl index 1e011a489..f6b0277f3 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district2/editOffice.ftl @@ -259,7 +259,19 @@ <#-- --> <#--
+ <#if markMap?? && markMap["township"]?? && markMap["township"] == 1> + + <#else> + + + 涔¢晣琛楅亾 + +
<#if markMap?? && markMap["loop_line_info"]?? && markMap["loop_line_info"] == 1> @@ -479,7 +491,7 @@ <#if markMap?? && markMap["estate_charge"]?? && markMap["estate_charge"] == 1> <#else> - + 鐗� 涓� 璐� From 8e027cceac1386f968d9ecb85c7afd62b451ed84 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 19 Jul 2023 14:06:35 +0800 Subject: [PATCH 11/19] update --- .../BigdataCommunityBatch.groovy | 21 ++++++--- .../ccbevaluation/BigdataForsaleBatch.groovy | 9 +++- .../fangjia/script/chongqing/PocTest.groovy | 31 ++++++++++--- .../script/commData/CommonDatautils.groovy | 44 +++++++++---------- .../fuzhou/DistrictInfoExportBatch.groovy | 18 ++------ .../fuzhou/DistrictPriceExportBatch.groovy | 2 +- .../fangjia/script/gj/YouDaDataParser.groovy | 4 +- .../script/gj/crawl/OfficeProcess.groovy | 8 ++-- .../gj/paimai/BeiKeCrawlByChrome.groovy | 6 ++- 9 files changed, 86 insertions(+), 57 deletions(-) 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 61b833dab..49d4de707 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 @@ -49,15 +49,25 @@ class BigdataCommunityBatch extends BaseBatch{ def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() def index = 0 + def today = new Date().getDate() + println "starting 。。。。。。。。。" for(def city : citys){ index ++ + + def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city","region", "name", "address","lat", "lng","all_area","build_area","virescence_percent","cubage_percent","car_site_count","finish_building_date","estate_type2","household_count","status","c_date","m_date","name_cat","street","street_number"]) - def ccbMaps = CcbCommonUtils.findCcbDistrict(cityCodeDataMap.get(city)) //融合导数时使用 -// def ccbMaps = CcbCommonUtils.findPgCcbDistrict(cityCodeDataMap.get(city)) //估值导数时使用 + + def ccbMaps = null + if(today<=10){ + ccbMaps = CcbCommonUtils.findCcbDistrict(cityCodeDataMap.get(city)) //融合导数时使用 + }else{ + ccbMaps = CcbCommonUtils.findPgCcbDistrict(cityCodeDataMap.get(city)) //估值导数时使用 + } + def rets = createCityDatas(cityCodeDataMap, distCodeMap, dists) rets = addDeleteDist(dists, ccbMaps, rets) rows.addAll(rets) @@ -77,9 +87,10 @@ class BigdataCommunityBatch extends BaseBatch{ FileUtils.batchCreateFile(rows, fileName,headers, "utf-8", false); println "txt 生成->导Oracle" - delPgData() - saveToPgSql(rows) - + if(today > 10){ + delPgData() + saveToPgSql(rows) + } // ExcelUtils.write("d:\\数据\\建行\\房产估值\\数据文件\\excel\\bigdata_community.xlsx", allDatas, "数据") // def datas = readTxt("d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_COMMUNITY_GJ.dat") // delPgData() 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 3479e90ea..10822463f 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 @@ -69,6 +69,10 @@ class BigdataForsaleBatch extends BaseBatch{ def pgsqlInstance = Sql.newInstance("jdbc:postgresql://192.168.0.236:5432/warehouse?stringtype=unspecified", "postgres", "postgres", "org.postgresql.Driver") + + def lastMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"); + def curMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM"); + static main(args) { runBatch(new BigdataForsaleBatch(), args); } @@ -81,6 +85,9 @@ class BigdataForsaleBatch extends BaseBatch{ def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() + def startDate = lastMonth+"18" + def endDate = curMonth+"19" + println "房源时间:"+startDate+" "+endDate def houseIdsfilter = findAllHouseIdsByCity() @@ -91,7 +98,7 @@ class BigdataForsaleBatch extends BaseBatch{ 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, 20230118, 20230219); - exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20230518, 20230619, houseIdsfilter); + exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, startDate.toInteger(), endDate.toInteger(), houseIdsfilter); //测试通过匹配接口配房源效果 // exportSellCSV(index, city, cityCodeDataMap, distCodeMap, districts, 20201201, 20211118) } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/chongqing/PocTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/chongqing/PocTest.groovy index 29a2403b5..a596bbb54 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/chongqing/PocTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/chongqing/PocTest.groovy @@ -20,6 +20,25 @@ class PocTest { static main(args) { def task = new PocTest(); task.run(); +// task.export() + } + + def export(){ + ExcelUtils.modify("D:\\数据\\其它\\广州.xlsx", { row -> + def dist = CommonDatautils.findDistrictById(row["B"]) + row['F'] = dist.address + row['G'] = dist.lng/10000000000.0 + row['H'] = dist.lat/10000000000.0 + row['I'] = dist.estate_type2 + row['J'] = dist.build_type + row['K'] = dist.schools + row['L'] = dist.kindergartens + row['M'] = dist.loudong_count + row['N'] = dist.household_count + row['O'] = dist.estate_charge + row['P'] = dist.finish_building_date + row['Q'] = dist.estate_company + }) } @@ -32,9 +51,10 @@ class PocTest { * @return */ def run(){ - def inputfile = "D:\\数据\\重庆农商行\\poc\\test.xls" +// def inputfile = "D:\\数据\\重庆农商行\\poc\\test.xls" + def inputfile = "D:\\数据\\其它\\广州.xlsx" // match(inputfile) -// addPrice(inputfile) + addPrice(inputfile) // addArroundPrice(inputfile) // standard(inputfile) // addLoudongNum(inputfile) @@ -132,15 +152,16 @@ class PocTest { def addPrice(path){ ExcelUtils.multiThreadingModify(path, { row -> - def commid = row['R'] + def commid = row['B'] if(commid){ def dist = CommonDatautils.findDistrictById(commid.trim()) if(dist){ - row['Q'] = dist.name +// row['Q'] = dist.name def priceObj = CommonDatautils.findDistrictPrice(dist.city, dist.region, dist.name) if(priceObj){ - row['F'] = priceObj.avg_price + row['R'] = priceObj.avg_price } + row['S'] = CommonDatautils.findNewSqmetreRent(dist.city, dist.region, dist.name) } } }) 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 4540e31c5..454b1a9e9 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 @@ -252,7 +252,7 @@ class CommonDatautils { q.put("visible", 0); q.put("cat", cat); q.put("city", city); -// q.put("name", "鲁能大厦") +// q.put("name", "交发风景") DBObject keys = new BasicDBObject(); if(fields){ @@ -899,28 +899,28 @@ class CommonDatautils { DBObject q = new BasicDBObject(); q.put("_id", new ObjectId(id.toString().replace("[","").replace("]",""))); - DBObject keys = new BasicDBObject(); - keys.put("alias", 1); - keys.put("addr_alias", 1); - keys.put("city", 1); - keys.put("region", 1); - keys.put("name", 1); - keys.put("estate_type2", 1); - keys.put("address", 1); - keys.put("build_structure", 1); - keys.put("out_pics", 1); - keys.put("lat", 1); - keys.put("lng", 1); - keys.put("lat2", 1); - keys.put("lng2", 1); - keys.put("name_cat", 1); - keys.put("finish_building_date", 1) - keys.put("mapping_alias", 1) - keys.put("sid", 1) - keys.put("status", 1) - keys.put("name_cat", 1) +// DBObject keys = new BasicDBObject(); +// keys.put("alias", 1); +// keys.put("addr_alias", 1); +// keys.put("city", 1); +// keys.put("region", 1); +// keys.put("name", 1); +// keys.put("estate_type2", 1); +// keys.put("address", 1); +// keys.put("build_structure", 1); +// keys.put("out_pics", 1); +// keys.put("lat", 1); +// keys.put("lng", 1); +// keys.put("lat2", 1); +// keys.put("lng2", 1); +// keys.put("name_cat", 1); +// keys.put("finish_building_date", 1) +// keys.put("mapping_alias", 1) +// keys.put("sid", 1) +// keys.put("status", 1) +// keys.put("name_cat", 1) try{ - DSCursor cursor = getDataStoreConnection().find(q, keys); + DSCursor cursor = getDataStoreConnection().find(q); if(cursor){ for(def obj : cursor){ return obj; diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictInfoExportBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictInfoExportBatch.groovy index 75ff94eee..414e61113 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictInfoExportBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictInfoExportBatch.groovy @@ -74,29 +74,17 @@ class DistrictInfoExportBatch extends BaseBatch{ def createDatas(def city){ def result = [] - def distKeys = [] def districts = CommonDatautils.findAllDistricts(city, "district", null); - for(def dist : districts){ - def key = dist.city +"##"+dist.region+"##"+dist.name - if(!distKeys.contains(key)){ - distKeys << key - } - } + def removeDists = CommonDatautils.findRemoveDistricts(city, "district", null, "2022-01-01"); -// for(def dist : removeDists){ -// def key = dist.city +"##"+dist.region+"##"+dist.name -// if(!distKeys.contains(key)){ -// distKeys << key -// districts << dist -// } -// } + def lastDate = DateUtils.getLastDayOfMonth(new Date(), -1) def startDate = DateUtils.getFirstDayOfMonth(lastDate); def fzAddrMap = getFzAddress(); //因为福州个性化问题,又不想影响自家数据库数据,所以另存一个福州小区库,用于手动添加数据 -// saveOrUpdateFzDist(districts) + saveOrUpdateFzDist(districts) remarkRemoveDist(removeDists) def fzDistricts = getFzDistricts(city) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy index 2dbc3b908..2aa5282a0 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictPriceExportBatch.groovy @@ -33,7 +33,7 @@ class DistrictPriceExportBatch extends BaseBatch{ static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com") - def specialDistsPriceMap = ["津泰新村7号、9-13号、15-17号":53620,"津泰新村14号":76230,"津泰新村1-6号、8号":32580] + def specialDistsPriceMap = ["津泰新村9-13号、15-18号":54000,"津泰新村14号":72000,"津泰新村1-6号、8号":35000,"津泰新村7号":75000,"津泰新村19号":25000] static main(args) { runBatch(new DistrictPriceExportBatch(), args) } 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 4de90b96b..ac0ef538c 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 = "2023-05-01" + static def statDate = "2023-06-01" static main(args) { def task = new YouDaDataParser(); // task.newHouseparse();//友达一手房存入mongo -// task.esfParser("D:\\数据\\友达\\2023年6月\\查询1.DBF");//友达二手房存入mongo +// task.esfParser("D:\\数据\\友达\\2023年7月\\查询1.DBF");//友达二手房存入mongo // task.newhouseToSaveEs();//新房保存到es task.esfhouseToSaveEs();//二手房保存到es // task.updateFinishDateByEsfTrade();//根据二手成交的竣工时间修改seaweed库中的竣工时间 diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy index 55ce0ed8f..d7fd9e44a 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy @@ -435,7 +435,7 @@ class OfficeProcess { pstmt.setString(5, d.source) println count+" "+d.city+" "+d.name pstmt.addBatch() - if(count % 1 ==0) { + if(count % 100 ==0) { try { pstmt.executeBatch() } catch (Exception e) { @@ -480,7 +480,7 @@ class OfficeProcess { } def checkRegion(){ - def citys = ["杭州","苏州"]//"上海","深圳","北京","广州","重庆","成都", + def citys = ["上海"]//"上海","深圳","北京","广州","重庆","成都", for(def city : citys){ def regionPointsMap = findRegionRange(city) def addDatas = findAddDatasByClickhouse(city) @@ -492,7 +492,7 @@ class OfficeProcess { if(data.lng){ def flag = isInArea(data.lng.toString().toDouble(), data.lat.toString().toDouble(), regionPointsMap.get(data.region)) def mark = flag?'T':'F' -// rets << ["city":data.city, "region":data.region, "name":data.name, "source":data.source, "flag":mark] + rets << ["city":data.city, "region":data.region, "name":data.name, "source":data.source, "flag":mark] updateOption(data.city, data.region, data.name, data.source, mark) println index+" "+data.region + " "+data.name+" "+ flag } @@ -502,7 +502,7 @@ class OfficeProcess { } def findAddDatasByClickhouse(city){ - def sql = "select city,region, name,option,lng,lat,source from office where city='${city}' and option like '%添加%'" + def sql = "select city,region, name,option,lng,lat,source from office where city='${city}' and region_fence is null" def datas = [] sqlInstance.eachRow(sql, {r-> datas << ["city":r.city,"region":r.region,"name":r.name, "lat":r.lat, "lng":r.lng, "option":r.option,"source":r.source] diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy index 0d031c591..2691fe7de 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy @@ -490,9 +490,11 @@ public class BeiKeCrawlByChrome { WebElement btn = driver.findElement(By.cssSelector("button[class='ant-btn btn-login ant-btn-primary']")); //获取点击登陆按钮。 - elemUsername.sendKeys("15021384995"); +// elemUsername.sendKeys("15021384995"); +// elemPassword.sendKeys("12qwaszx"); - elemPassword.sendKeys("12qwaszx"); + elemUsername.sendKeys("16283166371"); + elemPassword.sendKeys("Goojia123456"); btn.submit(); // 点击行为; Thread.sleep(10000) From 5d360349d23f7dccd5ac57fbcaa58056c3e5b99d Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 19 Jul 2023 14:26:34 +0800 Subject: [PATCH 12/19] update --- .../ccbevaluation/BigdataCommbuildtypeBatch.groovy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 61bd39b7e..e6e02e23d 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 @@ -35,12 +35,19 @@ class BigdataCommbuildtypeBatch extends BaseBatch{ def citys = CcbCommonUtils.getRunningCitys(args) def rets = [] def cityCodeDatas = CcbCommonUtils.findCityCodeValue() + def today = new Date().getDate() + for(def city : citys){ // def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) // def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name", "estate_type2","name_cat","build_type", "lng","c_date", "m_date"]) -// def distIds = CcbCommonUtils.findAllDistrictIdsByOracle(cityCodeDatas.get(city)); - def distIds = PgsqlCommUtils.findAllDistrictIdsByOracle(cityCodeDatas.get(city)) + def distIds = null + if(today<=10){ + distIds = CcbCommonUtils.findAllDistrictIdsByOracle(cityCodeDatas.get(city)); + }else{ + distIds = PgsqlCommUtils.findAllDistrictIdsByOracle(cityCodeDatas.get(city)) + } + def rows = createDatas(cityCodeDatas.get(city), distIds) rets.addAll(rows) println city +" "+rows.size() From 41d099fcb59fb2ca7a7920196d66ea71461d4b0b Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 19 Jul 2023 22:32:11 +0800 Subject: [PATCH 13/19] updadte --- .../script/ccbevaluation/AddSzDealData.groovy | 2 +- .../script/gj/paimai/BeiKeCrawlByChrome.groovy | 7 ++++--- .../script/gj/paimai/LianjiaCrawlByChrome.groovy | 9 +++++---- .../thirdPriceCrawl/DataStandardBatch.groovy | 16 ++++++++-------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddSzDealData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddSzDealData.groovy index 1c1fa2788..7ddc3a095 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddSzDealData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddSzDealData.groovy @@ -9,7 +9,7 @@ import com.mongodb.DBCollection /** * 深圳公众号成交数据录入 */ -def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳5月份二手房成交数据汇总.xls", 0, 1) +def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳6月份二手房成交数据汇总.xls", 0, 1) def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy index 2691fe7de..3df686d65 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy @@ -33,7 +33,7 @@ public class BeiKeCrawlByChrome { def DBCollection thirdPartyColl = CrawalDBUtil.getThirdPartyCol(); def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) - def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -2, "yyyy-MM") + def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM") //广州,佛山 重庆 @@ -207,9 +207,10 @@ public class BeiKeCrawlByChrome { if (!dbo) { parse(city, e, region, driver, null) - }else if(dbo && !dbo.lift){ - parse(city, e, region, driver, dbo._id) } +// else if(dbo && !dbo.lift){ +// parse(city, e, region, driver, dbo._id) +// } }else{ stop = true; break; diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy index c87a55634..52e1665f4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/LianjiaCrawlByChrome.groovy @@ -33,7 +33,7 @@ public class LianjiaCrawlByChrome { def DBCollection thirdPartyColl = CrawalDBUtil.getThirdPartyCol(); def lineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.43:28017"; DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl) - def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -2, "yyyy-MM") + def startMonth = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM") static main(args) { def task = new LianjiaCrawlByChrome(); @@ -304,9 +304,10 @@ public class LianjiaCrawlByChrome { def dbo = findTrade(durl , "链家在线") if (!dbo) { parse(city, e, regionText, driver, null) - }else if(dbo && !dbo.lift){ - parse(city, e, regionText, driver, dbo._id) } +// else if(dbo && !dbo.lift){ +// parse(city, e, regionText, driver, dbo._id) +// } }else{ stop = true; break; @@ -353,7 +354,7 @@ public class LianjiaCrawlByChrome { detail.region = RegionData.formatRegion(city, detail.region) } if(!detail.region){ - def str = detailDoc.toString().substring(detailDoc.toString().indexOf("resblockPosition")+1, detailDoc.toString().size()-1) + def str = detailDoc.toString().substring(detailDoc.toString().indexOf("resblockPosition")+18, detailDoc.toString().size()-1) str = str.substring(0, str.indexOf("',")) def locArrs = str.split(",") def gmap = GeocodeUtils.geoconvBaiduToGoogle(locArrs[0].toString().toDouble(), locArrs[1].toString().toDouble()) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy index f79d9ac1a..1d0ca1224 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/DataStandardBatch.groovy @@ -65,7 +65,7 @@ class DataStandardBatch extends BaseBatch{ def static final statusMap = ["城市未匹配":1,"区域未匹配":2,"小区匹配失败":3,"小区匹配成功":4,"异常错误":5, "无价格":6, "无名称":7] def static final websites = ["房估估","诸葛找房","安居客","搜房","中原地产","赶集", "链家","兔博士","城市房产","贝壳找房","Q房","Q房(新)","中原地产(新)","我爱我家","麦田","房途","C21","乐居","房产超市","58同城","365淘房","吉屋"] - public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10) static { thirdPartyColl = CrawalDBUtil.getThirdPartyCol(); matchErrorLogColl = CrawalDBUtil.getMatchErrorLogCol(); @@ -92,7 +92,7 @@ class DataStandardBatch extends BaseBatch{ cityMap.each{city,alias-> println "开始加载【${city}】" -// if(city == "福州"){ +// if(city == "石家庄"){ def detailMap = CommonDatautils.findAllCityDistrictNameAndAlias(city, "district", ["city","region","name","address","alias","addr_alias","mapping_alias","estate_type2"]) districtMap.putAll(detailMap) // } @@ -458,13 +458,13 @@ class DataStandardBatch extends BaseBatch{ def addr = null; if(data.address){ - try{ - addr = DataUtil.formateAddress(data.city, data.address) - }catch (Exception e){ - addr = data.address; - } +// try{ +// addr = DataUtil.formateAddress(data.city, data.address) +// }catch (Exception e){ +// addr = data.address; +// } def copyObj = data - copyObj.address = addr +// copyObj.address = addr district = getMatchAddressFromMap(copyObj) if(district){ type = 8; From 7a52c6764c4204efbc9a2b79be88f46bd57242df Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 20 Jul 2023 16:09:17 +0800 Subject: [PATCH 14/19] update --- .../ccbevaluation/BigdataDealBatch.groovy | 104 +++++++++--------- .../ccbevaluation/GuiDingPriceBatch.groovy | 6 +- .../script/ccbevaluation/TradeStatLog.groovy | 10 +- .../com/fangjia/script/gj/FiledStrand.groovy | 19 +++- .../gj/district/OfficeFieldCleanBatch.groovy | 30 +++-- .../gj/paimai/BeiKeCrawlByChrome.groovy | 5 +- 6 files changed, 104 insertions(+), 70 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 13fcabfc3..667458d29 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 @@ -37,7 +37,7 @@ class BigdataDealBatch extends BaseBatch{ def endDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMMdd"), -1, "yyyyMMdd")); - public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30) + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) def sourceMap = ["贝壳找房":"ke.com","我爱我家":"5i5j.com","链家在线":"lianjia.com","房天下":"fang.com","中原地产":"centanet.com","福州不动产":"","搜房":"fang.com"] public static final def offlineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.136:28017"; @@ -61,58 +61,58 @@ class BigdataDealBatch extends BaseBatch{ public void process(Object args) { //def weekend = DateUtils.parseFromTightByPattern("2021-07-25","yyyy-MM-dd")//DateUtils.getFirstDayOfWeek(new Date()) // def citys = CcbCommonUtils.citys; -// def citys = CcbCommonUtils.getRunningCitys(args) + def citys = CcbCommonUtils.getRunningCitys(args) if(args && args.size()>=2){ curDate = args[1].toString().toInteger() } println "curDate:"+curDate - def allCitys = ["福州"] //CommonDatautils.findAllCity() - for(def city : allCitys){ -// if(!ccbCitys.contains(city)){ - addDealPriceMatch(city); -// } +// def allCitys = CommonDatautils.findAllCity() +// for(def city : allCitys){ +//// if(!ccbCitys.contains(city)){ +// addDealPriceMatch(city); +//// } +// } + + + def rows = [] + def headers = []//["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"] + def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() + def index = 0 + for(def city : citys){ + index ++ + def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) + def ppeDists = [:] + + def statMap = [:]//getDistrictStatByCity(city, weekend) + if(city=="上海"){ + def youDataTrade = getYouDaData(statMap) + def youdaDatas = createData(youDataTrade, cityCodeDataMap, distCodeMap, "youda") + rows.addAll(youdaDatas) + println city +" "+youdaDatas.size() + } + + def trades = getCityData(city, statMap, ppeDists) + if(trades){ + def rets = createData(trades, cityCodeDataMap, distCodeMap, "other") + rows.addAll(rets) + println "【${index}】"+city +" 成交共:"+rets.size() + + def cityDatas = [] + cityDatas << headers + cityDatas.addAll(rows) + } + } + def fileName = "/home/goojia/ccb/BIGDATA_DEAL_GJ.dat" + if(CommonDatautils.isWindow()){ + fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_DEAL_GJ.dat" + } -// def rows = [] -// def headers = []//["城市ID","成交ID","城市名称","行政区ID","行政区名称","街道","门牌号","小区ID","小区名称","楼栋ID","楼栋编号","楼栋名称","单元ID","单元编号","单元名称","户ID","详细地址","建筑年代","权属","权属年限","期数","所在楼层","层类型","总楼层数","建筑类型","建筑结构","建筑面积","套内面积","户型","室","厅","厨","卫","房屋用途","室内结构","朝向","装修情况","评估编号","成交单价","成交总价","申报总价","评估总价","网签合同编号","交易日期","交易类型","出售付款方式","成交周期","是否有电梯","赠送面积(地面花园)","赠送面积(露台)","赠送面积(阳台)","赠送面积(飘窗)","赠送面积(阁楼)","赠送面积(车库)","赠送面积(地下室)","赠送面积(其他)","房源数据来源","中介公司ID","中介公司名称","备注","创建时间","更新时间","来源公司","成交金额","数据时间"] -// def cityCodeDataMap = CcbCommonUtils.findCityCodeValue() -// def index = 0 -// for(def city : citys){ -// index ++ -// def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) -// def ppeDists = [:] -// -// def statMap = [:]//getDistrictStatByCity(city, weekend) -// if(city=="上海"){ -// def youDataTrade = getYouDaData(statMap) -// def youdaDatas = createData(youDataTrade, cityCodeDataMap, distCodeMap, "youda") -// rows.addAll(youdaDatas) -// println city +" "+youdaDatas.size() -// } -// -// def trades = getCityData(city, statMap, ppeDists) -// if(trades){ -// def rets = createData(trades, cityCodeDataMap, distCodeMap, "other") -// rows.addAll(rets) -// println "【${index}】"+city +" 成交共:"+rets.size() -// -// def cityDatas = [] -// cityDatas << headers -// cityDatas.addAll(rows) -// } -// -// } -// -// def fileName = "/home/goojia/ccb/BIGDATA_DEAL_GJ.dat" -// if(CommonDatautils.isWindow()){ -// fileName = "d:\\数据\\建行\\房产估值\\数据文件\\txt\\BIGDATA_DEAL_GJ.dat" -// } -// -// FileUtils.batchCreateFile(rows, fileName,headers, "utf-8", false); -// println "txt 生成 " + rows.size() -// -// saveToPgSql(rows) + FileUtils.batchCreateFile(rows, fileName,headers, "utf-8", false); + println "txt 生成 " + rows.size() + + saveToPgSql(rows) } def createData(def rets, cityCodeDatas, distCodeMap, source){ @@ -652,9 +652,9 @@ class BigdataDealBatch extends BaseBatch{ for(def i=0;i=0.35 && estateCharege<=60){ return estateCharege; }else{ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy index 44e6641d4..b4ff6f8e2 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/OfficeFieldCleanBatch.groovy @@ -36,10 +36,10 @@ class OfficeFieldCleanBatch extends BaseBatch{ "virescence_percent":"greening_rate","cubage_percent":"plot_ratio","build_area":"build_area","all_area":"land_area" ,"finish_building_date":"finish_building_date","property_life":"property_life","standard_area":"standard_area","total_floor":"total_floor", "standard_height":"floor_height", "real_use_percent":"room_rate", "loop_line_info":"ring_location","car_site_count":"parking", - "parking_fee":"car_fee","elevators_count":"elevator_num","bay_area":"open_area"]//key:seaweed表字段 value:es表字段 + "parking_fee":"car_fee","elevators_count":"elevator_num","bay_area":"open_area","estate_type2":"property_type"]//key:seaweed表字段 value:es表字段 - //"安居客":"安居客app", - def sourceMap = ["房天下":"房天下","楼盘网":"楼盘网","办办网":"办办网","点点租":"点点租"] + // + def sourceMap = ["安居客":"安居客app","房天下":"房天下","楼盘网":"楼盘网","办办网":"办办网","点点租":"点点租"] def fieldMap = ["编号":"_id","城市":"city","区域":"region","名称":"name","别名":"alias","租金":"rent_price","板块":"block","物业公司":"estate_company","物业费":"estate_charge", "地址":"address","地址别名":"addr_alias","经度":"lng","纬度":"lat","类型":"estate_type2","建筑面积":"build_area","等级":"bed_kind", @@ -71,11 +71,11 @@ class OfficeFieldCleanBatch extends BaseBatch{ // addBlock() -// addFieldValue() + addFieldValue() // updateErrorField() - export() - test() +// export() +// test() // addOffice() } @@ -478,7 +478,12 @@ class OfficeFieldCleanBatch extends BaseBatch{ if(esVal){ def newVal = null if(seaweedfield == "estate_charge"){ - newVal = FiledStrand.processEstateCharge(c, FiledStrand.getNumber(esVal), dist.estate_type2) + if(dist.cat == "office"){ + newVal = FiledStrand.processEstateCharge(c, FiledStrand.getNumber(esVal), "office") + }else{ + newVal = FiledStrand.processEstateCharge(c, FiledStrand.getNumber(esVal), dist.estate_type2) + } + newVal = newVal.toString() } if(seaweedfield == "build_date" || seaweedfield == "live_date"){ @@ -532,7 +537,12 @@ class OfficeFieldCleanBatch extends BaseBatch{ } if(seaweedfield == "build_type"){ - newVal = FiledStrand.processBuildType(esVal, dist.estate_type2) + if(dist.cat == "office") { + newVal = FiledStrand.processBuildType(esVal, "office") + }else{ + newVal = FiledStrand.processBuildType(esVal, dist.estate_type2) + } + } if(seaweedfield == "land_property"){ @@ -570,6 +580,10 @@ class OfficeFieldCleanBatch extends BaseBatch{ newVal = esVal } + if(seaweedfield == "estate_type2"){ + newVal = FiledStrand.processEstateType(esVal) + } + if(newVal){ newValues.put(seaweedfield, newVal) } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy index 3df686d65..88b01f6c1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/paimai/BeiKeCrawlByChrome.groovy @@ -296,7 +296,10 @@ public class BeiKeCrawlByChrome { def detailDiv1 = JQueryUtils.select(".introContent .base", detailDoc) def detailDiv2 = JQueryUtils.select(".introContent .transaction", detailDoc) - def liftStr = detailDiv1.select("li:contains(梯户比例)").text().replace("梯户比例","") + def liftStr = null; + if(detailDiv1){ + liftStr = detailDiv1.select("li:contains(梯户比例)").text().replace("梯户比例","") + } if(liftStr){ detail.lift = DataFormatUtils.parseLift(liftStr) detail.lift_household = DataFormatUtils.parseHousehold(liftStr) From b92d6eb9a9c0457e7a2185fbf922376e8b00bf63 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Thu, 20 Jul 2023 17:18:22 +0800 Subject: [PATCH 15/19] update --- .../ccbevaluation/BigdataDealBatch.groovy | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 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 667458d29..03efd7a79 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 @@ -37,7 +37,7 @@ class BigdataDealBatch extends BaseBatch{ def endDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMMdd"), -1, "yyyyMMdd")); - public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) + public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30) def sourceMap = ["贝壳找房":"ke.com","我爱我家":"5i5j.com","链家在线":"lianjia.com","房天下":"fang.com","中原地产":"centanet.com","福州不动产":"","搜房":"fang.com"] public static final def offlineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.136:28017"; @@ -83,17 +83,18 @@ class BigdataDealBatch extends BaseBatch{ def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city) def ppeDists = [:] + def dealIds = findHistoryDealIds(city) def statMap = [:]//getDistrictStatByCity(city, weekend) if(city=="上海"){ def youDataTrade = getYouDaData(statMap) - def youdaDatas = createData(youDataTrade, cityCodeDataMap, distCodeMap, "youda") + def youdaDatas = createData(youDataTrade, cityCodeDataMap, distCodeMap, "youda", dealIds) rows.addAll(youdaDatas) println city +" "+youdaDatas.size() } def trades = getCityData(city, statMap, ppeDists) if(trades){ - def rets = createData(trades, cityCodeDataMap, distCodeMap, "other") + def rets = createData(trades, cityCodeDataMap, distCodeMap, "other", dealIds) rows.addAll(rets) println "【${index}】"+city +" 成交共:"+rets.size() @@ -115,7 +116,7 @@ class BigdataDealBatch extends BaseBatch{ saveToPgSql(rows) } - def createData(def rets, cityCodeDatas, distCodeMap, source){ + def createData(def rets, cityCodeDatas, distCodeMap, source, dealIds){ def result = Collections.synchronizedList(new ArrayList()); def totalCount = new AtomicLong() final CountDownLatch latch = new CountDownLatch(rets.size()) @@ -127,6 +128,10 @@ class BigdataDealBatch extends BaseBatch{ def ccbPriceMap = getCommunityPrices("上海") for(def i=0;i Date: Thu, 20 Jul 2023 17:37:06 +0800 Subject: [PATCH 16/19] update --- .../fangjia/script/ccbevaluation/BigdataDealBatch.groovy | 7 +++++-- .../script/gj/district/OfficeFieldCleanBatch.groovy | 8 ++++---- 2 files changed, 9 insertions(+), 6 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 03efd7a79..7f08e30ac 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 @@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CountDownLatch import java.util.concurrent.ExecutorService import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicLong import java.util.regex.Pattern @@ -84,6 +85,7 @@ class BigdataDealBatch extends BaseBatch{ def ppeDists = [:] def dealIds = findHistoryDealIds(city) + println "历史id加载量:"+dealIds.size() def statMap = [:]//getDistrictStatByCity(city, weekend) if(city=="上海"){ def youDataTrade = getYouDaData(statMap) @@ -129,7 +131,7 @@ class BigdataDealBatch extends BaseBatch{ for(def i=0;i Date: Thu, 20 Jul 2023 17:56:06 +0800 Subject: [PATCH 17/19] update --- .../script/ccbevaluation/BigdataDealBatch.groovy | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 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 7f08e30ac..d6f4bbf05 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 @@ -89,14 +89,14 @@ class BigdataDealBatch extends BaseBatch{ def statMap = [:]//getDistrictStatByCity(city, weekend) if(city=="上海"){ def youDataTrade = getYouDaData(statMap) - def youdaDatas = createData(youDataTrade, cityCodeDataMap, distCodeMap, "youda", dealIds) + def youdaDatas = createData(city, youDataTrade, cityCodeDataMap, distCodeMap, "youda", dealIds) rows.addAll(youdaDatas) println city +" "+youdaDatas.size() } def trades = getCityData(city, statMap, ppeDists) if(trades){ - def rets = createData(trades, cityCodeDataMap, distCodeMap, "other", dealIds) + def rets = createData(city, trades, cityCodeDataMap, distCodeMap, "other", dealIds) rows.addAll(rets) println "【${index}】"+city +" 成交共:"+rets.size() @@ -118,7 +118,7 @@ class BigdataDealBatch extends BaseBatch{ saveToPgSql(rows) } - def createData(def rets, cityCodeDatas, distCodeMap, source, dealIds){ + def createData(city, def rets, cityCodeDatas, distCodeMap, source, dealIds){ def result = Collections.synchronizedList(new ArrayList()); def totalCount = new AtomicLong() final CountDownLatch latch = new CountDownLatch(rets.size()) @@ -127,7 +127,11 @@ class BigdataDealBatch extends BaseBatch{ // def startDate = DateUtils.parseFromTightByPattern(DateUtils.addMonth(new Date(),-2),'yyyy-MM-dd') // def lianjiaPriceMap = getDistrictStatByCity("上海", startDate) - def ccbPriceMap = getCommunityPrices("上海") + def ccbPriceMap = null + if(city == "上海"){ + ccbPriceMap = getCommunityPrices("上海") + } + for(def i=0;i Date: Thu, 20 Jul 2023 18:08:38 +0800 Subject: [PATCH 18/19] update bug --- .../ccbevaluation/BigdataDealBatch.groovy | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 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 d6f4bbf05..2b9cba6de 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 @@ -134,30 +134,29 @@ class BigdataDealBatch extends BaseBatch{ for(def i=0;i Date: Fri, 21 Jul 2023 11:50:40 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E9=98=B2=E7=BB=8F=E7=BA=AC=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/controllers/weixin/WeiXinEvaluationController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 800a2360d..c89bc6f53 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 @@ -1282,7 +1282,10 @@ public class WeiXinEvaluationController { Point point = new Point(Double.valueOf(ll[0]), Double.valueOf(ll[1])); points.add(point); } - Point point = new Point(district.getLng2()/10000000000.0, district.getLat2()/10000000000.0); + Point point = null; + if(district.getLng2()!=null){ + point = new Point(district.getLng2()/10000000000.0, district.getLat2()/10000000000.0); + } //boolean flag = InsidePolygon.aboutZone(point, points); //boolean flag = InsidePolygon.isPtInPoly(point.getLon(), point.getLat(), points); boolean flag = InsidePolygon2.checkIsInPolygon(point, points);