From f6e421d4c5ee32e1ec7d68484081714dbf19287e Mon Sep 17 00:00:00 2001 From: mjt <13607600062@163.com> Date: Thu, 22 Feb 2024 14:47:10 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=89=E5=86=9C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../majintao/test/AliAddressTest.groovy | 72 +++++++++ .../test/AliAddressTestChecked.groovy | 76 +++++++++ .../script/majintao/test/FiveLevelTest.groovy | 64 ++++++++ .../script/majintao/test/SheNongTest.groovy | 124 +++++++++++++++ .../script/majintao/test/SheNongTest2.groovy | 147 ++++++++++++++++++ .../majintao/test/SheNongTestChecked.groovy | 44 ++++++ .../majintao/test/nanjingBankTest.groovy | 121 ++++++++++++++ .../test/sdklog/sdkclient_CommunicateLog_info | 0 .../test/sdklog/sdkclient_EMAYSDK_info | 0 .../fangjia/script/majintao/test/test.groovy | 72 +++++++++ .../com/fangjia/script/util/ExcelUtils.groovy | 2 +- 11 files changed, 721 insertions(+), 1 deletion(-) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTest.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTestChecked.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/FiveLevelTest.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest2.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTestChecked.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/nanjingBankTest.groovy create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_CommunicateLog_info create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_EMAYSDK_info create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTest.groovy new file mode 100644 index 000000000..1ac784f05 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTest.groovy @@ -0,0 +1,72 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.gj.village.ailiyun.SignatureUtils +import com.fangjia.script.util.ExcelUtils + +//def address = "江苏省徐州市贾汪区经济开发区大黄山镇孤山小区B3.801" +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\涉农对私测试数据.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +def count = 0 +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + + count = count + 1 + if (count % 10 == 0) { + println("已处理:" + count) + } + sleep(50) + + def address = items['A'] + def map = SignatureUtils.getAliAddressStrc(address) + //prov=河南省 city=信阳市 district=息县 town=孙庙乡 community=前赵楼村 road=前赵楼村 poi=爱婆店 roomno=012 + if ("prov" in map) { + def province = map.get("prov") + items['D'] = province + } + if ("city" in map) { + def city = map.get("city") + items['H'] = city + } + if ("district" in map) { + def district = map.get("district") + items['L'] = district + } + if ("town" in map) { + def town = map.get("town") + items['P'] = town + } + if ("community" in map) { + def community = map.get("community") + items['T'] = community + + } +// if ("road" in map) { +// def road = map.get("road") +// items['G'] = road +// +// } +// if ("poi" in map) { +// +// def poi = map.get("poi") +// items['H'] = poi +// +// } +// if ("roomno" in map) { +// def roomno = map.get("roomno") +// items['I'] = roomno +// +// } +// if ("devzone" in map) { +// def devzone = map.get("devzone") +// items['J'] = devzone +// +// } +// if ("roadno" in map) { +// def roadno = map.get("roadno") +// items['K'] = roadno +// } + + +}) + + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTestChecked.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTestChecked.groovy new file mode 100644 index 000000000..e744b76d4 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/AliAddressTestChecked.groovy @@ -0,0 +1,76 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.gj.village.ailiyun.SignatureUtils +import com.fangjia.script.util.ExcelUtils + +//def address = "江苏省徐州市贾汪区经济开发区大黄山镇孤山小区B3.801" +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\涉农对私测试数据.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +def count = 0 +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + + count = count + 1 + if (count % 10 == 0) { + println("已处理:" + count) + } + sleep(50) + + def address = items['A'] + def pro = items['D'] + if (pro == null) { + + def map = SignatureUtils.getAliAddressStrc(address) + //prov=河南省 city=信阳市 district=息县 town=孙庙乡 community=前赵楼村 road=前赵楼村 poi=爱婆店 roomno=012 + if ("prov" in map) { + def province = map.get("prov") + items['D'] = province + } + if ("city" in map) { + def city = map.get("city") + items['H'] = city + } + if ("district" in map) { + def district = map.get("district") + items['L'] = district + } + if ("town" in map) { + def town = map.get("town") + items['P'] = town + } + if ("community" in map) { + def community = map.get("community") + items['T'] = community + + } +// if ("road" in map) { +// def road = map.get("road") +// items['G'] = road +// +// } +// if ("poi" in map) { +// +// def poi = map.get("poi") +// items['H'] = poi +// +// } +// if ("roomno" in map) { +// def roomno = map.get("roomno") +// items['I'] = roomno +// +// } +// if ("devzone" in map) { +// def devzone = map.get("devzone") +// items['J'] = devzone +// +// } +// if ("roadno" in map) { +// def roadno = map.get("roadno") +// items['K'] = roadno +// } + } + + +}) + + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/FiveLevelTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/FiveLevelTest.groovy new file mode 100644 index 000000000..a430f9480 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/FiveLevelTest.groovy @@ -0,0 +1,64 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.util.ExcelUtils +import net.sf.json.JSONObject + + +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\临时数据\\2.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + + String url = "http://192.168.0.19:31080/FangJiaAddressService/v3/structure"; + + HttpRequest httpRequest = new HttpRequest(); + map = new HashMap() + + String address = items['A'] + + def map = [:] + map.put("address", address) + map.put("complete", "true") + map.put("addressAssessment", "true") + + def content = httpRequest.getJsonContent(url, map, "UTF-8") + def result = content.get("result") + if ("province" in result) { + items['B'] = result.get("province") + } + if ("provinceCode" in result) { + items['C'] = result.get("provinceCode") + } + if ("city" in result){ + items['D'] = result.get("city") + } + if("cityCode" in result){ + items['E'] = result.get("cityCode") + } + if ("district" in result){ + + items['F'] = result.get("district") + } + if ("districtCode" in result){ + + items['G'] = result.get("districtCode") + } + if ("township" in result){ + + items['H'] = result.get("township") + } + if ("townshipCode" in result){ + + items['I'] = result.get("townshipCode") + print(result.get("townshipCode")) + } + if ("address" in result){ + + items['J'] = result.get("address") + } + if ("formatAddress" in result){ + items['K'] = result.get("formatAddress") + } + +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest.groovy new file mode 100644 index 000000000..c1575a52f --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest.groovy @@ -0,0 +1,124 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.util.ExcelUtils + + +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\涉农对私测试数据.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +def count = 0 +ExcelUtils.multiThreadingModify(excelFilePath, { List items -> + count += 1 + if (count % 10 == 0) { + println("已处理:" + count) + } + + + String address = items['A'] + String province = items['B'] + if (province == null) { + String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; + + HttpRequest httpRequest = new HttpRequest(); + map = new HashMap() + + + def map = [:] + map.put("address", address) + map.put("complete", "true") + map.put("addressAssessment", "true") + map.put("type", "1") + + def content = httpRequest.getJsonContent(url, map, "UTF-8") + def result = content.get("result") + if (result != null) { + if ("province" in result) { + items['B'] = result.get("province") + } + if ("provinceCode" in result) { + items['C'] = result.get("provinceCode") + } + if ("city" in result) { + items['D'] = result.get("city") + } + if ("cityCode" in result) { + items['E'] = result.get("cityCode") + } + if ("district" in result) { + + items['F'] = result.get("district") + } + if ("districtCode" in result) { + + items['G'] = result.get("districtCode") + } + if ("town" in result) { + + items['H'] = result.get("town") + } + if ("townCode" in result) { + + items['I'] = result.get("townCode") + } + + if ("committee" in result) { + + items['J'] = result.get("committee") + } + if ("committeeCode" in result) { + + items['K'] = result.get("committeeCode") + } + if ("typeCode" in result) { + + items['L'] = result.get("typeCode") + } + if ("typeName") { + items['M'] = result.get("typeName") + } + if ("verifyFlag") { + items['N'] = result.get("verifyFlag") + } + if ("addrVerify") { + items['O'] = result.get("addrVerify") + } + if ("countyLevelCity") { + items['P'] = result.get("countyLevelCity") + } + if ("countyGov") { + items['Q'] = result.get("countyGov") + } + if ("communitySource") { + items['R'] = result.get("communitySource") + } + + if ("administrativeTowns" in result) { + items['T'] = result.get("administrativeTowns") + } + if ("devDistrict" in result) { + items['V'] = result.get("devDistrict") + } + if ("devDistrictName" in result) { + items['W'] = result.get("devDistrictName") + } + if ("splitCommittee" in result) { + items['X'] = result.get("splitCommittee") + } + if ("splitStreet" in result) { + items['Y'] = result.get("splitStreet") + } + if ("poiName" in result) { + items['Z'] = result.get("poiName") + } + if ("splitStreetNum" in result) { + items['AA'] = result.get("splitStreetNum") + } + if ("dev" in result) { + items['AB'] = result.get("dev") + } + } + + } + +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest2.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest2.groovy new file mode 100644 index 000000000..7b84a95d5 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTest2.groovy @@ -0,0 +1,147 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.util.ExcelUtils + + +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\对公.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +def count = 0 +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + count+=1 + if (count%10==0){ + println("已处理:"+count) + } + + String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; + + HttpRequest httpRequest = new HttpRequest(); + map = new HashMap() + + String address = items['A'] +// print(address) + +// province; +// city; +// district; +// town; +// committee; +// type; +// provinceCode; +// cityCode; +// districtCode; +// townCode; +// committeeCode; +// typeCode; +// typeName; +// verifyFlag;//涉农标识 +// addrVerify;//地址是否有效信息 +// countyLevelCity;//是否为县级市 +// administrativeTowns;//是否市辖建制镇 +// countyGov;//是否为县政府 +// devDistrict;//是否为开发区 +// devDistrictName;//开发区 +// splitCommittee; +// splitStreet; +// poiName; +// splitStreetNum; +// dev; +// communitySource;//居委来源 + + def map = [:] + map.put("address", address) + map.put("complete", "true") + map.put("addressAssessment", "true") + map.put("type", "2") + + def content = httpRequest.getJsonContent(url, map, "UTF-8") + def result = content.get("result") + if ("province" in result) { + items['B'] = result.get("province") + } + if ("provinceCode" in result) { + items['C'] = result.get("provinceCode") + } + if ("city" in result){ + items['D'] = result.get("city") + } + if("cityCode" in result){ + items['E'] = result.get("cityCode") + } + if ("district" in result){ + + items['F'] = result.get("district") + } + if ("districtCode" in result){ + + items['G'] = result.get("districtCode") + } + if ("town" in result){ + + items['H'] = result.get("town") + } + if ("townCode" in result){ + + items['I'] = result.get("townCode") + } + + if ("committee" in result){ + + items['J'] = result.get("committee") + } + if ("committeeCode" in result){ + + items['K'] = result.get("committeeCode") + } + if ("typeCode" in result){ + + items['L'] = result.get("typeCode") + } + if ("typeName"){ + items['M'] = result.get("typeName") + } + if ("verifyFlag"){ + items['N'] = result.get("verifyFlag") + } + if ("addrVerify"){ + items['O'] = result.get("addrVerify") + } + if ("countyLevelCity"){ + items['P'] = result.get("countyLevelCity") + } + if ("countyGov"){ + items['Q'] = result.get("countyGov") + } + if ("communitySource"){ + items['R'] = result.get("communitySource") + } + + if ("administrativeTowns" in result){ + items['T'] = result.get("administrativeTowns") + } + if ("devDistrict" in result){ + items['V'] = result.get("devDistrict") + } + if ("devDistrictName" in result){ + items['W'] = result.get("devDistrictName") + } + if ("splitCommittee" in result){ + items['X'] = result.get("splitCommittee") + } + if ("splitStreet" in result){ + items['Y'] = result.get("splitStreet") + } + if ("poiName" in result){ + items['Z'] = result.get("poiName") + } + if ("splitStreetNum" in result){ + items['AA'] = result.get("splitStreetNum") + } + if ("dev" in result){ + items['AB'] = result.get("dev") + } + + + +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTestChecked.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTestChecked.groovy new file mode 100644 index 000000000..8388fae47 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/SheNongTestChecked.groovy @@ -0,0 +1,44 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.util.ExcelUtils + + +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\涉农对私测试数据 - 副本.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +def count = 0 +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + count += 1 + if (count % 10 == 0) { + println("已处理:" + count) + } + + + String flag = items['X'] + String address = items['A'] + String tt = items['Y'] + if (flag == null&&"地址有效".equals(tt)) { + String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; + + HttpRequest httpRequest = new HttpRequest(); + map = new HashMap() + + + def map = [:] + map.put("address", address) + map.put("complete", "true") + map.put("addressAssessment", "true") + map.put("type", "1") + + def content = httpRequest.getJsonContent(url, map, "UTF-8") + def result = content.get("result") + if (result != null) { + if ("verifyFlag" in result) { + items['X'] = result.get("verifyFlag") + } + } + + } + +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/nanjingBankTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/nanjingBankTest.groovy new file mode 100644 index 000000000..f59dcafe2 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/nanjingBankTest.groovy @@ -0,0 +1,121 @@ +package com.fangjia.script.majintao.test + + + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.util.ExcelUtils + + +String excelFilePath = "C:\\Users\\Goojia\\Desktop\\南京银行测试.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +def count = 0 +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + count+=1 + if (count%10==0){ + println("已处理:"+count) + } + + String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; + + HttpRequest httpRequest = new HttpRequest(); + map = new HashMap() + + String address = items['A'] + + def map = [:] + map.put("address", address) + map.put("complete", "true") + map.put("addressAssessment", "true") + map.put("type", "2") + + def content = httpRequest.getJsonContent(url, map, "UTF-8") + def result = content.get("result") + if ("province" in result) { + items['B'] = result.get("province") + } + if ("provinceCode" in result) { + items['C'] = result.get("provinceCode") + } + if ("city" in result){ + items['D'] = result.get("city") + } + if("cityCode" in result){ + items['E'] = result.get("cityCode") + } + if ("district" in result){ + + items['F'] = result.get("district") + } + if ("districtCode" in result){ + + items['G'] = result.get("districtCode") + } + if ("town" in result){ + + items['H'] = result.get("town") + } + if ("townCode" in result){ + + items['I'] = result.get("townCode") + } + + if ("committee" in result){ + + items['J'] = result.get("committee") + } + if ("committeeCode" in result){ + + items['K'] = result.get("committeeCode") + } + if ("typeCode" in result){ + + items['L'] = result.get("typeCode") + } + if ("typeName"){ + items['M'] = result.get("typeName") + } + if ("verifyFlag"){ + items['N'] = result.get("verifyFlag") + } + if ("addrVerify"){ + items['O'] = result.get("addrVerify") + } + if ("countyLevelCity"){ + items['P'] = result.get("countyLevelCity") + } + if ("countyGov"){ + items['Q'] = result.get("countyGov") + } +// if ("communitySource"){ +// items['R'] = result.get("communitySource") +// } +// +// if ("administrativeTowns" in result){ +// items['T'] = result.get("administrativeTowns") +// } +// if ("devDistrict" in result){ +// items['V'] = result.get("devDistrict") +// } +// if ("devDistrictName" in result){ +// items['W'] = result.get("devDistrictName") +// } +// if ("splitCommittee" in result){ +// items['X'] = result.get("splitCommittee") +// } +// if ("splitStreet" in result){ +// items['Y'] = result.get("splitStreet") +// } +// if ("poiName" in result){ +// items['Z'] = result.get("poiName") +// } +// if ("splitStreetNum" in result){ +// items['AA'] = result.get("splitStreetNum") +// } +// if ("dev" in result){ +// items['AB'] = result.get("dev") +// } + + + +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_CommunicateLog_info b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_CommunicateLog_info new file mode 100644 index 000000000..e69de29bb diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_EMAYSDK_info b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_EMAYSDK_info new file mode 100644 index 000000000..e69de29bb diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy new file mode 100644 index 000000000..22a5ae18e --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy @@ -0,0 +1,72 @@ +package com.fangjia.script.majintao.test + +import com.fangjia.core.util.HttpRequest +import com.fangjia.script.util.ExcelUtils +import net.sf.json.JSONObject + + +String excelFilePath = "F:\\估家\\文件\\北交所\\testcopy1.xlsx"; +ExcelUtils.removeEmptyRow(excelFilePath) +ExcelUtils.singleThreadingModify(excelFilePath, { List items -> + + String comprehensiveUrl = "http://localhost:9180/comprehensiveQuery/houseValueInformation"; + String communityUrl = "http://open.fangjia.com/addrSvc/avgPrice"; + String valueUrl = "http://open.fangjia.com/property/addressEvaluate"; + String caseUrl = "http://open.fangjia.com/house/case"; + String poiUrl = "http://open.fangjia.com/district/addrFacilitys"; + + HttpRequest httpRequest = new HttpRequest(); + map = new HashMap() + + String city = items['A'] + String address = items['B'] + double size = items['C'] + + System.out.println(city + "---" + address + "----" + size); + + map.put("city", city) + map.put("address", address) + map.put("size", size.toString()) + map.put("strctureArea", size.toString()) + map.put("token", "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB") + + if (!address.contains("%")) { + // 发送HTTP请求 + long start + long end + +// start = System.currentTimeMillis(); +// httpRequest.getJsonContent(communityUrl, map, "UTF-8") +// +// +// end = System.currentTimeMillis(); +// items['D'] = String.valueOf(end - start); +// +// start = System.currentTimeMillis(); +// httpRequest.getJsonContent(valueUrl, map, "UTF-8") +// end = System.currentTimeMillis(); +// items['E'] = String.valueOf(end - start); +// +// start = System.currentTimeMillis(); +// httpRequest.getJsonContent(caseUrl, map, "UTF-8") +// end = System.currentTimeMillis(); +// items['F'] = String.valueOf(end - start); +// +// start = System.currentTimeMillis(); +// httpRequest.getJsonContent(poiUrl, map, "UTF-8") +// end = System.currentTimeMillis(); +// items['G'] = String.valueOf(end - start); + + start = System.currentTimeMillis(); + def content = httpRequest.getJsonContent(comprehensiveUrl, map, "UTF-8") + end = System.currentTimeMillis(); + items['H'] = String.valueOf(end - start); + println content.get("msg") + if(content.get("msg").contains("该地址不支持估价!")) { + items['I'] = "该地址不支持估价!" + } + } + + +}) + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ExcelUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ExcelUtils.groovy index 87c14b741..8af7a4d6c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ExcelUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/ExcelUtils.groovy @@ -454,7 +454,7 @@ public class ExcelUtils{ def data = ExcelUtils.read(fileName, srcSheetIndex, 0) def body = data.subList(1, data.size()) - def nThread = Runtime.getRuntime().availableProcessors() * 3 + def nThread = 10 println nThread ExecutorService executorService = Executors.newFixedThreadPool(3) final AtomicInteger counter = new AtomicInteger(0) From fd9c30d68c6c665d916a4f330f3344846e7fe4f4 Mon Sep 17 00:00:00 2001 From: mjt <13607600062@163.com> Date: Mon, 26 Feb 2024 13:46:04 +0800 Subject: [PATCH 02/11] =?UTF-8?q?open=E6=96=B0=E5=A2=9E=E6=B6=89=E5=86=9C?= =?UTF-8?q?=E6=96=B0=E8=A7=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/controllers/AddrSvcController.java | 63 ++++++++++++++++--- .../com/fangjia/open/model/AddressModel.java | 20 ++++++ 2 files changed, 76 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java index 020332464..e7dc05ae8 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddrSvcController.java @@ -206,7 +206,7 @@ public class AddrSvcController { //新匹配接口 json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8"); BasicModel basicModel = new BasicModel(200, "ok"); - if (json != null && json.size()>0) { + if (json != null && json.size() > 0) { basicModel.setResult(CommonDtoUtils.transformV(MatchedBuildingDto.class, json)); } mav.setModel(basicModel); @@ -284,16 +284,16 @@ public class AddrSvcController { //新匹配接口 json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8"); BasicModel basicModel = new BasicModel(200, "ok"); - if (json != null && json.size()>0) { + if (json != null && json.size() > 0) { MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json); - District district = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(),"district"); + District district = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(), "district"); if (null != district) { DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(dto.getCity(), dto.getDistrict(), dto.getName())); - if(null != statBo){ - if(statBo.getDistrictStat()!=null){ + if (null != statBo) { + if (statBo.getDistrictStat() != null) { dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice()); - }else if(statBo.getVillaDistrictStat()!=null){ + } else if (statBo.getVillaDistrictStat() != null) { dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice()); } @@ -309,8 +309,9 @@ public class AddrSvcController { return mav; } + /** - *五级地址标准化 + * 五级地址标准化 * * @param model * @return @@ -357,6 +358,54 @@ public class AddrSvcController { return mav; } + /** + * 涉农识别-新规则 + * + * @param model + * @return + */ + public Object villageIdentifyAction(AddressModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getAddress())) { + mav.setModel(BasicModel.buildBadRequestModel("地址不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null); + params.put("address", model.getAddress()); + params.put("type", StringUtils.isNotBlank(model.getType()) ? model.getType() : null); + params.put("showFullValue", StringUtils.isNotBlank(model.getShowFullValue()) ? model.getShowFullValue() : null); + params.put("showTestValue", StringUtils.isNotBlank(model.getShowTestValue()) ? model.getShowTestValue() : null); + Integer radius = model.getRadius(); + params.put("radius", (radius != null && radius != 0) ? radius.toString() : null); + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); + } catch (Exception e) { + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + if (json != null) { + int code = json.getInt("msgCode"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if (json.containsKey("result")) { + basicModel.setResult(json.get("result")); + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + public void setDistrictStatService(DistrictStatService districtStatService) { this.districtStatService = districtStatService; } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/AddressModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/AddressModel.java index 4572cb47e..fe0a1741d 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/AddressModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/AddressModel.java @@ -42,6 +42,10 @@ public class AddressModel extends FangjiaApiModel { //是否使用地图poi数据 private boolean useMap; + //涉农到区之后,是否显式后面的字段值 + private String showFullValue; + //是否显示涉农测试用字段值 + private String showTestValue; public boolean isContainsLocation() { return containsLocation; } @@ -258,4 +262,20 @@ public class AddressModel extends FangjiaApiModel { public void setUseMap(boolean useMap) { this.useMap = useMap; } + + public String getShowFullValue() { + return showFullValue; + } + + public void setShowFullValue(String showFullValue) { + this.showFullValue = showFullValue; + } + + public String getShowTestValue() { + return showTestValue; + } + + public void setShowTestValue(String showTestValue) { + this.showTestValue = showTestValue; + } } From dc4827865b3a6d2e44bf7a063b275f6e3d8a2629 Mon Sep 17 00:00:00 2001 From: mjt <13607600062@163.com> Date: Wed, 28 Feb 2024 10:43:15 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=B1=9F=E5=8D=97=E8=A1=8C=E6=88=BF?= =?UTF-8?q?=E6=BA=90=E6=95=B0=E6=8D=AEBUG=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/service/datastore/CzbankSampleServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java index f2185a8ad..588044016 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CzbankSampleServiceImpl.java @@ -250,6 +250,8 @@ public class CzbankSampleServiceImpl implements CzbankSampleService { selectedSample.add(querySamples.get(i)); } fillOthersInfo(selectedSample); + // 将最终样本进行排序 + sortForSample(selectedSample, target); List sampleList = new ArrayList(selectedSample.size()); for (SampleWrapper sampleWrapper : selectedSample) { From 6c88842f3611a52297ae83af756f9b8826b697e9 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 28 Feb 2024 16:20:23 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=8F=91=E9=82=AE=E4=BB=B6=E6=94=B9?= =?UTF-8?q?=E4=B8=BAwangwenyan@fangjia.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groovy/com/fangjia/script/Watcher.groovy | 51 +++++++-------- .../script/dailyCount/ApiDailyCount.groovy | 4 +- .../fangjia/script/gj/YouDaDataParser.groovy | 4 +- .../script/gj/village/GuangdaTest.groovy | 65 +++++++++++++++---- .../gj/xiamen/GaoDePoiDataProcess.groovy | 13 ++-- .../thirdPriceCrawl/SynchDistrictPrice.groovy | 4 +- .../ApiDailyCountOfficialAccount.groovy | 4 +- 7 files changed, 92 insertions(+), 53 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/Watcher.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/Watcher.groovy index 004d6bd4a..40fe526e8 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/Watcher.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/Watcher.groovy @@ -2,36 +2,35 @@ package com.fangjia.script public enum Watcher { //离职同事 - LiuPeiPei('13621626685', 'duxiaoyu@fangjia.com'), - YanZhou('13621626685','duxiaoyu@fangjia.com'), - HuangXiaoHu('13621626685', 'duxiaoyu@fangjia.com'), - SongYingXia('13621626685', 'duxiaoyu@fangjia.com'), - YuKai('13621626685', 'duxiaoyu@fangjia.com'), - RuanYaDong('13621626685', 'duxiaoyu@fangjia.com'), - Reda('13621626685', 'duxiaoyu@fangjia.com'), - Tomzhao('13621626685','duxiaoyu@fangjia.com'), - YuHai('13621626685','duxiaoyu@fangjia.com'), - Shibb('13621626685','duxiaoyu@fangjia.com'), - HeLvYuan('13621626685','duxiaoyu@fangjia.com'), - WangYuHui('13621626685','duxiaoyu@fangjia.com'), - LinXiaoShuai('15801810393','linxiaoshuai@fangjia.com'), - FangRui('17717680589','fangrui@fangjia.com'), - //DuXiaoYu('13621626685', 'duxiaoyu@fangjia.com'), + LiuPeiPei('13621626685', 'wangwenyan@fangjia.com'), + YanZhou('13621626685','wangwenyan@fangjia.com'), + HuangXiaoHu('13621626685', 'wangwenyan@fangjia.com'), + SongYingXia('13621626685', 'wangwenyan@fangjia.com'), + YuKai('13621626685', 'wangwenyan@fangjia.com'), + RuanYaDong('13621626685', 'wangwenyan@fangjia.com'), + Reda('13621626685', 'wangwenyan@fangjia.com'), + Tomzhao('13621626685','wangwenyan@fangjia.com'), + YuHai('13621626685','wangwenyan@fangjia.com'), + Shibb('13621626685','wangwenyan@fangjia.com'), + HeLvYuan('13621626685','wangwenyan@fangjia.com'), + WangYuHui('13621626685','wangwenyan@fangjia.com'), + LinXiaoShuai('15801810393','wangwenyan@fangjia.com'), + FangRui('17717680589','wangwenyan@fangjia.com'), + DuXiaoYu('13621626685', 'wangwenyan@fangjia.com'), //在职同事 - DuXiaoYu('13916076378', 'wangwenyan@fangjia.com'), - LiXue('13311649646','lixue@fangjia.com'), + LiXue('13311649646','wangwenyan@fangjia.com'), WangWenYan('13916076378','wangwenyan@fangjia.com'), GaoJuan('15021384995','gaojuan@fangjia.com'), - Hubingliang('15179856208','hubingliang@126.com'), - ZhouTongYun('13585834921','zhoutongyun@fangjia.com'), - YinJiHuan('18217642009','yinjihuan@fangjia.com'), - Xuhe('13862416422','xuhe@fangjia.com'), - ZongZhiMin('18260046486','zongzhimin@fangjia.com'), - RaoYanHui('18516539752','raoyanhui@fangjia.com'), - BaYi('15300424133','bayi@fangjia.com'), - WeiLei('18101751850','weilei@fangjia.com'), - JiangYaHui('13684913780','jiangyahui@fangjia.com'), + Hubingliang('15179856208','wangwenyan@fangjia.com'), + ZhouTongYun('13585834921','wangwenyan@fangjia.com'), + YinJiHuan('18217642009','wangwenyan@fangjia.com'), + Xuhe('13862416422','wangwenyan@fangjia.com'), + ZongZhiMin('18260046486','wangwenyan@fangjia.com'), + RaoYanHui('18516539752','wangwenyan@fangjia.com'), + BaYi('15300424133','wangwenyan@fangjia.com'), + WeiLei('18101751850','wangwenyan@fangjia.com'), + JiangYaHui('13684913780','wangwenyan@fangjia.com'), ShenJian('13764369683', 'shenjian@fangjia.com') private final String mobile; private final String email; diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/dailyCount/ApiDailyCount.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/dailyCount/ApiDailyCount.groovy index 6212900b5..a0ed5c281 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/dailyCount/ApiDailyCount.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/dailyCount/ApiDailyCount.groovy @@ -27,8 +27,8 @@ class ApiDailyCount extends BaseBatch{ private static final Jms jms = Jms.create('tcp://monitor.jms.db.fangjia.com:61616') def static emails = [ - 'xuqi@fangjia.com', - 'zongzhimin@fangjia.com' + 'wangwenyan@fangjia.com', + 'gaojuan@fangjia.com' ] static void main(String[] 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 621b548e7..c40aca736 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 @@ -52,9 +52,9 @@ class YouDaDataParser { static main(args) { def task = new YouDaDataParser(); // task.newHouseparse();//友达一手房存入mongo - task.esfParser("D:\\数据\\友达\\2024年1月\\查询1.DBF");//友达二手房存入mongo +// task.esfParser("D:\\数据\\友达\\2024年2月\\查询1.DBF");//友达二手房存入mongo // task.newhouseToSaveEs();//新房保存到es -// task.esfhouseToSaveEs();//二手房保存到es + task.esfhouseToSaveEs();//二手房保存到es // task.updateFinishDateByEsfTrade();//根据二手成交的竣工时间修改seaweed库中的竣工时间 } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy index 7d683c976..1196b6bd2 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/village/GuangdaTest.groovy @@ -18,7 +18,44 @@ DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) -def filePath = "D:\\数据\\光大\\全量.xlsx" +def filePath = "D:\\数据\\南京\\南京银行测试-新跑.xlsx" +ExcelUtils.multiThreadingModify(filePath, { row -> + def communityObj = null + if(row['E']){ + communityObj = findCommunityTown(community_CONN, row['C'], row['D'], row['E']) + } + if(communityObj){ + row['M'] = communityObj.province_code + row['N'] = communityObj.city_code + row['O'] = communityObj.area_code + row['P'] = communityObj.street_code + } + if(row['D']){ + if(row['D'].toString().endsWith("区")){ + row['F'] = "非农" + }else{ + if(communityObj){ + if(communityObj.has_gov && communityObj.has_gov=="是"){ + row['I'] = "是" + row['F'] = "非农" + }else{ + row['I'] = "否" + if(row['E']){ + def townObj = isTown(row['C'], row['D'], row['E']) + if(townObj){ + row['J'] = "是" + row['F'] = "非农" + }else{ + row['F'] = "农" + } + } + } + } + } + } + +}); +//def filePath = "D:\\数据\\光大\\全量.xlsx" //ExcelUtils.modify(filePath, { row -> // if(!row['O']){ // def jsonObj = FangjiaClientUtils.villageIdentify(null, row['A']) @@ -62,19 +99,19 @@ def filePath = "D:\\ // } // } - def retMap = SignatureUtils.getAliAddressStrc(row['A']) - println row['A'] +" " + retMap.toString() - if(retMap){ - row['Y'] = retMap.prov - row['Z'] = retMap.city - row['AA'] = retMap.district - row['AB'] = retMap.town - row['AC'] = retMap.devzone - row['AD'] = retMap.road - row['AE'] = retMap.roadno - row['AF'] = retMap.poi - row['AG'] = retMap.subpoi - } +// def retMap = SignatureUtils.getAliAddressStrc(row['A']) +// println row['A'] +" " + retMap.toString() +// if(retMap){ +// row['Y'] = retMap.prov +// row['Z'] = retMap.city +// row['AA'] = retMap.district +// row['AB'] = retMap.town +// row['AC'] = retMap.devzone +// row['AD'] = retMap.road +// row['AE'] = retMap.roadno +// row['AF'] = retMap.poi +// row['AG'] = retMap.subpoi +// } // }) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy index d5d8303d5..cfda2228d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/GaoDePoiDataProcess.groovy @@ -66,8 +66,10 @@ class GaoDePoiDataProcess extends BaseBatch{ @Override void process(Object args) { // println ProvinceData.getProvince("成都") - synchMapPoi(); -// synchCompany() +// synchMapPoi(); + + + synchCompany() // poiCatProcess() // addressAndCatProcess() // synchNetwork() @@ -99,10 +101,10 @@ class GaoDePoiDataProcess extends BaseBatch{ def synchCompany(){ fullCityMap = CommonDatautils.queryFullNameCity() //"三明市","宁德市","泉州市","厦门市","福州市","漳州市","南平市","龙岩市","莆田市", - def citys = ["湖州市"] + def citys = ["杭州","宁波","温州","嘉兴","台州","绍兴","金华","舟山","衢州","丽水"] for(def sampleCity : citys){ - def cityObj = fullCityMap.get("湖州"); + def cityObj = fullCityMap.get(sampleCity); def city = null if(cityObj){ city = cityObj.city @@ -112,6 +114,7 @@ class GaoDePoiDataProcess extends BaseBatch{ println city+ " 加载公司数据:"+companyDatas.size() def rows = running(city, companyDatas, "company", townMap) save(city, rows) +// saveToMG(city, rows) println "完成" } } @@ -182,7 +185,7 @@ class GaoDePoiDataProcess extends BaseBatch{ def createCompanyData(map, townMap){ def retMap = [:] - retMap._id = map._id + retMap.data_id = map._id.toString() retMap.fjw_province = map.province_name retMap.fjw_city = map.city_name diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy index 7c9ed802c..33e407462 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice.groovy @@ -26,8 +26,8 @@ class SynchDistrictPrice extends BaseBatch{ // "吉屋":"吉屋","365淘房":"365淘房","我爱我家":"我爱我家","诸葛找房APP":"诸葛找房","贝壳":"贝壳找房","链家":"链家","Q房":"Q房","麦田":"麦田", // "中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","乐有家":"乐有家","C21":"C21","城市房产":"城市房产","兔博士PC端":"兔博士" -// def esSources = ["我爱我家":"我爱我家","兔博士PC端":"兔博士","吉屋":"吉屋","贝壳找房":"贝壳找房","乐有家":"乐有家","365淘房":"365淘房","诸葛找房APP":"诸葛找房","链家":"链家","Q房":"Q房","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","C21":"C21","城市房产":"城市房产"] - def esSources = ["我爱我家":"我爱我家","兔博士PC端":"兔博士","吉屋":"吉屋","贝壳找房":"贝壳找房","乐有家":"乐有家","365淘房":"365淘房","诸葛找房APP":"诸葛找房","链家":"链家","Q房":"Q房","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","C21":"C21","城市房产":"城市房产","幸福里APP":"幸福里"] +// def esSources = ["搜房":"搜房"] + def esSources = ["我爱我家":"我爱我家","兔博士PC端":"兔博士","吉屋":"吉屋","贝壳找房":"贝壳找房","乐有家":"乐有家","365淘房":"365淘房","诸葛找房APP":"诸葛找房","链家":"链家","Q房":"Q房","麦田":"麦田","中原地产":"中原地产","安居客小程序":"安居客","搜房":"搜房","C21":"C21","城市房产小程序":"城市房产","幸福里APP":"幸福里"] static main(args) { runBatch(new SynchDistrictPrice(), args); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy index 4d695b799..e6425178c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy @@ -27,8 +27,8 @@ class ApiDailyCountOfficialAccount extends BaseBatch{ private static final Jms jms = Jms.create('tcp://monitor.jms.db.fangjia.com:61616') def static emails = [ - 'xuqi@fangjia.com', - 'zongzhimin@fangjia.com' + 'wangwenyan@fangjia.com', + 'gaojuan@fangjia.com' ] static void main(String[] args){ From 3791c3dd8ff9def9a2bdfa9c8b32d2cf686ee482 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 28 Feb 2024 16:25:59 +0800 Subject: [PATCH 05/11] updadte --- .../script/zongzhimin/ApiDailyCountOfficialAccount.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy index e6425178c..366adad0f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/zongzhimin/ApiDailyCountOfficialAccount.groovy @@ -27,8 +27,7 @@ class ApiDailyCountOfficialAccount extends BaseBatch{ private static final Jms jms = Jms.create('tcp://monitor.jms.db.fangjia.com:61616') def static emails = [ - 'wangwenyan@fangjia.com', - 'gaojuan@fangjia.com' + 'wangwenyan@fangjia.com' ] static void main(String[] args){ From 38c3b4d762b5b713aac7e6c9a391bccf1174292a Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 28 Feb 2024 16:52:02 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=8E=BB=E9=98=BF=E9=87=8C=E4=BA=91?= =?UTF-8?q?=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/fangjia-script/pom.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/projects/fangjia-script/pom.xml b/projects/fangjia-script/pom.xml index e04dc02ff..b98b25ab1 100644 --- a/projects/fangjia-script/pom.xml +++ b/projects/fangjia-script/pom.xml @@ -537,21 +537,21 @@ - - com.aliyun - aliyun-java-sdk-address-purification - 1.0.1 - - - com.aliyun - aliyun-java-sdk-core - 4.5.9 - - - com.alibaba - fastjson - 1.2.83 - + + + + + + + + + + + + + + + From bc9df89425ca28cf7388bb0a68a92380ee9b86c1 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 28 Feb 2024 17:50:44 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/ana/ManualOperationDataStat.groovy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ana/ManualOperationDataStat.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ana/ManualOperationDataStat.groovy index 9e0bfffd0..796f9b27b 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ana/ManualOperationDataStat.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ana/ManualOperationDataStat.groovy @@ -124,13 +124,13 @@ public class ManualOperationDataStat extends BaseBatch{ println(content) sendEmail(Watcher.WangWenYan.email, "后台统计量", content) sendEmail("wangchencen@fangjia.com", "后台统计量", content) - sendEmail("caoyuyan@fangjia.com", "后台统计量", content) - sendEmail("shenyuan@fangjia.com", "后台统计量", content) - sendEmail("xuminxia@fangjia.com", "后台统计量", content) - sendEmail("huangcunliang@fangjia.com", "后台统计量", content) - sendEmail("yaojingmeng@fangjia.com", "后台统计量", content) - sendEmail("muliangshu@fangjia.com", "后台统计量", content) - sendEmail("sunjian@fangjia.com", "后台统计量", content) +// sendEmail("caoyuyan@fangjia.com", "后台统计量", content) +// sendEmail("shenyuan@fangjia.com", "后台统计量", content) +// sendEmail("xuminxia@fangjia.com", "后台统计量", content) +// sendEmail("huangcunliang@fangjia.com", "后台统计量", content) +// sendEmail("yaojingmeng@fangjia.com", "后台统计量", content) +// sendEmail("muliangshu@fangjia.com", "后台统计量", content) +// sendEmail("sunjian@fangjia.com", "后台统计量", content) } } \ No newline at end of file From 203798e5e98a54ca94bd33561c2424df5a9a7c29 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 28 Feb 2024 18:00:03 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=82=AE=E7=AE=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/cover/LoudongDataCoverBatch.groovy | 14 +++++++------- .../fangjia/script/fangrui/LngLatEachWeek.groovy | 2 +- .../script/hubingliang/PdsUseStatisticBatch.groovy | 8 ++++---- .../log/AnalyticsApiLogPerformanceBatch.groovy | 4 ++-- .../fangjia/script/log/CommonLogAnaBatch.groovy | 10 +++++----- .../fangjia/script/log/DaikuanLogAnaBatch.groovy | 12 ++++++------ .../script/log/ReadBkoffSafeLogBatch.groovy | 14 +++++++------- .../groovy/com/fangjia/script/util/DBHelper.groovy | 2 +- .../script/wenyan/ComparisonDataStatistics.groovy | 2 +- .../script/wenyan/EvaluationSourceAnalyze.groovy | 2 +- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/LoudongDataCoverBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/LoudongDataCoverBatch.groovy index 74ec3b25f..63fbf843d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/LoudongDataCoverBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/LoudongDataCoverBatch.groovy @@ -24,16 +24,16 @@ class LoudongDataCoverBatch extends BaseBatch { static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); public DBCollection mongoColl = MongoUtils.getCollectionByName("fangjia", "house_loudong", "mongo.db.fangjia.com") public static final def EMAILS = [ - "duxiaoyu@fangjia.com", +// "duxiaoyu@fangjia.com", // "ruanyadong@fangjia.com", // "xiamin@fangjia.com", // "zhutianli@fangjia.com", - "joe@fangjia.com", - "yukai@fangjia.com", - "jiangxiaochun@fangjia.com", - "gaojuan@fangjia.com", - "shijing@fangjia.com", - "xiaohai@fangjia.com", +// "joe@fangjia.com", +// "yukai@fangjia.com", +// "jiangxiaochun@fangjia.com", + "gaojuan@fangjia.com" +// "shijing@fangjia.com", +// "xiaohai@fangjia.com", ] static def FIELDS_MAP = [ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangrui/LngLatEachWeek.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangrui/LngLatEachWeek.groovy index ff8e2fb8a..29478337f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangrui/LngLatEachWeek.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangrui/LngLatEachWeek.groovy @@ -82,7 +82,7 @@ class LngLatEachWeek extends BaseBatch { href = "点击下载附件" jms.sendMail("caoyuyan@fangjia.com","未匹配上的小区经纬度",href) jms.sendMail("wangchencen@fangjia.com","未匹配上的小区经纬度",href) - jms.sendMail("sunjian@fangjia.com","未匹配上的小区经纬度",href) +// jms.sendMail("sunjian@fangjia.com","未匹配上的小区经纬度",href) } public static Map getLngLatByAddress(String city, String address){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/PdsUseStatisticBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/PdsUseStatisticBatch.groovy index 3579922b1..c7a13eea0 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/PdsUseStatisticBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/PdsUseStatisticBatch.groovy @@ -45,10 +45,10 @@ class PdsUseStatisticBatch extends BaseBatch{ final static DBCollection fsDB = MongoUtils.getCollectionByName("fangjia_fs", "files", MongoUtils.MongoDB_Domain_fs_mongo, 27000) def static emails = [ - "duweiliang@fangjia.com", - "yaojingmeng@fangjia.com", - "xuqi@fangjia.com", - "wangpeili@fangjia.com" +// "duweiliang@fangjia.com", +// "yaojingmeng@fangjia.com", +// "xuqi@fangjia.com", + "gaojuan@fangjia.com" ] static main(args) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/AnalyticsApiLogPerformanceBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/AnalyticsApiLogPerformanceBatch.groovy index 7ec752606..26b8c5aa5 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/AnalyticsApiLogPerformanceBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/AnalyticsApiLogPerformanceBatch.groovy @@ -163,9 +163,9 @@ class AnalyticsApiLogPerformanceBatch extends BaseBatch { } static void sendEmail(String sub, String msg) { - jms.sendMail("duxiaoyu@fangjia.com", sub, msg) +// jms.sendMail("duxiaoyu@fangjia.com", sub, msg) jms.sendMail("wangwenyan@fangjia.com", sub, msg) - jms.sendMail("helvyuan@fangjia.com", sub, msg) +// jms.sendMail("helvyuan@fangjia.com", sub, msg) jms.sendMail("gaojuan@fangjia.com", sub, msg) } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/CommonLogAnaBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/CommonLogAnaBatch.groovy index 30da55b3e..94ea4a405 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/CommonLogAnaBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/CommonLogAnaBatch.groovy @@ -32,11 +32,11 @@ class CommonLogAnaBatch extends BaseBatch { def static bjEvaReport = []; public static final def EMAILS = [ - "jiangxiaochun@fangjia.com", - "limingmin@fangjia.com", - "xiaohai@fangjia.com", - "luxuping@fangjia.com", - "yukai@fangjia.com" + "jiangxiaochun@fangjia.com" +// "limingmin@fangjia.com", +// "xiaohai@fangjia.com", +// "luxuping@fangjia.com", +// "yukai@fangjia.com" ]; static main(args) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/DaikuanLogAnaBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/DaikuanLogAnaBatch.groovy index bd412eda3..41c9da3f7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/DaikuanLogAnaBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/DaikuanLogAnaBatch.groovy @@ -26,12 +26,12 @@ class DaikuanLogAnaBatch extends BaseBatch { static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); public static final def EMAILS = [ - "jiangxiaochun@fangjia.com", - "limingmin@fangjia.com", - "zhongjingyi@fangjia.com", - "xiaohai@fangjia.com", - "luxuping@fangjia.com", - "yukai@fangjia.com" + "jiangxiaochun@fangjia.com" +// "limingmin@fangjia.com", +// "zhongjingyi@fangjia.com", +// "xiaohai@fangjia.com", +// "luxuping@fangjia.com", +// "yukai@fangjia.com" ]; static main(args) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/ReadBkoffSafeLogBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/ReadBkoffSafeLogBatch.groovy index b2cda8f17..b2d649195 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/ReadBkoffSafeLogBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/log/ReadBkoffSafeLogBatch.groovy @@ -148,14 +148,14 @@ class ReadBkoffSafeLogBatch extends BaseBatch{ } static void sendEmail(String sub, String msg) { - jms.sendMail("duxiaoyu@fangjia.com", sub, msg) - jms.sendMail("joe@fangjia.com", sub, msg) - jms.sendMail("xiaohai@fangjia.com", sub, msg) +// jms.sendMail("duxiaoyu@fangjia.com", sub, msg) +// jms.sendMail("joe@fangjia.com", sub, msg) +// jms.sendMail("xiaohai@fangjia.com", sub, msg) jms.sendMail("caoyuyan@fangjia.com", sub, msg) - jms.sendMail("wangchencen@fangjia.com", sub, msg) - jms.sendMail("yaojingmeng@fangjia.com", sub, msg) - jms.sendMail("chichilook@qq.com", sub, msg) - jms.sendMail("sunjian@fangjia.com", sub, msg) +// jms.sendMail("wangchencen@fangjia.com", sub, msg) +// jms.sendMail("yaojingmeng@fangjia.com", sub, msg) +// jms.sendMail("chichilook@qq.com", sub, msg) +// jms.sendMail("sunjian@fangjia.com", sub, msg) } static public String getCatById(String id) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy index cd31567e6..438522549 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy @@ -36,7 +36,7 @@ class DBHelper { static final DB offline61PoseidonDb = new Mongo("192.168.0.61", 27037).getDB("poseidon"); static final online42GoojiaFangjiaDbConn = Sql.newInstance("jdbc:mysql://222.73.242.42:4306/goojia_fangjia?useUnicode=true&characterEncoding=utf-8", "sa", "G00jia", "com.mysql.jdbc.Driver"); static final offline89GoojiaFangjiaStatDbConn = Sql.newInstance("jdbc:mysql://192.168.0.89:3306/goojia_fangjia_stat?useUnicode=true&characterEncoding=utf-8", "root", "123456", "com.mysql.jdbc.Driver"); - static final emailsGroup0 = ['gaojuan@fangjia.com','yukai@fangjia.com','joe@fangjia.com','duxiaoyu@fangjia.com','tangye@fangjia.com','ruanyadong@fangjia.com','xiamin@fangjia.com','zhutianli@fangjia.com']; + static final emailsGroup0 = ['gaojuan@fangjia.com']; static final emailsFangjiaWang = ['all.list@fangjia.com']; static final mobilesYanzhou = ['13621626685']; static final emailsYanzhou = ['duxiaoyu@fangjia.com']; diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/ComparisonDataStatistics.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/ComparisonDataStatistics.groovy index 0f3c5e23a..9236574d7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/ComparisonDataStatistics.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/ComparisonDataStatistics.groovy @@ -23,7 +23,7 @@ public class ComparisonDataStatistics extends com.fangjia.script.BaseBatch{ static final DATE_NUMBER = new Date().format("yyyyMMdd").toInteger() static final DBCollection MESSENGER_COLL = MongoUtils.getCollectionByName("fangjia", "messenger", MongoUtils.FANGJIA_ONLINE_MONGO ,27017) static final def categories = ["district":"住宅", "office":"写字楼" , "shop":"商铺"] - def emails = ["wangwenyan@fangjia.com","duxiaoyu@fangjia.com","joe@fangjia.com","caoyuyan@fangjia.com"] + def emails = ["wangwenyan@fangjia.com","caoyuyan@fangjia.com"] static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); def static main(args){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/EvaluationSourceAnalyze.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/EvaluationSourceAnalyze.groovy index e7a3c1c7e..7241889ae 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/EvaluationSourceAnalyze.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/EvaluationSourceAnalyze.groovy @@ -14,7 +14,7 @@ class EvaluationSourceAnalyze extends BaseBatch { static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); public static final DBCollection STAT_COLL = MongoUtils.getCollectionByName("fangjia", "evaluation", "mongo.db.fangjia.com") - def emails = ["wangwenyan@fangjia.com","duxiaoyu@fangjia.com","joe@fangjia.com","xiaohai@fangjia.com"] + def emails = ["wangwenyan@fangjia.com","xiaohai@fangjia.com"] static main(args) { new EvaluationSourceAnalyze().process(null); From e993a2d0bce4f5d3f47838c95ecfd42c2ff4bfd8 Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Fri, 1 Mar 2024 10:25:53 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=8C=87=E5=AF=BC?= =?UTF-8?q?=E4=BB=B7=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/wenyan/Test3.groovy | 109 ++++++++---------- 1 file changed, 47 insertions(+), 62 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Test3.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Test3.groovy index d2ba9d116..f4430e6a9 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Test3.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Test3.groovy @@ -1,7 +1,16 @@ +import com.fangjia.core.RegionData +import com.fangjia.core.util.GeoUtils +import com.fangjia.core.util.HttpRequest import com.fangjia.core.util.Mongo3Utils +import com.fangjia.core.util.MongoUtils +import com.fangjia.script.util.CommonUtils +import com.fangjia.script.util.DbUtils import com.fangjia.script.util.ExcelUtils +import com.mongodb.BasicDBObject import com.mongodb.client.MongoCollection +import net.sf.json.JSONObject import org.bson.Document +import org.bson.types.ObjectId import org.elasticsearch.xpack.sql.jdbc.EsDataSource import java.sql.Connection @@ -11,67 +20,43 @@ import java.util.function.Consumer import static com.mongodb.client.model.Filters.and import static com.mongodb.client.model.Filters.eq +//REGION_CONN = MongoUtils.getCollectionByName("fangjia", "region_block", MongoUtils.MongoDB_Domain_mongo, MongoUtils.MongoDB_Port_28017); +//TOWNSHIP_CONN = MongoUtils.getCollectionByName("fangjia", "township", MongoUtils.MongoDB_Domain_mongo, MongoUtils.MongoDB_Port_28017); +//TOWNSHIP_CONN.find().each {BasicDBObject township-> +// township.area_station = township.central +// township.removeField("central") +// TOWNSHIP_CONN.save(township) +// +//} +//REGION_CONN.find(new BasicDBObject("category", "region")).each {BasicDBObject regionBlock-> +// def lng = regionBlock.lng/10000000000l +// def lat = regionBlock.lat/10000000000l +// HttpRequest request = new HttpRequest() +// JSONObject resp = request.getJsonContent("http://localhost:8080/FangJiaAddressService/geocode/township", ['location':"$lng,$lat".toString()], "UTF-8") +// if(resp.result){ +// TOWNSHIP_CONN.update(new BasicDBObject("_id", new ObjectId(resp.result.id)), new BasicDBObject('$set', new BasicDBObject('central', 1))) +// println(resp.result) +// } +//} -def cityList = ["上海", "广州", "北京", "深圳", "成都", "杭州", "重庆", "武汉", "西安", "天津"] -def roots = ["lianjia.com", "zhuge.com", "fang.com", "anjuke.com", "58.com", "soufy.cn"] -MongoCollection DISTRICT_STAT = Mongo3Utils.getDbCollection("fangjia", "district_stat_rent") -MongoCollection DEAL_PRICE = Mongo3Utils.getDbCollection("fangjia", "deal_price") -def data = [["城市", "区域", "小区名", "版块", "装修", "朝向", "室", "厅", "卫", '标题', '总价', '面积', '单价', '发布时间', '来源']] -cityList.each { def city -> - def statMap = [:] - DISTRICT_STAT.find(and(eq("city", city), eq("end_month_date", Date.parse("yyyyMMdd", "20190228")))).forEach(new Consumer() { - @Override - void accept(Document t) { - def key = "${t.city}_${t.region}_${t.district_name}_${t.house_type}".toString() - statMap[key] = t.avg_price - } - }) - roots.each { def root -> - EsDataSource dataSource = new EsDataSource(); - String address = "jdbc:es://http://192.168.0.206:9200/timezone=UTC&page.size=250&connect.timeout=120s&network.timeout=120s&page.timeout=120s" - dataSource.setUrl(address) - Properties connectionProperties = new Properties() - connectionProperties.put("user", "developer") - connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3") - dataSource.setProperties(connectionProperties) - Connection connection = dataSource.getConnection() - Statement statement = connection.createStatement() - ResultSet rs = statement.executeQuery("""select * from "seawater-2019" where city='${city}' and cat = 'rent' order by p_date""") - int count = 0 - while (rs.next()) { - String region = rs.getString("region") - String district_name = rs.getString("district_name") - int room = rs.getInt("room") - def key = "${city}_${region}_${district_name}_${room}".toString() - if (!statMap.containsKey(key)) { - continue - } - int total_price = rs.getInt("total_price") - double area = rs.getDouble("area") - int avg_price = (int) (total_price / area) - if (total_price * 1.3 || total_price < statMap[key] * 0.7) { - continue - } - String block = rs.getString("block") - String name = rs.getString("name") - String fitment = rs.getString("fitment") - String direction = rs.getString("direction") - int hall = rs.getInt("hall") - int toilet = rs.getInt("toilet") - int p_date = rs.getInt("p_date") - if (!block || !name || !fitment || !direction || room == 0 || hall == 0 || toilet == 0) { - continue - } - println(rs.getString('url')) - def item = [city, region, district_name, block, fitment, direction, room, hall, toilet, name, total_price, area, avg_price, p_date, root] - println(item) - data << item - count++ - if(count > 10){ - break - } - } - } -} -ExcelUtils.write("D:\\建设银行\\租金样本.xlsx", data, "结果") \ No newline at end of file +//CommonUtils.findAllCity().each {def city-> +// DbUtils.multiThreadingExecuteQueryOnSeaweed(DbUtils.buildSeaweedQuery(city, null, null, "district"),{BasicDBObject office-> +// if(!office.township){ +// def lng = office.lng/10000000000l +// def lat = office.lat/10000000000l +// HttpRequest request = new HttpRequest() +// JSONObject resp = request.getJsonContent("http://localhost:8080/FangJiaAddressService/geocode/township", ['location':"$lng,$lat".toString()], "UTF-8") +// if(resp.result){ +// println(office._id.toString() + "\t" + office.township + "\t-->\t" + resp.result.streetName) +// DbUtils.seaweed.update(new BasicDBObject("_id", office._id), new BasicDBObject('$set', new BasicDBObject('township', resp.result.streetName))) +// } +// } +// }) +//} +ExcelUtils.multiThreadingModify("C:\\Users\\goojia\\Desktop\\地图查询数据导出-添加经纬度-兴趣点.xlsx",{List item-> + def lng = item["AB"].toString().split(",")[0].toDouble() + def lat = item["AB"].toString().split(",")[1].toDouble() + item["AD"] = GeoUtils.calculateDistance(121.526672,31.142637,lng, lat) + println(item) +}) \ No newline at end of file From 51189231edb137921d5170abe2c4339cff9570dc Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Fri, 1 Mar 2024 11:34:27 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BC=98=E5=8C=96Trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/service/index/SellTriggerServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/index/SellTriggerServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/index/SellTriggerServiceImpl.java index af7d6be61..1f7ab6869 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/index/SellTriggerServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/index/SellTriggerServiceImpl.java @@ -165,8 +165,11 @@ public class SellTriggerServiceImpl implements TriggerService { newObj.put("districtname_key", district.getName() + "_" + newObj.get("region") + "_" + object.get("city")); newObj.put("district_name", district.getName()); } + }else{ + if(object.containsField("city") && object.containsField("district_name") && object.containsField("region")){ + newObj.put("districtname_key", object.get("district_name") + "_" + object.get("region") + "_" + object.get("city")); + } } - // newObj.put("if_school", 0); // if (districtSchoolMap != null && districtSchoolMap.containsKey(districtKey)) { // List skList = districtSchoolMap.get(districtKey); From f0061ade19d549f26467ab6be7e9eaaa66cd3011 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Sun, 3 Mar 2024 19:45:57 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=88=BF=E6=BA=90=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../averager/HouseChangingMonitorBatch.groovy | 2 +- .../script/avgprice/WebAverageLabor.groovy | 2 +- .../cover/DistrictDataCoverBatch.groovy | 18 ++++---- .../cover/DistrictFieldCoverBatch.groovy | 5 +-- .../script/district/DistrictHouseBatch.groovy | 44 +++++++++++++++++-- .../evaluation/EvaluationFieldProcent.groovy | 4 +- .../fangjiatong/FjtAnalyCrawlerIp.groovy | 2 +- .../com/fangjia/script/util/DBHelper.groovy | 2 +- .../com/fangjia/script/wenyan/Watcher.groovy | 4 +- 9 files changed, 57 insertions(+), 26 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/HouseChangingMonitorBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/HouseChangingMonitorBatch.groovy index 41a7088f2..2f785e37c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/HouseChangingMonitorBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/averager/HouseChangingMonitorBatch.groovy @@ -29,7 +29,7 @@ class HouseChangingMonitorBatch extends BaseBatch { DBCollection COLLECTION = MongoUtils.getCollectionByName("fangjia_log", "house_changing_monitor", "log.mongo.db.fangjia.com") Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); def EMAILS = [ - 'duxiaoyu@fangjia.com' + 'gaojuan@fangjia.com' ] public static void main(String[] args){ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/avgprice/WebAverageLabor.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/avgprice/WebAverageLabor.groovy index a1cf124eb..fdf9f1e5c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/avgprice/WebAverageLabor.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/avgprice/WebAverageLabor.groovy @@ -39,7 +39,7 @@ class WebAverageLabor extends BaseBatch{ public static final def CITIES = ["上海", "成都", "北京", "广州", "深圳"] - public static final def EMAILS = ["duxiaoyu@fangjia.com"] + public static final def EMAILS = ["wangwenyan@fangjia.com"] static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictDataCoverBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictDataCoverBatch.groovy index 1f060779c..083b4973d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictDataCoverBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictDataCoverBatch.groovy @@ -24,16 +24,16 @@ class DistrictDataCoverBatch extends BaseBatch { public DSCollection dsCollection = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed") public DBCollection mongoColl = MongoUtils.getCollectionByName("fangjia", "district_facilitys", "mongo.db.fangjia.com") public static final def EMAILS =[ - "duxiaoyu@fangjia.com", - "ruanyadong@fangjia.com", - "xiamin@fangjia.com", - "zhutianli@fangjia.com", - "joe@fangjia.com", - "yukai@fangjia.com", - "jiangxiaochun@fangjia.com", +// "duxiaoyu@fangjia.com", +// "ruanyadong@fangjia.com", +// "xiamin@fangjia.com", +// "zhutianli@fangjia.com", +// "joe@fangjia.com", +// "yukai@fangjia.com", +// "jiangxiaochun@fangjia.com", "gaojuan@fangjia.com", - "liuxingwang@fangjia.com", - "xiaohai@fangjia.com", +// "liuxingwang@fangjia.com", +// "xiaohai@fangjia.com", ] static def FIELDS_MAP = [ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictFieldCoverBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictFieldCoverBatch.groovy index 84bb4a078..9b187a3f5 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictFieldCoverBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/cover/DistrictFieldCoverBatch.groovy @@ -33,10 +33,7 @@ class DistrictFieldCoverBatch extends BaseBatch { final static String coverDomain = "mongo.db.fangjia.com" final static String datastoreDomain = "seaweed.db.fangjia.com" final static def emails = [ - "duxiaoyu@fangjia.com", - "joe@fangjia.com", "yukai@fangjia.com", "yanzhou@fangjia.com", - "gaojuan@fangjia.com", "yuanyadong@fangjia.com", "liuxingwang@fangjia.com", - "xiamin@fangjia.com", "zhutianli@fangjia.com" + "gaojuan@fangjia.com" ] // final static def emails = [ diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy index fa3d57a71..dbc92b4dd 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy @@ -1,8 +1,10 @@ package com.fangjia.script.district +import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.util.MongoUtils import com.mongodb.DBCursor +import org.bson.types.ObjectId import java.util.List @@ -40,6 +42,19 @@ class DistrictHouseBatch extends BaseBatch { @Override public void process(Object args) { + +// DBObject q = new BasicDBObject(); +// q.put("_id", new ObjectId("6501174f6f5638447b264189")); +// def obj = CommonDatautils.getHouseDataStoreConnection().findOne(q) +// obj.put("c_date", new Date()) +// CommonDatautils.getHouseDataStoreConnection().save(obj) + +// CommonDatautils.getHouseDataStoreConnection().find(new BasicDBObject("districtname_key","新城帝景南区_武进_常州")).each{ +// println(it) +// } + + + def cityList = cityList(); int c = 0 @@ -52,9 +67,28 @@ class DistrictHouseBatch extends BaseBatch { Map rentCountMap = facetDistrictInHouse("rent", city); println c + "\t" + city + "\t" + "\tsn:" + sn + "\t" + districts.size() + "\t" + DateUtil.formatToTightYYYYMMDDhhmmss(new Date()) for(DBObject district : districts) { - String key = district.get("name").toString().trim() + "_" + district.get("region") + "_" + district.get("city") - long sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0 - long rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0 + def names = [] + names << district.name + if(district.alias && districts.size()>0){ + for(def name : district.alias){ + if(!names.contains(name)){ + names << name + } + } + } + + long sellCount = 0 + long rentCount = 0 + for(def name : names){ + String key = name.toString().trim() + "_" + district.get("region") + "_" + district.get("city") + if(!sellCount){ + sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0 + } + if(!rentCount){ + rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0 + } + } + saveToDistrictHouse(district.get('city'), district.get("region"), district.get("name"), sellCount, rentCount, sn) } @@ -75,6 +109,7 @@ class DistrictHouseBatch extends BaseBatch { sellQuery.put('$facet', facet) sellQuery.put('city', city) sellQuery.put('cat',cat) +// sellQuery.put("district_name","新城帝景南区") // sellQuery.put('visible',0) DSCursor sellDSCursor = SEABIRD.find(sellQuery).skip(0).limit(0) List sellFacetResult = sellDSCursor.getFacetResults(); @@ -109,13 +144,14 @@ class DistrictHouseBatch extends BaseBatch { fields.put("city", 1) fields.put("region", 1) fields.put("name", 1) - + fields.put("alias", 1) def ret = [] DBObject q = new BasicDBObject() q.put('city', city) q.put('cat', 'district') q.put('visible', 0) +// q.put("name","新城帝景") DSCursor cur = SEAWEED.find(q, fields).batchSize(2000) Iterator iter = cur.iterator() diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/evaluation/EvaluationFieldProcent.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/evaluation/EvaluationFieldProcent.groovy index 46195928b..9c1578e2d 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/evaluation/EvaluationFieldProcent.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/evaluation/EvaluationFieldProcent.groovy @@ -29,9 +29,7 @@ class EvaluationFieldProcent extends BaseBatch{ public static final DBCollection EVALUA_COLL = MongoUtils.getCollectionByName("fangjia", "evaluation", "mongo.db.fangjia.com") public static final DBCollection EVALUA_COVER_COLL = MongoUtils.getCollectionByName("fangjia", "evaluation_field_coverage", "mongo.db.fangjia.com") - final static def emails = ["xiaohai@fangjia.com","jiangxiaochun@fangjia.com","limingmin@fangjia.com","duxiaoyu@fangjia.com", - "joe@fangjia.com", "yukai@fangjia.com", "gaojuan@fangjia.com", "yuanyadong@fangjia.com", - "xiamin@fangjia.com", "zhutianli@fangjia.com"] + final static def emails = [ "gaojuan@fangjia.com"] diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangjiatong/FjtAnalyCrawlerIp.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangjiatong/FjtAnalyCrawlerIp.groovy index a1043fb29..5091edaa5 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangjiatong/FjtAnalyCrawlerIp.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fangjiatong/FjtAnalyCrawlerIp.groovy @@ -30,7 +30,7 @@ class FjtAnalyCrawlerIp extends BaseBatch{ public static final def lineUrl = "mongodb://developer:G00IDCDEV12385@mongo.db.fangjia.com:28017"; public static final DBCollection addressMatchLogColl = MongoUtils.getCollectionByName2("fangjia", "address_match_log", lineUrl) - final static def emails = ["gaojuan@fangjia.com","jiangxiaochun@fangjia.com","duxiaoyu@fangjia.com","wangwenyan@fangjia.com","luxuping@fangjia.com","yaojiayi@fangjia.com"] + final static def emails = ["gaojuan@fangjia.com"] static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616'); static main(args) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy index 438522549..448d8aaea 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/DBHelper.groovy @@ -39,7 +39,7 @@ class DBHelper { static final emailsGroup0 = ['gaojuan@fangjia.com']; static final emailsFangjiaWang = ['all.list@fangjia.com']; static final mobilesYanzhou = ['13621626685']; - static final emailsYanzhou = ['duxiaoyu@fangjia.com']; + static final emailsYanzhou = ['wangwenyan@fangjia.com']; static List getCityNames(){ DBObject dbObject = new BasicDBObject("status",0); diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Watcher.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Watcher.groovy index d0134fa35..d20623baa 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Watcher.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/Watcher.groovy @@ -3,9 +3,9 @@ package com.fangjia.script.wenyan public enum Watcher { //在职同事 - DuXiaoYu('13621626685', 'duxiaoyu@fangjia.com'), + DuXiaoYu('13621626685', 'wangwenyan@fangjia.com'), WangWenYan('13916076378','wangwenyan@fangjia.com'), - Tomzhao('15021021464','zhaoshumao@fangjia.com'), + Tomzhao('15021021464','wangwenyan@fangjia.com'), GaoJuan('15021384995','gaojuan@fangjia.com'); private final String mobile;