cardStock.py 1.15 KB
#coding=utf-8

# @Time    : 2021/7/16 14:09
# @Author  : Ljq
# @File    : cardStock.py
# @Software: PyCharm


"""
    卡片库存接口
"""

import requests
import json
from commons.readConf import readConfig

print("cS")

def cardVoid(cardHost,webHeaders,cardNo):
    url = cardHost+"/cardStorage/cardVoid.action"
    webHeaders["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"
    data = {"cardNo":cardNo}
    res = requests.post(url=url,headers=webHeaders,data=data)
    return res

def queryCardStorageList(cardHost,webHeaders,**kwargs):
    """
    卡片库存查询
    :param cardHost:
    :param webHeaders:
    :param kwargs: {"rows":"10","page":"1","sort":"create_time","order":"desc","type":"10","cardFace":"buyer","state":"1","cardNo":"210524153943","startDate":"2021-05-24","endDate":"2021-05-24"}
    :return:
    """
    url = cardHost+"/cardStorage/queryCardStorageList.action"
    webHeaders["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"
    data = {"rows":"10","page":"1","sort":"create_time","order":"desc"}
    data = dict(data,**kwargs)
    res = requests.post(url=url,headers=webHeaders,data=data)
    return res