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
a42ddc99
Commit
a42ddc99
authored
Mar 10, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230310
parent
0b1a12e9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
7 deletions
+13
-7
apps/models.py
+0
-0
apps/view_index/view.py
+0
-0
apps/view_map/view.py
+3
-1
apps/view_radar/view.py
+0
-2
insert_company_hots.py
+10
-4
No files found.
apps/models.py
View file @
a42ddc99
This diff is collapsed.
Click to expand it.
apps/view_index/view.py
View file @
a42ddc99
This diff is collapsed.
Click to expand it.
apps/view_map/view.py
View file @
a42ddc99
...
@@ -441,11 +441,12 @@ def attract_enterprise():
...
@@ -441,11 +441,12 @@ def attract_enterprise():
Enterprise
.
dengl
==
'1'
if
qualificat
==
'瞪羚企业'
else
text
(
''
),
Enterprise
.
dengl
==
'1'
if
qualificat
==
'瞪羚企业'
else
text
(
''
),
Enterprise
.
isfive
==
'1'
if
qualificat
==
'中国500强企业'
else
text
(
''
),
Enterprise
.
isfive
==
'1'
if
qualificat
==
'中国500强企业'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
qualificat
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
qualificat
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
chain_master
==
'1'
if
qualificat
==
'链主企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
qualificat
==
'限额以上服务业企业'
else
text
(
''
)
Enterprise
.
serve
==
'1'
if
qualificat
==
'限额以上服务业企业'
else
text
(
''
)
)
)
size
=
enterprise_obj
.
count
()
size
=
enterprise_obj
.
count
()
enterprise_obj_list
=
enterprise_obj
.
order_by
(
Company
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
enterprise_obj_list
=
enterprise_obj
.
order_by
(
Enterprise
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
df
=
[{
"id"
:
i
.
id
,
df
=
[{
"id"
:
i
.
id
,
"company_name"
:
i
.
company_name
,
"company_name"
:
i
.
company_name
,
...
@@ -458,6 +459,7 @@ def attract_enterprise():
...
@@ -458,6 +459,7 @@ def attract_enterprise():
"瞪羚"
if
i
.
dengl
==
'1'
else
''
,
"瞪羚"
if
i
.
dengl
==
'1'
else
''
,
"中国500强"
if
i
.
isfive
==
'1'
else
''
,
"中国500强"
if
i
.
isfive
==
'1'
else
''
,
"规模以上企业"
if
i
.
scale
==
'1'
else
''
,
"规模以上企业"
if
i
.
scale
==
'1'
else
''
,
"链主企业"
if
i
.
chain_master
==
'1'
else
''
,
"限额以上服务业"
if
i
.
serve
==
'1'
else
''
]))
"限额以上服务业"
if
i
.
serve
==
'1'
else
''
]))
}
for
i
in
enterprise_obj_list
]
}
for
i
in
enterprise_obj_list
]
data
=
{
"size"
:
size
,
"df"
:
df
}
data
=
{
"size"
:
size
,
"df"
:
df
}
...
...
apps/view_radar/view.py
View file @
a42ddc99
...
@@ -1190,14 +1190,12 @@ def newList1():
...
@@ -1190,14 +1190,12 @@ def newList1():
if
district
:
if
district
:
enterprise
=
enterprise
.
filter_by
(
district
=
district
)
enterprise
=
enterprise
.
filter_by
(
district
=
district
)
if
product
:
if
product
:
# 有可能会变成模糊查询
enterprise
=
enterprise
.
filter
(
or_
(
enterprise
=
enterprise
.
filter
(
or_
(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all1
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all1
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all2
.
like
(
"
%
{}
%
"
.
format
(
product
))
Enterprise
.
product_all2
.
like
(
"
%
{}
%
"
.
format
(
product
))
))
))
if
name
:
if
name
:
# 有可能会变成模糊查询
enterprise
=
enterprise
.
filter
(
Enterprise
.
company_name
.
like
(
"
%
{}
%
"
.
format
(
name
)))
enterprise
=
enterprise
.
filter
(
Enterprise
.
company_name
.
like
(
"
%
{}
%
"
.
format
(
name
)))
if
select
==
"1"
:
# 瞪羚
if
select
==
"1"
:
# 瞪羚
remind
=
"瞪羚企业"
remind
=
"瞪羚企业"
...
...
insert_company_hots.py
View file @
a42ddc99
...
@@ -12,13 +12,19 @@ from apps import db
...
@@ -12,13 +12,19 @@ from apps import db
def
handle
():
def
handle
():
with
app
.
app_context
():
with
app
.
app_context
():
company_obj_list
=
Company
.
query
.
all
()
# company_obj_list = Company.query.all()
# company_obj_list = Enterprise.query.all()
# print(company_obj_list)
# print(company_obj_list)
# 读取企业数据表的资质
# 读取企业数据表的资质
i
=
1
i
=
1
for
company_obj
in
company_obj_list
:
# for company_obj in company_obj_list:
for
id
in
range
(
16
,
5944047
):
company_obj
=
Enterprise
.
query
.
get
(
id
)
if
not
company_obj
:
continue
grade_li
=
[]
grade_li
=
[]
# if company_obj.company_name == '山
西永硕新材料科技
有限公司':
# if company_obj.company_name == '山
东中联佳裕软件股份
有限公司':
# print('--')
# print('--')
if
company_obj
.
isfive
and
company_obj
.
isfive
==
'1'
:
# 五百强
if
company_obj
.
isfive
and
company_obj
.
isfive
==
'1'
:
# 五百强
grade_li
.
append
(
5
)
grade_li
.
append
(
5
)
...
@@ -70,7 +76,7 @@ def handle():
...
@@ -70,7 +76,7 @@ def handle():
total_grede
=
0
total_grede
=
0
company_obj
.
hots
=
total_grede
company_obj
.
hots
=
total_grede
db
.
session
.
commit
()
db
.
session
.
commit
()
print
(
str
(
round
(
i
/
len
(
company_obj_list
)
*
100
,
2
)
)
+
'
%
'
)
print
(
str
(
i
/
5944031
*
100
)
+
'
%
'
)
i
+=
1
i
+=
1
...
...
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