Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
2eb94017
Commit
2eb94017
authored
Jan 12, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230112
parent
f898d867
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
60 deletions
+137
-60
apps/inves_manage/siku_view.py
+4
-1
apps/models.py
+5
-0
apps/view_choose/__init__.py
+1
-0
apps/view_choose/choose_view.py
+0
-0
apps/view_map/view.py
+127
-59
No files found.
apps/inves_manage/siku_view.py
View file @
2eb94017
...
...
@@ -439,7 +439,10 @@ def write_dynamic(user_name, project_id, item, time):
@api_manage.route
(
"/SearchProject"
,
methods
=
[
"POST"
])
def
search_project
():
req_dic
=
request
.
get_json
()
# token = request.headers['token']
token
=
request
.
headers
[
'token'
]
flag
=
req_dic
[
'flag'
]
# 1为线索库,2为对接库,3为签约库,4为开工库
# 线索库
distribute_condition
=
req_dic
[
'distribute_condition'
]
# 分发情况
...
...
apps/models.py
View file @
2eb94017
...
...
@@ -113,6 +113,11 @@ class Enterprise(db.Model):
c_type
=
db
.
Column
(
db
.
Integer
,
index
=
True
,
doc
=
'行业类id'
,
comment
=
'行业类id'
)
# 行业类id
f_name
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'父行业类名'
,
comment
=
'父行业类名'
)
# 父行业类名
f_type
=
db
.
Column
(
db
.
Integer
,
index
=
True
,
doc
=
'父行业类id'
,
comment
=
'父行业类id'
)
# 父行业类id
sxonhun
=
db
.
Column
(
db
.
String
(
32
))
# 是否山西100强
scale
=
db
.
Column
(
db
.
String
(
32
))
# 规模以上企业
serve
=
db
.
Column
(
db
.
String
(
32
))
# 限额以上服务业
__table_args__
=
({
'comment'
:
'全国企业表'
})
# 添加表注释
...
...
apps/view_choose/__init__.py
View file @
2eb94017
...
...
@@ -6,4 +6,5 @@ api_address = Blueprint("api_address", __name__)
from
.
import
view
from
.
import
map_view
from
.
import
fill_data
from
.
import
choose_view
apps/view_choose/choose_view.py
0 → 100644
View file @
2eb94017
This diff is collapsed.
Click to expand it.
apps/view_map/view.py
View file @
2eb94017
from
flask
import
g
,
current_app
,
request
,
jsonify
,
session
from
sqlalchemy
import
or_
from
sqlalchemy
import
or_
,
and_
from
apps.view_map
import
api_map
from
apps.util
import
login_required
,
verify_token
...
...
@@ -159,64 +159,65 @@ def attract_cnums():
# 全国企业列表
@api_map.route
(
'/AttractEnterprise'
,
methods
=
[
'POST'
])
# @login_required
def
enterprise
():
'''
太原市企业列表
:return:
'''
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
page
=
req_dict
.
get
(
"page"
)
# 分页页码
perpage
=
req_dict
.
get
(
"perpage"
)
# 分页大小
province
=
req_dict
.
get
(
"province"
)
city
=
req_dict
.
get
(
"city"
)
district
=
req_dict
.
get
(
"district"
)
product
=
req_dict
.
get
(
"product"
)
# 产业产品选择
if
not
all
([
page
,
perpage
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
if
inid
:
# 子行业分类
enterprise
=
Enterprise
.
query
.
filter_by
(
c_type
=
inid
)
else
:
enterprise
=
Enterprise
.
query
.
filter_by
()
# 区域选择
if
province
:
enterprise
=
enterprise
.
filter_by
(
province
=
province
)
if
city
:
enterprise
=
enterprise
.
filter_by
(
city
=
city
)
if
district
:
enterprise
=
enterprise
.
filter_by
(
district
=
district
)
if
product
:
enterprise
=
enterprise
.
filter
(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)))
size
=
enterprise
.
count
()
enterprise
=
enterprise
.
order_by
(
Enterprise
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
# 企业热度倒序
df
=
[{
"id"
:
i
.
id
,
"company_name"
:
i
.
company_name
,
"hots"
:
i
.
hots
,
"aptitude"
:
[
'高新技术企业'
if
i
.
high_new
==
'1'
else
'科技型中小企业'
if
i
.
tbe
==
'1'
else
'上市企业'
if
i
.
quoted_company
==
'1'
else
'山西民营100强'
if
i
.
sxmon
==
'1'
else
'山西专精特新企业'
if
i
.
zjtg
==
'1'
else
'独角兽企业'
if
i
.
unicorn
==
'1'
else
'瞪羚'
if
i
.
dengl
==
'1'
else
'中国500强'
if
i
.
isfive
==
'1'
else
'规模以上企业'
if
i
.
scale
==
'1'
else
'限额以上服务业'
if
i
.
serve
==
'1'
else
''
]
}
for
i
in
enterprise
]
data
=
{
"size"
:
size
,
"df"
:
df
}
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
# @api_map.route('/AttractEnterprise', methods=['POST'])
# # @login_required
# def enterprise():
# '''
# 太原市企业列表
# :return:
# '''
# req_dict = request.get_json()
# inid = req_dict.get("inid") # 行业id
# page = req_dict.get("page") # 分页页码
# perpage = req_dict.get("perpage") # 分页大小
# province = req_dict.get("province")
# city = req_dict.get("city")
# district = req_dict.get("district")
# product = req_dict.get("product") # 产业产品选择
#
#
# if not all([page, perpage]):
# return jsonify(code=RET.PARAMERR, msg="参数不完整")
#
# try:
# if inid: # 子行业分类
# enterprise = Enterprise.query.filter_by(c_type=inid)
# else:
# enterprise = Enterprise.query.filter_by()
# # 区域选择
# if province:
# enterprise = enterprise.filter_by(province=province)
# if city:
# enterprise = enterprise.filter_by(city=city)
# if district:
# enterprise = enterprise.filter_by(district=district)
# if product:
# enterprise = enterprise.filter(Enterprise.product_all.like("%{}%".format(product)))
# size = enterprise.count()
# enterprise = enterprise.order_by(Enterprise.hots.desc()).paginate(page, perpage).items # 企业热度倒序
#
# df = [{"id": i.id,
# "company_name": i.company_name,
# "hots": i.hots,
# "aptitude": ['高新技术企业' if i.high_new == '1' else
# '科技型中小企业' if i.tbe == '1' else
# '上市企业' if i.quoted_company == '1' else
# '山西民营100强' if i.sxmon == '1' else
# '山西专精特新企业' if i.zjtg == '1' else
# '独角兽企业' if i.unicorn == '1' else
# '瞪羚' if i.dengl == '1' else
# '中国500强' if i.isfive == '1' else
# '规模以上企业' if i.scale == '1' else
# '限额以上服务业' if i.serve == '1' else '']
# } for i in enterprise]
# data = {"size": size, "df": df}
# except Exception as e:
# current_app.logger.error(e)
# return jsonify(code=RET.DBERR, msg="数据库查询错误")
#
# return jsonify(code=RET.OK, msg="获取成功", data=data)
""""""
# 招商地图下的散点图(至区后)
@api_map.route
(
'/AttractSdmap'
,
methods
=
[
'POST'
])
# @login_required
...
...
@@ -316,3 +317,70 @@ def search_enterprise():
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
'查询出错!'
)
# 全国企业列表
@api_map.route
(
'/AttractEnterprise'
,
methods
=
[
'POST'
])
def
attract_enterprise
():
'''
太原市企业列表
:return:
'''
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
company_name
=
req_dict
.
get
(
"company_name"
)
# 产业产品名称筛选
entype
=
req_dict
.
get
(
"entype"
)
# 企业类型id
qualificat
=
req_dict
.
get
(
"qualificat"
)
# 企业资质id
quoted
=
req_dict
.
get
(
"quoted"
)
# 上市板块(A股,1)(创业股,2)(港股,3)(新三股,4)(新四股,5)(中小板,6)
area
=
req_dict
.
get
(
"area"
)
# ["省","市","区"]
province
=
area
[
0
]
city
=
area
[
1
]
district
=
area
[
2
]
page
=
req_dict
.
get
(
"page"
)
# 分页页码
perpage
=
req_dict
.
get
(
"perpage"
)
# 分页大小
if
not
all
([
page
,
perpage
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
enterprise_obj
=
Enterprise
.
query
.
filter
(
and_
(
Enterprise
.
entype
.
like
(
'
%
{}
%
'
.
format
(
entype
))
if
entype
else
text
(
''
),
Enterprise
.
company_name
.
like
(
'
%
{}
%
'
.
format
(
company_name
))
if
company_name
else
text
(
''
),
Enterprise
.
c_type
==
inid
if
inid
else
text
(
''
),
Enterprise
.
public_id
==
quoted
if
quoted
else
text
(
''
),
Enterprise
.
province
==
province
if
province
else
text
(
''
),
Enterprise
.
city
==
city
if
city
else
text
(
''
),
Enterprise
.
district
==
district
if
district
else
text
(
''
),
Enterprise
.
high_new
==
'1'
if
qualificat
==
'高新技术企业'
else
text
(
''
),
Enterprise
.
tbe
==
'1'
if
qualificat
==
'科技型中小企业'
else
text
(
''
),
Enterprise
.
quoted_company
==
'1'
if
qualificat
==
'上市企业'
else
text
(
''
),
Enterprise
.
sxonhun
==
'1'
if
qualificat
==
'山西100强企业'
else
text
(
''
),
Enterprise
.
zjtg
==
'1'
if
qualificat
==
'山西专精特新企业'
else
text
(
''
),
Enterprise
.
unicorn
==
'1'
if
qualificat
==
'独角兽企业'
else
text
(
''
),
Enterprise
.
dengl
==
'1'
if
qualificat
==
'瞪羚企业'
else
text
(
''
),
Enterprise
.
isfive
==
'1'
if
qualificat
==
'中国500强企业'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
qualificat
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
qualificat
==
'限额以上服务业企业'
else
text
(
''
),
))
size
=
enterprise_obj
.
count
()
enterprise_obj_list
=
enterprise_obj
.
paginate
(
page
,
perpage
)
.
items
df
=
[{
"id"
:
i
.
id
,
"company_name"
:
i
.
company_name
,
"aptitude"
:
list
(
filter
(
None
,
[
"高新技术企业"
if
i
.
high_new
==
'1'
else
''
,
"科技型中小企业"
if
i
.
tbe
==
'1'
else
''
,
"上市企业"
if
i
.
quoted_company
==
'1'
else
''
,
"山西民营100强"
if
i
.
sxonhun
==
'1'
else
''
,
"山西专精特新企业"
if
i
.
zjtg
==
'1'
else
''
,
"独角兽企业"
if
i
.
unicorn
==
'1'
else
''
,
"瞪羚"
if
i
.
dengl
==
'1'
else
''
,
"中国500强"
if
i
.
isfive
==
'1'
else
''
,
"规模以上企业"
if
i
.
scale
==
'1'
else
''
,
"限额以上服务业"
if
i
.
serve
==
'1'
else
''
]))
}
for
i
in
enterprise_obj_list
]
data
=
{
"size"
:
size
,
"df"
:
df
}
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment