修复评级bug
This commit is contained in:
@@ -143,13 +143,17 @@ def calc_consumption_rating(community_summary_df):
|
|||||||
|
|
||||||
def sync(city=None):
|
def sync(city=None):
|
||||||
if pd.isna(city):
|
if pd.isna(city):
|
||||||
for city in areautils.get_all_cities():
|
for city_now in areautils.get_all_cities():
|
||||||
log.info(f"{city}开始评级....")
|
log.info(f"{city_now}开始评级....")
|
||||||
community_summary_df = calc_consumption_potential(city)
|
community_summary_df = calc_consumption_potential(city_now)
|
||||||
calc_consumption_rating(community_summary_df)
|
calc_consumption_rating(community_summary_df)
|
||||||
|
save_png(city_now)
|
||||||
|
nextcloudutils.up_to_nextcloud(save_png_path, nextcloud_aim_file_path)
|
||||||
else:
|
else:
|
||||||
community_summary_df = calc_consumption_potential(city)
|
community_summary_df = calc_consumption_potential(city)
|
||||||
calc_consumption_rating(community_summary_df)
|
calc_consumption_rating(community_summary_df)
|
||||||
|
save_png(city)
|
||||||
|
nextcloudutils.up_to_nextcloud(save_png_path, nextcloud_aim_file_path)
|
||||||
|
|
||||||
|
|
||||||
def filter_min_max(city, community_summary_df):
|
def filter_min_max(city, community_summary_df):
|
||||||
@@ -180,7 +184,7 @@ def save_png(city=None):
|
|||||||
"""
|
"""
|
||||||
生成财力评级图表
|
生成财力评级图表
|
||||||
"""
|
"""
|
||||||
sql = "select id, city, region, name, consumption_rating from community_summary"
|
sql = "select id, city, region, name, total_price, estate_charge, avg_cost, relative_price_ranking, consumption_rating from community_summary"
|
||||||
if pd.notna(city):
|
if pd.notna(city):
|
||||||
sql += " where city='" + city + "'"
|
sql += " where city='" + city + "'"
|
||||||
community_summary_df = es206_client.scan_by_sql_to_data_frame(sql)
|
community_summary_df = es206_client.scan_by_sql_to_data_frame(sql)
|
||||||
@@ -220,6 +224,4 @@ def save_png(city=None):
|
|||||||
|
|
||||||
|
|
||||||
sync()
|
sync()
|
||||||
save_png()
|
|
||||||
nextcloudutils.up_to_nextcloud(save_png_path, nextcloud_aim_file_path)
|
|
||||||
dingutils.send_text("【分布图生成完毕】财力评级已完成, 请点击 https://nextcloud.fangjia.com/s/gNTqRqnEnsYkJc4 查看分布图", "c7ac6c86bfbe49a95e30a68616c4d784ae7781c715430dc9c5f6b46d3e6ebd78")
|
dingutils.send_text("【分布图生成完毕】财力评级已完成, 请点击 https://nextcloud.fangjia.com/s/gNTqRqnEnsYkJc4 查看分布图", "c7ac6c86bfbe49a95e30a68616c4d784ae7781c715430dc9c5f6b46d3e6ebd78")
|
||||||
|
|||||||
Reference in New Issue
Block a user