Commit 4ae78d068e58f1e00e6538c62d317cfc4a27a813

Authored by liujiqiang
1 parent 1a29c94a

批号结算-测试用例新增

commons/api/hg/CheckIn/demo.py
@@ -9,22 +9,73 @@ @@ -9,22 +9,73 @@
9 9
10 """ 10 """
11 11
12 -ys = {"a":"1","b":{"c":"3"},"dd":[{"e":"5"}]}  
13 -gc = {"a":"a","c":"c","e":"e"}  
14 -  
15 -def replaceJsonData(json={},data={}):  
16 - for i in json.keys():  
17 - if i in data.keys() and type(json[i]) != dict and type(json[i]) != list:  
18 - json[i]=data[i]  
19 - elif type(json[i]) == dict:  
20 - json[i] = replaceJsonData(json=json[i],data=data)  
21 - elif type(json[i]) == list:  
22 - for list_child_index in range(len(json[i])):  
23 - if type(json[i][list_child_index]) == dict:  
24 - json[i][list_child_index] = replaceJsonData(json=json[i][list_child_index], data=data)  
25 - return json  
26 -  
27 -  
28 -# print(ys["d"])  
29 -# a = replaceJsonData(json=ys,data=gc)  
30 -# print(a)  
31 \ No newline at end of file 12 \ No newline at end of file
  13 +import requests
  14 +import xml.dom.minidom
  15 +
  16 +url = "http://10.28.1.155:6789"
  17 +
  18 +payload = """<?xml version="1.0" encoding="GBK"?>
  19 +<stream>
  20 + <action>DLBALQRY</action>
  21 + <userName>11100165758310248856</userName>
  22 + <list name="userDataList">
  23 + <row>
  24 + <accountNo>8113101013600080147</accountNo>
  25 + </row>
  26 + </list>
  27 +</stream>"""
  28 +
  29 +searchLoad = """<?xml version="1.0" encoding="GBK"?>
  30 +<stream>
  31 + <action>DLCIDSTT</action>
  32 + <userName>11100165758310248856</userName>
  33 + <clientID>1195178300421038080</clientID>
  34 + <type></type>
  35 + <controlFlag>1</controlFlag>
  36 +</stream>"""
  37 +
  38 +do_pay = """<?xml version="1.0" encoding="GBK"?>
  39 +<stream>
  40 + <action>DLINTTRN</action>
  41 + <userName>11100165758310248856</userName>
  42 + <list name="userDataList">
  43 + <row>
  44 + <clientID>1195236505817833472</clientID>
  45 + <preFlg>0</preFlg>
  46 + <preDate></preDate>
  47 + <preTime></preTime>
  48 + <payType>2</payType>
  49 + <payFlg>1</payFlg>
  50 + <payAccountNo>8113101013600080147</payAccountNo>
  51 + <recAccountNo>6217690700023561</recAccountNo>
  52 + <recAccountName>慈伪化</recAccountName>
  53 + <recOpenBankName>中信银行北京安贞支行</recOpenBankName>
  54 + <recOpenBankCode>302100011309</recOpenBankCode>
  55 + <tranAmount>2.20</tranAmount>
  56 + <abstract>Online bank withdraw</abstract>
  57 + <memo>Online bank withdraw</memo>
  58 + <chkNum>20210914</chkNum>
  59 + </row>
  60 + </list>
  61 +</stream>"""
  62 +
  63 +headers = {
  64 + 'Content-Type': 'application/xml'
  65 +}
  66 +
  67 +# # 余额
  68 +# print(payload)
  69 +# response = requests.request("POST", url, headers=headers, data=payload)
  70 +
  71 +# 订单状态
  72 +print(searchLoad)
  73 +response = requests.request("POST", url, headers=headers, data=searchLoad)
  74 +
  75 +# # 缴费
  76 +# print(do_pay)
  77 +# response = requests.request("POST", url, headers=headers, data=do_pay.encode("gbk"))
  78 +
  79 +a = response.content.decode("gbk")
  80 +xml = xml.dom.minidom.parseString(a)
  81 +print("------------------------------------------------")
  82 +print(xml.toprettyxml())
config/marketConfig/conf_test.conf
@@ -11,6 +11,7 @@ sy_cardNumRe_01=888810033081 @@ -11,6 +11,7 @@ sy_cardNumRe_01=888810033081
11 #hd 11 #hd
12 hd_cardNumRe_01=210823173732 12 hd_cardNumRe_01=210823173732
13 #hg 13 #hg
  14 +; hg_cardNumRe_01=888800010626
14 hg_cardNumRe_01=888800010591 15 hg_cardNumRe_01=888800010591
15 hg_cardNumRe_02=888800010592 16 hg_cardNumRe_02=888800010592
16 hg_posCode_01=123 17 hg_posCode_01=123
report/test.log
1 -[2021-09-14 11:09:05] [INFO] : ======================================================================================  
2 -[2021-09-14 11:09:05] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb  
3 -[2021-09-14 11:09:05] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb  
4 -{'data': None, 'json': {'userName': '111222', 'password': 'EmGtRPV6kawgKe9lnvhrzQftIM9vpxXcsnKUuZBj0L1fH+Lr270OPPUkT+YI69D87J9V/Vl/Z7XqpH9+qETijhO6mWjGDoxxqbhAAvc+fOxgPpdvSwQ7P0DE9JkOA5r4+mKbN7DhBa69i0RkO5MkOUouUbXYdoUY+3jfXaZT0jI='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}}  
5 -  
6 -[2021-09-14 11:09:05] [INFO] : ======================================================================================  
7 -[2021-09-14 11:09:05] [INFO] : http://test.uap.diligrp.com/login/login.action  
8 -[2021-09-14 11:09:05] [INFO] : http://10.28.12.150:80/login/login.action 1 +[2021-09-15 10:33:33] [INFO] : ======================================================================================
  2 +[2021-09-15 10:33:33] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb
  3 +[2021-09-15 10:33:33] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb
  4 +{'data': None, 'json': {'userName': '111222', 'password': 'DQXEjlThXAkerQ5AdTWgzBb+S7lpE99qU2rcDnKgA4TPFIMi5uBo7qCC9W+F+/+LbFOIYcdDPrNR5qfdDDb5B7cZaVfqDT4HnJcGk0O2iI44pPAEVicie2h3neKfDfgwmAaSiynHplT/C2AHNWqeY47/Q49d0VEWtgqwdCRy9bQ='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}}
  5 +
  6 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  7 +[2021-09-15 10:33:34] [INFO] : http://test.uap.diligrp.com/login/login.action
  8 +[2021-09-15 10:33:34] [INFO] : http://10.28.12.150:80/login/login.action
9 {'data': b'userName=111222&password=111111', 'json': None, 'headers': {'Host': 'test.uap.diligrp.com', 'Connection': 'keep-alive', 'Content-Length': '33', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1', 'Origin': 'http://test.uap.diligrp.com', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Referer': 'http://test.uap.diligrp.com/login/index.html', 'Accept-Encoding': 'gzip,deflate', 'Accept-Language': 'zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7', 'Cookie': 'UAP_accessToken=;UAP_refreshToken=;UAP_loginPath='}, 'allow_redirects': False} 9 {'data': b'userName=111222&password=111111', 'json': None, 'headers': {'Host': 'test.uap.diligrp.com', 'Connection': 'keep-alive', 'Content-Length': '33', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1', 'Origin': 'http://test.uap.diligrp.com', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Referer': 'http://test.uap.diligrp.com/login/index.html', 'Accept-Encoding': 'gzip,deflate', 'Accept-Language': 'zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7', 'Cookie': 'UAP_accessToken=;UAP_refreshToken=;UAP_loginPath='}, 'allow_redirects': False}
10 10
11 -[2021-09-14 11:09:05] [INFO] : ======================================================================================  
12 -[2021-09-14 11:09:05] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/businessChargeItem/listBusinessChargeItem 11 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  12 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/businessChargeItem/listBusinessChargeItem
13 {"marketId": 15, "businessType": "501"} 13 {"marketId": 15, "businessType": "501"}
14 {} 14 {}
15 15
16 -[2021-09-14 11:09:05] [INFO] : ======================================================================================  
17 -[2021-09-14 11:09:05] [INFO] : http://test.gateway.diligrp.com:8285/card-web/accountQuery/simpleInfo.action 16 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  17 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/card-web/accountQuery/simpleInfo.action
18 None 18 None
19 {'params': {'cardNo': '888800010591'}} 19 {'params': {'cardNo': '888800010591'}}
20 20
21 -[2021-09-14 11:09:05] [INFO] : ======================================================================================  
22 -[2021-09-14 11:09:05] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree 21 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  22 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree
23 {"marketId": 15, "keyword": "\u8461\u8404", "state": 1} 23 {"marketId": 15, "keyword": "\u8461\u8404", "state": 1}
24 {} 24 {}
25 25
26 -[2021-09-14 11:09:06] [INFO] : ======================================================================================  
27 -[2021-09-14 11:09:06] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/city/listByKeywordsWithCityCode 26 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  27 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/city/listByKeywordsWithCityCode
28 {"allLevelKeyword": "\u4e07\u5dde"} 28 {"allLevelKeyword": "\u4e07\u5dde"}
29 {} 29 {}
30 30
31 -[2021-09-14 11:09:06] [INFO] : ======================================================================================  
32 -[2021-09-14 11:09:06] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/district/search 31 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  32 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/district/search
33 {"marketId": 15, "nameLike": "\u897f\u533a"} 33 {"marketId": 15, "nameLike": "\u897f\u533a"}
34 {} 34 {}
35 35
36 -[2021-09-14 11:09:06] [INFO] : ======================================================================================  
37 -[2021-09-14 11:09:06] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee 36 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  37 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
38 {"businessType": "501", "chargeItem": 518, "marketId": 15} 38 {"businessType": "501", "chargeItem": 518, "marketId": 15}
39 {} 39 {}
40 40
41 -[2021-09-14 11:09:06] [INFO] : ======================================================================================  
42 -[2021-09-14 11:09:06] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee 41 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  42 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
43 {"businessType": "501", "chargeItem": 520, "marketId": 15} 43 {"businessType": "501", "chargeItem": 520, "marketId": 15}
44 {} 44 {}
45 45
46 -[2021-09-14 11:09:06] [INFO] : ======================================================================================  
47 -[2021-09-14 11:09:06] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save 46 +[2021-09-15 10:33:34] [INFO] : ======================================================================================
  47 +[2021-09-15 10:33:34] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save
48 {"accountId": 107796, "cardNo": "888800010591", "customerId": 142000, "customerCode": "00131702", "customerName": "\u53f2\u4e1c\u6676", "fixedphoneNumber": null, "mobilephoneNumber": "18080008020", "identityCardAddress": "", "identityCardNo": "110101202109024587", "identityCardType": "ID", "registerDetailDtoList": [{"id": 0, "areaId": 272, "areaName": "\u897f\u533a", "quantity": 0, "productId": 754107, "registerRecordId": 0, "remark": null, "weight": 100, "weightType": 0, "created": null, "createdById": 0, "createdByName": null, "createdByDepartmentId": 0, "createdByDepartmentName": null, "registerCertificateList": null, "product": null, "registerCertificateDtoList": null, "productDto": {"id": 0, "originId": 500101, "originName": "\u4e07\u5dde\u533a", "pieceWeight": 0, "categoryId": 754107, "categoryCode": 754107, "categoryName": "\u8461\u8404", "created": null}}], "registerFeeDtoList": [{"id": 0, "actualFee": 200, "receivableFee": 1300, "discountFee": 1100, "registerRecordId": 0, "payStatus": 0, "chargeItemName": "\u5176\u4ed6\u6536\u8d39", "chargeType": 1, "chargeItemId": 518, "registerFeeType": 999, "created": null, "createdById": 0, "createdByName": null, "settleDate": null, "isBehalf": 0, "registerLoadingFeeExtDto": null}], "tradePassword": "111111"} 48 {"accountId": 107796, "cardNo": "888800010591", "customerId": 142000, "customerCode": "00131702", "customerName": "\u53f2\u4e1c\u6676", "fixedphoneNumber": null, "mobilephoneNumber": "18080008020", "identityCardAddress": "", "identityCardNo": "110101202109024587", "identityCardType": "ID", "registerDetailDtoList": [{"id": 0, "areaId": 272, "areaName": "\u897f\u533a", "quantity": 0, "productId": 754107, "registerRecordId": 0, "remark": null, "weight": 100, "weightType": 0, "created": null, "createdById": 0, "createdByName": null, "createdByDepartmentId": 0, "createdByDepartmentName": null, "registerCertificateList": null, "product": null, "registerCertificateDtoList": null, "productDto": {"id": 0, "originId": 500101, "originName": "\u4e07\u5dde\u533a", "pieceWeight": 0, "categoryId": 754107, "categoryCode": 754107, "categoryName": "\u8461\u8404", "created": null}}], "registerFeeDtoList": [{"id": 0, "actualFee": 200, "receivableFee": 1300, "discountFee": 1100, "registerRecordId": 0, "payStatus": 0, "chargeItemName": "\u5176\u4ed6\u6536\u8d39", "chargeType": 1, "chargeItemId": 518, "registerFeeType": 999, "created": null, "createdById": 0, "createdByName": null, "settleDate": null, "isBehalf": 0, "registerLoadingFeeExtDto": null}], "tradePassword": "111111"}
49 {} 49 {}
50 50
51 -[2021-09-14 11:09:08] [INFO] : ======================================================================================  
52 -[2021-09-14 11:09:08] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/settle/changeBatchCodeState  
53 -{"batchCode": "2109000335", "state": "2"}  
54 -{}  
55 -  
56 -[2021-09-14 11:09:08] [INFO] : ======================================================================================  
57 -[2021-09-14 11:09:08] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/settle/query  
58 -None  
59 -{'params': {'batchCode': '2109000335'}}  
60 -  
testcase/hg/test_batchSettlement/test_batchSettlement.py
@@ -38,7 +38,7 @@ class test_batch(unittest.TestCase): @@ -38,7 +38,7 @@ class test_batch(unittest.TestCase):
38 def tearDownClass(cls) -> None: 38 def tearDownClass(cls) -> None:
39 pass 39 pass
40 40
41 - def test_searchState_1(self): 41 + def test_searchBatchState_2(self):
42 """ 42 """
43 批号管理--查询--验证查询已关闭的批号自动加载批号信息 43 批号管理--查询--验证查询已关闭的批号自动加载批号信息
44 """ 44 """
@@ -55,4 +55,20 @@ class test_batch(unittest.TestCase): @@ -55,4 +55,20 @@ class test_batch(unittest.TestCase):
55 # 结算单查询 55 # 结算单查询
56 res = batchSettlement.settle_query(session=session,host=self.gatewayHost,batchCode=batchCode) 56 res = batchSettlement.settle_query(session=session,host=self.gatewayHost,batchCode=batchCode)
57 print(res.text) 57 print(res.text)
58 - assert "tradingOrder" in res.text,"验证查询已关闭的批号自动加载批号信息"  
59 \ No newline at end of file 58 \ No newline at end of file
  59 + assert "tradingOrder" in res.text,"验证查询已关闭的批号自动加载批号信息"
  60 +
  61 + def test_searchBatchState_1(self):
  62 + """
  63 + 批号管理--查询--验证查询已关闭的批号自动加载批号信息
  64 + """
  65 + # 创建初始数据
  66 + posCode = self.posCode
  67 + state = "2"
  68 + resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)
  69 + print(resBatchCode.json())
  70 + batchCode = resBatchCode.json()["data"]["batchCode"]
  71 + print("test_searchState_1 --> self.batchCode:", batchCode)
  72 + # # 变更交易状态
  73 + # resCAT = sellingGoods.doCreateAndTrade(session=session,host=self.gatewayHost,batchCode=batchCode,
  74 + # ic=self.ic_buyer,posCode=posCode)
  75 + # print(resCAT.json())
60 \ No newline at end of file 76 \ No newline at end of file