getLookupList.py
1.84 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
# -*- coding: utf-8 -*-
# @Time : 2021/8/10 17:40
# @Author : Ljq
# @File : getLookupList.py
# @Software: PyCharm
"""
进门列表基础数据获取接口
"""
import json,time,random,re
from commons.scripts import dealContentType as dct
from commons.scripts import jsonToUrlcode
from commons.MySession import my
def get_LookupList(host="",providerName="车型"):
"""基础数据获取接口
:param providerName:
:return:
[{'text': '蔬菜', 'value': '14152'}]
"""
providerDict = {"车型": "carTypeForJmsfProvider", "货物品类": "categoryProvider", "接车部门": "authDepartmentProvider",
"称重类型": "entranceFeeBillTypeProvider", "状态": "entranceFeeBillStateProvider",
"交易类型": "tradeTypeProvider"}
url = host + "/provider/getLookupList.action"
# print(providerName)
data = {"provider":providerDict[providerName]}
headers = dct.urlCode()
res = my.useHeadersRequests(method="POST", url=url, data=data, headers=headers)
return res
def get_reach(host="",depId="56"):
"""通过部门编号获取区域"""
url = host + "/api/jmsf/ajax/district/search.action"
data = {"depId":depId}
headers = dct.urlCode()
res = my.useHeadersRequests(method="POST", url=url, data=data, headers=headers)
return res
def get_product(host="",productName="蔬菜"):
"""通过部门编号获取区域"""
url = host + f"/category/search.action?name={productName}"
data = {"name":productName,"keyword":productName}
headers = dct.urlCode()
res = my.useHeadersRequests(method="get", url=url, params=data, headers=headers)
return res
# host="http://test.jmsf.diligrp.com:8385"
# print(get_LookupList(host=host,providerName="货物品类").json())
# print(get_reach(host).json())
# print(get_category(host=host,productName="蔬菜").json())