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
d0593b51
Commit
d0593b51
authored
Mar 16, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230316
parent
5f2a1393
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
apps/view_index/view.py
+0
-0
merge_company.py
+41
-0
No files found.
apps/view_index/view.py
View file @
d0593b51
This diff is collapsed.
Click to expand it.
merge_company.py
0 → 100644
View file @
d0593b51
"""
更新企业是否为链主字段
"""
# # -*- coding:utf-8 -*-
import
threading
import
pandas
as
pd
from
apps.models
import
IndustryChain
,
Enterprise
,
Company
from
manager
import
app
from
apps
import
db
"""
根据资质计算企业的热度,并提交保存
"""
# 读取链主企业文件
xl_path
=
"无标题.xlsx"
data
=
pd
.
read_excel
(
xl_path
)
# com_li = []
# for i in range(len(data)):
# com_name = str(data.loc[i, "企业名称"])
# com_li.append(com_name)
def
handle
():
with
app
.
app_context
():
for
i
in
range
(
len
(
data
)):
com_name
=
str
(
data
.
loc
[
i
,
"company_name"
])
ent_id
=
str
(
data
.
loc
[
i
,
"ent_id"
])
company_obj
=
Company
.
query
.
filter_by
(
company_name
=
com_name
)
.
first
()
if
company_obj
:
company_obj
.
company_id
=
ent_id
db
.
session
.
commit
()
print
(
'已完成,一共{}个'
.
format
(
i
))
if
__name__
==
'__main__'
:
t
=
threading
.
Thread
(
target
=
handle
)
t
.
start
()
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