batch.py
1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
# @Time : 2021/9/8 17:45
# @Author : Ljq
# @File : batch.py
# @Software: PyCharm
"""
批号管理业务相关接口
"""
import json,time,random,re
from commons.scripts import dealContentType as dct
from commons.scripts import jsonToUrlCode
from commons.scripts import replaceJsonData as rJD
import urllib.parse
from commons.MySession import sessionHg
host = "http://test.gateway.diligrp.com:8285"
def batchCodeQuery(session=None,host=None,**kwargs):
"""
登记单状态变更
:param batchCode:等级单号
:param _t:时间戳
"""
url = host+"/hg-trading/api/settle/batchCodeQuery"
headers = {}
data = {"batchCode":"2109000198","_t":"1631094801343"}
data = dict(data,**kwargs)
res = session.useHeadersRequests(method="GET",url=url,params=data,headers=headers)
return res
# res = get_batchCodeQuery(session=sessionHg,host=host,batchCode="2109000202")
# print(res.json())
def changeBatchCodeState(session=None,host=None,**kwargs):
"""
登记单状态变更
:param batchCode:等级单号
:param state:变更状态,1继续,2停止
"""
url = host+"/hg-trading/api/settle/changeBatchCodeState"
headers = {}
data = {"batchCode":"2109000198","state":2}
data = dict(data,**kwargs)
res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers)
return res
# res = changeBatchCodeState(session=sessionHg,host=host,batchCode="2109000202",state=1)
# print(res.json())