Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
7448fdfe
Commit
7448fdfe
authored
Jan 05, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
84a20d73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
calc_result/main.py
+10
-7
No files found.
calc_result/main.py
View file @
7448fdfe
...
...
@@ -6,7 +6,6 @@
# @Software: PyCharm
import
requests
,
json
,
redis
,
re
from
RiskComputer
import
RiskComputer
# from FactorGet import FactorGet
from
IndexGet
import
IndexGet
#使用任务号获取任务信息
...
...
@@ -16,9 +15,10 @@ def getInfo_ByBatchNo(BatchNo):
name
=
{
"batchCode"
:
BatchNo
}
# 根据任务号进行接口访问参数
taskInfo
=
requests
.
get
(
url
,
name
)
# 访问接口返回的信息
taskInfo_New
=
json
.
loads
(
taskInfo
.
text
)
print
(
"任务信息获取:"
,
taskInfo_New
)
print
(
"任务信息获取:"
,
taskInfo_New
,
BatchNo
)
if
taskInfo_New
[
'data'
]
is
None
:
print
(
"taskInfo_New['data'] is None"
)
client
.
rpop
(
'notifyRule'
)
quit
()
Info_Task
=
taskInfo_New
[
'data'
]
AccountInfo
=
{}
...
...
@@ -111,20 +111,21 @@ def fun(str):
redisPool
=
redis
.
ConnectionPool
(
host
=
'43.247.184.32'
,
port
=
8967
,
password
=
'Gongsibao2018'
,
db
=
2
)
client
=
redis
.
Redis
(
connection_pool
=
redisPool
)
# value=client.rpop('notifyRule')
a
=
client
.
lrange
(
'notifyRule'
,
0
,
1
)
value
=
a
[
0
]
a
=
client
.
lrange
(
'notifyRule'
,
0
,
-
1
)
print
(
a
)
value
=
a
[
-
1
]
print
(
value
,
"redis"
)
if
client
is
None
:
client
.
rpop
(
'notifyRule'
)
quit
()
if
value
is
None
:
client
.
rpop
(
'notifyRule'
)
quit
()
result
=
json
.
loads
(
value
)
content
=
result
[
"content"
]
taxTypeCode
=
content
[
'taxTypeCode'
]
#企业性质
accountTypeCode
=
content
[
'accountTypeCode'
]
#会计准则
BatchNo
=
content
[
"batchCode"
]
# taxTypeCode="ST"#企业性质
# accountTypeCode="S"#会计准则
# BatchNo=51
if
taxTypeCode
==
"ST"
:
taxTypeCode
=
"S"
...
...
@@ -183,3 +184,4 @@ rc.Compute()#指标计算
jsonstr
=
rc
.
Ret2Json
()
#指标输出成樊辉要的格式
print
(
jsonstr
)
client
.
rpop
(
'notifyRule'
)
print
(
"消耗结束"
)
\ No newline at end of file
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