添加街道字段
This commit is contained in:
+1
-1
@@ -671,7 +671,7 @@ public class PropertyController {
|
|||||||
&& !"1007486".equals(userId) && !"1007533".equals(userId) && !"1007630".equals(userId)
|
&& !"1007486".equals(userId) && !"1007533".equals(userId) && !"1007630".equals(userId)
|
||||||
&& !"1007705".equals(userId) && !"1007739".equals(userId) && !"1007736".equals(userId)
|
&& !"1007705".equals(userId) && !"1007739".equals(userId) && !"1007736".equals(userId)
|
||||||
&& !"1007741".equals(userId) && !"1007742".equals(userId) && !"1007743".equals(userId)
|
&& !"1007741".equals(userId) && !"1007742".equals(userId) && !"1007743".equals(userId)
|
||||||
&& !"1007747".equals(userId)
|
&& !"1007747".equals(userId) && !"1007757".equals(userId)
|
||||||
&& model.getDetailLevel() != null && model.getDetailLevel() != 0) {// 临时权限控制
|
&& model.getDetailLevel() != null && model.getDetailLevel() != 0) {// 临时权限控制
|
||||||
mav.setModel(BasicModel.buildUnAuthorizedModel());
|
mav.setModel(BasicModel.buildUnAuthorizedModel());
|
||||||
return mav;
|
return mav;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.fangjia.core.ProvinceData
|
|||||||
import com.fangjia.script.util.CommonUtils
|
import com.fangjia.script.util.CommonUtils
|
||||||
import com.fangjia.script.util.DataUtil
|
import com.fangjia.script.util.DataUtil
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
|
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
|
||||||
@@ -11,45 +12,71 @@ import com.mongodb.BasicDBObject
|
|||||||
import com.mongodb.DBCollection
|
import com.mongodb.DBCollection
|
||||||
import net.sf.json.JSONObject
|
import net.sf.json.JSONObject
|
||||||
import org.apache.commons.lang.StringUtils
|
import org.apache.commons.lang.StringUtils
|
||||||
DBCollection SEAWEED_TOWNSHIP = MongoUtils.getCollectionByName("fangjia_base", "seaweed_township", "192.168.0.235", 27018)
|
//DBCollection SEAWEED_TOWNSHIP = MongoUtils.getCollectionByName("fangjia_base", "seaweed_township", "192.168.0.235", 27018)
|
||||||
def count = 0
|
//def count = 0
|
||||||
List<List<String>> data = Collections.synchronizedList([])
|
//List<List<String>> data = Collections.synchronizedList([])
|
||||||
data << ["ID","城市","区域","小区名","经度","纬度","街道"]
|
//data << ["ID","城市","区域","小区名","经度","纬度","街道"]
|
||||||
|
//
|
||||||
CommonUtils.findAllCity().each {def city->
|
//CommonUtils.findAllCity().each {def city->
|
||||||
DbUtils.multiThreadingExecuteQueryOnSeaweed(DbUtils.buildSeaweedQuery(city),{BasicDBObject item->
|
// DbUtils.multiThreadingExecuteQueryOnSeaweed(DbUtils.buildSeaweedQuery(city),{BasicDBObject item->
|
||||||
if(StringUtils.isBlank(item.township) && item.lng){
|
// if(StringUtils.isBlank(item.township) && item.lng){
|
||||||
count++
|
// count++
|
||||||
def lng = item.lng/10000000000d
|
// def lng = item.lng/10000000000d
|
||||||
def lat = item.lat/10000000000d
|
// def lat = item.lat/10000000000d
|
||||||
def location = "${lng},${lat}"
|
// def location = "${lng},${lat}"
|
||||||
JSONObject resp = GaoDeApiUtils.geocode(location)
|
// JSONObject resp = GaoDeApiUtils.geocode(location)
|
||||||
def row = []
|
// def row = []
|
||||||
row << item._id.toString()
|
// row << item._id.toString()
|
||||||
row << item.city
|
// row << item.city
|
||||||
row << item.region
|
// row << item.region
|
||||||
row << item.name
|
// row << item.name
|
||||||
row << lng
|
// row << lng
|
||||||
row << lat
|
// row << lat
|
||||||
BasicDBObject dbo = new BasicDBObject()
|
// BasicDBObject dbo = new BasicDBObject()
|
||||||
dbo.id = item._id.toString()
|
// dbo.id = item._id.toString()
|
||||||
dbo.city = item.city
|
// dbo.city = item.city
|
||||||
dbo.region = item.region
|
// dbo.region = item.region
|
||||||
dbo.name = item.name
|
// dbo.name = item.name
|
||||||
dbo.lng = lng
|
// dbo.lng = lng
|
||||||
dbo.lat = lat
|
// dbo.lat = lat
|
||||||
if(resp.regeocode && resp.regeocode.addressComponent && resp.regeocode.addressComponent.township){
|
// if(resp.regeocode && resp.regeocode.addressComponent && resp.regeocode.addressComponent.township){
|
||||||
row << resp.regeocode.addressComponent.township
|
// row << resp.regeocode.addressComponent.township
|
||||||
dbo.township = resp.regeocode.addressComponent.township
|
// dbo.township = resp.regeocode.addressComponent.township
|
||||||
}
|
// }
|
||||||
println(row)
|
// println(row)
|
||||||
data << row
|
// data << row
|
||||||
SEAWEED_TOWNSHIP.insert(dbo)
|
// SEAWEED_TOWNSHIP.insert(dbo)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
//}
|
||||||
ExcelUtils.write("D:\\街道补充数据.xlsx", data, "补充数据")
|
//ExcelUtils.write("D:\\街道补充数据.xlsx", data, "补充数据")
|
||||||
|
|
||||||
|
//ExcelUtils.modify("D:\\街道补充数据.xlsx",{List item ->
|
||||||
|
// if(item["G"] && item["H"] == null){
|
||||||
|
// DbUtils.seaweed.update(new BasicDBObject("_id", item["A"]), new BasicDBObject('$set', new BasicDBObject('township', item["G"])))
|
||||||
|
// }
|
||||||
|
// println(item)
|
||||||
|
//})
|
||||||
|
|
||||||
|
//ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Downloads\\错误经纬度.xlsx",{List item->
|
||||||
|
// def location = "${item["A"]},${item["B"]}"
|
||||||
|
// JSONObject resp = GaoDeApiUtils.geocode(location)
|
||||||
|
// if(resp.regeocode && resp.regeocode.formatted_address){
|
||||||
|
// item['G'] = resp.regeocode.formatted_address
|
||||||
|
// println(item)
|
||||||
|
// }
|
||||||
|
//})
|
||||||
|
|
||||||
|
//def count = 0
|
||||||
|
//CommonUtils.findAllCity().each {def city->
|
||||||
|
// DbUtils.executeQueryOnSeaweed(DbUtils.buildSeaweedQuery(city),{BasicDBObject item->
|
||||||
|
// if(item.township){
|
||||||
|
// count++
|
||||||
|
// }
|
||||||
|
// }, new BasicDBObject("township", 1))
|
||||||
|
//}
|
||||||
|
//println(count)
|
||||||
|
|
||||||
|
ElasticUtils.executeSqlQuery("select count(*), p_date from seawater where p_date > 20210501 group by p_date",{
|
||||||
|
println(it)
|
||||||
|
})
|
||||||
@@ -9,6 +9,11 @@ import com.fangjia.core.util.HttpRequest
|
|||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import net.sf.json.JSONObject
|
import net.sf.json.JSONObject
|
||||||
|
|
||||||
|
def strt(String addr){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ExcelUtils.modify("D:\\nextcloud\\数据\\地址类服务测试\\建行地址相似度评级测试.xlsx",{List item->
|
ExcelUtils.modify("D:\\nextcloud\\数据\\地址类服务测试\\建行地址相似度评级测试.xlsx",{List item->
|
||||||
def city = item["A"]
|
def city = item["A"]
|
||||||
def address1 = item["B"]
|
def address1 = item["B"]
|
||||||
|
|||||||
Reference in New Issue
Block a user