weighingServiceSave.py
2.33 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
59
60
61
62
63
64
65
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import my,sy1,heb
from commons.basic.duplicateToken import duplicateToken
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
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,market):
self.market=market
self.url = weighingServiceSave.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
self.header = weighingServiceSave.header
self.header["UAP_accessToken"] = self.market.cookies["UAP_accessToken"]
self.header["UAP_refreshToken"] = self.market.cookies["UAP_refreshToken"]
self.header["UAP_firmId"] = self.market.cookies["UAP_firmId"]
self.header["Host"] = com.get_global_config("global_data", "host", "gateway")
def refresh_commit_token(self):
self.header["jmsf_duplicate_commit_token"] = duplicateToken(self.market).jmsf_duplicate_commit_token()
# tt=weighingServiceSave(heb)
# tt.refresh_commit_token()
# re=heb.post(url=tt.url,headers=tt.header,json=tt.body)
# print(re.json())
# print(heb.user.sort())
# print(sy1.user.sort())