weighingServiceSave.py
2.14 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
55
56
57
58
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import my,s1
from commons.api.duplicateToken import duplicateToken
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
du=duplicateToken()
class weighingServiceSave():
url = "http://test.gateway.diligrp.com:8285/jmsf-web/api/entrace/weighingServiceSave"
header = {
"jmsf_duplicate_commit_token": "demo",
"UAP_accessToken": "demo",
"UAP_refreshToken": "demo",
"UAP_firmId": "9",
"Content-Type": "application/json",
"Host": "test.gateway.diligrp.com:8285",
"Content-Length": "453"}
body = {
"carTypeId": 128,
"carTypeName": "玉玺",
"carTypeCode": "888",
"driverTel": "16111111111",
"fee": "18.00",
"greeterId": 0,
"greeterName": None,
"plate": "京A666666",
"remark": "test_称重服务接口测试",
"weighImgs": [],
"weight": 10.0,
"weightDate": "2021-07-29 15:50:26",
"pathAddress": "40-5B-D8-DF-CA-C7",
"entryPlateInputType": 1,
"customerType": 0,
"carryStatus": 0,
"customerName": None,
"pwd": "",
"totalPrice": 18.00,
"ic": "",
"customerId": 0,
"accountId": 0,
"protocolId": None}
def __init__(self):
self.url = weighingServiceSave.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
self.header = weighingServiceSave.header
self.header["jmsf_duplicate_commit_token"] = du.jmsf_duplicate_commit_token()
self.header["UAP_accessToken"] = s1.cookies["UAP_accessToken"]
self.header["UAP_refreshToken"] = s1.cookies["UAP_refreshToken"]
self.header["UAP_firmId"] = s1.cookies["UAP_firmId"]
self.header["Host"] = com.get_global_config("global_data", "host", "gateway")
# tt=weighingServiceSave()
# re=s1.post(url=tt.url,headers=tt.header,json=tt.body,proxies=my.myproxies)
# print(re.json())