填充城乡分类

This commit is contained in:
Jian Shen
2022-03-10 17:59:48 +08:00
parent 91560b90c1
commit 322f7ab041
@@ -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
// }
// }
// }
})