Commit 3d9d89f158ba1634bdad626a02036fd4e8345d48

Authored by wenleiming
1 parent 8bd7c243

创建订单优化

commons/api/hg/transaction/createAndTrade.py
... ... @@ -76,8 +76,8 @@ class createAndTrade():
76 76 }
77 77 ]
78 78 }
79   -
80   -
  79 + self.body2 = {"sellerId":141962,"sellerName":"云云康飞卖","sellerAccountId":107663,"sellerCardNo":"888810062816","buyerId":141968,"buyerName":"袁豪正买","buyerCardHolder":"袁豪正买","buyerAccountId":107676,"buyerCardNo":"888810061104","posCode":"111222","tradePassword":"111111","orderItemList":[{"number":0,"batchCode":"2111001098","productId":1247,"productCode":"1600023","productName":"圆茄","categoryId":1600023,"weightType":1,"quantity":100,"pieceWeight":20,"grossWeight":0.0,"tareWeight":0.0,"weight":2000.0,"price":300,"PriceStr":"3.00","amount":30000,"amountStr":"300.00","originId":50000000,"originName":"美属萨摩亚","feeItemList":[{"type":1,"chargeItemId":521,"chargeItemName":"买家手续费","amount":16500.0},{"type":2,"chargeItemId":522,"chargeItemName":"卖家手续费","amount":253.00},{"type":2,"chargeItemId":527,"chargeItemName":"卖家仓储服务费","amount":145.00},{"type":2,"chargeItemId":550,"chargeItemName":"卖家清洁费","amount":200.0}]}]}
  80 + self.body3 = {"sellerId":141962,"sellerCode":"00131682","sellerName":"云云康飞卖","sellerAccountId":107663,"sellerCardNo":"888810062816","buyerId":141968,"buyerCode":"00131670","buyerName":"袁豪正买","buyerCardHolder":"袁豪正买","buyerAccountId":107676,"buyerCardNo":"888810061104","posCode":"111222","tradePassword":"111111","orderSource":2,"orderItemList":[{"number":0,"batchCode":"2111001093","productId":1247,"productCode":"1600023","productName":"圆茄","categoryId":1600023,"weightType":1,"quantity":100,"pieceWeight":20,"grossWeight":None,"tareWeight":None,"weight":2000.0,"price":200,"PriceStr":"2.00","amount":20000,"amountStr":"200.00","originId":50000000,"originName":"美属萨摩亚","areaId":274,"areaName":"东区01","feeItemList":[{"type":1,"chargeItemId":521,"chargeItemName":"买家手续费","amount":11000.0,"number":"0"},{"type":2,"chargeItemId":522,"chargeItemName":"卖家手续费","amount":253.00,"number":"0"},{"type":2,"chargeItemId":527,"chargeItemName":"卖家仓储服务费","amount":145.00,"number":"0"},{"type":2,"chargeItemId":550,"chargeItemName":"卖家清洁费","amount":200.0,"number":"0"}]}]}
81 81 # creat = createAndTrade()
82 82 # print(creat.body)
83 83 # re = hg.post(url = creat.url,json = creat.body,headers = creat.header,proxies=hg.myproxies)
... ...
commons/api/hg/transaction/l_createAndTrade.py
... ... @@ -74,9 +74,9 @@ class l_createAndTrade():
74 74 "amount":231.00
75 75 }]}]}
76 76  
77   -
  77 + self.body1 = {"sellerId":141969,"sellerCode":"00131671","sellerName":"严安彬卖","sellerAccountId":107677,"sellerCardNo":"888810061102","buyerId":141968,"buyerCode":"00131670","buyerName":"袁豪正买","buyerCardHolder":"袁豪正买","buyerAccountId":107676,"buyerCardNo":"888810061104","posCode":"1995","tradePassword":"111111","orderSource":2,"orderItemList":[{"number":0,"batchCode":"2111001080","productId":1246,"productCode":"1600018","productName":"菠菜","categoryId":1600018,"weightType":1,"quantity":100,"pieceWeight":10,"grossWeight":None,"tareWeight":None,"weight":1000.0,"price":500,"PriceStr":"5.00","amount":50000,"amountStr":"500.00","originId":50000000,"originName":"美属萨摩亚","areaId":274,"areaName":"东区01","feeItemList":[{"type":1,"chargeItemId":521,"chargeItemName":"买家手续费","amount":27500.0,"number":"0"},{"type":2,"chargeItemId":522,"chargeItemName":"卖家手续费","amount":253.00,"number":"0"},{"type":2,"chargeItemId":527,"chargeItemName":"卖家仓储服务费","amount":145.00,"number":"0"},{"type":2,"chargeItemId":550,"chargeItemName":"卖家清洁费","amount":200.0,"number":"0"}]}]}
78 78 # lcat = l_createAndTrade()
79   -# print(lcat.body)
80   -# re = hg.post(url = lcat.url,json = lcat.body,headers = lcat.header,proxies=hg.myproxies)
  79 +# print(lcat.body1)
  80 +# re = hg.post(url = lcat.url,json = lcat.body1,headers = lcat.header,proxies=hg.myproxies)
81 81 # print(re.json())
82 82 # print(re.headers)
83 83 \ No newline at end of file
... ...
commons/basic/registerRecord_save.py
... ... @@ -106,7 +106,8 @@ class registerRecord_save():
106 106 }
107 107 #大客户有装卸10元和其他费2元
108 108 self.body2={"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":1000,"productId":374690,"registerRecordId":0,"remark":None,"weight":1000,"weightType":0,"created":None,"createdById":0,"createdByName":None,"createdByDepartmentId":0,"createdByDepartmentName":None,"registerCertificateList":None,"product":None,"registerCertificateDtoList":None,"productDto":{"id":0,"originId":100000000,"originName":"安提瓜和巴布达","pieceWeight":1,"categoryId":374690,"categoryCode":"374690","categoryName":"苹果","created":None}}],"registerFeeDtoList":[{"id":0,"actualFee":200.0,"receivableFee":1300.0,"discountFee":1100.0,"registerRecordId":0,"payStatus":0,"chargeItemName":"其他收费","chargeType":1,"chargeItemId":518,"registerFeeType":999,"created":None,"createdById":0,"createdByName":None,"settleDate":None,"isBehalf":1,"registerLoadingFeeExtDto":None},{"id":0,"actualFee":1000.0,"receivableFee":1000.0,"discountFee":0.0,"registerRecordId":0,"payStatus":0,"chargeItemName":"装卸费","chargeType":0,"chargeItemId":531,"registerFeeType":1,"created":None,"createdById":0,"createdByName":None,"settleDate":None,"isBehalf":1,"registerLoadingFeeExtDto":{"loadingTeamId":54,"loadingTeam":"大江","loadingFee":850.0,"behalfLoadingFee":150.0}}],"tradePassword":""}
109   -
110   -# tt=registerRecord_save()
111   -# re=hg.post(url=tt.url,headers=tt.header,json=tt.body2,proxies=hg.myproxies)
112   -# print(str(re.json()))
113 109 \ No newline at end of file
  110 + self.body3 = {"accountId":107677,"cardNo":"888810061102","customerId":141969,"customerCode":"00131671","customerName":"严安彬卖","fixedphoneNumber":None,"mobilephoneNumber":"18055974406","identityCardAddress":"","identityCardNo":"65010119640812071X","identityCardType":"ID","registerDetailDtoList":[{"id":0,"areaId":274,"areaName":"东区01","quantity":100,"productId":1600018,"registerRecordId":0,"remark":None,"weight":1000,"weightType":0,"created":None,"createdById":0,"createdByName":None,"createdByDepartmentId":0,"createdByDepartmentName":None,"registerCertificateList":None,"product":None,"registerCertificateDtoList":None,"productDto":{"id":0,"originId":50000000,"originName":"美属萨摩亚","pieceWeight":10,"categoryId":1600018,"categoryCode":"1600018","categoryName":"菠菜","created":None}}],"registerFeeDtoList":[{"id":0,"actualFee":2000.0,"receivableFee":2000.0,"discountFee":0.0,"registerRecordId":0,"payStatus":0,"chargeItemName":"其他收费","chargeType":1,"chargeItemId":518,"registerFeeType":999,"created":None,"createdById":0,"createdByName":None,"settleDate":None,"isBehalf":1,"registerLoadingFeeExtDto":None,"originId":0,"originName":"","pieceWeight":0,"categoryId":None,"categoryCode":"","categoryName":""},{"id":0,"actualFee":2000.0,"receivableFee":2000.0,"discountFee":0.0,"registerRecordId":0,"payStatus":0,"chargeItemName":"装卸费","chargeType":0,"chargeItemId":531,"registerFeeType":1,"created":None,"createdById":0,"createdByName":None,"settleDate":None,"isBehalf":1,"registerLoadingFeeExtDto":{"loadingTeamId":57,"loadingTeam":"杭果大队","loadingFee":1780.0,"behalfLoadingFee":220.0,"shareRatio":11.0},"originId":50000000,"originName":"美属萨摩亚","pieceWeight":10,"categoryId":1600018,"categoryCode":"1600018","categoryName":"菠菜"}],"tradePassword":"","holdCertificateName":"严安彬卖","holdCertificateNumber":None}
  111 + self.body4 = {"accountId":107663,"cardNo":"888810062816","customerId":141962,"customerCode":"00131682","customerName":"云云康飞卖","fixedphoneNumber":None,"mobilephoneNumber":"18010474936","identityCardAddress":"","identityCardNo":"650101196408120576","identityCardType":"ID","registerDetailDtoList":[{"id":0,"areaId":274,"areaName":"东区01","quantity":100,"productId":1600023,"registerRecordId":0,"remark":None,"weight":2000,"weightType":0,"created":None,"createdById":0,"createdByName":None,"createdByDepartmentId":0,"createdByDepartmentName":None,"registerCertificateList":None,"product":None,"registerCertificateDtoList":None,"productDto":{"id":0,"originId":50000000,"originName":"美属萨摩亚","pieceWeight":20,"categoryId":1600023,"categoryCode":"1600023","categoryName":"圆茄","created":None}}],"registerFeeDtoList":[{"id":0,"actualFee":2200.0,"receivableFee":2200.0,"discountFee":0.0,"registerRecordId":0,"payStatus":0,"chargeItemName":"其他收费","chargeType":1,"chargeItemId":518,"registerFeeType":999,"created":None,"createdById":0,"createdByName":None,"settleDate":None,"isBehalf":1,"registerLoadingFeeExtDto":None,"originId":0,"originName":"","pieceWeight":0,"categoryId":None,"categoryCode":"","categoryName":""},{"id":0,"actualFee":2000.0,"receivableFee":2000.0,"discountFee":0.0,"registerRecordId":0,"payStatus":0,"chargeItemName":"装卸费","chargeType":0,"chargeItemId":531,"registerFeeType":1,"created":None,"createdById":0,"createdByName":None,"settleDate":None,"isBehalf":1,"registerLoadingFeeExtDto":{"loadingTeamId":57,"loadingTeam":"杭果大队","loadingFee":1780.0,"behalfLoadingFee":220.0,"shareRatio":11.0},"originId":50000000,"originName":"美属萨摩亚","pieceWeight":20,"categoryId":1600023,"categoryCode":"1600023","categoryName":"圆茄"}],"tradePassword":"","holdCertificateName":"云云康飞卖","holdCertificateNumber":"650101196408120576"}
  112 +tt=registerRecord_save()
  113 +re=hg.post(url=tt.url,headers=tt.header,json=tt.body4)
  114 +print(str(re.json()))
114 115 \ No newline at end of file
... ...
testcase/hg/tradingOrder/test_createAndTrade.py
... ... @@ -45,11 +45,11 @@ ORDER BY
45 45 aua.account_id DESC
46 46 LIMIT 1
47 47 ''')
48   - body2 = r.body.copy()
  48 + body2 = r.body4.copy()
49 49 body2["accountId"] = str(cls.aaa[0])
50 50 body2["cardNo"] = str(cls.aaa[1])
51 51 body2["customerId"] = str(cls.aaa[2])
52   - body2["customerCode"] = str(cls.aaa[3])
  52 + body2["sellerCode"] = str(cls.aaa[3])
53 53 body2["customerName"] = str(cls.aaa[4])
54 54 body2["identityCardNo"] = str(cls.aaa[5])
55 55 body2["mobilephoneNumber"] = str(cls.aaa[6])
... ... @@ -65,7 +65,7 @@ ORDER BY
65 65 @unittest.case_mark(my.mark())
66 66 def test_createAndTrade_01(self):
67 67 "大客户创建订单"
68   - body = creat.body.copy()
  68 + body = creat.body3.copy()
69 69 body["orderItemList"][0]["batchCode"] = self.batch
70 70 print("创建订单body",body)
71 71 re1 = hg.post(url = creat.url, headers = creat.header, json = body)
... ...
testcase/hg/tradingOrder/test_l_createAndTrade.py
... ... @@ -32,7 +32,7 @@ WHERE
32 32 ORDER BY
33 33 aua.account_id DESC
34 34 LIMIT 1''')
35   - body2 = r.body.copy()
  35 + body2 = r.body3.copy()
36 36 body2["accountId"] = str(cls.aaa[0])
37 37 body2["cardNo"] = str(cls.aaa[1])
38 38 body2["customerId"] = str(cls.aaa[2])
... ... @@ -55,7 +55,7 @@ ORDER BY
55 55 @unittest.case_mark(my.mark())
56 56 def test_l_createAndTrade_01(self):
57 57 "普通客户创建订单"
58   - body = lcat.body.copy()
  58 + body = lcat.body1.copy()
59 59 body["orderItemList"][0]["batchCode"] = self.batch
60 60 print("创建订单body",body)
61 61 re1 = hg.post(url = lcat.url, headers = lcat.header, json = body,proxies = my.proxies)
... ... @@ -69,3 +69,4 @@ ORDER BY
69 69  
70 70 if __name__ == '__main__':
71 71 unittest.main()
  72 +
... ...