Commit 29dc4464 by dong

fix20221220

parent 74dd65e2
......@@ -809,36 +809,36 @@ def project_graph():
if flag == 1:
total_num = project_obj.count()
num1 = project_obj.filter(or_(
ProjectManagement.project_source.like('%北京%'),
ProjectManagement.project_source.like('%天津%'),
ProjectManagement.project_source.like('%河北%')
ProjectManagement.investor_district.like('%北京%'),
ProjectManagement.investor_district.like('%天津%'),
ProjectManagement.investor_district.like('%河北%')
)).count()
num2 = project_obj.filter(or_(
ProjectManagement.project_source.like('%江苏%'),
ProjectManagement.project_source.like('%浙江%'),
ProjectManagement.project_source.like('%上海%')
ProjectManagement.investor_district.like('%江苏%'),
ProjectManagement.investor_district.like('%浙江%'),
ProjectManagement.investor_district.like('%上海%')
)).count()
num3 = project_obj.filter(or_(
ProjectManagement.project_source.like('%广东%'),
ProjectManagement.project_source.like('%香港%'),
ProjectManagement.project_source.like('%澳门%')
ProjectManagement.investor_district.like('%广东%'),
ProjectManagement.investor_district.like('%香港%'),
ProjectManagement.investor_district.like('%澳门%')
)).count()
num4 = project_obj.filter(or_(
ProjectManagement.project_source.like('%河南%'),
ProjectManagement.project_source.like('%长治%'),
ProjectManagement.project_source.like('%晋城%'),
ProjectManagement.project_source.like('%运城%'),
ProjectManagement.project_source.like('%聊城%'),
ProjectManagement.project_source.like('%菏泽%'),
ProjectManagement.project_source.like('%泰安%'),
ProjectManagement.project_source.like('%宿州%'),
ProjectManagement.project_source.like('%淮北%'),
ProjectManagement.project_source.like('%阜阳%'),
ProjectManagement.project_source.like('%亳州%'),
ProjectManagement.project_source.like('%蚌埠%'),
ProjectManagement.project_source.like('%淮南%'),
ProjectManagement.project_source.like('%邢台%'),
ProjectManagement.project_source.like('%邯郸%')
ProjectManagement.investor_district.like('%河南%'),
ProjectManagement.investor_district.like('%长治%'),
ProjectManagement.investor_district.like('%晋城%'),
ProjectManagement.investor_district.like('%运城%'),
ProjectManagement.investor_district.like('%聊城%'),
ProjectManagement.investor_district.like('%菏泽%'),
ProjectManagement.investor_district.like('%泰安%'),
ProjectManagement.investor_district.like('%宿州%'),
ProjectManagement.investor_district.like('%淮北%'),
ProjectManagement.investor_district.like('%阜阳%'),
ProjectManagement.investor_district.like('%亳州%'),
ProjectManagement.investor_district.like('%蚌埠%'),
ProjectManagement.investor_district.like('%淮南%'),
ProjectManagement.investor_district.like('%邢台%'),
ProjectManagement.investor_district.like('%邯郸%')
)).count()
num5 = total_num - sum([num1, num2, num3, num4])
total_num = sum([num1, num2, num3, num4, num5])
......@@ -917,13 +917,13 @@ def project_graph():
elif flag == 5:
if project_source == '京津冀':
num1 = project_obj.filter(or_(
ProjectManagement.project_source.like('%北京%'),
ProjectManagement.investor_district.like('%北京%'),
)).count()
num2 = project_obj.filter(or_(
ProjectManagement.project_source.like('%天津%'),
ProjectManagement.investor_district.like('%天津%'),
)).count()
num3 = project_obj.filter(or_(
ProjectManagement.project_source.like('%河北%')
ProjectManagement.investor_district.like('%河北%')
)).count()
total_num = sum([num1, num2, num3])
......@@ -934,13 +934,13 @@ def project_graph():
]
if project_source == '长三角':
num1 = project_obj.filter(or_(
ProjectManagement.project_source.like('%江苏%'),
ProjectManagement.investor_district.like('%江苏%'),
)).count()
num2 = project_obj.filter(or_(
ProjectManagement.project_source.like('%浙江%'),
ProjectManagement.investor_district.like('%浙江%'),
)).count()
num3 = project_obj.filter(or_(
ProjectManagement.project_source.like('%上海%')
ProjectManagement.investor_district.like('%上海%')
)).count()
total_num = sum([num1, num2, num3])
......@@ -951,13 +951,13 @@ def project_graph():
]
if project_source == '珠三角':
num1 = project_obj.filter(or_(
ProjectManagement.project_source.like('%广东%'),
ProjectManagement.investor_district.like('%广东%'),
)).count()
num2 = project_obj.filter(or_(
ProjectManagement.project_source.like('%香港%'),
ProjectManagement.investor_district.like('%香港%'),
)).count()
num3 = project_obj.filter(or_(
ProjectManagement.project_source.like('%澳门%')
ProjectManagement.investor_district.like('%澳门%')
)).count()
total_num = sum([num1, num2, num3])
......@@ -968,29 +968,29 @@ def project_graph():
]
if project_source == '中原经济区':
project_obj_list = project_obj.filter(or_(
ProjectManagement.project_source.like('%河南%'),
ProjectManagement.project_source.like('%长治%'),
ProjectManagement.project_source.like('%晋城%'),
ProjectManagement.project_source.like('%运城%'),
ProjectManagement.project_source.like('%聊城%'),
ProjectManagement.project_source.like('%菏泽%'),
ProjectManagement.project_source.like('%泰安%'),
ProjectManagement.project_source.like('%宿州%'),
ProjectManagement.project_source.like('%淮北%'),
ProjectManagement.project_source.like('%阜阳%'),
ProjectManagement.project_source.like('%亳州%'),
ProjectManagement.project_source.like('%蚌埠%'),
ProjectManagement.project_source.like('%淮南%'),
ProjectManagement.project_source.like('%邢台%'),
ProjectManagement.project_source.like('%邯郸%')
ProjectManagement.investor_district.like('%河南%'),
ProjectManagement.investor_district.like('%长治%'),
ProjectManagement.investor_district.like('%晋城%'),
ProjectManagement.investor_district.like('%运城%'),
ProjectManagement.investor_district.like('%聊城%'),
ProjectManagement.investor_district.like('%菏泽%'),
ProjectManagement.investor_district.like('%泰安%'),
ProjectManagement.investor_district.like('%宿州%'),
ProjectManagement.investor_district.like('%淮北%'),
ProjectManagement.investor_district.like('%阜阳%'),
ProjectManagement.investor_district.like('%亳州%'),
ProjectManagement.investor_district.like('%蚌埠%'),
ProjectManagement.investor_district.like('%淮南%'),
ProjectManagement.investor_district.like('%邢台%'),
ProjectManagement.investor_district.like('%邯郸%')
)).all()
source_list = set([project_obj.project_source for project_obj in project_obj_list])
source_list = set([project_obj.investor_district for project_obj in project_obj_list])
num_list = []
source_data_list = []
data = []
for source in list(source_list):
num = project_obj.filter(or_(
ProjectManagement.project_source.like('%{}%'.format(source)),
ProjectManagement.investor_district.like('%{}%'.format(source)),
)).count()
num_list.append(num)
source_data_list.append({"source": source, "num": num})
......@@ -1048,69 +1048,69 @@ def areal_project():
if flag == 1: # 项目来源区域分布项目列表
if project_source == '京津冀':
project_obj = project_obj.filter(or_(
ProjectManagement.project_source.like('%北京%'),
ProjectManagement.project_source.like('%天津%'),
ProjectManagement.project_source.like('%河北%')
ProjectManagement.investor_district.like('%北京%'),
ProjectManagement.investor_district.like('%天津%'),
ProjectManagement.investor_district.like('%河北%')
))
elif project_source == '长三角':
project_obj = project_obj.filter(or_(
ProjectManagement.project_source.like('%江苏%'),
ProjectManagement.project_source.like('%浙江%'),
ProjectManagement.project_source.like('%上海%')
ProjectManagement.investor_district.like('%江苏%'),
ProjectManagement.investor_district.like('%浙江%'),
ProjectManagement.investor_district.like('%上海%')
))
elif project_source == '珠三角':
project_obj = project_obj.filter(or_(
ProjectManagement.project_source.like('%广东%'),
ProjectManagement.project_source.like('%香港%'),
ProjectManagement.project_source.like('%澳门%')
ProjectManagement.investor_district.like('%广东%'),
ProjectManagement.investor_district.like('%香港%'),
ProjectManagement.investor_district.like('%澳门%')
))
elif project_source == '中原经济区':
project_obj = project_obj.filter(or_(
ProjectManagement.project_source.like('%河南%'),
ProjectManagement.project_source.like('%天津%'),
ProjectManagement.project_source.like('%河北%'),
ProjectManagement.project_source.like('%长治%'),
ProjectManagement.project_source.like('%晋城%'),
ProjectManagement.project_source.like('%运城%'),
ProjectManagement.project_source.like('%聊城%'),
ProjectManagement.project_source.like('%菏泽%'),
ProjectManagement.project_source.like('%泰安%'),
ProjectManagement.project_source.like('%宿州%'),
ProjectManagement.project_source.like('%淮北%'),
ProjectManagement.project_source.like('%阜阳%'),
ProjectManagement.project_source.like('%亳州%'),
ProjectManagement.project_source.like('%蚌埠%'),
ProjectManagement.project_source.like('%淮南%'),
ProjectManagement.project_source.like('%邢台%'),
ProjectManagement.project_source.like('%邯郸%'),
ProjectManagement.investor_district.like('%河南%'),
ProjectManagement.investor_district.like('%天津%'),
ProjectManagement.investor_district.like('%河北%'),
ProjectManagement.investor_district.like('%长治%'),
ProjectManagement.investor_district.like('%晋城%'),
ProjectManagement.investor_district.like('%运城%'),
ProjectManagement.investor_district.like('%聊城%'),
ProjectManagement.investor_district.like('%菏泽%'),
ProjectManagement.investor_district.like('%泰安%'),
ProjectManagement.investor_district.like('%宿州%'),
ProjectManagement.investor_district.like('%淮北%'),
ProjectManagement.investor_district.like('%阜阳%'),
ProjectManagement.investor_district.like('%亳州%'),
ProjectManagement.investor_district.like('%蚌埠%'),
ProjectManagement.investor_district.like('%淮南%'),
ProjectManagement.investor_district.like('%邢台%'),
ProjectManagement.investor_district.like('%邯郸%'),
))
elif project_source == '其他':
project_obj = project_obj.filter(and_(
ProjectManagement.project_source.notlike('%河南%'),
ProjectManagement.project_source.notlike('%长治%'),
ProjectManagement.project_source.notlike('%晋城%'),
ProjectManagement.project_source.notlike('%运城%'),
ProjectManagement.project_source.notlike('%聊城%'),
ProjectManagement.project_source.notlike('%菏泽%'),
ProjectManagement.project_source.notlike('%泰安%'),
ProjectManagement.project_source.notlike('%宿州%'),
ProjectManagement.project_source.notlike('%淮北%'),
ProjectManagement.project_source.notlike('%阜阳%'),
ProjectManagement.project_source.notlike('%亳州%'),
ProjectManagement.project_source.notlike('%蚌埠%'),
ProjectManagement.project_source.notlike('%淮南%'),
ProjectManagement.project_source.notlike('%邢台%'),
ProjectManagement.project_source.notlike('%邯郸%'),
ProjectManagement.project_source.notlike('%北京%'),
ProjectManagement.project_source.notlike('%天津%'),
ProjectManagement.project_source.notlike('%河北%'),
ProjectManagement.project_source.notlike('%江苏%'),
ProjectManagement.project_source.notlike('%浙江%'),
ProjectManagement.project_source.notlike('%上海%'),
ProjectManagement.project_source.notlike('%广东%'),
ProjectManagement.project_source.notlike('%香港%'),
ProjectManagement.project_source.notlike('%澳门%')
ProjectManagement.investor_district.notlike('%河南%'),
ProjectManagement.investor_district.notlike('%长治%'),
ProjectManagement.investor_district.notlike('%晋城%'),
ProjectManagement.investor_district.notlike('%运城%'),
ProjectManagement.investor_district.notlike('%聊城%'),
ProjectManagement.investor_district.notlike('%菏泽%'),
ProjectManagement.investor_district.notlike('%泰安%'),
ProjectManagement.investor_district.notlike('%宿州%'),
ProjectManagement.investor_district.notlike('%淮北%'),
ProjectManagement.investor_district.notlike('%阜阳%'),
ProjectManagement.investor_district.notlike('%亳州%'),
ProjectManagement.investor_district.notlike('%蚌埠%'),
ProjectManagement.investor_district.notlike('%淮南%'),
ProjectManagement.investor_district.notlike('%邢台%'),
ProjectManagement.investor_district.notlike('%邯郸%'),
ProjectManagement.investor_district.notlike('%北京%'),
ProjectManagement.investor_district.notlike('%天津%'),
ProjectManagement.investor_district.notlike('%河北%'),
ProjectManagement.investor_district.notlike('%江苏%'),
ProjectManagement.investor_district.notlike('%浙江%'),
ProjectManagement.investor_district.notlike('%上海%'),
ProjectManagement.investor_district.notlike('%广东%'),
ProjectManagement.investor_district.notlike('%香港%'),
ProjectManagement.investor_district.notlike('%澳门%')
))
else:
pass
......@@ -1132,7 +1132,7 @@ def areal_project():
elif flag == 5: # 下钻的二级数据
if project_source:
project_obj = project_obj.filter(
ProjectManagement.project_source.like('%{}%'.format(project_source))
ProjectManagement.investor_district.like('%{}%'.format(project_source))
)
if industry_name:
project_obj = project_obj.filter(ProjectManagement.industry2 == industry_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment