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
55961840
Commit
55961840
authored
Mar 16, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230316
parent
7557ec03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
18 deletions
+65
-18
apps/view_index/view.py
+56
-9
insert_company_hots.py
+9
-9
No files found.
apps/view_index/view.py
View file @
55961840
...
@@ -952,11 +952,15 @@ def get_enterprise_licence():
...
@@ -952,11 +952,15 @@ def get_enterprise_licence():
req_dict
=
request
.
get_json
()
req_dict
=
request
.
get_json
()
id
=
req_dict
.
get
(
"id"
)
# 企业id
id
=
req_dict
.
get
(
"id"
)
# 企业id
# token = request.headers['token']
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseLicence"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -973,6 +977,9 @@ def get_enterprise_licence():
...
@@ -973,6 +977,9 @@ def get_enterprise_licence():
"license_org"
:
data
.
license_org
,
"license_org"
:
data
.
license_org
,
"licence_content"
:
data
.
licence_content
,
"licence_content"
:
data
.
licence_content
,
"source"
:
data
.
source
}
for
data
in
data_info1
if
data_info1
]
"source"
:
data
.
source
}
for
data
in
data_info1
if
data_info1
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -992,7 +999,10 @@ def get_enterprise_taxInfo():
...
@@ -992,7 +999,10 @@ def get_enterprise_taxInfo():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseTaxInfo"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1009,6 +1019,8 @@ def get_enterprise_taxInfo():
...
@@ -1009,6 +1019,8 @@ def get_enterprise_taxInfo():
"eval_department"
:
data
.
eval_department
,
"eval_department"
:
data
.
eval_department
,
"type"
:
data
.
type
,
"type"
:
data
.
type
,
"business_id"
:
data
.
business_id
}
for
data
in
data_info2
if
data_info2
]
"business_id"
:
data
.
business_id
}
for
data
in
data_info2
if
data_info2
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1029,7 +1041,10 @@ def get_enterprise_inoutInfo():
...
@@ -1029,7 +1041,10 @@ def get_enterprise_inoutInfo():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseInoutInfo"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1043,6 +1058,8 @@ def get_enterprise_inoutInfo():
...
@@ -1043,6 +1058,8 @@ def get_enterprise_inoutInfo():
"management_category"
:
data
.
management_category
,
"management_category"
:
data
.
management_category
,
"record_date"
:
data
.
record_date
,
"record_date"
:
data
.
record_date
,
"industry_category"
:
data
.
industry_category
}
for
data
in
data_info3
if
data_info3
]
"industry_category"
:
data
.
industry_category
}
for
data
in
data_info3
if
data_info3
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1063,7 +1080,10 @@ def get_enterprise_supplier():
...
@@ -1063,7 +1080,10 @@ def get_enterprise_supplier():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseSupplier"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1078,6 +1098,8 @@ def get_enterprise_supplier():
...
@@ -1078,6 +1098,8 @@ def get_enterprise_supplier():
"pub_date"
:
data
.
pub_date
,
"pub_date"
:
data
.
pub_date
,
"sources"
:
data
.
sources
,
"sources"
:
data
.
sources
,
"relation"
:
data
.
relation
}
for
data
in
data_info4
if
data_info4
]
"relation"
:
data
.
relation
}
for
data
in
data_info4
if
data_info4
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1098,7 +1120,10 @@ def get_enterprise_client():
...
@@ -1098,7 +1120,10 @@ def get_enterprise_client():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseClient"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1113,6 +1138,8 @@ def get_enterprise_client():
...
@@ -1113,6 +1138,8 @@ def get_enterprise_client():
"pub_date"
:
data
.
pub_date
,
"pub_date"
:
data
.
pub_date
,
"sources"
:
data
.
sources
,
"sources"
:
data
.
sources
,
"relation"
:
data
.
relation
}
for
data
in
data_info5
if
data_info5
]
"relation"
:
data
.
relation
}
for
data
in
data_info5
if
data_info5
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1133,7 +1160,10 @@ def get_enterprise_equity():
...
@@ -1133,7 +1160,10 @@ def get_enterprise_equity():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseEquity"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1150,6 +1180,8 @@ def get_enterprise_equity():
...
@@ -1150,6 +1180,8 @@ def get_enterprise_equity():
"pub_date"
:
data
.
pub_date
,
"pub_date"
:
data
.
pub_date
,
"status"
:
data
.
status
"status"
:
data
.
status
}
for
data
in
data_info6
if
data_info6
]
}
for
data
in
data_info6
if
data_info6
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1170,7 +1202,10 @@ def get_enterprise_punish():
...
@@ -1170,7 +1202,10 @@ def get_enterprise_punish():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterprisePunish"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1186,6 +1221,8 @@ def get_enterprise_punish():
...
@@ -1186,6 +1221,8 @@ def get_enterprise_punish():
"punish_content"
:
data
.
punish_content
,
"punish_content"
:
data
.
punish_content
,
"punish_org"
:
data
.
punish_org
,
"punish_org"
:
data
.
punish_org
,
"sources"
:
data
.
sources
}
for
data
in
data_info7
if
data_info7
]
"sources"
:
data
.
sources
}
for
data
in
data_info7
if
data_info7
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1206,7 +1243,10 @@ def get_enterprise_certificate():
...
@@ -1206,7 +1243,10 @@ def get_enterprise_certificate():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterpriseCertificate"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1220,6 +1260,8 @@ def get_enterprise_certificate():
...
@@ -1220,6 +1260,8 @@ def get_enterprise_certificate():
"cert_name"
:
data
.
cert_name
,
"cert_name"
:
data
.
cert_name
,
"cert_no"
:
data
.
cert_no
,
"cert_no"
:
data
.
cert_no
,
"end_date"
:
data
.
end_date
}
for
data
in
data_info8
if
data_info8
]
"end_date"
:
data
.
end_date
}
for
data
in
data_info8
if
data_info8
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
@@ -1240,7 +1282,10 @@ def get_enterprise_patent():
...
@@ -1240,7 +1282,10 @@ def get_enterprise_patent():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterprisePatent"
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
try
:
try
:
enterprise
=
Enterprise
.
query
.
get
(
id
)
enterprise
=
Enterprise
.
query
.
get
(
id
)
company_id
=
enterprise
.
company_id
company_id
=
enterprise
.
company_id
...
@@ -1258,6 +1303,8 @@ def get_enterprise_patent():
...
@@ -1258,6 +1303,8 @@ def get_enterprise_patent():
"pub_date"
:
data
.
pub_date
,
"pub_date"
:
data
.
pub_date
,
"inventor"
:
data
.
inventor
"inventor"
:
data
.
inventor
}
for
data
in
data_info9
if
data_info9
]
}
for
data
in
data_info9
if
data_info9
]
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
...
insert_company_hots.py
View file @
55961840
...
@@ -12,19 +12,19 @@ from apps import db
...
@@ -12,19 +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()
# 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
(
305515
,
5944047
):
#
for id in range(305515, 5944047):
try
:
#
try:
company_obj
=
Enterprise
.
query
.
get
(
id
)
#
company_obj = Enterprise.query.get(id)
if
not
company_obj
:
#
if not company_obj:
continue
#
continue
except
:
#
except:
continue
#
continue
grade_li
=
[]
grade_li
=
[]
# if company_obj.company_name == '山东中联佳裕软件股份有限公司':
# if company_obj.company_name == '山东中联佳裕软件股份有限公司':
...
...
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