Commit 7448fdfe by 蒋勇

d

parent 84a20d73
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment