l_createAndTrade.py
2.61 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- coding: utf-8 -*-
"""
@Time : 2021/9/9 18:24
@Auth : wlm
@File :l_createAndTrade.py
@IDE :PyCharm
"""
"""
普通客户模式——新增交易单
"""
from commons import common as com
from commons.MySession import hg
class l_createAndTrade():
def __init__(self):
self.url = "http://test.gateway.diligrp.com:8285/hg-trading/api/tradingOrder/createAndTrade"
self.header = {
"UAP_accessToken":"demo",
"UAP_refreshToken":"demo",
"Content-Type":"application/json;charset=utf-8",
"Host":"test.gateway.diligrp.com:8285"
}
self.body = {
"sellerId":141969,
"sellerName":"严安彬卖",
"sellerAccountId":107677,
"sellerCardNo":"888810061102",
"buyerId":141968,
"buyerName":"袁豪正买",
"buyerCardHolder":"袁豪正买",
"buyerAccountId":107676,
"buyerCardNo":"888810061104",
"posCode":"333444",
"tradePassword":"111111",
"orderItemList":[{
"number":0,
"batchCode":"2109000660",
"productId":125,
"productCode":"374690",
"productName":"苹果",
"categoryId":374690,
"weightType":1,
"quantity":10,
"pieceWeight":1,
"grossWeight":0.0,
"tareWeight":0.0,
"weight":10.0,
"price":2000,
"PriceStr":"20.00",
"amount":20000,
"amountStr":"200.00",
"originId":510100,
"originName":"成都市",
"feeItemList":[{
"type":1,
"chargeItemId":521,
"chargeItemName":"买家手续费",
"amount":550.0
},{
"type":2,
"chargeItemId":522,
"chargeItemName":"卖家手续费",
"amount":989.00
},{
"type":2,
"chargeItemId":527,
"chargeItemName":"卖家仓储服务费",
"amount":522.00
},{
"type":2,
"chargeItemId":534,
"chargeItemName":"卖家其他费用",
"amount":231.00
}]}]}
# lcat = l_createAndTrade()
# print(lcat.body)
# re = hg.post(url = lcat.url,json = lcat.body,headers = lcat.header,proxies=hg.myproxies)
# print(re.json())
# print(re.headers)