From 4b7fe557805cf34a4f1d81da7bcfed432fdead94 Mon Sep 17 00:00:00 2001 From: mjt <13607600062@163.com> Date: Thu, 22 Feb 2024 10:42:06 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=89=E5=86=9C?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/PoseidonOnce.groovy | 2 +- .../script/gj/meishubao/MsbPocTest.groovy | 2 +- .../script/majintao/test/FiveLevelTest.groovy | 64 ++++++++ .../script/majintao/test/SheNongTest.groovy | 124 +++++++++++++++ .../script/majintao/test/SheNongTest2.groovy | 147 ++++++++++++++++++ .../test/sdklog/sdkclient_CommunicateLog_info | 0 .../test/sdklog/sdkclient_EMAYSDK_info | 0 .../script/majintao/{ => test}/test.groovy | 2 +- .../com/fangjia/script/majintao/test2.groovy | 4 - .../com/fangjia/script/webCrawl/Test.groovy | 6 +- 10 files changed, 341 insertions(+), 10 deletions(-) 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/sdklog/sdkclient_CommunicateLog_info create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/sdklog/sdkclient_EMAYSDK_info rename projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/{ => test}/test.groovy (98%) delete mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test2.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/PoseidonOnce.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/PoseidonOnce.groovy index fa4c6891f..48b616432 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/PoseidonOnce.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/PoseidonOnce.groovy @@ -78,7 +78,7 @@ class PoseidonOnce { // DBCursor cur = coll.find() // println cur.count() String url = "http://www.fangjia.com"; - DBCollection coll = MongoUtils.getCollectionByName("fangjia", "test2", "192.168.0.188") + DBCollection coll = MongoUtils.getCollectionByName("fangjia", "FiveLevelTest", "192.168.0.188") // for(int i=426000;i<1000000;i++) { // String s = url + i + "_" + url.hashCode() // DBObject dbo = new BasicDBObject() diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meishubao/MsbPocTest.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meishubao/MsbPocTest.groovy index f517a80b8..522a1fe7e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meishubao/MsbPocTest.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/meishubao/MsbPocTest.groovy @@ -19,7 +19,7 @@ class MsbPocTest { // match(inputfile) // matchOld(inputfile) // addPrice("D:\\数据\\美术宝\\美术宝测试数据(价格).xlsx") -// test("D:\\数据\\美术宝\\test2.xlsx") +// test("D:\\数据\\美术宝\\FiveLevelTest.xlsx") // cityPrice() // mergeMatchPrice("D:\\数据\\美术宝\\美术宝-新接口价格.xlsx") 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/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.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy similarity index 98% rename from projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test.groovy rename to projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy index 350ffa191..22a5ae18e 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test/test.groovy @@ -1,4 +1,4 @@ -package com.fangjia.script.majintao +package com.fangjia.script.majintao.test import com.fangjia.core.util.HttpRequest import com.fangjia.script.util.ExcelUtils diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test2.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test2.groovy deleted file mode 100644 index 2c6e2d2ea..000000000 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/majintao/test2.groovy +++ /dev/null @@ -1,4 +0,0 @@ -import org.bson.types.ObjectId - -a = new ObjectId() -print(a) \ No newline at end of file diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/webCrawl/Test.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/webCrawl/Test.groovy index 796aaedcb..11d317c09 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/webCrawl/Test.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/webCrawl/Test.groovy @@ -43,15 +43,15 @@ class Test { static main(args) { // String test1 = " qwdwqd ssss "; -// String test2 = " qwdwqd ss"; +// String FiveLevelTest = " qwdwqd ss"; // String test3 = "qwdwqd dd"; // // test1 = test1.replaceAll(" |\\s+", " "); -// test2 = test2.replaceAll(" |\\s+", " "); +// FiveLevelTest = FiveLevelTest.replaceAll(" |\\s+", " "); // test3 = test3.replaceAll(" |\\s+", " "); // // String[] arrs1 = test1.split("\\s+") -// String[] arrs2 = test2.split("\\s+") +// String[] arrs2 = FiveLevelTest.split("\\s+") // String[] arrs3 = test3.split("\\s+") // // println arrs1 From 8513f91c3f55c43e22f1467ec4bea2d382bb34f4 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 09:37:09 +0800 Subject: [PATCH 02/13] =?UTF-8?q?2006mongo=E5=8A=A0=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia-core/src/main/java/com/fangjia/core/Constants.java | 2 +- .../com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy | 3 ++- .../com/fangjia/script/openApi/OpenApiLogAnalyBatch.groovy | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-core/src/main/java/com/fangjia/core/Constants.java b/projects/fangjia-core/src/main/java/com/fangjia/core/Constants.java index 7a9f45104..2cc2c080c 100644 --- a/projects/fangjia-core/src/main/java/com/fangjia/core/Constants.java +++ b/projects/fangjia-core/src/main/java/com/fangjia/core/Constants.java @@ -7,7 +7,7 @@ public interface Constants { String FANGJIA_CRAWL_MONGO_URI = "mongodb://192.168.0.235:27018"; String LOG_MONGO_URI = "mongodb://192.168.0.42:52002"; String SEABIRD_MONGO_URI = "mongodb://192.168.0.74:57007"; - String SEAWATER_MONGO_URI = "mongodb://192.168.0.206:27020"; + String SEAWATER_MONGO_URI = "mongodb://root:Goojia%40206!!#@192.168.0.206:27020"; String MSVC_FANG_JIA_DATA_SERVICE_BASE_PATH ="http://192.168.0.100:38080/FangJiaDataService"; } diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy index b1ed3a554..d0c89f4fc 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy @@ -1,5 +1,6 @@ package com.fangjia.script.hubingliang +import com.fangjia.core.Constants import com.fangjia.core.util.DateUtil import groovy.sql.Sql @@ -23,7 +24,7 @@ import com.mongodb.DBObject @BatchOwner(Watcher.Hubingliang) class ApiInvokeStatistics extends BaseBatch{ final static def mongoDomain = "mongo.db.fangjia.com" - public static final DBCollection OPEN_URI_LOG = MongoUtils.getCollectionByName("business", "open_uri_log", "seawater.mongo.db.fangjia.com", 27020) + public static final DBCollection OPEN_URI_LOG = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log") public static final DBCollection OPEN_URI_LOG_COUNT = MongoUtils.getCollectionByName("business", "api_invoke_statistical", "mongo.db.fangjia.com", 27017) static final dbFangjia = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/fangjia?autoReconnect=true&characterEncoding=utf-8&autoReconnect=true", "sa", "G00jia", "com.mysql.jdbc.Driver"); static main(args) { diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/openApi/OpenApiLogAnalyBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/openApi/OpenApiLogAnalyBatch.groovy index cd92b6635..135c1b920 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/openApi/OpenApiLogAnalyBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/openApi/OpenApiLogAnalyBatch.groovy @@ -1,5 +1,6 @@ package com.fangjia.script.openApi +import com.fangjia.core.Constants import groovy.sql.Sql; import java.util.regex.Matcher import java.util.regex.Pattern @@ -24,7 +25,7 @@ import com.fangjia.script.Watcher class OpenApiLogAnalyBatch extends BaseBatch{ - static DBCollection OPEN_URI_LOG_COLL = MongoUtils.getCollectionByName("business", "open_uri_log", "seawater.mongo.db.fangjia.com",27020); + static DBCollection OPEN_URI_LOG_COLL = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log") static DBCollection OPEN_URI_ANALY_COLL = MongoUtils.getCollectionByName("business", "open_uri_analy", "mongo.db.fangjia.com"); final Sql USER_CONN = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/fangjia?useUnicode=true&characterEncoding=utf-8&autoReconnect=true", "sa", "G00jia", "com.mysql.jdbc.Driver") From d09c645d4118a890919a66f41f011b2f3ce4a5a8 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 10:19:15 +0800 Subject: [PATCH 03/13] =?UTF-8?q?2006mongo=E5=90=8C=E6=AD=A5ES?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/sync/AnalysisOpenUriLogSyncBatch.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/AnalysisOpenUriLogSyncBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/AnalysisOpenUriLogSyncBatch.groovy index a634ea6dc..9979ef73c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/AnalysisOpenUriLogSyncBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/AnalysisOpenUriLogSyncBatch.groovy @@ -16,6 +16,7 @@ import org.apache.commons.lang.StringUtils import org.elasticsearch.action.bulk.BulkProcessor import org.elasticsearch.action.index.IndexRequest import java.util.concurrent.TimeUnit +import com.fangjia.core.Constants /** * 功能说明: @@ -24,7 +25,7 @@ import java.util.concurrent.TimeUnit class AnalysisOpenUriLogSyncBatch extends BaseBatch { - DBCollection OPEN_URI_LOG_COLL = MongoUtils.getCollectionByName("business", "open_uri_log", "192.168.0.206",27020) + DBCollection OPEN_URI_LOG_COLL = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log") static final def SQL = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/goojia_fangjia?&characterEncoding=utf8", "sa", "G00jia", "com.mysql.jdbc.Driver"); @@ -53,7 +54,7 @@ class AnalysisOpenUriLogSyncBatch extends BaseBatch { void process(Object args) { Map userInfo = getUserInfo() - def startDate = DateUtil.truncateDay(DateUtil.add(new Date(), -3)) + def startDate = DateUtil.truncateDay(DateUtil.add(new Date(), -30)) def endDate = DateUtil.truncateDay(new Date()) BasicDBObject query = new BasicDBObject() query.append("c_date", new BasicDBObject('$gte', startDate).append('$lt', endDate)) From 7e37b8b793cfa69857ed42186abeb94aa497d5a8 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 11:21:56 +0800 Subject: [PATCH 04/13] =?UTF-8?q?api=E6=A0=B9=E6=8D=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E9=80=89=E6=8B=A9=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/apiUser/list.ftl | 220 +++++++----------- 1 file changed, 86 insertions(+), 134 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl b/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl index 1275224a6..08c4c5c78 100644 --- a/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl @@ -28,10 +28,28 @@ top: 0; background-color: #f2f2f2; } + .resizable-td { - resize: horizontal; /* 鍏佽姘村钩璋冩暣澶у皬 */ - overflow: auto; /* 鏄剧ず婊氬姩鏉′互渚挎煡鐪嬭秴鍑洪儴鍒� */ - min-width: 50px; /* 璁剧疆鏈�灏忓搴︼紝闃叉杩囦簬缂╁皬 */ + resize: horizontal; + overflow: auto; + min-width: 50px; + } + + .form-label { + font-size: 15px; + } + + .form-select { + font-size: 15px; + margin-right: 10px; + } + + .form-button { + font-size: 15px; + } + + .form-group { + display: inline-block; } @@ -51,16 +69,16 @@
- - +
- @@ -68,135 +86,54 @@
-
- +
- - -<#-- --> - - - - - - - - - - + + + + + + + + + + + + - <#if (apiUserBoList??&&apiUserBoList?size>0)> + <#if (apiUserBoList?? && apiUserBoList?size > 0)> <#list apiUserBoList as bo> - style="background-color:#C3C3C3"> - - -<#-- --> - - - - - - - - - + style="background-color:#C3C3C3"> + + + + + + + + + + + @@ -205,24 +142,39 @@
- ID - - 鏄电О - --> -<#-- 璐︽埛鐢ㄩ��--> -<#-- - username - - password - - 閿�鍞礋璐d汉 - - 鍏徃 - - appKey - - 璐︽埛绫诲瀷 - - 璐︽埛鐢ㄩ�� - - 鏄惁鐩戞帶 - - 鍒版湡鏃堕棿 - - 鎿嶄綔 - ID鏄电Оusernamepassword閿�鍞礋璐d汉鍏徃appKey璐︽埛绫诲瀷璐︽埛鐢ㄩ��鏄惁鐩戞帶鍒版湡鏃堕棿鎿嶄綔
- ${bo.userId!} - - ${bo.displayName!} - --> -<#-- <#if bo.purpose?? && bo.purpose == 1>--> -<#-- API--> -<#-- <#elseif bo.purpose?? && bo.purpose == 2>--> -<#-- PDS--> -<#-- <#elseif bo.purpose?? && bo.purpose == 4>--> -<#-- 鎴跨敓娲�--> -<#-- --> -<#-- - ${bo.userName!} - - <#if bo.password?? && bo.password == t_util.md5Hex('123456')> - 鍒濆瀵嗙爜 - <#else> - ****** - - - ${bo.manager!} - - ${bo.company!} - - ${bo.appKey!} - - <#if bo.isTest==0> - 姝e紡璐︽埛 - <#elseif bo.isTest==1> - 娴嬭瘯璐︽埛 - <#else> - 鍐呴儴璐︽埛 - - - <#if bo.purpose?? && bo.purpose == 1> - API - <#elseif bo.purpose?? && bo.purpose == 2> - PDS - <#elseif bo.purpose?? && bo.purpose == 4> - 鎴跨敓娲� - - - <#if bo.isMonitor==1> - 鏄� - <#else> - 鍚� - - - <#if bo.deadTime??> - ${bo.deadTime?string("yyyy骞碝M鏈坉d鏃�")} - -
${bo.userId!}${bo.displayName!}${bo.userName!}<#if bo.password?? && bo.password == t_util.md5Hex('123456')>鍒濆瀵嗙爜<#else>******${bo.manager!}${bo.company!}${bo.appKey!}<#if bo.isTest == 0>姝e紡璐︽埛<#elseif bo.isTest == 1>娴嬭瘯璐︽埛<#else>鍐呴儴璐︽埛<#if bo.purpose?? && bo.purpose == 1>API<#elseif bo.purpose?? && bo.purpose == 2>PDS<#elseif bo.purpose?? && bo.purpose == 4>鎴跨敓娲�<#if bo.isMonitor == 1>鏄�<#else>鍚�<#if bo.deadTime??>${bo.deadTime?string("yyyy骞碝M鏈坉d鏃�")} API鏉冮檺鎺у埗 鏂板API 鍩庡競绠$悊 浠锋牸璇勭骇 - <#if bo.status==0> + <#if bo.status == 0> 绂佺敤 <#else> - 鍐嶅惎鐢� + 鍐嶅惎鐢�
+ - \ No newline at end of file From 13cc4bf574c6df8a77bfddf9183f129fab55f683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Tue, 3 Sep 2024 11:48:34 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E8=81=94=E6=83=B3=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=9D=9E=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/open/controllers/AddrSvcController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 9893c6e7c..258d75236 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 @@ -271,10 +271,11 @@ public class AddrSvcController { public Object suggestionAction(AddressModel model) { RestfulModelAndView mav = new RestfulModelAndView(); - if (StringUtils.isBlank(model.getCity())) { - mav.setModel(BasicModel.buildBadRequestModel("城市不能为空")); - return mav; - } + // 城市改为非必填 +// if (StringUtils.isBlank(model.getCity())) { +// mav.setModel(BasicModel.buildBadRequestModel("城市不能为空")); +// return mav; +// } if (StringUtils.isBlank(model.getKeywords())) { mav.setModel(BasicModel.buildBadRequestModel("关键字不能为空")); return mav; From 8135d5fc17c3273e45b01e8ee8297aa3159d36c0 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 13:17:02 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E5=85=89=E5=A4=A7=E6=B6=89=E5=86=9C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/controllers/GdBankController.java | 83 ++++++++++++++----- 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GdBankController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GdBankController.java index fd1709bf3..304f4813b 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GdBankController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/GdBankController.java @@ -50,6 +50,44 @@ public class GdBankController { } }; + /** + * 判断所属区域 + * + * @param map + * @return + */ + public String addrArea(Map map, String type) { + if (map.get("verifyFlag") == null) { + return ""; + } + if (map.get("verifyFlag").equals("非农")) { + return "城市区域"; + } + if (map.get("verifyFlag").equals("农")) { + return "农村区域"; + } + if ("2".equals(type) && "是".equals(map.get("countyGov"))) { + return "县城城区"; + } + return ""; + } + + /** + * 判断县级市 + */ + public String countyLevelCity(Map map) { + if (map.get("city") == null) { + return ""; + } + if (map.get("city").endsWith("区")) { + return "否"; + } + if (map.get("city").equals("东莞市") || map.get("city").equals("嘉峪关市") || map.get("city").equals("中山市") || map.get("city").equals("儋州市")) { + return "否"; + } + return "是"; + } + /** * 涉农识别-新规则-光大银行 * @@ -90,22 +128,16 @@ public class GdBankController { if (json.containsKey("result")) { //我们的结果 JSONObject result = json.getJSONObject("result"); - if (("是").equals(result.get("countyLevelCity"))) { - result.put("prefectureLevelCity", "否"); - } else if (("否").equals(result.get("countyLevelCity"))) { - result.put("prefectureLevelCity", "是"); - } - // 如果是无效信息或者没有行政区划,则用我们的 - if (result.containsKey("addrVerify") && ("无效".equals(result.getString("addrVerify")) || "没有行政区划".equals(result.getString("addrVerify")))) { + //我们省级及以上有开发区,直接用我们的结果 + if (result.containsKey("devDistrictName")) { basicModel.setResult(result); - //我们省级及以上有开发区,直接用我们的结果 - } else if (result.containsKey("devDistrictName")) { + + } else if (!"2".equals(type)) { // 对私的不用齐梁 basicModel.setResult(result); } else { try { //如果是江苏省或者浙江省 调用齐梁的结果 if ("江苏省".equals(result.getString("province")) || "浙江省".equals(result.getString("province"))) { - //结果比较,如果涉农结果不一致 //调用齐梁 type :1 对公 0 对私 //我们 type :1 对私 2 对共 @@ -113,23 +145,31 @@ public class GdBankController { Map map = senRequest(address, qltype); // 涉农结果不一样 if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) { - //有市辖建制镇, 或者城市不一样 用我们 - if (result.containsKey("city") && ("是".equals(result.get("administrativeTowns")) || (!result.get("city").equals(map.get("city")) - && StringUtils.isNotBlank(result.getString("city"))))) { + // 齐梁县政府但是涉农为农,取我们的结果 扬中市三茅街道中华村永固河路1号 + if ("是".equals(map.get("countyGov")) && "农".equals(map.get("verifyFlag"))) { basicModel.setResult(result); + mav.setModel(basicModel); + return mav; + } + //城市不一样 用我们 + if (result.containsKey("city")) { + if ((!result.get("city").equals(map.get("city")) && StringUtils.isNotBlank(result.getString("city")))) { + basicModel.setResult(result); + } else { + map.put("addrVerify", "地址有效"); + map.put("typeName", areaMap.get(map.get("typeCode"))); + map.put("addrArea", addrArea(map, type)); + map.put("countyLevelCity", countyLevelCity(map)); + basicModel.setResult(map); + } } else { - if (("是").equals(result.get("countyLevelCity"))) { - map.put("prefectureLevelCity", "否"); - } else if (("否").equals(result.get("countyLevelCity"))) { - map.put("prefectureLevelCity", "是"); - } map.put("addrVerify", "地址有效"); - if (result.containsKey("countyLevelCity")) { - map.put("countyLevelCity", result.getString("countyLevelCity")); - } map.put("typeName", areaMap.get(map.get("typeCode"))); + map.put("addrArea", addrArea(map, type)); + map.put("countyLevelCity", countyLevelCity(map)); basicModel.setResult(map); } + } else { basicModel.setResult(result); } @@ -145,6 +185,7 @@ public class GdBankController { } } + } mav.setModel(basicModel); } else { From d19b33ca4464e5da2669b8ef059962bf2cccdc18 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 14:10:35 +0800 Subject: [PATCH 07/13] =?UTF-8?q?api=E6=A0=B9=E6=8D=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E9=80=89=E6=8B=A9=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/apiUser/list.ftl | 236 +++++++++++------- .../src/main/webapp/layout/menu.ftl | 2 +- 2 files changed, 143 insertions(+), 95 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl b/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl index 08c4c5c78..f38b9b079 100644 --- a/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/apiUser/list.ftl @@ -28,28 +28,10 @@ top: 0; background-color: #f2f2f2; } - .resizable-td { - resize: horizontal; - overflow: auto; - min-width: 50px; - } - - .form-label { - font-size: 15px; - } - - .form-select { - font-size: 15px; - margin-right: 10px; - } - - .form-button { - font-size: 15px; - } - - .form-group { - display: inline-block; + resize: horizontal; /* 鍏佽姘村钩璋冩暣澶у皬 */ + overflow: auto; /* 鏄剧ず婊氬姩鏉′互渚挎煡鐪嬭秴鍑洪儴鍒� */ + min-width: 50px; /* 璁剧疆鏈�灏忓搴︼紝闃叉杩囦簬缂╁皬 */ } @@ -69,71 +51,152 @@
- + + + +
- + + +
- + +
- +
- - - - - - - - - - - - + + +<#-- --> + + + + + + + + + + - <#if (apiUserBoList?? && apiUserBoList?size > 0)> + <#if (apiUserBoList??&&apiUserBoList?size>0)> <#list apiUserBoList as bo> - style="background-color:#C3C3C3"> - - - - - - - - - - - + style="background-color:#C3C3C3"> + + +<#-- --> + + + + + + + + + @@ -142,39 +205,24 @@
ID鏄电Оusernamepassword閿�鍞礋璐d汉鍏徃appKey璐︽埛绫诲瀷璐︽埛鐢ㄩ��鏄惁鐩戞帶鍒版湡鏃堕棿鎿嶄綔 + ID + + 鏄电О + --> +<#-- 璐︽埛鐢ㄩ��--> +<#-- + username + + password + + 閿�鍞礋璐d汉 + + 鍏徃 + + appKey + + 璐︽埛绫诲瀷 + + 璐︽埛鐢ㄩ�� + + 鏄惁鐩戞帶 + + 鍒版湡鏃堕棿 + + 鎿嶄綔 +
${bo.userId!}${bo.displayName!}${bo.userName!}<#if bo.password?? && bo.password == t_util.md5Hex('123456')>鍒濆瀵嗙爜<#else>******${bo.manager!}${bo.company!}${bo.appKey!}<#if bo.isTest == 0>姝e紡璐︽埛<#elseif bo.isTest == 1>娴嬭瘯璐︽埛<#else>鍐呴儴璐︽埛<#if bo.purpose?? && bo.purpose == 1>API<#elseif bo.purpose?? && bo.purpose == 2>PDS<#elseif bo.purpose?? && bo.purpose == 4>鎴跨敓娲�<#if bo.isMonitor == 1>鏄�<#else>鍚�<#if bo.deadTime??>${bo.deadTime?string("yyyy骞碝M鏈坉d鏃�")}
+ ${bo.userId!} + + ${bo.displayName!} + --> +<#-- <#if bo.purpose?? && bo.purpose == 1>--> +<#-- API--> +<#-- <#elseif bo.purpose?? && bo.purpose == 2>--> +<#-- PDS--> +<#-- <#elseif bo.purpose?? && bo.purpose == 4>--> +<#-- 鎴跨敓娲�--> +<#-- --> +<#-- + ${bo.userName!} + + <#if bo.password?? && bo.password == t_util.md5Hex('123456')> + 鍒濆瀵嗙爜 + <#else> + ****** + + + ${bo.manager!} + + ${bo.company!} + + ${bo.appKey!} + + <#if bo.isTest==0> + 姝e紡璐︽埛 + <#elseif bo.isTest==1> + 娴嬭瘯璐︽埛 + <#else> + 鍐呴儴璐︽埛 + + + <#if bo.purpose?? && bo.purpose == 1> + API + <#elseif bo.purpose?? && bo.purpose == 2> + PDS + <#elseif bo.purpose?? && bo.purpose == 4> + 鎴跨敓娲� + + + <#if bo.isMonitor==1> + 鏄� + <#else> + 鍚� + + + <#if bo.deadTime??> + ${bo.deadTime?string("yyyy骞碝M鏈坉d鏃�")} + + API鏉冮檺鎺у埗 鏂板API 鍩庡競绠$悊 浠锋牸璇勭骇 - <#if bo.status == 0> + <#if bo.status==0> 绂佺敤 <#else> - 鍐嶅惎鐢� + 鍐嶅惎鐢�
- + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/layout/menu.ftl b/projects/fangjia-bkoff/src/main/webapp/layout/menu.ftl index 2b326e80e..da9cec860 100644 --- a/projects/fangjia-bkoff/src/main/webapp/layout/menu.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/layout/menu.ftl @@ -295,7 +295,7 @@ <@menuitem uri='/creditRate/list' text="浠锋牸鍙俊搴︿笌鍖归厤鐜囧叧绯�" /> <@menuitem uri='/czBank/sampleLogs' text="娴欏晢閾惰" /> <@menuitem uri='/villageIdentify/importResult' text="娑夊啘缁撴灉瀵煎叆" /> - <@menuitem uri='/apiCountLog/list' text="API娆℃暟鏃ュ織" /> + <@menuitem uri='/apiCountLog/list?purpose=1&isTest=0&status=0' text="API娆℃暟鏃ュ織" /> From d399786e7f83ba42431c91c6c033bef8daa18406 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 14:54:28 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E6=8A=8A=E5=93=8D=E5=BA=94code=20?= =?UTF-8?q?=E4=B8=BA0=20=E7=9A=84=E6=94=B9=E4=B8=BA200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fangjia/open/controllers/AddrSvcController.java | 2 +- .../java/com/fangjia/open/controllers/AddressController.java | 2 +- 2 files changed, 2 insertions(+), 2 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 258d75236..237353af9 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 @@ -177,7 +177,7 @@ public class AddrSvcController { try { json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8"); if (json != null) { - int code = json.getInt("status"); + int code = json.getInt("status") == 0 ? 200 : 0; String msg = json.getString("msg"); BasicModel basicModel = new BasicModel(code, msg); if (json.containsKey("result")) { diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java index f036e2232..a484fd8cf 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java @@ -2277,7 +2277,7 @@ public class AddressController { } if (json != null) { - int code = json.getInt("status"); + int code = json.getInt("status") == 0 ? 200 : 0; String msg = json.getString("msg"); BasicModel basicModel = new BasicModel(code, msg); if (json.containsKey("result")) { From ffebd87bae125aac78185666da63c39b384c2db8 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 3 Sep 2024 16:52:22 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=9B=BD=E4=BF=A1=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 | 136 ++++++++++++++---- 1 file changed, 112 insertions(+), 24 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 237353af9..6b669977b 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 @@ -312,6 +312,46 @@ public class AddrSvcController { return mav; } + /** + * 地址联想 + */ + public Object tipsAction(AddressModel model) { + + RestfulModelAndView mav = new RestfulModelAndView(); + if (StringUtils.isBlank(model.getKeywords())) { + mav.setModel(BasicModel.buildBadRequestModel("搜索关键字不能为空")); + return mav; + } + + HttpRequest request = new HttpRequest(); + JSONObject json = null; + Map params = new HashMap(); + params.put("keywords", model.getKeywords()); + params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : ""); + params.put("max", model.getMax() != 0 ? String.valueOf(model.getMax()) : ""); + try { + json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/tips", params, "UTF-8"); + if (json != null) { + int code = json.getInt("msgCode"); + String msg = json.getString("msg"); + BasicModel basicModel = new BasicModel(code, msg); + if (json.containsKey("result")) { + JSONArray jsonArray = json.getJSONArray("result"); + if (jsonArray.size() > 0) { + basicModel.setResult(jsonArray); + } + } + mav.setModel(basicModel); + } else { + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + } catch (Exception e) { + e.printStackTrace(); + mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); + } + return mav; + } + public Object avgPriceAction(AddressModel model) { RestfulModelAndView mav = new RestfulModelAndView(); if (StringUtils.isBlank(model.getAddress())) { @@ -1048,11 +1088,21 @@ public class AddrSvcController { for (Object o : jsonArray) { JSONObject result = (JSONObject) o; HashMap map = new HashMap(); - map.put("id", result.getString("id")); - map.put("province", result.getString("province")); - map.put("provinceCode", result.getString("tjjProvinceCode")); - map.put("city", result.getString("city")); - map.put("cityCode", result.getString("tjjCityCode")); + if (result.containsKey("id")) { + map.put("id", result.getString("id")); + } + if (result.containsKey("province")) { + map.put("province", result.getString("province")); + } + if (result.containsKey("provinceCode")) { + map.put("provinceCode", result.getString("tjjProvinceCode")); + } + if (result.containsKey("city")) { + map.put("city", result.getString("city")); + } + if (result.containsKey("cityCode")) { + map.put("cityCode", result.getString("tjjCityCode")); + } list.add(map); } } @@ -1096,9 +1146,15 @@ public class AddrSvcController { for (Object o : jsonArray) { JSONObject result = (JSONObject) o; HashMap map = new HashMap(); - map.put("id", result.getString("id")); - map.put("province", result.getString("province")); - map.put("provinceCode", result.getString("mzbProvinceCode")); + if (result.containsKey("id")) { + map.put("id", result.getString("id")); + } + if (result.containsKey("province")) { + map.put("province", result.getString("province")); + } + if (result.containsKey("provinceCode")) { + map.put("provinceCode", result.getString("mzbProvinceCode")); + } list.add(map); } } @@ -1145,13 +1201,27 @@ public class AddrSvcController { for (Object o : jsonArray) { JSONObject result = (JSONObject) o; HashMap map = new HashMap(); - map.put("id", result.getString("id")); - map.put("province", result.getString("province")); - map.put("provinceCode", result.getString("tjjProvinceCode")); - map.put("city", result.getString("city")); - map.put("cityCode", result.getString("tjjCityCode")); - map.put("district", result.getString("district")); - map.put("districtCode", result.getString("tjjDistrictCode")); + if (result.containsKey("id")) { + map.put("id", result.getString("id")); + } + if (result.containsKey("province")) { + map.put("province", result.getString("province")); + } + if (result.containsKey("provinceCode")) { + map.put("provinceCode", result.getString("tjjProvinceCode")); + } + if (result.containsKey("city")) { + map.put("city", result.getString("city")); + } + if (result.containsKey("cityCode")) { + map.put("cityCode", result.getString("tjjCityCode")); + } + if (result.containsKey("district")) { + map.put("district", result.getString("district")); + } + if (result.containsKey("districtCode")) { + map.put("districtCode", result.getString("tjjDistrictCode")); + } list.add(map); } } @@ -1193,15 +1263,33 @@ public class AddrSvcController { for (Object o : jsonArray) { JSONObject result = (JSONObject) o; HashMap map = new HashMap(); - map.put("id", result.getString("id")); - map.put("province", result.getString("province")); - map.put("provinceCode", result.getString("tjjProvinceCode")); - map.put("city", result.getString("city")); - map.put("cityCode", result.getString("tjjCityCode")); - map.put("district", result.getString("district")); - map.put("districtCode", result.getString("tjjDistrictCode")); - map.put("street", result.getString("street")); - map.put("streetCode", result.getString("tjjStreetCode")); + if (result.containsKey("id")) { + map.put("id", result.getString("id")); + } + if (result.containsKey("province")) { + map.put("province", result.getString("province")); + } + if (result.containsKey("provinceCode")) { + map.put("provinceCode", result.getString("tjjProvinceCode")); + } + if (result.containsKey("city")) { + map.put("city", result.getString("city")); + } + if (result.containsKey("cityCode")) { + map.put("cityCode", result.getString("tjjCityCode")); + } + if (result.containsKey("district")) { + map.put("district", result.getString("district")); + } + if (result.containsKey("districtCode")) { + map.put("districtCode", result.getString("tjjDistrictCode")); + } + if (result.containsKey("street")) { + map.put("street", result.getString("street")); + } + if (result.containsKey("streetCode")) { + map.put("streetCode", result.getString("tjjStreetCode")); + } list.add(map); } } From 4d71c4db1b7d776be57a1a2b3fd68677d3d8a48c Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Fri, 6 Sep 2024 17:48:21 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E8=B7=91=E5=90=8D=E5=BD=95=E9=9B=86?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/gj/data_handle/MinglujiData.groovy | 163 ++++++++++++++++-- 1 file changed, 148 insertions(+), 15 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy index 2624d025c..bbe36b024 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy @@ -16,7 +16,8 @@ class MinglujiData { DBCollection mlj_COLL = MongoUtils.getCollectionByName("crawl", "kfq_mingluji_com", "192.168.0.206",27020) def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; - DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL) + + DBCollection development_zone_CONN = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com") DBCollection dev_mapping_CONN = MongoUtils.getCollectionByName2("fangjia", "dev_mapping", MONGO100_URL) DBCollection community_100_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) @@ -30,16 +31,19 @@ class MinglujiData { } def run(){ - def prov = "浙江省" - def city = "嘉兴" + def prov = "河北省" + def city = "石家庄市" // exportDatas(city) matchDev(prov, city) matchCommunity(city) - + fiveLevelSplit(city) + nineLevelSplit(city) // tempMatchDev(prov) + +// checkDev() // saveMljData() - fiveLevelSplit(city) + } def exportDatas(city){ def datas = findMinglujiDatas(city) @@ -84,9 +88,9 @@ class MinglujiData { if (d['E'] && !d['N']) { - def obj = findDevByName(d['E']) + def obj = findDevByName(null, d['E']) if (!obj) { - obj = findDevByAlias(d['E']) + obj = findDevByAlias(null, d['E']) if (!obj) { obj = findDebBySimlar(devs, d['E'], d['B']) if (!obj) { @@ -122,9 +126,9 @@ class MinglujiData { def devs = loadAllDevs(prov) ExcelUtils.multiThreadingModify("D:\\数据\\数据建设\\名录集\\湖州-开发区-等级.xlsx",{d-> if(d['U'] && !d['W'] ){ - def obj = findDevByName(d['U']) + def obj = findDevByName(null, d['U']) if(!obj){ - obj = findDevByAlias(d['U']) + obj = findDevByAlias(null, d['U']) if(!obj){ obj = findDebBySimlar(devs, d['U'], d['B']) if(!obj){ @@ -202,34 +206,157 @@ class MinglujiData { } } + def nineLevelSplit(city){ + def i = 1; + while(i<20) { + def fileName = "/home/goojia/gj/mlj_${i}.xlsx" + if (CommonDatautils.isWindow()) { + fileName = "D:\\数据\\数据建设\\名录集\\${city}_${i}.xlsx" + } + + File file = new File(fileName); + if (file.exists()) { + ExcelUtils.multiThreadingModify(fileName,{d-> + if(d['E'] && !d['Z']){ + def jsonObject1 = com.fangjia.script.gj.district.FangjiaClientUtils.formatNinelevel(d['B'], d['E']) + if(jsonObject1) { + if (jsonObject1.get("dev") && jsonObject1.get("dev") != "null") { + def devName = jsonObject1.get("dev") + def obj = findDev(jsonObject1.get("city"), devName) + d['AD'] = devName + if(jsonObject1.containsKey("detail") && jsonObject1.detail.dev_confi!='null'){ + d['AJ'] = jsonObject1.detail.dev_confi + } + if (obj) { + d['AG'] = obj._id.toString() + d['AF'] = obj.name + } + } + } + } + + if(d['E'] && !d['M']) { + def jsonObject = com.fangjia.script.gj.district.FangjiaClientUtils.formatNinelevel(d['B'], d['J']) + def street = jsonObject.get("street") + def streetNumber = jsonObject.get("streetNumber") + if (jsonObject.get("province") && jsonObject.get("province") != "null") { + d['W'] = jsonObject.get("province") + } + + if (jsonObject.get("city") && jsonObject.get("city") != "null") { + d['X'] = jsonObject.get("city") + } + + if (jsonObject.get("district") && jsonObject.get("district") != "null") { + d['Y'] = jsonObject.get("district") + } + + if (jsonObject.get("township") && jsonObject.get("township") != "null") { + d['Z'] = jsonObject.get("township") + } + + if (jsonObject && street && streetNumber && street != "null") { + d['AA'] = jsonObject.get("street") + def road = jsonObject.get("street") + if (streetNumber != 'null') { + d['AB'] = jsonObject.get("streetNumber") + road = road + jsonObject.get("streetNumber") + } else { + d['AC'] = "信息不完整" + } + + if (!d['AC'] && !d['J'].contains(road)) { + d['AC'] = "原地址不含路" + } + + if (!d['AC']) { + def flag = road.matches('^[\u4e00-\u9fa5]+?(路|大道|巷|胡同|街).+[弄号]$') + if (!flag) { + d['AC'] = "路非法" + } + def roadsize = jsonObject.get("street").size() + if (!d['AC'] && (roadsize < 3 || roadsize > 7)) { + d['AC'] = "路太长|路太短" + } + } + }else{ + d['AC'] = "无地址" + } + + if (jsonObject.get("dev") && jsonObject.get("dev") != "null") { + def devName = jsonObject.get("dev") + def obj = findDev(jsonObject.get("city"), devName) + d['AE'] = devName + if (obj) { + d['AI'] = obj._id.toString() + d['AH'] = obj.name + } + if(jsonObject.containsKey("detail") && jsonObject.detail.dev_confi!='null'){ + d['AK'] = jsonObject.detail.dev_confi + } + } + } + },0) + println fileName +" 九级拆分完成" + } + i++ + } + } + + + def findDev( city, name){ + def obj = findDevByName(city, name) + if(!obj){ + obj = findDevByAlias(city, name) + if(obj){ + obj.match_way = "别名" + } + }else{ + obj.match_way = "相同" + } + return obj + } def fiveLevelSplit(city){ def i = 1; while(i<20) { def fileName = "/home/goojia/gj/mlj_${i}.xlsx" if (CommonDatautils.isWindow()) { - fileName = "D:\\数据\\数据建设\\名录集\\mlj_${i}.xlsx" + fileName = "D:\\数据\\数据建设\\名录集\\${city}_${i}.xlsx" } File file = new File(fileName); if (file.exists()) { ExcelUtils.multiThreadingModify(fileName, { d -> - if(d['J'] && !d['X']){ + if(d['J'] && !d['AN']){ def jsonObject = com.fangjia.script.gj.district.FangjiaClientUtils.formatFivelevel(d['B'], d['J']) if(jsonObject) { if (jsonObject.get("address") && jsonObject.get("address") != "null") { - d['X'] = jsonObject.get("address") + d['AN'] = jsonObject.get("address") } } } }) } i++ + println fileName +" 五级拆分完成" } } + def checkDev(){ + ExcelUtils.multiThreadingModify("D:\\数据\\数据建设\\名录集\\嘉兴入库数据.xlsx",{d-> + if(d['F']){ + def obj = findDevByName(null, d['F']) + if(obj){ + d['I'] = "库中" + }else{ + d['I'] = "非库中" + } + } + }) + } def saveMljData(){ - ExcelUtils.multiThreadingModify("D:\\数据\\数据建设\\名录集\\湖州入库2.xlsx",{d-> + ExcelUtils.multiThreadingModify("D:\\数据\\数据建设\\名录集\\嘉兴入库数据.xlsx",{d-> def obj = new BasicDBObject() obj.put("province", d['A']) obj.put("city", d['B']) @@ -281,14 +408,20 @@ class MinglujiData { } return last } - def findDevByName(name){ + def findDevByName(city, name){ def q = new BasicDBObject() + if(city){ + q.put("city", city) + } q.put("name", name) return development_zone_CONN.findOne(q) } - def findDevByAlias(name){ + def findDevByAlias(city, name){ def q = new BasicDBObject() + if(city){ + q.put("city", city) + } q.put('alias', new BasicDBObject('$in',[name])) return development_zone_CONN.findOne(q) } From 48ede3457382bf9aa4e07eec7613cfb1216e43c2 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Mon, 9 Sep 2024 14:10:50 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E8=B5=B0=E5=8A=BF=E5=9B=BE=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/fangjia-coresite/src/main/webapp/trend/trend.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl b/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl index 375d1ec56..57168fb3d 100644 --- a/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl +++ b/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl @@ -406,10 +406,10 @@ const month = now.getMonth() + 1; // 鏈� let divElement = document.getElementById("date"); - divElement.innerHTML = ""+year+"骞�"+month+"鏈�"+""; + $("#date").html(""+year+"骞�"+month+"鏈�"+"") let divElement2 = document.getElementById("date2"); - divElement2.innerHTML = ""+year+"骞�"+month+"鏈�"+""; + $("#date2").html(""+year+"骞�"+month+"鏈�"+"") $(function(){ $('.td04').each(function(i){ From 38712f886d26d2c25fbde74748d9d81c5d623c3c Mon Sep 17 00:00:00 2001 From: majintao Date: Wed, 11 Sep 2024 11:37:56 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=89=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E7=BB=9F=E8=AE=A1=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl b/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl index 4f5ec9781..93a24eb3f 100644 --- a/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/apiUser/apiVisitStat.ftl @@ -579,7 +579,7 @@ <#if way==1> ${bo.key!} <#else> - ${bo.key!} + ${bo.key!} <#if way?? && way==1> @@ -787,7 +787,6 @@ function submitForm(action) { const form = document.getElementById('myForm'); if (action === 'query') { - debugger form.action = "<#if way?? && way==0>../apiUser/pandect<#else>../apiUser/apiVisitStat"; } else if (action === 'download') { form.action = "../apiUser/export"; From 0b8f063f9a6c1b037caa48071a3aec3a71c59a23 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Wed, 11 Sep 2024 13:29:21 +0800 Subject: [PATCH 13/13] update --- .../fangjia/script/gj/data_handle/MinglujiData.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy index bbe36b024..ae1400128 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/MinglujiData.groovy @@ -34,9 +34,9 @@ class MinglujiData { def prov = "河北省" def city = "石家庄市" // exportDatas(city) - matchDev(prov, city) - matchCommunity(city) - fiveLevelSplit(city) +// matchDev(prov, city) +// matchCommunity(city) +// fiveLevelSplit(city) nineLevelSplit(city) // tempMatchDev(prov) @@ -216,7 +216,7 @@ class MinglujiData { File file = new File(fileName); if (file.exists()) { - ExcelUtils.multiThreadingModify(fileName,{d-> + ExcelUtils.modify(fileName,{d-> if(d['E'] && !d['Z']){ def jsonObject1 = com.fangjia.script.gj.district.FangjiaClientUtils.formatNinelevel(d['B'], d['E']) if(jsonObject1) { @@ -235,7 +235,7 @@ class MinglujiData { } } - if(d['E'] && !d['M']) { + if(d['J'] && !d['M']) { def jsonObject = com.fangjia.script.gj.district.FangjiaClientUtils.formatNinelevel(d['B'], d['J']) def street = jsonObject.get("street") def streetNumber = jsonObject.get("streetNumber")