registerRecord_save.py 2.59 KB
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import hg
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


class registerRecord_save():
    "录入批次号"

    def __init__(self):
        self.url = "http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save"
        self.header = {
                    "UAP_accessToken" :"demo",
                    "UAP_refreshToken" :"demo",
                    "UAP_firmId" :"15",
                    "Content-Type" :"application/json",
                    "Host" :"test.gateway.diligrp.com:8285"}
        self.body = {
                    "accountId": 107792,
                    "cardNo": "888810026785",
                    "customerId": 141992,
                    "customerCode": "00131694",
                    "customerName": "特朗普vip",
                    "fixedphoneNumber": None,
                    "mobilephoneNumber": "16111111112",
                    "identityCardAddress": "",
                    "identityCardNo": "110101198001012390",
                    "identityCardType": "ID",
                    "registerDetailDtoList": [{
                        "id": 0,
                        "areaId": 274,
                        "areaName": "东区01",
                        "quantity": 10,
                        "productId": 374690,
                        "registerRecordId": 0,
                        "remark": None,
                        "weight": 10,
                        "weightType": 0,
                        "created": None,
                        "createdById": 0,
                        "createdByName": None,
                        "createdByDepartmentId": 0,
                        "createdByDepartmentName": None,
                        "registerCertificateList": None,
                        "product": None,
                        "registerCertificateDtoList": None,
                        "productDto": {
                            "id": 0,
                            "originId": 510100,
                            "originName": "成都市",
                            "pieceWeight": 1,
                            "categoryId": 374690,
                            "categoryCode": "374690",
                            "categoryName": "苹果",
                            "created": None
                        }
                    }],
                    "registerFeeDtoList": [],
                    "tradePassword": "" }


  

tt=registerRecord_save()
re=hg.post(url=tt.url,headers=tt.header,json=tt.body,proxies=hg.myproxies)
print(str(re.json()))