Merge branch 'script_gj' of http://gitlab.fangjia.com/dev0/main into script_gj

This commit is contained in:
2022-03-21 13:59:51 +08:00
2 changed files with 54 additions and 36 deletions
@@ -15,42 +15,60 @@ ExcelUtils.multiThreadingModify("D:\\Users\\Domi\\Documents\\֪ʶ
def province = item['D']
def city = item['E']
def area = item['F']
def township = item['G']
def community = item['H']
String township = item['G']
String community = item['H']
if (StringUtils.isBlank(city)) {
return ;
}
if (ProvinceData.isGovernmentCity(city)) {
townConn.find(new BasicDBObject("province", "重庆市")
.append("region", area + "区")
.append("street", township)
.append("juweihui", community), new BasicDBObject()).limit(1).each {
obj ->
item['T'] = obj.juweihui_type
}
if (item['T'] == null) {
townConn.find(new BasicDBObject("province", "重庆市")
.append("region", area + "区")
.append("juweihui", community), new BasicDBObject()).limit(1).each {
obj ->
item['T'] = obj.juweihui_type
}
}
} else {
townConn.find(new BasicDBObject("city", city + "市")
.append("region", area + "区")
.append("street", township)
.append("juweihui", community), new BasicDBObject()).limit(1).each {
obj ->
item['T'] = obj.juweihui_type
}
if (item['T'] == null) {
townConn.find(new BasicDBObject("city", city + "市")
.append("region", area + "区")
.append("juweihui", community), new BasicDBObject()).limit(1).each {
obj ->
item['T'] = obj.juweihui_type
}
}
if (item['T'] != null) {
return ;
}
// if (community == null) {
// return ;
// }
if (township) {
if (township.endsWith("镇") || township.endsWith("乡")) {
item['T'] = 2
} else if (township.endsWith("街道")) {
item['T'] = 1
}
}
// community = community.replaceAll("居委会", "")
// community = community.replaceAll("居民委员会", "")
// community = community.replaceAll("村民委员会", "")
// community = community.replaceAll("村委会", "")
//
// if (ProvinceData.isGovernmentCity(city)) {
// townConn.find(new BasicDBObject("province", "重庆市")
// .append("region", area + "区")
// .append("street", township)
// .append("juweihui", new BasicDBObject('$regex', "^" + community)), new BasicDBObject()).limit(1).each {
// obj ->
// item['T'] = obj.juweihui_type
// }
// if (item['T'] == null) {
// townConn.find(new BasicDBObject("province", "重庆市")
// .append("region", area + "区")
// .append("juweihui", new BasicDBObject('$regex', "^" + community)), new BasicDBObject()).limit(1).each {
// obj ->
// item['T'] = obj.juweihui_type
// }
// }
// } else {
// townConn.find(new BasicDBObject("city", city + "市")
// .append("region", area + "区")
// .append("street", township)
// .append("juweihui", new BasicDBObject('$regex', "^" + community)), new BasicDBObject()).limit(1).each {
// obj ->
// item['T'] = obj.juweihui_type
// }
// if (item['T'] == null) {
// townConn.find(new BasicDBObject("city", city + "市")
// .append("region", area + "区")
// .append("juweihui", new BasicDBObject('$regex', "^" + community)), new BasicDBObject()).limit(1).each {
// obj ->
// item['T'] = obj.juweihui_type
// }
// }
// }
})
@@ -21,10 +21,10 @@ import java.util.concurrent.Executors
class CommitteeLatLng {
static DBCollection villagesConn = MongoUtils.getCollectionByName("fangjia", "villages", "192.168.0.43", 28017)
static ExecutorService executorService = Executors.newFixedThreadPool(20)
static ExecutorService executorService = Executors.newFixedThreadPool(10)
static void main(String[] args) {
dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0)).append("name", "席庄二村委会"))
dealPoi(new BasicDBObject("status_location", new BasicDBObject('$ne', 0)).append("year", 2021))
//dealLocation()
executorService.shutdown()
}