Commit 7448fdfe by 蒋勇

d

parent 84a20d73
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
# @Software: PyCharm # @Software: PyCharm
import requests,json,redis,re import requests,json,redis,re
from RiskComputer import RiskComputer from RiskComputer import RiskComputer
# from FactorGet import FactorGet
from IndexGet import IndexGet from IndexGet import IndexGet
#使用任务号获取任务信息 #使用任务号获取任务信息
...@@ -16,9 +15,10 @@ def getInfo_ByBatchNo(BatchNo): ...@@ -16,9 +15,10 @@ def getInfo_ByBatchNo(BatchNo):
name = {"batchCode":BatchNo} # 根据任务号进行接口访问参数 name = {"batchCode":BatchNo} # 根据任务号进行接口访问参数
taskInfo = requests.get(url,name) # 访问接口返回的信息 taskInfo = requests.get(url,name) # 访问接口返回的信息
taskInfo_New = json.loads(taskInfo.text) taskInfo_New = json.loads(taskInfo.text)
print("任务信息获取:",taskInfo_New) print("任务信息获取:",taskInfo_New,BatchNo)
if taskInfo_New['data'] is None: if taskInfo_New['data'] is None:
print("taskInfo_New['data'] is None") print("taskInfo_New['data'] is None")
client.rpop('notifyRule')
quit() quit()
Info_Task = taskInfo_New['data'] Info_Task = taskInfo_New['data']
AccountInfo = {} AccountInfo = {}
...@@ -111,20 +111,21 @@ def fun(str): ...@@ -111,20 +111,21 @@ def fun(str):
redisPool = redis.ConnectionPool(host='43.247.184.32', port=8967, password='Gongsibao2018',db=2) redisPool = redis.ConnectionPool(host='43.247.184.32', port=8967, password='Gongsibao2018',db=2)
client = redis.Redis(connection_pool=redisPool) client = redis.Redis(connection_pool=redisPool)
# value=client.rpop('notifyRule') # value=client.rpop('notifyRule')
a = client.lrange('notifyRule',0,1) a = client.lrange('notifyRule',0,-1)
value =a[0] print(a)
value =a[-1]
print(value,"redis")
if client is None: if client is None:
client.rpop('notifyRule')
quit() quit()
if value is None: if value is None:
client.rpop('notifyRule')
quit() quit()
result=json.loads(value) result=json.loads(value)
content=result["content"] content=result["content"]
taxTypeCode=content['taxTypeCode']#企业性质 taxTypeCode=content['taxTypeCode']#企业性质
accountTypeCode=content['accountTypeCode']#会计准则 accountTypeCode=content['accountTypeCode']#会计准则
BatchNo=content["batchCode"] BatchNo=content["batchCode"]
# taxTypeCode="ST"#企业性质
# accountTypeCode="S"#会计准则
# BatchNo=51
if taxTypeCode=="ST": if taxTypeCode=="ST":
taxTypeCode="S" taxTypeCode="S"
...@@ -182,4 +183,5 @@ rc.IndexsGet(indexs)#把指标装入对象 ...@@ -182,4 +183,5 @@ rc.IndexsGet(indexs)#把指标装入对象
rc.Compute()#指标计算 rc.Compute()#指标计算
jsonstr = rc.Ret2Json()#指标输出成樊辉要的格式 jsonstr = rc.Ret2Json()#指标输出成樊辉要的格式
print(jsonstr) print(jsonstr)
client.rpop('notifyRule') client.rpop('notifyRule')
\ No newline at end of file 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