新增企业库处理流程

This commit is contained in:
沈健
2025-06-09 10:50:30 +08:00
parent 02e1aab542
commit 43f35fa63e
4 changed files with 229 additions and 3 deletions
+24 -1
View File
@@ -11,7 +11,30 @@ flag = False
for province in areautils.get_all_province():
print(f"开始处理{province}数据")
# 百度经纬度转高德经纬度
df = DIDATA_DEV_ELASTIC_CLIENT.scan_by_sql_to_data_frame(f"select location from didata_enterprise where province='{province}'")
df = DIDATA_DEV_ELASTIC_CLIENT.scan_to_data_frame(index='didata_enterprise', query={
"query": {
"bool": {
"must": [
{
"term": {
"province": {
"value": "" + province + ""
}
}
}
],
"must_not": [
{
"exists": {
"field": "gaode_location"
}
}
]
}
}
})
if len(df) == 0:
continue
def deal_location(item):
if pd.isna(item['location']):
return item