createAndTrade.py
2.16 KB
# -*- coding: utf-8 -*-
"""
@Time : 2021/8/31 14:43
@Auth : wlm
@File :createAndTrade.py
@IDE :PyCharm
"""
"""
大客户模式——新增交易单
"""
from commons.MySession import hg
class 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"}
# 大客户body
self.body = {"sellerId":141992,"sellerName":"特朗普vip","sellerAccountId":107792,"sellerCardNo":"888810026785","buyerId":141995,"buyerName":"拜登","buyerAccountId":107791,"buyerCardNo":"888810043394","posCode":"666","tradePassword":"111111","orderItemList":[{"number":0,"batchCode":"2109000067","productId":125,"productCode":"374690","productName":"苹果","categoryId":374690,"weightType":1,"quantity":1,"pieceWeight":1,"grossWeight":0,"tareWeight":0,"weight":1,"price":2000,"PriceStr":"20","amount":2000,"amountStr":20.0,"originId":510100,"originName":"成都市","feeItemList":[{"type":1,"chargeItemId":521,"chargeItemName":"买家手续费","amount":550.0},{"type":2,"chargeItemId":522,"chargeItemName":"卖家手续费","amount":989.00}]}]}
#普通客户body
self.body1={"sellerId":141995,"sellerName":"拜登","sellerAccountId":107791,"sellerCardNo":"888810043394","buyerId":141992,"buyerName":"特朗普vip","buyerAccountId":107792,"buyerCardNo":"888810026785","posCode":"666","tradePassword":"111111","orderItemList":[{"number":0,"batchCode":"2109000073","productId":125,"productCode":"374690","productName":"苹果","categoryId":374690,"weightType":1,"quantity":1,"pieceWeight":1,"grossWeight":0,"tareWeight":0,"weight":1,"price":2000,"PriceStr":"20","amount":2000,"amountStr":20.0,"originId":510100,"originName":"成都市","feeItemList":[{"type":1,"chargeItemId":521,"chargeItemName":"买家手续费","amount":550.0},{"type":2,"chargeItemId":522,"chargeItemName":"卖家手续费","amount":989.00}]}]}
# tt = createAndTrade()
# re = hg.post(url = tt.url,json = tt.body,headers = tt.header,proxies=hg.myproxies)
# print(re.json())