Commit 042ff4c5e47dcee4cfe0cbcc42a3e9ae87b1b5d2
Merge remote-tracking branch 'origin/master'
Showing
17 changed files
with
439 additions
and
26 deletions
commons/MySession.py
@@ -294,6 +294,8 @@ my.set_mark() | @@ -294,6 +294,8 @@ my.set_mark() | ||
294 | # sessionSy = mysession().cliLogin("sy_userName_01") | 294 | # sessionSy = mysession().cliLogin("sy_userName_01") |
295 | # 哈尔滨客户端session | 295 | # 哈尔滨客户端session |
296 | # sessionHeb = mysession().cliLogin("hd_userName_01") | 296 | # sessionHeb = mysession().cliLogin("hd_userName_01") |
297 | +# 杭果客户端session | ||
298 | +sessionHg = mysession().cliLogin("hg_userName_01") | ||
297 | #获取对应市场session | 299 | #获取对应市场session |
298 | # sy1=mysession("host1").get_session_client("sy_user01") | 300 | # sy1=mysession("host1").get_session_client("sy_user01") |
299 | # heb=mysession("host1").get_session_client("heb_user01") | 301 | # heb=mysession("host1").get_session_client("heb_user01") |
commons/api/hg/CheckIn/CheckIn.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | ||
2 | + | ||
3 | +# @Time : 2021/9/8 14:17 | ||
4 | +# @Author : Ljq | ||
5 | +# @File : CheckIn.py | ||
6 | +# @Software: PyCharm | ||
7 | + | ||
8 | +""" | ||
9 | +创建进门登记单 | ||
10 | +""" | ||
11 | + | ||
12 | +import json,time,random,re | ||
13 | +from commons.scripts import dealContentType as dct | ||
14 | +from commons.scripts import jsonToUrlCode | ||
15 | +from commons.scripts import replaceJsonData as rJD | ||
16 | +import urllib.parse | ||
17 | +from commons.MySession import sessionHg | ||
18 | + | ||
19 | +host = "http://test.gateway.diligrp.com:8285" | ||
20 | + | ||
21 | +def get_simpleInfo(session=None,host=None,ic=None): | ||
22 | + url = host+"/card-web/accountQuery/simpleInfo.action" | ||
23 | + headers={} | ||
24 | + data={"cardNo":ic} | ||
25 | + res = session.useHeadersRequests(method="GET",url=url,params=data,headers=headers) | ||
26 | + return res | ||
27 | + | ||
28 | + | ||
29 | +def get_tree(session=None,host=None,**kwargs): | ||
30 | + "商品信息获取" | ||
31 | + url = host+"/assets-service/api/cusCategory/getTree" | ||
32 | + headers = dct.jsonCode() | ||
33 | + data={"marketId":15,"keyword":"西瓜","state":1} | ||
34 | + data = dict(data,**kwargs) | ||
35 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
36 | + return res | ||
37 | + | ||
38 | + | ||
39 | +def get_cityCode(session=None,host=None,allLevelKeyword="万州"): | ||
40 | + """""" | ||
41 | + url = host+"/assets-service/api/city/listByKeywordsWithCityCode" | ||
42 | + headers = dct.jsonCode() | ||
43 | + data={"allLevelKeyword":allLevelKeyword} | ||
44 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
45 | + return res | ||
46 | + | ||
47 | + | ||
48 | +def get_searchArea(session=None,host=None,**kwargs): | ||
49 | + """""" | ||
50 | + url = host+"/assets-service/api/district/search" | ||
51 | + headers = dct.jsonCode() | ||
52 | + data={"marketId":15,"nameLike":"西区"} | ||
53 | + data = dict(data,**kwargs) | ||
54 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
55 | + return res | ||
56 | + | ||
57 | + | ||
58 | +def get_chargeItem(session=None,host=None,**kwargs): | ||
59 | + """获取费用项""" | ||
60 | + url = host+"/hg-trading/api/businessChargeItem/listBusinessChargeItem" | ||
61 | + headers = dct.jsonCode() | ||
62 | + data={"marketId":15,"businessType":"501"} | ||
63 | + data = dict(data,**kwargs) | ||
64 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
65 | + return res | ||
66 | + | ||
67 | + | ||
68 | +def get_queryFee(session=None,host=None,**kwargs): | ||
69 | + """根据费用项获取费用""" | ||
70 | + url = host+"/dili-rule/api/chargeRule/queryFee" | ||
71 | + headers = dct.jsonCode() | ||
72 | + data={"businessType":"501","chargeItem":520,"marketId":15} | ||
73 | + data = dict(data,**kwargs) | ||
74 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
75 | + return res | ||
76 | + | ||
77 | + | ||
78 | +def save_registerRecord(session=None,host=None,**kwargs): | ||
79 | + """生成登记单并缴费""" | ||
80 | + url = host+"/hg-trading/api/registerRecord/save" | ||
81 | + headers = dct.jsonCode() | ||
82 | + data = {"accountId": 107796, "cardNo": "888800010591", "customerId": 142000, "customerCode": "00131702", | ||
83 | + "customerName": "史东晶", "fixedphoneNumber": None, "mobilephoneNumber": "18080008020", | ||
84 | + "identityCardAddress": "", "identityCardNo": "110101202109024587", "identityCardType": "ID", | ||
85 | + "registerDetailDtoList": [ | ||
86 | + {"id": 0, "areaId": 272, "areaName": "西区", "quantity": 0, "productId": 754107, "registerRecordId": 0, | ||
87 | + "remark": None, "weight": 100, "weightType": 0, "created": None, "createdById": 0, | ||
88 | + "createdByName": None, "createdByDepartmentId": 0, "createdByDepartmentName": None, | ||
89 | + "registerCertificateList": None, "product": None, "registerCertificateDtoList": None, | ||
90 | + "productDto": {"id": 0, "originId": 500101, "originName": "万州区", "pieceWeight": 0, | ||
91 | + "categoryId": 754107, "categoryCode": "754107", "categoryName": "葡萄", | ||
92 | + "created": None}}], | ||
93 | + "registerFeeDtoList": [ | ||
94 | + {"id": 0, "actualFee": 200.0, "receivableFee": 1300.0, "discountFee": 1100.0, "registerRecordId": 0, | ||
95 | + "payStatus": 0, "chargeItemName": "其他收费", "chargeType": 1, "chargeItemId": 518, "registerFeeType": 999, | ||
96 | + "created": None, "createdById": 0, "createdByName": None, "settleDate": None, "isBehalf": 0, | ||
97 | + "registerLoadingFeeExtDto": None}], "tradePassword": "111111"} | ||
98 | + data = rJD.replaceJsonData(json=data,data=kwargs) | ||
99 | + print(data) | ||
100 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
101 | + return res | ||
102 | + | ||
103 | +def create_registerRecord(session=None,host=None,ic="888800010591",goodsName="葡萄",nameLike="西区", | ||
104 | + allLevelKeyword="万州",tradePassword="111111",weight=100): | ||
105 | + """创建进门登记单并缴费""" | ||
106 | + # 获取费用信息 | ||
107 | + marketId = session.userInfo["data"]["user"]["firmId"] | ||
108 | + res = get_chargeItem(session=session,host=host,marketId=marketId) | ||
109 | + chargeItemId = [i["id"] for i in res.json()["data"] if i["chargeItem"] == "其他收费"][0] | ||
110 | + chargeItemIdChild = [i["id"] for i in res.json()["data"] if "parentId" in i.keys() and i["parentId"] == chargeItemId][0] | ||
111 | + | ||
112 | + # 获取客户信息 | ||
113 | + resSimpleInfo = get_simpleInfo(session=session,host=host,ic=ic) | ||
114 | + accountId = resSimpleInfo.json()["data"]["accountInfo"]["accountId"] | ||
115 | + cardNo = resSimpleInfo.json()["data"]["accountInfo"]["cardNo"] | ||
116 | + customerId = resSimpleInfo.json()["data"]["accountInfo"]["customerId"] | ||
117 | + customerCode = resSimpleInfo.json()["data"]["accountInfo"]["customerCode"] | ||
118 | + customerName = resSimpleInfo.json()["data"]["accountInfo"]["customerName"] | ||
119 | + mobilephoneNumber = resSimpleInfo.json()["data"]["accountInfo"]["customerContactsPhone"] | ||
120 | + identityCardNo = resSimpleInfo.json()["data"]["accountInfo"]["customerCertificateNumber"] | ||
121 | + | ||
122 | + # 获取商品信息 | ||
123 | + resTree = get_tree(session=session,host=host,keyword=goodsName,marketId=marketId) | ||
124 | + productId = resTree.json()["data"][0]["id"] | ||
125 | + categoryId = productId | ||
126 | + categoryCode = productId | ||
127 | + categoryName = resTree.json()["data"][0]["name"] | ||
128 | + | ||
129 | + # 获取产地信息 | ||
130 | + resCity = get_cityCode(session=session,host=host,allLevelKeyword=allLevelKeyword) | ||
131 | + originId = resCity.json()["data"][0]["id"] | ||
132 | + originName = resCity.json()["data"][0]["name"] | ||
133 | + | ||
134 | + # 获取区域信息 | ||
135 | + resArea = get_searchArea(session=session,host=host,nameLike=nameLike,marketId=marketId) | ||
136 | + areaId = resArea.json()["data"][0]["id"] | ||
137 | + areaName = resArea.json()["data"][0]["name"] | ||
138 | + | ||
139 | + # 采用其他收费时获取应收金额,优惠金额,实际金额 | ||
140 | + receivableFee = int(get_queryFee(session=session,host=host,chargeItem=chargeItemId,marketId=marketId).json()["data"]["totalFee"])*100 | ||
141 | + discountFee = int(get_queryFee(session=session, host=host, chargeItem=chargeItemIdChild,marketId=marketId).json()["data"]["totalFee"])*100 | ||
142 | + actualFee = receivableFee - discountFee | ||
143 | + | ||
144 | + | ||
145 | + # 创建进门登记单并缴费 | ||
146 | + resSave = save_registerRecord(session=session, host=host, weight=weight, tradePassword=tradePassword, | ||
147 | + chargeItemId=chargeItemId, accountId=accountId, cardNo=cardNo, customerId=customerId, | ||
148 | + customerCode=customerCode, customerName=customerName, | ||
149 | + mobilephoneNumber=mobilephoneNumber, identityCardNo=identityCardNo, | ||
150 | + productId=productId, categoryId=categoryId, categoryCode=categoryCode, | ||
151 | + categoryName=categoryName, originId=originId, originName=originName, areaId=areaId, | ||
152 | + areaName=areaName, receivableFee=receivableFee, discountFee=discountFee, | ||
153 | + actualFee=actualFee) | ||
154 | + return resSave | ||
155 | + | ||
156 | + | ||
157 | +# res = create_registerRecord(session=sessionHg,ic="888800010592",host=host,goodsName="苹果",allLevelKeyword="金牛区", | ||
158 | +# nameLike="西区",tradePassword="111111",weight="50") | ||
159 | +# print(res.text) | ||
0 | \ No newline at end of file | 160 | \ No newline at end of file |
commons/api/hg/CheckIn/__init__.py
0 → 100644
commons/api/hg/CheckIn/demo.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | ||
2 | + | ||
3 | +# @Time : 2021/9/8 16:23 | ||
4 | +# @Author : Ljq | ||
5 | +# @File : demo.py | ||
6 | +# @Software: PyCharm | ||
7 | + | ||
8 | +""" | ||
9 | + | ||
10 | +""" | ||
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) | ||
0 | \ No newline at end of file | 31 | \ No newline at end of file |
commons/api/hg/CheckIn/进门单登记
0 → 100644
commons/api/hg/settlement/__init__.py
0 → 100644
commons/api/hg/settlement/batch.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | ||
2 | + | ||
3 | +# @Time : 2021/9/8 17:45 | ||
4 | +# @Author : Ljq | ||
5 | +# @File : batch.py | ||
6 | +# @Software: PyCharm | ||
7 | + | ||
8 | +""" | ||
9 | +批号管理业务相关接口 | ||
10 | +""" | ||
11 | + | ||
12 | + | ||
13 | +import json,time,random,re | ||
14 | +from commons.scripts import dealContentType as dct | ||
15 | +from commons.scripts import jsonToUrlCode | ||
16 | +from commons.scripts import replaceJsonData as rJD | ||
17 | +import urllib.parse | ||
18 | +from commons.MySession import sessionHg | ||
19 | + | ||
20 | +host = "http://test.gateway.diligrp.com:8285" | ||
21 | + | ||
22 | +def batchCodeQuery(session=None,host=None,**kwargs): | ||
23 | + """ | ||
24 | + 登记单状态变更 | ||
25 | + :param batchCode:等级单号 | ||
26 | + :param _t:时间戳 | ||
27 | + """ | ||
28 | + url = host+"/hg-trading/api/settle/batchCodeQuery" | ||
29 | + headers = {} | ||
30 | + data = {"batchCode":"2109000198","_t":"1631094801343"} | ||
31 | + data = dict(data,**kwargs) | ||
32 | + res = session.useHeadersRequests(method="GET",url=url,params=data,headers=headers) | ||
33 | + return res | ||
34 | + | ||
35 | +# res = get_batchCodeQuery(session=sessionHg,host=host,batchCode="2109000202") | ||
36 | +# print(res.json()) | ||
37 | + | ||
38 | +def changeBatchCodeState(session=None,host=None,**kwargs): | ||
39 | + """ | ||
40 | + 登记单状态变更 | ||
41 | + :param batchCode:等级单号 | ||
42 | + :param state:变更状态,1继续,2停止 | ||
43 | + """ | ||
44 | + url = host+"/hg-trading/api/settle/changeBatchCodeState" | ||
45 | + headers = {} | ||
46 | + data = {"batchCode":"2109000198","state":2} | ||
47 | + data = dict(data,**kwargs) | ||
48 | + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers) | ||
49 | + return res | ||
50 | + | ||
51 | +# res = changeBatchCodeState(session=sessionHg,host=host,batchCode="2109000202",state=1) | ||
52 | +# print(res.json()) |
commons/api/hg/settlement/batchQuery.py
0 → 100644
commons/api/hg/settlement/batchSettlement.py
0 → 100644
commons/api/hg/settlement/结算管理
0 → 100644
commons/basic/get_duplicateToken.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | ||
2 | + | ||
3 | +# @Time : 2021/9/8 14:14 | ||
4 | +# @Author : Ljq | ||
5 | +# @File : get_duplicateToken.py | ||
6 | +# @Software: PyCharm | ||
7 | + | ||
8 | +""" | ||
9 | + | ||
10 | +""" | ||
11 | + | ||
12 | +def get_duplicateToken(session=None,host=""): | ||
13 | + """进门防重接口""" | ||
14 | + url = host + "/jmsf-web/appCommon/duplicateToken.action" | ||
15 | + headers = dct.jsonCode() | ||
16 | + res = session.useHeadersRequests(method="get", url=url, headers=headers) | ||
17 | + return res | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |
commons/scripts/jsonToUrlcode.py renamed to commons/scripts/jsonToUrlCode.py
commons/scripts/replaceJsonData.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | ||
2 | + | ||
3 | +# @Time : 2021/9/8 16:45 | ||
4 | +# @Author : Ljq | ||
5 | +# @File : replaceJsonData.py | ||
6 | +# @Software: PyCharm | ||
7 | + | ||
8 | +""" | ||
9 | +使用无嵌套的json格式数据,对嵌套的json内部的值的进行替换 | ||
10 | +""" | ||
11 | + | ||
12 | +def replaceJsonData(json={},data={}): | ||
13 | + for i in json.keys(): | ||
14 | + if i in data.keys() and type(json[i]) != dict and type(json[i]) != list: | ||
15 | + json[i]=data[i] | ||
16 | + elif type(json[i]) == dict: | ||
17 | + json[i] = replaceJsonData(json=json[i],data=data) | ||
18 | + elif type(json[i]) == list: | ||
19 | + for list_child_index in range(len(json[i])): | ||
20 | + if type(json[i][list_child_index]) == dict: | ||
21 | + json[i][list_child_index] = replaceJsonData(json=json[i][list_child_index], data=data) | ||
22 | + return json | ||
0 | \ No newline at end of file | 23 | \ No newline at end of file |
config/marketConfig/conf_test.conf
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | [loginInfo] | 2 | [loginInfo] |
3 | sy_userName_01=scgy,123123 | 3 | sy_userName_01=scgy,123123 |
4 | hd_userName_01=哈尔滨田太子,a123456 | 4 | hd_userName_01=哈尔滨田太子,a123456 |
5 | +hg_userName_01=hg_cgy,123123 | ||
5 | 6 | ||
6 | # 测试依赖信息 | 7 | # 测试依赖信息 |
7 | [testInfo] | 8 | [testInfo] |
@@ -9,6 +10,8 @@ hd_userName_01=哈尔滨田太子,a123456 | @@ -9,6 +10,8 @@ hd_userName_01=哈尔滨田太子,a123456 | ||
9 | sy_cardNumRe_01=888810033081 | 10 | sy_cardNumRe_01=888810033081 |
10 | #hd | 11 | #hd |
11 | hd_cardNumRe_01=210823173732 | 12 | hd_cardNumRe_01=210823173732 |
13 | +#hg | ||
14 | +hg_cardNumRe_01=888800010591 | ||
12 | 15 | ||
13 | 16 | ||
14 | [host] | 17 | [host] |
report/test.log
1 | -[2021-08-27 14:56:04] [INFO] : ====================================================================================== | ||
2 | -[2021-08-27 14:56:04] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
3 | -{'data': None, 'json': {'userName': 'sy_chen', 'password': 'NxcpSj8I9WK3GY9MlAfHXIQLnAwYsREKkHVx1Z3sBqTdjgk3+/t0aIn/Xpn0DfUsOgwulzZ9XQ5HhEcu+jky7LdPPnNslkyWsXoXQOfWDa39mB2CRzHInV3gNxos3iyqiNCDXy5hTKM1oy7yhE8CfzlqPUcWRDnZ4iGGMhZNpE4='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | 1 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== |
2 | +[2021-09-08 18:19:16] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
3 | +[2021-09-08 18:19:16] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb | ||
4 | +{'data': None, 'json': {'userName': '111222', 'password': 'UQq2o0Q6W7XIaDqnez/Hyq3gDuBAZUuOnWAy97RA2s99LIQtVP4tTXJdRLOWCNfF3dS+elBLSKoAPfXygUuoPFrSODa6QYZQ3L4Aufl3fk4wn9ei3l2WczKg0rc030FbxfDUBzKL7QMfjRp2oCfpSH+/r6fVPM1UcZXWRhoxfnU='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | ||
4 | 5 | ||
5 | -[2021-08-27 14:56:04] [INFO] : ====================================================================================== | ||
6 | -[2021-08-27 14:56:04] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb | ||
7 | -{'data': None, 'json': {'userName': '哈尔滨田太子', 'password': 'X8+561DIatg517K/JNe3l4hqIjDSq+r7gTsW4xgP4d0ai6N6gjOD0tn1If8rr54HrYZ//XRY3jdL++cIz5z+HyP5eMD+igf6v+a2W4j8p/IRJsP9v6R3q4Rz35gUoOKalURfJdkQFyzZf7E3X3esOiPMR7n927vUdjIJVAYZU10='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}} | 6 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== |
7 | +[2021-09-08 18:19:16] [INFO] : http://test.uap.diligrp.com/login/login.action | ||
8 | +[2021-09-08 18:19:16] [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} | ||
8 | 10 | ||
9 | -[2021-08-27 14:56:05] [INFO] : ====================================================================================== | ||
10 | -[2021-08-27 14:56:05] [INFO] : http://test.uap.diligrp.com/login/login.action | ||
11 | -{'data': b'userName=sy_chen&password=123456', '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} | 11 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== |
12 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/businessChargeItem/listBusinessChargeItem | ||
13 | +{"marketId": 15, "businessType": "501"} | ||
14 | +{} | ||
15 | + | ||
16 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== | ||
17 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/card-web/accountQuery/simpleInfo.action | ||
18 | +None | ||
19 | +{'params': {'cardNo': '888800010592'}} | ||
20 | + | ||
21 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== | ||
22 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree | ||
23 | +{"marketId": 15, "keyword": "\u82f9\u679c", "state": 1} | ||
24 | +{} | ||
25 | + | ||
26 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== | ||
27 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/city/listByKeywordsWithCityCode | ||
28 | +{"allLevelKeyword": "\u91d1\u725b\u533a"} | ||
29 | +{} | ||
30 | + | ||
31 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== | ||
32 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/district/search | ||
33 | +{"marketId": 15, "nameLike": "\u897f\u533a"} | ||
34 | +{} | ||
35 | + | ||
36 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== | ||
37 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee | ||
38 | +{"businessType": "501", "chargeItem": 518, "marketId": 15} | ||
39 | +{} | ||
40 | + | ||
41 | +[2021-09-08 18:19:16] [INFO] : ====================================================================================== | ||
42 | +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee | ||
43 | +{"businessType": "501", "chargeItem": 520, "marketId": 15} | ||
44 | +{} | ||
45 | + | ||
46 | +[2021-09-08 18:19:17] [INFO] : ====================================================================================== | ||
47 | +[2021-09-08 18:19:17] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save | ||
48 | +{"accountId": 107667, "cardNo": "888800010592", "customerId": 141963, "customerCode": "00131684", "customerName": "\u676d\u679c\u5ba2\u6237\u957f\u6b4c\u4e00", "fixedphoneNumber": null, "mobilephoneNumber": "18080018009", "identityCardAddress": "", "identityCardNo": "110101202108265741", "identityCardType": "ID", "registerDetailDtoList": [{"id": 0, "areaId": 272, "areaName": "\u897f\u533a", "quantity": 0, "productId": 374690, "registerRecordId": 0, "remark": null, "weight": "50", "weightType": 0, "created": null, "createdById": 0, "createdByName": null, "createdByDepartmentId": 0, "createdByDepartmentName": null, "registerCertificateList": null, "product": null, "registerCertificateDtoList": null, "productDto": {"id": 0, "originId": 510106, "originName": "\u91d1\u725b\u533a", "pieceWeight": 0, "categoryId": 374690, "categoryCode": 374690, "categoryName": "\u82f9\u679c", "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 | +{} | ||
12 | 50 | ||
13 | -[2021-08-27 14:56:05] [INFO] : 发送邮件 | ||
14 | -[2021-08-27 14:56:08] [INFO] : 邮件发送完毕 |
testcase/hg/test_batch/__init__.py
0 → 100644
testcase/hg/tradingOrder/test_createAndTrade.py
1 | import unittest | 1 | import unittest |
2 | import urllib3 | 2 | import urllib3 |
3 | -from commons.MySession import hg,my | ||
4 | -from commons.api.hg.transaction import createAndTrade | ||
5 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | 3 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
6 | -import commons.ConfigDB as db | ||
7 | -crat = createAndTrade() | 4 | +from commons.MySession import hg,my |
5 | +from commons import ConfigDB as db | ||
6 | +from commons.api.hg.transaction.createAndTrade import createAndTrade | ||
7 | +from commons.basic.registerRecord_save import registerRecord_save | ||
8 | +creat = createAndTrade() | ||
9 | +r = registerRecord_save() | ||
8 | 10 | ||
9 | """ | 11 | """ |
10 | 创建大客户订单 | 12 | 创建大客户订单 |
@@ -14,19 +16,59 @@ class test_createAndTrade(unittest.TestCase): | @@ -14,19 +16,59 @@ class test_createAndTrade(unittest.TestCase): | ||
14 | "创建大客户订单" | 16 | "创建大客户订单" |
15 | @classmethod | 17 | @classmethod |
16 | def setUpClass(cls): | 18 | def setUpClass(cls): |
17 | - pass | ||
18 | - def setUp(self): | ||
19 | - pass | 19 | + # 新增一个进门批号单 |
20 | + # 新增一个进门批号单 | ||
21 | + # cls.aaa = db.mysql_selectOne(''' | ||
22 | + # SELECT | ||
23 | + # aua.account_id,auc.card_no,aua.customer_id,aua.customer_code,aua.customer_name,aua.customer_certificate_number | ||
24 | + # FROM | ||
25 | + # ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id ) | ||
26 | + # LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id | ||
27 | + # ORDER BY aua.account_id DESC LIMIT 1 | ||
28 | + # ''') | ||
29 | + cls.aaa = db.mysql_selectOne(''' | ||
30 | + SELECT | ||
31 | + aua.account_id AS "账号id", | ||
32 | + auc.card_no AS "园区卡号", | ||
33 | + aua.customer_id AS "客户id", | ||
34 | + aua.customer_code AS "客户code", | ||
35 | + aua.customer_name AS "客户姓名", | ||
36 | + aua.customer_certificate_number AS "客户身份证号码", | ||
37 | + aua.hold_contacts_phone AS "持卡人电话" | ||
38 | +FROM | ||
39 | + ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id ) | ||
40 | + LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id | ||
41 | +WHERE | ||
42 | + sp.customer_id = 141962 AND sp.market_id =15 | ||
43 | +ORDER BY | ||
44 | + aua.account_id DESC | ||
45 | + LIMIT 1 | ||
46 | + ''') | ||
47 | + body2 = r.body.copy() | ||
48 | + body2["accountId"] = str(cls.aaa[0]) | ||
49 | + body2["cardNo"] = str(cls.aaa[1]) | ||
50 | + body2["customerId"] = str(cls.aaa[2]) | ||
51 | + body2["customerCode"] = str(cls.aaa[3]) | ||
52 | + body2["customerName"] = str(cls.aaa[4]) | ||
53 | + body2["identityCardNo"] = str(cls.aaa[5]) | ||
54 | + body2["mobilephoneNumber"] = str(cls.aaa[6]) | ||
55 | + print("士大夫但是",body2) | ||
56 | + print("水电费",cls.aaa) | ||
57 | + print("撒地方",type(cls.aaa)) | ||
58 | + re = hg.post(url = r.url, headers = r.header, json = body2,proxies = hg.proxies) | ||
59 | + # 获取批号 | ||
60 | + # cls.batch = re.json()["data"]["batchCode"] | ||
61 | + # return cls.batch | ||
20 | 62 | ||
63 | + @unittest.case_mark(my.mark()) | ||
21 | def test_createAndTrade_01(self): | 64 | def test_createAndTrade_01(self): |
22 | - "创建大客户借款单" | ||
23 | - | ||
24 | - @unittest.case_mark(my.mark()) | ||
25 | - def test_vipCustomerLoan_details_01(self): | ||
26 | - "大客户借款-详情:选择指定大客户借款数据,点击查看" | ||
27 | - re = hg.post(url=crat.url, headers=crat.header, json=crat.body) | ||
28 | - print(re.json()) | ||
29 | - self.assertTrue("'操作成功'" in str(re.json()).replace(" ", "")) | 65 | + "大客户创建订单" |
66 | + body = creat.body.copy() | ||
67 | + body["orderItemList"][0]["batchCode"] = self.batch | ||
68 | + re1 = hg.post(url = creat.url, headers = creat.header, json = body,proxies = hg.proxies) | ||
69 | + print(re1.json()) | ||
70 | + self.assertEqual(re1.status_code, 200) | ||
71 | + self.assertTrue("'操作成功'" in str(re1.json()).replace(" ", "")) | ||
30 | 72 | ||
31 | 73 | ||
32 | @classmethod | 74 | @classmethod |