填充城乡分类
This commit is contained in:
+52
-34
@@ -15,42 +15,60 @@ ExcelUtils.multiThreadingModify("D:\\Users\\Domi\\Documents\\֪ʶ
|
|||||||
def province = item['D']
|
def province = item['D']
|
||||||
def city = item['E']
|
def city = item['E']
|
||||||
def area = item['F']
|
def area = item['F']
|
||||||
def township = item['G']
|
String township = item['G']
|
||||||
def community = item['H']
|
String community = item['H']
|
||||||
if (StringUtils.isBlank(city)) {
|
if (StringUtils.isBlank(city)) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
if (ProvinceData.isGovernmentCity(city)) {
|
if (item['T'] != null) {
|
||||||
townConn.find(new BasicDBObject("province", "重庆市")
|
return ;
|
||||||
.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 (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
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user