Commit 598c12f3b16c70d5ce9aa7842e1b43de4937d0ac
Merge remote-tracking branch 'origin/master'
# Conflicts: # report/test.log
Showing
35 changed files
with
605 additions
and
563 deletions
commons/MySession.py
... | ... | @@ -56,8 +56,9 @@ class mysession(requests.Session): |
56 | 56 | self.firmid={"group":"1","hd":"2","cd":"3","qqhe":"4","mdj":"5","gy":"6","cc":"7","sg":"8","sy":"9"} |
57 | 57 | self.user={} |
58 | 58 | |
59 | - def cliLogin(self): | |
60 | - self.webHeaders, self.clientHeaders, self.userInfo = cliSession().loginUser() | |
59 | + def cliLogin(self,user="sy_userName_01"): | |
60 | + self.webHeaders, self.clientHeaders, self.userInfo = cliSession().loginUser(user=user) | |
61 | + return self | |
61 | 62 | |
62 | 63 | def get_session(self, account, **kwargs): |
63 | 64 | "如下代码,可以通过配置文件来控制登录的账户session" |
... | ... | @@ -260,7 +261,14 @@ class mysession(requests.Session): |
260 | 261 | |
261 | 262 | my = mysession() |
262 | 263 | my.set_mark() |
263 | -my.cliLogin() | |
264 | + | |
265 | +# 沈阳客户端session | |
266 | +sessionSy = mysession().cliLogin("sy_userName_01") | |
267 | +# 哈尔滨客户端session | |
268 | +sessionHeb = mysession().cliLogin("hd_userName_01") | |
269 | +# print(sessionSy.userInfo) | |
270 | +# print(sessionHeb.userInfo) | |
271 | + | |
264 | 272 | sy1=mysession().get_session_client("sy_user01") |
265 | 273 | heb=mysession().get_session_client("heb_user01") |
266 | 274 | # sg=mysession().get_session_client("sg_user01") | ... | ... |
commons/api/entranceFeeBillList/apiDemo.py
... | ... | @@ -11,24 +11,27 @@ |
11 | 11 | |
12 | 12 | import json,time,random |
13 | 13 | from commons.scripts import dealContentType as dct |
14 | -from commons.MySession import my | |
14 | +from commons.MySession import my,sessionHeb | |
15 | 15 | from commons.basic import getLookupList as gLL |
16 | 16 | |
17 | -def get_carType(session=None,host="",**kwargs): | |
17 | +global mk_sign | |
18 | +mk_sign = "haaab" | |
19 | + | |
20 | +def get_carType(host="",**kwargs): | |
18 | 21 | """车型获取""" |
19 | 22 | url = host + "/jmsf-web/api/jmsf/query/listCarType" |
20 | 23 | data = {"businessCode":"jmsf"} |
21 | 24 | headers = dct.jsonCode() |
22 | 25 | data = dict(data, **kwargs) |
23 | - res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
26 | + res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
24 | 27 | return res |
25 | 28 | |
26 | -def get_listCategoryByCondition(session=None,host="",**kwargs): | |
29 | +def get_listCategoryByCondition(host="",**kwargs): | |
27 | 30 | """商品获取""" |
28 | 31 | url = host + "/assets-service/api/cusCategory/getTree" |
29 | 32 | # marketId = my.userInfo()[] |
30 | 33 | data = {"marketId":9,"state":1,"keyword":"蔬菜"} |
31 | 34 | headers = dct.jsonCode() |
32 | 35 | data = dict(data, **kwargs) |
33 | - res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
36 | + res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
34 | 37 | return res |
35 | 38 | \ No newline at end of file | ... | ... |
commons/api/entranceFeeBillList/entranceFeeBillList.py
... | ... | @@ -12,11 +12,11 @@ |
12 | 12 | import json,time,random,re |
13 | 13 | from commons.scripts import dealContentType as dct |
14 | 14 | from commons.scripts import jsonToUrlcode |
15 | -from commons.MySession import my | |
15 | +# from commons.MySession import my | |
16 | 16 | from bs4 import BeautifulSoup |
17 | 17 | import urllib.parse |
18 | 18 | |
19 | -def listPage(host="",attrName="收费单号",attrValue=None,**kwargs): | |
19 | +def listPage(session=None,host="",attrName="收费单号",attrValue=None,**kwargs): | |
20 | 20 | """ |
21 | 21 | 进门单列表查询接口 |
22 | 22 | :param kwargs: |
... | ... | @@ -67,45 +67,45 @@ def listPage(host="",attrName="收费单号",attrValue=None,**kwargs): |
67 | 67 | data["metadata[status]"] = json.dumps(data["metadata[status]"]) |
68 | 68 | |
69 | 69 | # 请求接口 |
70 | - res = my.useHeadersRequests(method="POST", url=url, data=data, headers=headers) | |
70 | + res = session.useHeadersRequests(method="POST", url=url, data=data, headers=headers) | |
71 | 71 | return res |
72 | 72 | |
73 | -def get_OrderDetails(host="",orderId=None): | |
73 | +def get_OrderDetails(session=None,host="",orderId=None): | |
74 | 74 | """获取订单详情""" |
75 | 75 | headers = dct.urlCode() |
76 | 76 | url = host + f"/entranceFeeBill/pay/{orderId}.action" |
77 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
77 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
78 | 78 | return res |
79 | 79 | |
80 | -def get_orderUnfreeze(host="",orderId=None): | |
80 | +def get_orderUnfreeze(session=None,host="",orderId=None): | |
81 | 81 | """获取订单详情""" |
82 | 82 | headers = dct.urlCode() |
83 | 83 | url = host + f"/entranceFeeBill/unfreeze/{orderId}.action" |
84 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
84 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
85 | 85 | return res |
86 | 86 | |
87 | -def get_orderView(host="",orderId=None): | |
87 | +def get_orderView(session=None,host="",orderId=None): | |
88 | 88 | """获取订单详情""" |
89 | 89 | headers = dct.urlCode() |
90 | 90 | url = host + f"/entranceFeeBill/view/{orderId}.action" |
91 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
91 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
92 | 92 | return res |
93 | 93 | |
94 | -def get_icCheck(host="",ic=None): | |
94 | +def get_icCheck(session=None,host="",ic=None): | |
95 | 95 | """进门缴费单详情页面刷卡刷卡""" |
96 | 96 | headers = dct.urlCode() |
97 | 97 | url = host + f"/api/jmsf/ajax/icCheck?ic={ic}" |
98 | - res = my.useHeadersRequests("get", url=url,headers=headers) | |
98 | + res = session.useHeadersRequests("get", url=url,headers=headers) | |
99 | 99 | return res |
100 | 100 | |
101 | -def get_city(host="",name=None): | |
101 | +def get_city(session=None,host="",name=None): | |
102 | 102 | """进门缴费单缴费金额计算""" |
103 | 103 | headers = dct.urlCode() |
104 | 104 | url = host + f"/api/jmsf/ajax/city/?name={name}&query={name}" |
105 | - res = my.useHeadersRequests("get", url=url,headers=headers) | |
105 | + res = session.useHeadersRequests("get", url=url,headers=headers) | |
106 | 106 | return res |
107 | 107 | |
108 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
108 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
109 | 109 | """缴费金额获取 |
110 | 110 | :params kwargs: |
111 | 111 | protocolId: |
... | ... | @@ -216,10 +216,10 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
216 | 216 | data["autocomplete-cartype"]=autocompletecartype |
217 | 217 | data = dict(data,**kwargs) |
218 | 218 | print("get_calculateRes",data) |
219 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
219 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
220 | 220 | return res |
221 | 221 | |
222 | -def do_doPay(host="",autocompletecartype=None,fee_str="",**kwargs): | |
222 | +def do_doPay(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
223 | 223 | """进门单缴费""" |
224 | 224 | url = host + "/entranceTrade/doPay.action" |
225 | 225 | headers = dct.urlCode() |
... | ... | @@ -260,14 +260,14 @@ def do_doPay(host="",autocompletecartype=None,fee_str="",**kwargs): |
260 | 260 | |
261 | 261 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
262 | 262 | print("================开始请求================") |
263 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
263 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
264 | 264 | return res |
265 | 265 | |
266 | 266 | |
267 | 267 | |
268 | -def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111", | |
268 | +def do_payOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111", | |
269 | 269 | ic=888810032426): |
270 | - a = listPage(host=host, attrName=attrName, attrValue=attrValue) | |
270 | + a = listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
271 | 271 | print("listPage", a.json()) |
272 | 272 | orderId = a.json()["rows"][0]["id"] |
273 | 273 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -275,7 +275,7 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" |
275 | 275 | print(orderId) |
276 | 276 | |
277 | 277 | # # 订单详情获取 |
278 | - resOrderDetails = get_OrderDetails(host=host, orderId=orderId) | |
278 | + resOrderDetails = get_OrderDetails(session=session,host=host, orderId=orderId) | |
279 | 279 | |
280 | 280 | # 正则取值 |
281 | 281 | regionId = re.findall('<option value="(.*?)" bind-name="', resOrderDetails.text)[0] |
... | ... | @@ -330,7 +330,7 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" |
330 | 330 | |
331 | 331 | |
332 | 332 | # 用户信息获取 |
333 | - res = get_icCheck(host=host, ic=ic) | |
333 | + res = get_icCheck(session=session,host=host, ic=ic) | |
334 | 334 | print(res.text) |
335 | 335 | customerId = res.json()["data"]["aInfo"]["customerId"] |
336 | 336 | customerName = res.json()["data"]["aInfo"]["customerName"] |
... | ... | @@ -338,7 +338,7 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" |
338 | 338 | mobile = res.json()["data"]["aInfo"]["mobile"] |
339 | 339 | |
340 | 340 | # 省市区获取 |
341 | - res = get_city(host=host, name="万州") | |
341 | + res = get_city(session=session,host=host, name="万州") | |
342 | 342 | print('res.json()["suggestions"]',res.json()["suggestions"]) |
343 | 343 | originId = res.json()["suggestions"][0]["id"] |
344 | 344 | parentId = res.json()["suggestions"][0]["parentId"] |
... | ... | @@ -352,7 +352,7 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" |
352 | 352 | print("categoryId",categoryId) |
353 | 353 | |
354 | 354 | # 获取缴费金额 |
355 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
355 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
356 | 356 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
357 | 357 | status=status, |
358 | 358 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -399,13 +399,13 @@ def do_payOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号" |
399 | 399 | freezeMoneySymbol = fee_int |
400 | 400 | comparisonFreezeAmount = fee_int |
401 | 401 | modified = created |
402 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
402 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
403 | 403 | marketFlag = firmCode |
404 | 404 | itemReceivableAmount = receivable |
405 | 405 | receivableAmount = receivable |
406 | 406 | tareWeightDate = tareWeightDate |
407 | 407 | |
408 | - aa = do_doPay(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
408 | + aa = do_doPay(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
409 | 409 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
410 | 410 | source=source, |
411 | 411 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationDoAmend.py
... | ... | @@ -12,21 +12,20 @@ |
12 | 12 | import json,time,random,re |
13 | 13 | from commons.scripts import dealContentType as dct |
14 | 14 | from commons.scripts import jsonToUrlcode |
15 | -from commons.MySession import my | |
16 | 15 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 16 | from bs4 import BeautifulSoup |
18 | 17 | import urllib.parse |
19 | 18 | |
20 | 19 | |
21 | -def get_orderAmend(host="",orderId=None): | |
20 | +def get_orderAmend(session=None,host="",orderId=None): | |
22 | 21 | """获å–订å•è¯¦æƒ…""" |
23 | 22 | headers = dct.urlCode() |
24 | 23 | url = host + f"/entranceFeeBill/amend/{orderId}.action" |
25 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
24 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
26 | 25 | return res |
27 | 26 | |
28 | 27 | |
29 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
28 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
30 | 29 | """缴费金é¢èŽ·å– |
31 | 30 | :params kwargs: |
32 | 31 | protocolId: |
... | ... | @@ -136,10 +135,10 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
136 | 135 | data["autocomplete-cartype"]=autocompletecartype |
137 | 136 | data = dict(data,**kwargs) |
138 | 137 | print("get_calculateRes",data) |
139 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
138 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
140 | 139 | return res |
141 | 140 | |
142 | -def do_doAmend(host="",autocompletecartype=None,fee_str="",**kwargs): | |
141 | +def do_doAmend(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
143 | 142 | """进门å•ç¼´è´¹""" |
144 | 143 | url = host + "/entranceFeeBill/doAmend.action" |
145 | 144 | headers = dct.urlCode() |
... | ... | @@ -174,12 +173,12 @@ def do_doAmend(host="",autocompletecartype=None,fee_str="",**kwargs): |
174 | 173 | |
175 | 174 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
176 | 175 | print("================开始请求================") |
177 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
176 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
178 | 177 | return res |
179 | 178 | |
180 | -def do_amendOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å·",attrValue="202108060900032",pwd="111111", | |
179 | +def do_amendOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å·",attrValue="202108060900032",pwd="111111", | |
181 | 180 | ic=888810032426): |
182 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
181 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
183 | 182 | print("listPage", a.json()) |
184 | 183 | orderId = a.json()["rows"][0]["id"] |
185 | 184 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -187,7 +186,7 @@ def do_amendOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
187 | 186 | print(orderId) |
188 | 187 | |
189 | 188 | # # 订å•è¯¦æƒ…èŽ·å– |
190 | - resOrderDetails = get_orderAmend(host=host, orderId=orderId) | |
189 | + resOrderDetails = get_orderAmend(session=session,host=host, orderId=orderId) | |
191 | 190 | # print(resOrderDetails.text) |
192 | 191 | |
193 | 192 | # bså–值 |
... | ... | @@ -259,7 +258,7 @@ def do_amendOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
259 | 258 | ic = orderDetailsDict["ic"] |
260 | 259 | |
261 | 260 | # çœå¸‚åŒºèŽ·å– |
262 | - res = eFBL.get_city(host=host, name="万州") | |
261 | + res = eFBL.get_city(session=session,host=host, name="万州") | |
263 | 262 | # print(res.text) |
264 | 263 | originId = res.json()["suggestions"][0]["id"] |
265 | 264 | |
... | ... | @@ -269,7 +268,7 @@ def do_amendOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
269 | 268 | modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
270 | 269 | |
271 | 270 | # 获å–ç¼´è´¹é‡‘é¢ |
272 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
271 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
273 | 272 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
274 | 273 | status=status, |
275 | 274 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -315,13 +314,13 @@ def do_amendOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
315 | 314 | freezeMoneySymbol = fee_int |
316 | 315 | comparisonFreezeAmount = fee_int |
317 | 316 | modified = created |
318 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
317 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
319 | 318 | marketFlag = firmCode |
320 | 319 | itemReceivableAmount = receivable |
321 | 320 | receivableAmount = receivable |
322 | 321 | tareWeightDate = tareWeightDate |
323 | 322 | |
324 | - aa = do_doAmend(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
323 | + aa = do_doAmend(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
325 | 324 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
326 | 325 | source=source, |
327 | 326 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationDoCorrect.py
... | ... | @@ -12,21 +12,20 @@ |
12 | 12 | import json,time,random,re |
13 | 13 | from commons.scripts import dealContentType as dct |
14 | 14 | from commons.scripts import jsonToUrlcode |
15 | -from commons.MySession import my | |
16 | 15 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 16 | from bs4 import BeautifulSoup |
18 | 17 | import urllib.parse |
19 | 18 | |
20 | 19 | |
21 | -def get_orderCorrect(host="",orderId=None): | |
20 | +def get_orderCorrect(session=None,host="",orderId=None): | |
22 | 21 | """获取订单详情""" |
23 | 22 | headers = dct.urlCode() |
24 | 23 | url = host + f"/entranceFeeBill/correct/{orderId}.action" |
25 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
24 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
26 | 25 | return res |
27 | 26 | |
28 | 27 | |
29 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
28 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
30 | 29 | """缴费金额获取 |
31 | 30 | :params kwargs: |
32 | 31 | protocolId: |
... | ... | @@ -136,10 +135,10 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
136 | 135 | data["autocomplete-cartype"]=autocompletecartype |
137 | 136 | data = dict(data,**kwargs) |
138 | 137 | print("get_calculateRes",data) |
139 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
138 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
140 | 139 | return res |
141 | 140 | |
142 | -def do_doCorrect(host="",autocompletecartype=None,fee_str="",**kwargs): | |
141 | +def do_doCorrect(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
143 | 142 | """进门单缴费""" |
144 | 143 | url = host + "/entranceFeeBill/doCorrect.action" |
145 | 144 | headers = dct.urlCode() |
... | ... | @@ -176,11 +175,11 @@ def do_doCorrect(host="",autocompletecartype=None,fee_str="",**kwargs): |
176 | 175 | |
177 | 176 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
178 | 177 | print("================开始请求================") |
179 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
178 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
180 | 179 | return res |
181 | 180 | |
182 | -def do_correctOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111"): | |
183 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
181 | +def do_correctOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111"): | |
182 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
184 | 183 | print("listPage", a.json()) |
185 | 184 | orderId = a.json()["rows"][0]["id"] |
186 | 185 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -188,7 +187,7 @@ def do_correctOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
188 | 187 | print(orderId) |
189 | 188 | |
190 | 189 | # # 订单详情获取 |
191 | - resOrderDetails = get_orderCorrect(host=host, orderId=orderId) | |
190 | + resOrderDetails = get_orderCorrect(session=session,host=host, orderId=orderId) | |
192 | 191 | # print(resOrderDetails.text) |
193 | 192 | |
194 | 193 | # bs取值 |
... | ... | @@ -252,7 +251,7 @@ def do_correctOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
252 | 251 | |
253 | 252 | |
254 | 253 | # 用户信息获取 |
255 | - # res = eFBL.get_icCheck(host=host, ic=ic) | |
254 | + # res = eFBL.get_icCheck(session=session,host=host, ic=ic) | |
256 | 255 | # print(res.text) |
257 | 256 | # customerId = res.json()["data"]["aInfo"]["customerId"] |
258 | 257 | # customerName = res.json()["data"]["aInfo"]["customerName"] |
... | ... | @@ -265,7 +264,7 @@ def do_correctOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
265 | 264 | ic = orderDetailsDict["ic"] |
266 | 265 | |
267 | 266 | # 省市区获取 |
268 | - res = eFBL.get_city(host=host, name="万州") | |
267 | + res = eFBL.get_city(session=session,host=host, name="万州") | |
269 | 268 | print(res.text) |
270 | 269 | originId = res.json()["suggestions"][0]["id"] |
271 | 270 | |
... | ... | @@ -275,7 +274,7 @@ def do_correctOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
275 | 274 | modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
276 | 275 | |
277 | 276 | # 获取缴费金额 |
278 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
277 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
279 | 278 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
280 | 279 | status=status, |
281 | 280 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -335,13 +334,13 @@ def do_correctOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
335 | 334 | freezeMoneySymbol = fee_int |
336 | 335 | comparisonFreezeAmount = fee_int |
337 | 336 | modified = created |
338 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
337 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
339 | 338 | marketFlag = firmCode |
340 | 339 | itemReceivableAmount = receivable |
341 | 340 | receivableAmount = receivable |
342 | 341 | tareWeightDate = tareWeightDate |
343 | 342 | |
344 | - res = do_doCorrect(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
343 | + res = do_doCorrect(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
345 | 344 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
346 | 345 | source=source, |
347 | 346 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationDoFreeze.py
... | ... | @@ -12,12 +12,11 @@ |
12 | 12 | import json,time,random,re |
13 | 13 | from commons.scripts import dealContentType as dct |
14 | 14 | from commons.scripts import jsonToUrlcode |
15 | -from commons.MySession import my | |
16 | 15 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 16 | from bs4 import BeautifulSoup |
18 | 17 | import urllib.parse |
19 | 18 | |
20 | -def do_doFreeze(host="",autocompletecartype=None,fee_str="",**kwargs): | |
19 | +def do_doFreeze(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
21 | 20 | """进门å•ç¼´è´¹""" |
22 | 21 | url = host + "/entranceTrade/doFreeze.action" |
23 | 22 | headers = dct.urlCode() |
... | ... | @@ -57,12 +56,12 @@ def do_doFreeze(host="",autocompletecartype=None,fee_str="",**kwargs): |
57 | 56 | |
58 | 57 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
59 | 58 | print("================开始请求================") |
60 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
59 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
61 | 60 | return res |
62 | 61 | |
63 | -def do_freezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å·",attrValue="202108060900032",pwd="111111", | |
62 | +def do_freezeOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å·",attrValue="202108060900032",pwd="111111", | |
64 | 63 | ic=888810032426): |
65 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
64 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
66 | 65 | print("listPage", a.json()) |
67 | 66 | orderId = a.json()["rows"][0]["id"] |
68 | 67 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -70,7 +69,7 @@ def do_freezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
70 | 69 | print(orderId) |
71 | 70 | |
72 | 71 | # # 订å•è¯¦æƒ…èŽ·å– |
73 | - resOrderDetails = eFBL.get_OrderDetails(host=host, orderId=orderId) | |
72 | + resOrderDetails = eFBL.get_OrderDetails(session=session,host=host, orderId=orderId) | |
74 | 73 | |
75 | 74 | # æ£åˆ™å–值 |
76 | 75 | regionId = re.findall('<option value="(.*?)" bind-name="', resOrderDetails.text)[0] |
... | ... | @@ -125,7 +124,7 @@ def do_freezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
125 | 124 | |
126 | 125 | |
127 | 126 | # 用户信æ¯èŽ·å– |
128 | - res = eFBL.get_icCheck(host=host, ic=ic) | |
127 | + res = eFBL.get_icCheck(session=session,host=host, ic=ic) | |
129 | 128 | print(res.text) |
130 | 129 | customerId = res.json()["data"]["aInfo"]["customerId"] |
131 | 130 | customerName = res.json()["data"]["aInfo"]["customerName"] |
... | ... | @@ -133,7 +132,7 @@ def do_freezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
133 | 132 | mobile = res.json()["data"]["aInfo"]["mobile"] |
134 | 133 | |
135 | 134 | # çœå¸‚åŒºèŽ·å– |
136 | - res = eFBL.get_city(host=host, name="万州") | |
135 | + res = eFBL.get_city(session=session,host=host, name="万州") | |
137 | 136 | print(res.text) |
138 | 137 | originId = res.json()["suggestions"][0]["id"] |
139 | 138 | parentId = res.json()["suggestions"][0]["parentId"] |
... | ... | @@ -145,7 +144,7 @@ def do_freezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
145 | 144 | modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
146 | 145 | |
147 | 146 | # 获å–ç¼´è´¹é‡‘é¢ |
148 | - res = eFBL.get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
147 | + res = eFBL.get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
149 | 148 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
150 | 149 | status=status, |
151 | 150 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -192,13 +191,13 @@ def do_freezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å |
192 | 191 | freezeMoneySymbol = fee_int |
193 | 192 | comparisonFreezeAmount = fee_int |
194 | 193 | modified = created |
195 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
194 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
196 | 195 | marketFlag = firmCode |
197 | 196 | itemReceivableAmount = receivable |
198 | 197 | receivableAmount = receivable |
199 | 198 | tareWeightDate = tareWeightDate |
200 | 199 | |
201 | - aa = do_doFreeze(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
200 | + aa = do_doFreeze(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
202 | 201 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
203 | 202 | source=source, |
204 | 203 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationDoInvalid.py
... | ... | @@ -18,15 +18,15 @@ from bs4 import BeautifulSoup |
18 | 18 | import urllib.parse |
19 | 19 | |
20 | 20 | |
21 | -def get_orderInvalid(host="",orderId=None): | |
21 | +def get_orderInvalid(session=None,host="",orderId=None): | |
22 | 22 | """获取订单详情""" |
23 | 23 | headers = dct.urlCode() |
24 | 24 | url = host + f"/entranceFeeBill/invalid/{orderId}.action" |
25 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
25 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
26 | 26 | return res |
27 | 27 | |
28 | 28 | |
29 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
29 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
30 | 30 | """缴费金额获取 |
31 | 31 | :params kwargs: |
32 | 32 | protocolId: |
... | ... | @@ -136,10 +136,10 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
136 | 136 | data["autocomplete-cartype"]=autocompletecartype |
137 | 137 | data = dict(data,**kwargs) |
138 | 138 | print("get_calculateRes",data) |
139 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
139 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
140 | 140 | return res |
141 | 141 | |
142 | -def do_doInvalid(host="",autocompletecartype=None,fee_str="",**kwargs): | |
142 | +def do_doInvalid(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
143 | 143 | """进门单缴费""" |
144 | 144 | url = host + "/entranceFeeBill/doInvalid.action" |
145 | 145 | headers = dct.urlCode() |
... | ... | @@ -169,12 +169,12 @@ def do_doInvalid(host="",autocompletecartype=None,fee_str="",**kwargs): |
169 | 169 | data = dict(data, **kwargs) |
170 | 170 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
171 | 171 | print("================开始请求================") |
172 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
172 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
173 | 173 | return res |
174 | 174 | |
175 | -def do_invalidOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111", | |
175 | +def do_invalidOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="111111", | |
176 | 176 | ic=888810032426): |
177 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
177 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
178 | 178 | print("listPage", a.json()) |
179 | 179 | orderId = a.json()["rows"][0]["id"] |
180 | 180 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -182,7 +182,7 @@ def do_invalidOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
182 | 182 | print(orderId) |
183 | 183 | |
184 | 184 | # # 订单详情获取 |
185 | - resOrderDetails = get_orderInvalid(host=host, orderId=orderId) | |
185 | + resOrderDetails = get_orderInvalid(session=session,host=host, orderId=orderId) | |
186 | 186 | |
187 | 187 | # bs取值 |
188 | 188 | orderDetailsList = BeautifulSoup(resOrderDetails.text, "html.parser").findAll("input") |
... | ... | @@ -232,7 +232,7 @@ def do_invalidOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
232 | 232 | |
233 | 233 | |
234 | 234 | # # 用户信息获取 |
235 | - # res = eFBL.get_icCheck(host=host, ic=ic) | |
235 | + # res = eFBL.get_icCheck(session=session,host=host, ic=ic) | |
236 | 236 | # print(res.text) |
237 | 237 | # customerId = res.json()["data"]["aInfo"]["customerId"] |
238 | 238 | # customerName = res.json()["data"]["aInfo"]["customerName"] |
... | ... | @@ -245,7 +245,7 @@ def do_invalidOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
245 | 245 | ic = orderDetailsDict["ic"] |
246 | 246 | |
247 | 247 | # 省市区获取 |
248 | - res = eFBL.get_city(host=host, name="万州") | |
248 | + res = eFBL.get_city(session=session,host=host, name="万州") | |
249 | 249 | print(res.text) |
250 | 250 | originId = res.json()["suggestions"][0]["id"] |
251 | 251 | |
... | ... | @@ -255,7 +255,7 @@ def do_invalidOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
255 | 255 | modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
256 | 256 | |
257 | 257 | # 获取缴费金额 |
258 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
258 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
259 | 259 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
260 | 260 | status=status, |
261 | 261 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -301,13 +301,13 @@ def do_invalidOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单 |
301 | 301 | freezeMoneySymbol = fee_int |
302 | 302 | comparisonFreezeAmount = fee_int |
303 | 303 | modified = created |
304 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
304 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
305 | 305 | marketFlag = firmCode |
306 | 306 | itemReceivableAmount = receivable |
307 | 307 | receivableAmount = receivable |
308 | 308 | tareWeightDate = tareWeightDate |
309 | 309 | |
310 | - aa = do_doInvalid(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
310 | + aa = do_doInvalid(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
311 | 311 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
312 | 312 | source=source, |
313 | 313 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationDoUndo.py
... | ... | @@ -17,14 +17,14 @@ from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 17 | from bs4 import BeautifulSoup |
18 | 18 | import urllib.parse |
19 | 19 | |
20 | -def get_orderRefund(host="",orderId=None): | |
20 | +def get_orderRefund(session=None,host="",orderId=None): | |
21 | 21 | """获取订单详情""" |
22 | 22 | headers = dct.urlCode() |
23 | 23 | url = host + f"/entranceFeeBill/refund/{orderId}.action" |
24 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
24 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
25 | 25 | return res |
26 | 26 | |
27 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
27 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
28 | 28 | """缴费金额获取""" |
29 | 29 | url = host + "/calculate/index.action" |
30 | 30 | headers = dct.urlCode() |
... | ... | @@ -52,11 +52,11 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
52 | 52 | data["autocomplete-cartype"]=autocompletecartype |
53 | 53 | data = dict(data,**kwargs) |
54 | 54 | print("get_calculateRes",data) |
55 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
55 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
56 | 56 | return res |
57 | 57 | |
58 | 58 | |
59 | -def do_doUndo(host="",autocompletecartype=None,fee_str="",**kwargs): | |
59 | +def do_doUndo(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
60 | 60 | """进门单缴费""" |
61 | 61 | url = host + "/entranceTrade/doUndo.action" |
62 | 62 | headers = dct.urlCode() |
... | ... | @@ -85,14 +85,14 @@ def do_doUndo(host="",autocompletecartype=None,fee_str="",**kwargs): |
85 | 85 | data = dict(data, **kwargs) |
86 | 86 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
87 | 87 | print("================开始请求================") |
88 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
88 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
89 | 89 | return res |
90 | 90 | |
91 | 91 | |
92 | 92 | |
93 | -def do_undoOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="", | |
93 | +def do_undoOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108060900032",pwd="", | |
94 | 94 | ic=888810032426): |
95 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
95 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
96 | 96 | print("listPage", a.json()) |
97 | 97 | orderId = a.json()["rows"][0]["id"] |
98 | 98 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -100,7 +100,7 @@ def do_undoOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号 |
100 | 100 | print(orderId) |
101 | 101 | |
102 | 102 | # # 订单详情获取 |
103 | - resOrderDetails = get_orderRefund(host=host, orderId=orderId) | |
103 | + resOrderDetails = get_orderRefund(session=session,host=host, orderId=orderId) | |
104 | 104 | |
105 | 105 | # 正则取值 |
106 | 106 | # regionId = re.findall('<option value="(.*?)" bind-name="', resOrderDetails.text)[0] |
... | ... | @@ -170,7 +170,7 @@ def do_undoOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号 |
170 | 170 | ic = orderDetailsDict["ic"] |
171 | 171 | |
172 | 172 | # 省市区获取 |
173 | - res = eFBL.get_city(host=host, name="万州") | |
173 | + res = eFBL.get_city(session=session,host=host, name="万州") | |
174 | 174 | print(res.text) |
175 | 175 | originId = res.json()["suggestions"][0]["id"] |
176 | 176 | # parentId = res.json()["suggestions"][0]["parentId"] |
... | ... | @@ -182,7 +182,7 @@ def do_undoOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号 |
182 | 182 | # modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
183 | 183 | |
184 | 184 | # 获取缴费金额 |
185 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
185 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
186 | 186 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
187 | 187 | status=status, |
188 | 188 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -229,14 +229,14 @@ def do_undoOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号 |
229 | 229 | chargeTotalAmountYuan = fee_int - int(discount_amount) |
230 | 230 | freezeMoneySymbol = fee_int |
231 | 231 | comparisonFreezeAmount = fee_int |
232 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
232 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
233 | 233 | marketFlag = firmCode |
234 | 234 | itemReceivableAmount = receivable |
235 | 235 | receivableAmount = receivable |
236 | 236 | tareWeightDate = tareWeightDate |
237 | 237 | print("categoryId2",categoryId) |
238 | 238 | |
239 | - aa = do_doUndo(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
239 | + aa = do_doUndo(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
240 | 240 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
241 | 241 | source=source, |
242 | 242 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationDoUpdate.py
... | ... | @@ -12,21 +12,21 @@ |
12 | 12 | import json,time,random,re |
13 | 13 | from commons.scripts import dealContentType as dct |
14 | 14 | from commons.scripts import jsonToUrlcode |
15 | -from commons.MySession import my | |
15 | +# from commons.MySession import my | |
16 | 16 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 17 | from bs4 import BeautifulSoup |
18 | 18 | import urllib.parse |
19 | 19 | |
20 | 20 | |
21 | -def get_orderUpdate(host="",orderId=None): | |
21 | +def get_orderUpdate(session=None,host="",orderId=None): | |
22 | 22 | """恥祕""" |
23 | 23 | headers = dct.urlCode() |
24 | 24 | url = host + f"/entranceFeeBill/update/{orderId}.action" |
25 | - res = my.useHeadersRequests("get", url=url, headers=headers) | |
25 | + res = session.useHeadersRequests("get", url=url, headers=headers) | |
26 | 26 | return res |
27 | 27 | |
28 | 28 | |
29 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
29 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
30 | 30 | """蝻渲晶 |
31 | 31 | :params kwargs: |
32 | 32 | protocolId: |
... | ... | @@ -136,10 +136,10 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
136 | 136 | data["autocomplete-cartype"]=autocompletecartype |
137 | 137 | data = dict(data,**kwargs) |
138 | 138 | print("get_calculateRes",data) |
139 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
139 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
140 | 140 | return res |
141 | 141 | |
142 | -def do_doUpdate(host="",autocompletecartype=None,fee_str="",**kwargs): | |
142 | +def do_doUpdate(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
143 | 143 | """餈撈韐""" |
144 | 144 | url = host + "/entranceFeeBill/doUpdate.action" |
145 | 145 | headers = dct.urlCode() |
... | ... | @@ -195,12 +195,12 @@ def do_doUpdate(host="",autocompletecartype=None,fee_str="",**kwargs): |
195 | 195 | |
196 | 196 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
197 | 197 | print("================撘憪窈瘙================") |
198 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
198 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
199 | 199 | return res |
200 | 200 | |
201 | -def do_updateOrder(host="http://test.jmsf.diligrp.com:8385",attrName="韐孵",attrValue="202108060900032",pwd="111111", | |
201 | +def do_updateOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="韐孵",attrValue="202108060900032",pwd="111111", | |
202 | 202 | ic=888810032426): |
203 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
203 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
204 | 204 | print("listPage", a.json()) |
205 | 205 | orderId = a.json()["rows"][0]["id"] |
206 | 206 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -208,7 +208,7 @@ def do_updateOrder(host="http://test.jmsf.diligrp.com:8385",attrName="韐孵 |
208 | 208 | print(orderId) |
209 | 209 | |
210 | 210 | # # 霈W祕 |
211 | - resOrderDetails = get_orderUpdate(host=host, orderId=orderId) | |
211 | + resOrderDetails = get_orderUpdate(session=session,host=host, orderId=orderId) | |
212 | 212 | |
213 | 213 | # 甇 |
214 | 214 | regionId = re.findall('<option value="(.*?)" bind-name="', resOrderDetails.text)[0] |
... | ... | @@ -269,7 +269,7 @@ def do_updateOrder(host="http://test.jmsf.diligrp.com:8385",attrName="韐孵 |
269 | 269 | |
270 | 270 | |
271 | 271 | # # 靽⊥ |
272 | - # res = eFBL.get_icCheck(host=host, ic=ic) | |
272 | + # res = eFBL.get_icCheck(session=session,host=host, ic=ic) | |
273 | 273 | # print(res.text) |
274 | 274 | # customerId = res.json()["data"]["aInfo"]["customerId"] |
275 | 275 | # customerName = res.json()["data"]["aInfo"]["customerName"] |
... | ... | @@ -282,7 +282,7 @@ def do_updateOrder(host="http://test.jmsf.diligrp.com:8385",attrName="韐孵 |
282 | 282 | ic = orderDetailsDict["ic"] |
283 | 283 | |
284 | 284 | # |
285 | - res = eFBL.get_city(host=host, name="銝") | |
285 | + res = eFBL.get_city(session=session,host=host, name="銝") | |
286 | 286 | print('res.json()["suggestions"]',res.json()["suggestions"]) |
287 | 287 | originId = res.json()["suggestions"][0]["id"] |
288 | 288 | parentId = res.json()["suggestions"][0]["parentId"] |
... | ... | @@ -294,7 +294,7 @@ def do_updateOrder(host="http://test.jmsf.diligrp.com:8385",attrName="韐孵 |
294 | 294 | modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
295 | 295 | |
296 | 296 | # 撈韐寥 |
297 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
297 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
298 | 298 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
299 | 299 | status=status, |
300 | 300 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -340,13 +340,13 @@ def do_updateOrder(host="http://test.jmsf.diligrp.com:8385",attrName="韐孵 |
340 | 340 | freezeMoneySymbol = fee_int |
341 | 341 | comparisonFreezeAmount = fee_int |
342 | 342 | modified = created |
343 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
343 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
344 | 344 | marketFlag = firmCode |
345 | 345 | itemReceivableAmount = receivable |
346 | 346 | receivableAmount = receivable |
347 | 347 | tareWeightDate = tareWeightDate |
348 | 348 | |
349 | - aa = do_doUpdate(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
349 | + aa = do_doUpdate(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
350 | 350 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
351 | 351 | source=source, |
352 | 352 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/entranceFeeBillList/operationUnfreeze.py
... | ... | @@ -18,7 +18,7 @@ from bs4 import BeautifulSoup |
18 | 18 | import urllib.parse |
19 | 19 | |
20 | 20 | |
21 | -def get_calculateRes(host="",autocompletecartype=None,**kwargs): | |
21 | +def get_calculateRes(session=None,host="",autocompletecartype=None,**kwargs): | |
22 | 22 | """缴费金é¢èŽ·å– |
23 | 23 | :params kwargs: |
24 | 24 | protocolId: |
... | ... | @@ -128,10 +128,10 @@ def get_calculateRes(host="",autocompletecartype=None,**kwargs): |
128 | 128 | data["autocomplete-cartype"]=autocompletecartype |
129 | 129 | data = dict(data,**kwargs) |
130 | 130 | print("get_calculateRes",data) |
131 | - res = my.useHeadersRequests("post", url=url,data=data,headers=headers) | |
131 | + res = session.useHeadersRequests("post", url=url,data=data,headers=headers) | |
132 | 132 | return res |
133 | 133 | |
134 | -def do_doUnfreeze(host="",autocompletecartype=None,fee_str="",**kwargs): | |
134 | +def do_doUnfreeze(session=None,host="",autocompletecartype=None,fee_str="",**kwargs): | |
135 | 135 | """进门å•ç¼´è´¹""" |
136 | 136 | url = host + "/entranceTrade/doUnfreeze.action" |
137 | 137 | headers = dct.urlCode() |
... | ... | @@ -160,12 +160,12 @@ def do_doUnfreeze(host="",autocompletecartype=None,fee_str="",**kwargs): |
160 | 160 | data = dict(data, **kwargs) |
161 | 161 | data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str |
162 | 162 | print("================开始请求================") |
163 | - res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
163 | + res = session.useHeadersRequests("post", url=url, data=data_uc, headers=headers) | |
164 | 164 | return res |
165 | 165 | |
166 | -def do_unfreezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å·",attrValue="202108060900032",pwd="111111", | |
166 | +def do_unfreezeOrder(session=None,host="http://test.jmsf.diligrp.com:8385",attrName="收费å•å·",attrValue="202108060900032",pwd="111111", | |
167 | 167 | ic=888810032426): |
168 | - a = eFBL.listPage(host=host, attrName=attrName, attrValue=attrValue) | |
168 | + a = eFBL.listPage(session=session,host=host, attrName=attrName, attrValue=attrValue) | |
169 | 169 | print("listPage", a.json()) |
170 | 170 | orderId = a.json()["rows"][0]["id"] |
171 | 171 | number = a.json()["rows"][0]["number"] |
... | ... | @@ -173,7 +173,7 @@ def do_unfreezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å |
173 | 173 | print(orderId) |
174 | 174 | |
175 | 175 | # # 订å•è¯¦æƒ…èŽ·å– |
176 | - resOrderDetails = eFBL.get_orderUnfreeze(host=host, orderId=orderId) | |
176 | + resOrderDetails = eFBL.get_orderUnfreeze(session=session,host=host, orderId=orderId) | |
177 | 177 | |
178 | 178 | # bså–值 |
179 | 179 | orderDetailsList = BeautifulSoup(resOrderDetails.text, "html.parser").findAll("input") |
... | ... | @@ -236,7 +236,7 @@ def do_unfreezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å |
236 | 236 | ic = orderDetailsDict["ic"] |
237 | 237 | |
238 | 238 | # çœå¸‚åŒºèŽ·å– |
239 | - res = eFBL.get_city(host=host, name="万州") | |
239 | + res = eFBL.get_city(session=session,host=host, name="万州") | |
240 | 240 | print(res.text) |
241 | 241 | originId = res.json()["suggestions"][0]["id"] |
242 | 242 | |
... | ... | @@ -246,7 +246,7 @@ def do_unfreezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å |
246 | 246 | modified = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
247 | 247 | |
248 | 248 | # 获å–ç¼´è´¹é‡‘é¢ |
249 | - res = get_calculateRes(host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
249 | + res = get_calculateRes(session=session,host=host, autocompletecartype=autocompletecartype, optType=optType, correctInfo=correctInfo, | |
250 | 250 | weightType=weightType, id=orderId, goodsId=goodsId, number=number, modified=modified, |
251 | 251 | status=status, |
252 | 252 | source=source, correctDiscount=correctDiscount, plate=plate, carTypeName=carTypeName, |
... | ... | @@ -292,13 +292,13 @@ def do_unfreezeOrder(host="http://test.jmsf.diligrp.com:8385",attrName="收费å |
292 | 292 | freezeMoneySymbol = fee_int |
293 | 293 | comparisonFreezeAmount = fee_int |
294 | 294 | modified = created |
295 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
295 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
296 | 296 | marketFlag = firmCode |
297 | 297 | itemReceivableAmount = receivable |
298 | 298 | receivableAmount = receivable |
299 | 299 | tareWeightDate = tareWeightDate |
300 | 300 | |
301 | - aa = do_doUnfreeze(host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
301 | + aa = do_doUnfreeze(session=session,host=host, autocompletecartype=autocompletecartype, fee_str=fee_str, pwd=pwd, optType=optType, | |
302 | 302 | weightType=weightType, id=id, goodsId=goodsId, number=number, created=created, status=status, |
303 | 303 | source=source, |
304 | 304 | correctDiscount=correctDiscount, totalAmount=totalAmount, customerId=customerId, | ... | ... |
commons/api/hpApi.py
... | ... | @@ -17,16 +17,16 @@ from commons.api import entranceFeeBillList as eFBL |
17 | 17 | |
18 | 18 | host = "http://test.gateway.diligrp.com:8285" |
19 | 19 | |
20 | -def get_listBackSkinTrucks(host="",**kwargs): | |
20 | +def get_listBackSkinTrucks(session=None,host="",**kwargs): | |
21 | 21 | """获取接车员信息""" |
22 | 22 | url = host + "/jmsf-web/api/jmsf/query/listBackSkinTrucks" |
23 | 23 | data = {"plate":"","number":"","customerName":""} |
24 | 24 | headers = dct.jsonCode() |
25 | 25 | data = dict(data, **kwargs) |
26 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
26 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
27 | 27 | return res |
28 | 28 | |
29 | -def backSkinWeighSave(host="",**kwargs): | |
29 | +def backSkinWeighSave(session=None,host="",**kwargs): | |
30 | 30 | """获取接车员信息""" |
31 | 31 | url = host + "/jmsf-web/api/entrace/backSkinWeighSave" |
32 | 32 | data = {"hasStoreTruck": 1, "number": "202108120900052", "outGreeterId": 223, "outGreeterName": "测试沈阳", |
... | ... | @@ -36,11 +36,11 @@ def backSkinWeighSave(host="",**kwargs): |
36 | 36 | "carTypeCode": "003", "carTypeId": 53, "carTypeName": "板车"} |
37 | 37 | headers = dct.jsonCode() |
38 | 38 | data = dict(data, **kwargs) |
39 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
39 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
40 | 40 | return res |
41 | 41 | |
42 | -def do_backSkinWeighSave(host="",number=None,userName=None): | |
43 | - orderInfo = get_listBackSkinTrucks(host=host,number=number).json()["data"][0] | |
42 | +def do_backSkinWeighSave(session=None,host="",number=None,userName=None): | |
43 | + orderInfo = get_listBackSkinTrucks(session=session,host=host,number=number).json()["data"][0] | |
44 | 44 | print(orderInfo) |
45 | 45 | # 参数 |
46 | 46 | number=number |
... | ... | @@ -55,7 +55,7 @@ def do_backSkinWeighSave(host="",number=None,userName=None): |
55 | 55 | tareWeightDate=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
56 | 56 | |
57 | 57 | # 获取接车员信息 |
58 | - listByExample = zcApi.get_listByExample(host=host) | |
58 | + listByExample = zcApi.get_listByExample(session=session,host=host) | |
59 | 59 | print(listByExample.json()) |
60 | 60 | if userName == None: |
61 | 61 | listByExampleIndex = 0 |
... | ... | @@ -65,7 +65,7 @@ def do_backSkinWeighSave(host="",number=None,userName=None): |
65 | 65 | outGreeterId = listByExample.json()["data"][listByExampleIndex]["id"] |
66 | 66 | outGreeterName = listByExample.json()["data"][listByExampleIndex]["realName"] |
67 | 67 | |
68 | - res_HP = backSkinWeighSave(host=host,number=number,tareWeight=tareWeight,carTypeWeight=carTypeWeight, | |
68 | + res_HP = backSkinWeighSave(session=session,host=host,number=number,tareWeight=tareWeight,carTypeWeight=carTypeWeight, | |
69 | 69 | plate=plate,trailerNumber=trailerNumber,carTypeCode=carTypeCode, |
70 | 70 | carTypeId=carTypeId,carTypeName=carTypeName,tareWeightDate=tareWeightDate, |
71 | 71 | outGreeterId=outGreeterId,outGreeterName=outGreeterName) | ... | ... |
commons/api/sjApi.py
... | ... | @@ -17,7 +17,7 @@ from commons.api import entranceFeeBillList as eFBL |
17 | 17 | from commons.basic import getLookupList as gLL |
18 | 18 | |
19 | 19 | |
20 | -def create_sparePartsWeighSave(host="",duplicateToken=None,**kwargs): | |
20 | +def create_sparePartsWeighSave(session=None,host="",duplicateToken=None,**kwargs): | |
21 | 21 | """查询证明类型 |
22 | 22 | :param host: |
23 | 23 | :param **kwargs: |
... | ... | @@ -92,21 +92,21 @@ def create_sparePartsWeighSave(host="",duplicateToken=None,**kwargs): |
92 | 92 | headers = dct.jsonCode() |
93 | 93 | headers["jmsf_duplicate_commit_token"] = duplicateToken |
94 | 94 | data = dict(data, **kwargs) |
95 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
95 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
96 | 96 | return res |
97 | 97 | |
98 | -def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transactionName=None, | |
98 | +def create_sj(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=None,transactionName=None, | |
99 | 99 | plate="川A12345",goodsTagName=None,depName=None,proveName=None,itemWeight="10",qty="22"): |
100 | 100 | """ |
101 | 101 | |
102 | 102 | """ |
103 | 103 | # 模板获取 |
104 | - templateAttr_list = gLL.get_templateAttr(host=host,moduleCode="SJ") | |
104 | + templateAttr_list = gLL.get_templateAttr(session=session,host=host,moduleCode="SJ") | |
105 | 105 | print(templateAttr_list) |
106 | 106 | |
107 | 107 | # 获取车型 |
108 | 108 | if "车型" in templateAttr_list: |
109 | - carType = zcApi.get_carType(host=host) | |
109 | + carType = zcApi.get_carType(session=session,host=host) | |
110 | 110 | print(carType.text) |
111 | 111 | if carTypeName == None: |
112 | 112 | carTypeIndex = 0 |
... | ... | @@ -126,7 +126,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
126 | 126 | |
127 | 127 | # 获取商品 |
128 | 128 | if "商品" in templateAttr_list or "商品(末级)" in templateAttr_list: |
129 | - categoryByCondition = zcApi.get_listCategoryByCondition(host=host, keyword=keyword) | |
129 | + categoryByCondition = zcApi.get_listCategoryByCondition(session=session,host=host, keyword=keyword) | |
130 | 130 | cateId = categoryByCondition.json()["data"][0]["id"] |
131 | 131 | productId = categoryByCondition.json()["data"][0]["id"] |
132 | 132 | productName = categoryByCondition.json()["data"][0]["name"] |
... | ... | @@ -139,20 +139,20 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
139 | 139 | |
140 | 140 | # 获取接车员信息 |
141 | 141 | if "进门接车员" in templateAttr_list: |
142 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
143 | - firmId = my.userInfo["data"]["user"]["firmId"] | |
142 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
143 | + firmId = session.userInfo["data"]["user"]["firmId"] | |
144 | 144 | |
145 | 145 | try: |
146 | - res_config = gLL.get_config(host=host, marketId=firmId) | |
146 | + res_config = gLL.get_config(session=session,host=host, marketId=firmId) | |
147 | 147 | departmentId = [i["value"] for i in res_config.json()["rows"] if i["name"] == "DepartmentId"][0] |
148 | 148 | except: |
149 | 149 | departmentId = None |
150 | 150 | # print("==========1============") |
151 | - # print(my.userInfo["data"]["user"]) | |
151 | + # print(session.userInfo["data"]["user"]) | |
152 | 152 | # print(firmCode) |
153 | 153 | # print(departmentId) |
154 | 154 | # print("==========1============") |
155 | - listByExample = zcApi.get_listByExample(host=host,firmCode=firmCode,departmentId=departmentId) | |
155 | + listByExample = zcApi.get_listByExample(session=session,host=host,firmCode=firmCode,departmentId=departmentId) | |
156 | 156 | print("listByExample",listByExample.json()) |
157 | 157 | if userName == None: |
158 | 158 | listByExampleIndex = 0 |
... | ... | @@ -181,7 +181,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
181 | 181 | |
182 | 182 | # 获取交易类型 |
183 | 183 | if "交易类型" in templateAttr_list: |
184 | - transactionType = zcApi.query_transactionType(host=host) | |
184 | + transactionType = zcApi.query_transactionType(session=session,host=host) | |
185 | 185 | print(transactionType.json()) |
186 | 186 | print("交易类型") |
187 | 187 | if transactionName == None: |
... | ... | @@ -199,7 +199,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
199 | 199 | |
200 | 200 | # 获取货物标签 |
201 | 201 | if "货物标签" in templateAttr_list: |
202 | - goodsTag = zcApi.get_goodsTag(host=host) | |
202 | + goodsTag = zcApi.get_goodsTag(session=session,host=host) | |
203 | 203 | print(goodsTag.json()) |
204 | 204 | if goodsTagName == None: |
205 | 205 | transactionTypeIndex = 0 |
... | ... | @@ -212,7 +212,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
212 | 212 | |
213 | 213 | # 产地信息获取 |
214 | 214 | if "产地" in templateAttr_list: |
215 | - address = zcApi.get_address(host=host) | |
215 | + address = zcApi.get_address(session=session,host=host) | |
216 | 216 | print(address.json()) |
217 | 217 | originId = address.json()["data"][0]["id"] |
218 | 218 | origin = address.json()["data"][0]["name"] |
... | ... | @@ -225,7 +225,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
225 | 225 | # 查询部门信息 |
226 | 226 | # 查询部门信息 |
227 | 227 | if "接车部门" in templateAttr_list or "收费部门" in templateAttr_list: |
228 | - depRes = zcApi.get_dep(host=host) | |
228 | + depRes = zcApi.get_dep(session=session,host=host) | |
229 | 229 | print(depRes.json()) |
230 | 230 | if depName == None: |
231 | 231 | depResIndex = 0 |
... | ... | @@ -240,7 +240,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
240 | 240 | |
241 | 241 | # 获取证明类型 |
242 | 242 | if "证明类型" in templateAttr_list: |
243 | - proveType = zcApi.get_proveType(host=host) | |
243 | + proveType = zcApi.get_proveType(session=session,host=host) | |
244 | 244 | print(proveType.json()) |
245 | 245 | # print("proveName",proveName) |
246 | 246 | if proveName == None: |
... | ... | @@ -257,7 +257,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
257 | 257 | print("proveTypeName", proveTypeName) |
258 | 258 | |
259 | 259 | # 获取防重token |
260 | - duplicateTokenRes = zcApi.get_duplicateToken(host=host) | |
260 | + duplicateTokenRes = zcApi.get_duplicateToken(session=session,host=host) | |
261 | 261 | print(duplicateTokenRes.json()) |
262 | 262 | duplicateToken = duplicateTokenRes.json()["data"] |
263 | 263 | |
... | ... | @@ -270,7 +270,7 @@ def create_sj(host=None,carTypeName=None,keyword="蔬菜",userName=None,transact |
270 | 270 | weight = int(itemWeight)*int(qty) |
271 | 271 | |
272 | 272 | # 创建进门单 |
273 | - cre_res = create_sparePartsWeighSave(host=host, duplicateToken=duplicateToken, | |
273 | + cre_res = create_sparePartsWeighSave(session=session,host=host, duplicateToken=duplicateToken, | |
274 | 274 | carTypeCode=carTypeCode, carTypeId=carTypeId, |
275 | 275 | carTypeName=carTypeName, plate=plate,weight=weight, |
276 | 276 | productId=productId, productName=productName, proveTypeCode=proveTypeCode, | ... | ... |
commons/api/zcApi.py
... | ... | @@ -13,94 +13,94 @@ |
13 | 13 | |
14 | 14 | import json,time,random |
15 | 15 | from commons.scripts import dealContentType as dct |
16 | -from commons.MySession import my | |
16 | +# from commons.MySession import my | |
17 | 17 | from commons.basic import getLookupList as gLL |
18 | 18 | |
19 | 19 | |
20 | -def get_carType(host="",**kwargs): | |
20 | +def get_carType(session=None,host="",**kwargs): | |
21 | 21 | """车型获取""" |
22 | 22 | url = host + "/jmsf-web/api/jmsf/query/listCarType" |
23 | 23 | data = {"businessCode":"jmsf"} |
24 | 24 | headers = dct.jsonCode() |
25 | 25 | data = dict(data, **kwargs) |
26 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
26 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
27 | 27 | return res |
28 | 28 | |
29 | -def get_listCategoryByCondition(host="",**kwargs): | |
29 | +def get_listCategoryByCondition(session=None,host="",**kwargs): | |
30 | 30 | """商品获取""" |
31 | 31 | url = host + "/assets-service/api/cusCategory/getTree" |
32 | - # marketId = my.userInfo()[] | |
32 | + # marketId = session.userInfo()[] | |
33 | 33 | data = {"marketId":9,"state":1,"keyword":"蔬菜"} |
34 | 34 | headers = dct.jsonCode() |
35 | 35 | data = dict(data, **kwargs) |
36 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
36 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
37 | 37 | return res |
38 | 38 | |
39 | -def get_listByExample(host="",**kwargs): | |
39 | +def get_listByExample(session=None,host="",**kwargs): | |
40 | 40 | """获取接车员信息""" |
41 | 41 | url = host + "/dili-uap/userApi/listByExample.api" |
42 | 42 | data = {"firmCode":"sy","departmentId":58,"keyword":""} |
43 | 43 | headers = dct.jsonCode() |
44 | 44 | data = dict(data, **kwargs) |
45 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
45 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
46 | 46 | return res |
47 | 47 | |
48 | -def get_proveType(host="",**kwargs): | |
48 | +def get_proveType(session=None,host="",**kwargs): | |
49 | 49 | """查询证明类型""" |
50 | 50 | url = host + "/jmsf-web/api/jmsf/query/listCodeByPid" |
51 | 51 | data = {"pid":"prove_type"} |
52 | 52 | headers = dct.jsonCode() |
53 | 53 | data = dict(data, **kwargs) |
54 | - res = my.useHeadersRequests(method="get", url=url, params=json.loads(json.dumps(data)), headers=headers) | |
54 | + res = session.useHeadersRequests(method="get", url=url, params=json.loads(json.dumps(data)), headers=headers) | |
55 | 55 | return res |
56 | 56 | |
57 | -def query_transactionType(host="",**kwargs): | |
57 | +def query_transactionType(session=None,host="",**kwargs): | |
58 | 58 | """查交易类型""" |
59 | 59 | url = host + "/assets-service/api/tradeType/query" |
60 | 60 | data = {"pageNum":100,"pageSize":100,"marketId":9} |
61 | 61 | headers = dct.jsonCode() |
62 | 62 | data = dict(data, **kwargs) |
63 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
63 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
64 | 64 | return res |
65 | 65 | |
66 | -def get_goodsTag(host="",**kwargs): | |
66 | +def get_goodsTag(session=None,host="",**kwargs): | |
67 | 67 | """获取货物标签""" |
68 | 68 | url = host + "/jmsf-web/api/jmsf/query/listCodeByPid" |
69 | 69 | data = {"pid":"goods_tag"} |
70 | 70 | headers = dct.jsonCode() |
71 | 71 | data = dict(data, **kwargs) |
72 | - res = my.useHeadersRequests(method="get", url=url, params=json.loads(json.dumps(data)), headers=headers) | |
72 | + res = session.useHeadersRequests(method="get", url=url, params=json.loads(json.dumps(data)), headers=headers) | |
73 | 73 | return res |
74 | 74 | |
75 | -def get_address(host="",**kwargs): | |
75 | +def get_address(session=None,host="",**kwargs): | |
76 | 76 | """产地获取""" |
77 | 77 | url = host + "/jmsf-web/api/jmsf/query/address" |
78 | 78 | data = {"province":"C","city":None,"area":None} |
79 | 79 | headers = dct.jsonCode() |
80 | 80 | data = dict(data, **kwargs) |
81 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
81 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
82 | 82 | return res |
83 | 83 | |
84 | -def get_dep(host="",**kwargs): | |
84 | +def get_dep(session=None,host="",**kwargs): | |
85 | 85 | """获取部门信息""" |
86 | 86 | url = host + "/jmsf-web/api/jmsf/query/dep" |
87 | 87 | data = {"keyword":""} |
88 | 88 | headers = dct.jsonCode() |
89 | 89 | data = dict(data, **kwargs) |
90 | - res = my.useHeadersRequests(method="get", url=url, params=data, headers=headers) | |
90 | + res = session.useHeadersRequests(method="get", url=url, params=data, headers=headers) | |
91 | 91 | return res |
92 | 92 | |
93 | 93 | |
94 | 94 | |
95 | -def get_duplicateToken(host=""): | |
95 | +def get_duplicateToken(session=None,host=""): | |
96 | 96 | """进门防重接口""" |
97 | 97 | url = host + "/jmsf-web/appCommon/duplicateToken.action" |
98 | 98 | headers = dct.jsonCode() |
99 | - res = my.useHeadersRequests(method="get", url=url, headers=headers) | |
99 | + res = session.useHeadersRequests(method="get", url=url, headers=headers) | |
100 | 100 | return res |
101 | 101 | |
102 | 102 | |
103 | -def create_wholeCarWeighSave(host="",duplicateToken=None,**kwargs): | |
103 | +def create_wholeCarWeighSave(session=None,host="",duplicateToken=None,**kwargs): | |
104 | 104 | """查询证明类型 |
105 | 105 | :param host: |
106 | 106 | :param **kwargs: |
... | ... | @@ -190,19 +190,19 @@ def create_wholeCarWeighSave(host="",duplicateToken=None,**kwargs): |
190 | 190 | headers = dct.jsonCode() |
191 | 191 | headers["jmsf_duplicate_commit_token"] = duplicateToken |
192 | 192 | data = dict(data, **kwargs) |
193 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
193 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
194 | 194 | return res |
195 | 195 | |
196 | -def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transactionName=None, | |
196 | +def create_jmsf(session=None,host=None,carTypeName=None,keyword="蔬菜",userName=None,transactionName=None, | |
197 | 197 | newWeight=99,plate="川A12345",goodsTagName=None,depName=None,proveName=None): |
198 | 198 | """ |
199 | 199 | |
200 | 200 | """ |
201 | - templateAttr_list = gLL.get_templateAttr(host=host) | |
201 | + templateAttr_list = gLL.get_templateAttr(session=session,host=host) | |
202 | 202 | print(templateAttr_list) |
203 | 203 | # 获取车型 |
204 | 204 | if "车型" in templateAttr_list: |
205 | - carType = get_carType(host=host) | |
205 | + carType = get_carType(session=session,host=host) | |
206 | 206 | if carTypeName == None: |
207 | 207 | carTypeIndex = 0 |
208 | 208 | else: |
... | ... | @@ -220,7 +220,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
220 | 220 | |
221 | 221 | # 获取商品 |
222 | 222 | if "商品" in templateAttr_list or "商品(末级)" in templateAttr_list: |
223 | - categoryByCondition = get_listCategoryByCondition(host=host, keyword=keyword) | |
223 | + categoryByCondition = get_listCategoryByCondition(session=session,host=host, keyword=keyword) | |
224 | 224 | cateId = categoryByCondition.json()["data"][0]["id"] |
225 | 225 | productId = categoryByCondition.json()["data"][0]["id"] |
226 | 226 | productName = categoryByCondition.json()["data"][0]["name"] |
... | ... | @@ -233,8 +233,8 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
233 | 233 | |
234 | 234 | # 获取接车员信息 |
235 | 235 | if "进门接车员" in templateAttr_list: |
236 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
237 | - firmId = my.userInfo["data"]["user"]["firmId"] | |
236 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
237 | + firmId = session.userInfo["data"]["user"]["firmId"] | |
238 | 238 | |
239 | 239 | try: |
240 | 240 | res_config = gLL.get_config(host=host, marketId=firmId) |
... | ... | @@ -242,11 +242,11 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
242 | 242 | except: |
243 | 243 | departmentId = None |
244 | 244 | # print("==========1============") |
245 | - # print(my.userInfo["data"]["user"]) | |
245 | + # print(session.userInfo["data"]["user"]) | |
246 | 246 | # print(firmCode) |
247 | 247 | # print(departmentId) |
248 | 248 | # print("==========1============") |
249 | - listByExample = get_listByExample(host=host,firmCode=firmCode,departmentId=departmentId) | |
249 | + listByExample = get_listByExample(session=session,host=host,firmCode=firmCode,departmentId=departmentId) | |
250 | 250 | print("listByExample",listByExample.json()) |
251 | 251 | if userName == None: |
252 | 252 | listByExampleIndex = 0 |
... | ... | @@ -261,7 +261,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
261 | 261 | |
262 | 262 | # 获取交易类型 |
263 | 263 | if "交易类型" in templateAttr_list: |
264 | - transactionType = query_transactionType(host=host) | |
264 | + transactionType = query_transactionType(session=session,host=host) | |
265 | 265 | if transactionName == None: |
266 | 266 | transactionTypeIndex = 0 |
267 | 267 | else: |
... | ... | @@ -277,7 +277,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
277 | 277 | |
278 | 278 | # 获取货物标签 |
279 | 279 | if "货物标签" in templateAttr_list: |
280 | - goodsTag = get_goodsTag(host=host) | |
280 | + goodsTag = get_goodsTag(session=session,host=host) | |
281 | 281 | if goodsTagName == None: |
282 | 282 | transactionTypeIndex = 0 |
283 | 283 | else: |
... | ... | @@ -289,7 +289,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
289 | 289 | |
290 | 290 | # 产地信息获取 |
291 | 291 | if "产地" in templateAttr_list: |
292 | - address = get_address(host=host) | |
292 | + address = get_address(session=session,host=host) | |
293 | 293 | originId = address.json()["data"][0]["id"] |
294 | 294 | origin = address.json()["data"][0]["name"] |
295 | 295 | originCode = address.json()["data"][0]["cityCode"] |
... | ... | @@ -300,7 +300,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
300 | 300 | |
301 | 301 | # 查询部门信息 |
302 | 302 | if "接车部门" in templateAttr_list or "收费部门" in templateAttr_list: |
303 | - depRes = get_dep(host=host) | |
303 | + depRes = get_dep(session=session,host=host) | |
304 | 304 | print("depRes",depRes.json()) |
305 | 305 | if depName == None: |
306 | 306 | depResIndex = 0 |
... | ... | @@ -315,7 +315,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
315 | 315 | |
316 | 316 | # 获取证明类型 |
317 | 317 | if "证明类型" in templateAttr_list: |
318 | - proveType = get_proveType(host=host) | |
318 | + proveType = get_proveType(session=session,host=host) | |
319 | 319 | print(proveType.json()) |
320 | 320 | # print("proveName",proveName) |
321 | 321 | if proveName == None: |
... | ... | @@ -330,7 +330,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
330 | 330 | proveTypeName = "" |
331 | 331 | |
332 | 332 | # 获取防重token |
333 | - duplicateTokenRes = get_duplicateToken(host=host) | |
333 | + duplicateTokenRes = get_duplicateToken(session=session,host=host) | |
334 | 334 | print(duplicateTokenRes.json()) |
335 | 335 | duplicateToken = duplicateTokenRes.json()["data"] |
336 | 336 | |
... | ... | @@ -351,7 +351,7 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa |
351 | 351 | weighmanRecord["grossWeightDate"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
352 | 352 | |
353 | 353 | # 创建进门单 |
354 | - cre_res = create_wholeCarWeighSave(host=host, duplicateToken=duplicateToken, | |
354 | + cre_res = create_wholeCarWeighSave(session=session,host=host, duplicateToken=duplicateToken, | |
355 | 355 | carTypeCode=carTypeCode, carTypeId=carTypeId, |
356 | 356 | carTypeName=carTypeName, carTypeWeight=carTypeWeight, plate=plate, |
357 | 357 | productId=productId, productName=productName, proveTypeCode=proveTypeCode, | ... | ... |
commons/basic/getLookupList.py
... | ... | @@ -14,7 +14,7 @@ from commons.scripts import dealContentType as dct |
14 | 14 | from commons.scripts import jsonToUrlcode |
15 | 15 | from commons.MySession import my |
16 | 16 | |
17 | -def get_LookupList(host="",providerName="车型"): | |
17 | +def get_LookupList(session=None,host="",providerName="车型"): | |
18 | 18 | """基础数据获取接口 |
19 | 19 | :param providerName: |
20 | 20 | :return: |
... | ... | @@ -27,44 +27,44 @@ def get_LookupList(host="",providerName="车型"): |
27 | 27 | # print(providerName) |
28 | 28 | data = {"provider":providerDict[providerName]} |
29 | 29 | headers = dct.urlCode() |
30 | - res = my.useHeadersRequests(method="POST", url=url, data=data, headers=headers) | |
30 | + res = session.useHeadersRequests(method="POST", url=url, data=data, headers=headers) | |
31 | 31 | return res |
32 | 32 | |
33 | -def get_reach(host="",depId="56"): | |
33 | +def get_reach(session=None,host="",depId="56"): | |
34 | 34 | """通过部门编号获取区域""" |
35 | 35 | url = host + "/api/jmsf/ajax/district/search.action" |
36 | 36 | data = {"depId":depId} |
37 | 37 | headers = dct.urlCode() |
38 | - res = my.useHeadersRequests(method="POST", url=url, data=data, headers=headers) | |
38 | + res = session.useHeadersRequests(method="POST", url=url, data=data, headers=headers) | |
39 | 39 | return res |
40 | 40 | |
41 | -def get_product(host="",productName="蔬菜"): | |
41 | +def get_product(session=None,host="",productName="蔬菜"): | |
42 | 42 | """通过部门编号获取区域""" |
43 | 43 | url = host + f"/category/search.action?name={productName}" |
44 | 44 | data = {"name":productName,"keyword":productName} |
45 | 45 | headers = dct.urlCode() |
46 | - res = my.useHeadersRequests(method="get", url=url, params=data, headers=headers) | |
46 | + res = session.useHeadersRequests(method="get", url=url, params=data, headers=headers) | |
47 | 47 | return res |
48 | 48 | |
49 | -def get_templateUnit(host="",moduleCode="ZC"): | |
49 | +def get_templateUnit(session=None,host="",moduleCode="ZC"): | |
50 | 50 | """通过部门编号获取区域""" |
51 | - print(my.userInfo["data"]["user"]["firmId"]) | |
52 | - marketCode = my.userInfo["data"]["user"]["firmId"] | |
51 | + print(session.userInfo["data"]["user"]["firmId"]) | |
52 | + marketCode = session.userInfo["data"]["user"]["firmId"] | |
53 | 53 | url = host + f"/jmsf-web/api/template/getTemplateUnit?marketCode={marketCode}&moduleCode={moduleCode}" |
54 | 54 | headers = dct.urlCode() |
55 | - res = my.useHeadersRequests(method="get", url=url, headers=headers) | |
55 | + res = session.useHeadersRequests(method="get", url=url, headers=headers) | |
56 | 56 | return res |
57 | 57 | |
58 | -def get_templateAttr(host="http://test.gateway.diligrp.com:8285",moduleCode="ZC"): | |
59 | - attr_list = [i["unitName"] for i in get_templateUnit(host=host,moduleCode=moduleCode).json()["data"]] | |
58 | +def get_templateAttr(session=None,host="http://test.gateway.diligrp.com:8285",moduleCode="ZC"): | |
59 | + attr_list = [i["unitName"] for i in get_templateUnit(session=session,host=host,moduleCode=moduleCode).json()["data"]] | |
60 | 60 | return attr_list |
61 | 61 | |
62 | -def get_config(host="",marketId="9"): | |
62 | +def get_config(session=None,host="",marketId="9"): | |
63 | 63 | """通过部门编号获取区域""" |
64 | 64 | url = host + "/assets-service/api/config/query" |
65 | 65 | data = {"marketId":marketId,"pageNum":100,"pageSize":100} |
66 | 66 | headers = dct.jsonCode() |
67 | - res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
67 | + res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) | |
68 | 68 | return res |
69 | 69 | |
70 | 70 | # # host="http://test.jmsf.diligrp.com:8385" | ... | ... |
commons/clientSession.py
... | ... | @@ -16,29 +16,27 @@ from commons.scripts.pwdCry import pwdCry |
16 | 16 | |
17 | 17 | class cliSession(object): |
18 | 18 | def __init__(self): |
19 | - rConf = readConfig() | |
20 | - | |
21 | - def __init__(self): | |
22 | - rC = readConfig() | |
23 | - self.userName = rC.returnOptionsItems("loginInfo","userName") | |
24 | - self.password = pwdCry(rC.returnOptionsItems("loginInfo","password")) | |
25 | - self.loginUrl = rC.returnOptionsItems("host","uapHost")+"/api/authenticationApi/loginWeb" | |
26 | - self.loginData = {"userName":self.userName,"password":self.password} | |
19 | + self.rC = readConfig() | |
27 | 20 | self.webHeaders = {"X-Requested-With":"XMLHttpRequest", |
28 | 21 | "Content-Type":"application/x-www-form-urlencoded", |
29 | 22 | "Cookie":"UAP_accessToken=${UAP_accessToken}; UAP_refreshToken=${UAP_refreshToken};UAP_firmId=${UAP_firmId}"} |
30 | - | |
31 | 23 | self.clientHeaders={"UAP_accessToken":"${UAP_accessToken}", |
32 | 24 | "UAP_refreshToken":"${UAP_refreshToken}", |
33 | 25 | "UAP_firmId":"${UAP_firmId}", |
34 | 26 | "Cookie":"UAP_accessToken=${UAP_accessToken}; UAP_refreshToken=${UAP_refreshToken}", |
35 | 27 | "Content-Type":"application/json"} |
36 | 28 | |
37 | - def loginUser(self): | |
38 | - """ | |
39 | 29 | |
30 | + def loginUser(self,user="sy_userName_01"): | |
31 | + """ | |
40 | 32 | :return: |
41 | 33 | """ |
34 | + # 登录信息准备 | |
35 | + self.userName,self.password = self.rC.returnOptionsItems("loginInfo",user).split(",") | |
36 | + self.password = pwdCry(self.password) | |
37 | + self.loginUrl = self.rC.returnOptionsItems("host","uapHost")+"/api/authenticationApi/loginWeb" | |
38 | + self.loginData = {"userName":self.userName,"password":self.password} | |
39 | + | |
42 | 40 | # 返回登录信息,以及可用headers,clientHeaders用户客户端操作header,webHeaders用于web页面使用headers |
43 | 41 | res = requests.post(url=self.loginUrl,data=json.dumps(self.loginData)) |
44 | 42 | # print(res.json()) |
... | ... | @@ -51,3 +49,6 @@ class cliSession(object): |
51 | 49 | self.clientHeaders["UAP_firmId"] = str(UAP_firmId) |
52 | 50 | self.clientHeaders["Cookie"] = clientHeadersCookie |
53 | 51 | return self.webHeaders,self.clientHeaders,res.json() |
52 | + | |
53 | +# a,b,c = cliSession().loginUser() | |
54 | +# print(c) | |
54 | 55 | \ No newline at end of file | ... | ... |
commons/scripts/readConf.py
... | ... | @@ -19,7 +19,7 @@ class readConfig(object): |
19 | 19 | # 按市场读取配置文件数据 |
20 | 20 | self.conf = configparser.ConfigParser() |
21 | 21 | self.evn_name = os.name |
22 | - self.file_name = r'test_config_heb.conf' | |
22 | + self.file_name = r'conf_test.conf' | |
23 | 23 | self.relative_path = r'/config/marketConfig/' |
24 | 24 | self.file_path = os.path.abspath( |
25 | 25 | os.path.join(os.path.dirname(__file__), "../../")) + self.relative_path + self.file_name | ... | ... |
config/marketConfig/conf_pre.conf
0 → 100644
1 | +#登录信息 | |
2 | +[loginInfo] | |
3 | +sy_userName_01=scgy,123123 | |
4 | +hd_userName_01=哈尔滨田太子,a123456 | |
5 | + | |
6 | +# 测试依赖信息 | |
7 | +[testInfo] | |
8 | +#sy | |
9 | +sy_cardNumRe_01=888810033081 | |
10 | +#hd | |
11 | +hd_cardNumRe_01=210823173732 | |
12 | + | |
13 | + | |
14 | +[host] | |
15 | +cardHost=http://test.card.diligrp.com:8386 | |
16 | +uapHost=http://test.uap.diligrp.com | |
17 | +gatewayHost=http://test.gateway.diligrp.com:8285 | |
18 | +jmsfHost=http://test.jmsf.diligrp.com:8385 | |
0 | 19 | \ No newline at end of file | ... | ... |
config/marketConfig/conf_test.conf
0 → 100644
1 | +#登录信息 | |
2 | +[loginInfo] | |
3 | +sy_userName_01=scgy,123123 | |
4 | +hd_userName_01=哈尔滨田太子,a123456 | |
5 | + | |
6 | +# 测试依赖信息 | |
7 | +[testInfo] | |
8 | +#sy | |
9 | +sy_cardNumRe_01=888810033081 | |
10 | +#hd | |
11 | +hd_cardNumRe_01=210823173732 | |
12 | + | |
13 | + | |
14 | +[host] | |
15 | +cardHost=http://test.card.diligrp.com:8386 | |
16 | +uapHost=http://test.uap.diligrp.com | |
17 | +gatewayHost=http://test.gateway.diligrp.com:8285 | |
18 | +jmsfHost=http://test.jmsf.diligrp.com:8385 | |
0 | 19 | \ No newline at end of file | ... | ... |
config/marketConfig/test_config_heb.conf deleted
100644 → 0
1 | -#沈阳市场信息 | |
2 | -[loginInfo] | |
3 | -userName=哈尔滨田太子 | |
4 | -password=a123456 | |
5 | - | |
6 | -[testInfo] | |
7 | -#已添加的身份证号 | |
8 | -cCNum=11010119990307865X | |
9 | -cCNumB=110101199903077593 | |
10 | -#入库未开卡的卡号 | |
11 | -cardNum=210607113166 | |
12 | -#已开卡的卡号 | |
13 | -cardNumRe=210823173732 | |
14 | -#密码设置 | |
15 | -loginPwd=111111 | |
16 | - | |
17 | -[host] | |
18 | -cardHost=http://test.card.diligrp.com:8386 | |
19 | -uapHost=http://test.uap.diligrp.com | |
20 | -gatewayHost=http://test.gateway.diligrp.com:8285 | |
21 | -jmsfHost=http://test.jmsf.diligrp.com:8385 | |
22 | 0 | \ No newline at end of file |
config/marketConfig/test_config_sy.conf deleted
100644 → 0
1 | -#沈阳市场信息 | |
2 | -[loginInfo] | |
3 | -userName=scgy | |
4 | -password=123123 | |
5 | - | |
6 | -[testInfo] | |
7 | -#已添加的身份证号 | |
8 | -cCNum=11010119990307865X | |
9 | -cCNumB=110101199903077593 | |
10 | -#入库未开卡的卡号 | |
11 | -cardNum=210607113166 | |
12 | -#已开卡的卡号 | |
13 | -cardNumRe=888810033081 | |
14 | -#密码设置 | |
15 | -loginPwd=111111 | |
16 | - | |
17 | -[host] | |
18 | -cardHost=http://test.card.diligrp.com:8386 | |
19 | -uapHost=http://test.uap.diligrp.com | |
20 | -gatewayHost=http://test.gateway.diligrp.com:8285 | |
21 | -jmsfHost=http://test.jmsf.diligrp.com:8385 | |
22 | 0 | \ No newline at end of file |
testcase/heb/test_HP/test_HP.py
... | ... | @@ -18,6 +18,9 @@ from commons.api.entranceFeeBillList import operationDoFreeze as oDF |
18 | 18 | from commons.api import hpApi |
19 | 19 | import time,random |
20 | 20 | |
21 | +from commons.MySession import sessionHeb | |
22 | +session = sessionHeb | |
23 | + | |
21 | 24 | class test_HPCreate(unittest.TestCase): |
22 | 25 | """哈尔滨市场-整车-车辆回皮""" |
23 | 26 | def setUp(self) -> None: |
... | ... | @@ -31,7 +34,7 @@ class test_HPCreate(unittest.TestCase): |
31 | 34 | def setUpClass(cls) -> None: |
32 | 35 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
33 | 36 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
34 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
37 | + cls.ic = rC.returnOptionsItems("testInfo", "hd_cardNumRe_01") | |
35 | 38 | |
36 | 39 | @classmethod |
37 | 40 | def tearDownClass(cls) -> None: |
... | ... | @@ -41,11 +44,11 @@ class test_HPCreate(unittest.TestCase): |
41 | 44 | """整车-车辆回皮:创建回皮进门单""" |
42 | 45 | plate = f"川B{random.randint(10000,99999)}" |
43 | 46 | goods = "雪莲果" |
44 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
47 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
45 | 48 | print(cre_res.json()) |
46 | 49 | number = cre_res.json()["data"]["number"] |
47 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
48 | - res,tareWeight = hpApi.do_backSkinWeighSave(host=self.gatewayHost,number=number) | |
50 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
51 | + res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number) | |
49 | 52 | assert res.json()["code"]=="200","回皮失败" |
50 | 53 | assert "data" in res.text,"回皮失败" |
51 | 54 | |
... | ... | @@ -53,11 +56,11 @@ class test_HPCreate(unittest.TestCase): |
53 | 56 | """整车-车辆回皮:根据车牌号查询""" |
54 | 57 | plate = f"川B{random.randint(10000,99999)}" |
55 | 58 | goods="火龙果" |
56 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
59 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
57 | 60 | print(cre_res.json()) |
58 | 61 | number = cre_res.json()["data"]["number"] |
59 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
60 | - res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,plate=plate) | |
62 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
63 | + res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,plate=plate) | |
61 | 64 | print(res.json()) |
62 | 65 | assert res.json()["code"]=="200","车号查询失败" |
63 | 66 | assert res.json()["data"][-1]["number"]==number,"车号查询失败" |
... | ... | @@ -66,11 +69,11 @@ class test_HPCreate(unittest.TestCase): |
66 | 69 | """整车-车辆回皮:根据收费单号查询""" |
67 | 70 | plate = f"川B{random.randint(10000,99999)}" |
68 | 71 | goods="火龙果" |
69 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
72 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
70 | 73 | print(cre_res.json()) |
71 | 74 | number = cre_res.json()["data"]["number"] |
72 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
73 | - res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,number=number) | |
75 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
76 | + res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,number=number) | |
74 | 77 | print(res.json()) |
75 | 78 | assert res.json()["code"]=="200","车号查询失败" |
76 | 79 | assert res.json()["data"][-1]["number"]==number,"车号查询失败" |
... | ... | @@ -80,13 +83,13 @@ class test_HPCreate(unittest.TestCase): |
80 | 83 | plate = f"川B{random.randint(10000,99999)}" |
81 | 84 | goods="雪莲果" |
82 | 85 | ic = self.ic |
83 | - customerName= eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
86 | + customerName= eFBL.get_icCheck(session=session,host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
84 | 87 | print(customerName) |
85 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
88 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
86 | 89 | print(cre_res.json()) |
87 | 90 | number = cre_res.json()["data"]["number"] |
88 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
89 | - res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,customerName=customerName) | |
91 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
92 | + res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,customerName=customerName) | |
90 | 93 | print(res.json()) |
91 | 94 | assert res.json()["code"]=="200","车号查询失败" |
92 | 95 | assert res.json()["data"][-1]["number"]==number,"车号查询失败" |
93 | 96 | \ No newline at end of file | ... | ... |
testcase/heb/test_SJ/test_SJ.py
... | ... | @@ -16,6 +16,8 @@ from commons.api import zcApi as zcA |
16 | 16 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 17 | from commons.api import sjApi |
18 | 18 | import time,random |
19 | +from commons.MySession import sessionHeb | |
20 | +session = sessionHeb | |
19 | 21 | |
20 | 22 | class test_SJCreate(unittest.TestCase): |
21 | 23 | """哈尔滨市场-散件-创建整车进门单""" |
... | ... | @@ -46,7 +48,7 @@ class test_SJCreate(unittest.TestCase): |
46 | 48 | |
47 | 49 | |
48 | 50 | # 获取车型 |
49 | - carType = zcA.get_carType(host=self.gatewayHost) | |
51 | + carType = zcA.get_carType(session=session,host=self.gatewayHost) | |
50 | 52 | print(carType.text) |
51 | 53 | print(carType.json()["data"][0]) |
52 | 54 | carTypeCode = carType.json()["data"][0]["code"] |
... | ... | @@ -54,51 +56,51 @@ class test_SJCreate(unittest.TestCase): |
54 | 56 | carTypeName = carType.json()["data"][0]["carTypeName"] |
55 | 57 | |
56 | 58 | # 获取商品 |
57 | - categoryByCondition = zcA.get_listCategoryByCondition(host=self.gatewayHost) | |
59 | + categoryByCondition = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost) | |
58 | 60 | print(categoryByCondition.json()) |
59 | 61 | cateId = categoryByCondition.json()["data"][0]["id"] |
60 | 62 | productId = categoryByCondition.json()["data"][0]["id"] |
61 | 63 | productName = categoryByCondition.json()["data"][0]["name"] |
62 | 64 | |
63 | 65 | # 获取接车员 |
64 | - listByExample = zcA.get_listByExample(host=self.gatewayHost) | |
66 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost) | |
65 | 67 | print(listByExample.json()) |
66 | 68 | inGreeterId = listByExample.json()["data"][0]["id"] |
67 | 69 | inGreeterName = listByExample.json()["data"][0]["realName"] |
68 | 70 | |
69 | 71 | # 获取交易类型 |
70 | - transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
72 | + transactionType = zcA.query_transactionType(session=session,host=self.gatewayHost) | |
71 | 73 | print(transactionType.json()) |
72 | 74 | tradeType = transactionType.json()["rows"][0]["code"] |
73 | 75 | tradeTypeId = transactionType.json()["rows"][0]["id"] |
74 | 76 | tradeTypeName = transactionType.json()["rows"][0]["name"] |
75 | 77 | |
76 | 78 | # 获取货物标签 |
77 | - goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
79 | + goodsTag = zcA.get_goodsTag(session=session,host=self.gatewayHost) | |
78 | 80 | print(goodsTag.json()) |
79 | 81 | # goodsTagId = goodsTag.json()["data"][0]["id"] |
80 | 82 | |
81 | 83 | # 产地信息获取 |
82 | - address = zcA.get_address(host=self.gatewayHost) | |
84 | + address = zcA.get_address(session=session,host=self.gatewayHost) | |
83 | 85 | print(address.json()) |
84 | 86 | originId = address.json()["data"][0]["id"] |
85 | 87 | origin = address.json()["data"][0]["name"] |
86 | 88 | originCode = address.json()["data"][0]["cityCode"] |
87 | 89 | |
88 | 90 | # 查询部门信息 |
89 | - depRes = zcA.get_dep(host=self.gatewayHost) | |
91 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost) | |
90 | 92 | print(depRes.json()) |
91 | 93 | feeDepId = depRes.json()["data"][0]["id"] |
92 | 94 | feeDepName = depRes.json()["data"][0]["name"] |
93 | 95 | |
94 | 96 | # 获取证明类型 |
95 | - proveType = zcA.get_proveType(host=self.gatewayHost) | |
97 | + proveType = zcA.get_proveType(session=session,host=self.gatewayHost) | |
96 | 98 | print(proveType.json()) |
97 | 99 | proveTypeCode = proveType.json()["data"][0]["id"] |
98 | 100 | proveTypeName = proveType.json()["data"][0]["name"] |
99 | 101 | |
100 | 102 | # 获取防重token |
101 | - duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
103 | + duplicateTokenRes = zcA.get_duplicateToken(session=session,host=self.gatewayHost) | |
102 | 104 | print(duplicateTokenRes.json()) |
103 | 105 | duplicateToken = duplicateTokenRes.json()["data"] |
104 | 106 | |
... | ... | @@ -106,7 +108,7 @@ class test_SJCreate(unittest.TestCase): |
106 | 108 | weight = int(itemWeight) * int(qty) |
107 | 109 | |
108 | 110 | # 创建进门单 |
109 | - cre_res = sjApi.create_sparePartsWeighSave(host=self.gatewayHost, duplicateToken=duplicateToken, | |
111 | + cre_res = sjApi.create_sparePartsWeighSave(session=session,host=self.gatewayHost, duplicateToken=duplicateToken, | |
110 | 112 | carTypeCode=carTypeCode, carTypeId=carTypeId, |
111 | 113 | carTypeName=carTypeName, plate=plate, weight=weight, |
112 | 114 | productId=productId, productName=productName, proveTypeCode=proveTypeCode, | ... | ... |
testcase/heb/test_ZC/test_ZCBasic.py
... | ... | @@ -13,9 +13,9 @@ import json |
13 | 13 | import unittest |
14 | 14 | from commons.scripts.readConf import rC |
15 | 15 | from commons.api import zcApi as zcA |
16 | -from commons.MySession import my | |
17 | -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL | |
18 | -import time,random | |
16 | +from commons.basic import getLookupList as gLL | |
17 | +from commons.MySession import sessionHeb | |
18 | +session = sessionHeb | |
19 | 19 | |
20 | 20 | class test_ZCBasic(unittest.TestCase): |
21 | 21 | """哈尔滨市场-整车-创建整车进门单基础信息接口测试""" |
... | ... | @@ -38,7 +38,7 @@ class test_ZCBasic(unittest.TestCase): |
38 | 38 | def test_getCar(self): |
39 | 39 | """整车-整车创建:获取车型接口调用测试""" |
40 | 40 | # 获取车型 |
41 | - carType = zcA.get_carType(host=self.gatewayHost) | |
41 | + carType = zcA.get_carType(session=session,host=self.gatewayHost) | |
42 | 42 | print(carType.text) |
43 | 43 | assert carType.json()["code"] == "200" |
44 | 44 | assert carType.json()["data"] != [] |
... | ... | @@ -46,9 +46,9 @@ class test_ZCBasic(unittest.TestCase): |
46 | 46 | def test_getAllCategory(self): |
47 | 47 | """整车-整车创建:获取测试商品信息测试""" |
48 | 48 | # 获取 |
49 | - # print(my.userInfo["data"]["user"]["firmCode"]) | |
50 | - marketId = my.userInfo["data"]["user"]["firmId"] | |
51 | - resCategory = zcA.get_listCategoryByCondition(host=self.gatewayHost,marketId=marketId,keyword="") | |
49 | + # print(session.userInfo["data"]["user"]["firmCode"]) | |
50 | + marketId = session.userInfo["data"]["user"]["firmId"] | |
51 | + resCategory = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost,marketId=marketId,keyword="") | |
52 | 52 | print(resCategory.text) |
53 | 53 | assert resCategory.json()["code"] == "200","全商品查询失败" |
54 | 54 | assert resCategory.json()["data"] != [],"全商品查询失败,查询结果不应该为空" |
... | ... | @@ -56,8 +56,8 @@ class test_ZCBasic(unittest.TestCase): |
56 | 56 | def test_getOneCategory(self): |
57 | 57 | """整车-整车创建:获取测试商品信息测试""" |
58 | 58 | # 获取 |
59 | - marketId = my.userInfo["data"]["user"]["firmId"] | |
60 | - resCategory = zcA.get_listCategoryByCondition(host=self.gatewayHost,marketId=marketId,keyword="火龙果") | |
59 | + marketId = session.userInfo["data"]["user"]["firmId"] | |
60 | + resCategory = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost,marketId=marketId,keyword="火龙果") | |
61 | 61 | print(resCategory.text) |
62 | 62 | nameList = [i["name"] for i in resCategory.json()["data"]] |
63 | 63 | assert resCategory.json()["code"] == "200" |
... | ... | @@ -66,29 +66,29 @@ class test_ZCBasic(unittest.TestCase): |
66 | 66 | |
67 | 67 | def test_getAllExample(self): |
68 | 68 | """整车-整车创建:接车员信息获取测试""" |
69 | - # print(my.userInfo["data"]["user"]["departmentId"]) | |
70 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
71 | - departmentId = my.userInfo["data"]["user"]["departmentId"] | |
72 | - listByExample = zcA.get_listByExample(host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId) | |
69 | + # print(session.userInfo["data"]["user"]["departmentId"]) | |
70 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
71 | + departmentId = session.userInfo["data"]["user"]["departmentId"] | |
72 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId) | |
73 | 73 | print(listByExample.json()) |
74 | 74 | assert listByExample.json()["code"]=="200","接车员信息获取测试失败" |
75 | 75 | assert listByExample.json()["data"]!=[],"接车员信息获取测试失败" |
76 | 76 | |
77 | 77 | def test_getOneExample(self): |
78 | 78 | """整车-整车创建:按接车员名称信息查询接车员""" |
79 | - # print(my.userInfo["data"]["user"]["departmentId"]) | |
80 | - # firmCode = my.userInfo["data"]["user"]["firmCode"] | |
81 | - # departmentId = my.userInfo["data"]["user"]["departmentId"] | |
79 | + # print(session.userInfo["data"]["user"]["departmentId"]) | |
80 | + # firmCode = session.userInfo["data"]["user"]["firmCode"] | |
81 | + # departmentId = session.userInfo["data"]["user"]["departmentId"] | |
82 | 82 | |
83 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
84 | - firmId = my.userInfo["data"]["user"]["firmId"] | |
83 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
84 | + firmId = session.userInfo["data"]["user"]["firmId"] | |
85 | 85 | try: |
86 | - res_config = gLL.get_config(host=host, marketId=firmId) | |
86 | + res_config = gLL.get_config(session=session,host=self.gatewayHost, marketId=firmId) | |
87 | 87 | departmentId = [i["value"] for i in res_config.json()["rows"] if i["name"] == "DepartmentId"][0] |
88 | 88 | except: |
89 | 89 | departmentId = None |
90 | 90 | keyword="哈达测试" |
91 | - listByExample = zcA.get_listByExample(host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId, | |
91 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId, | |
92 | 92 | keyword=keyword) |
93 | 93 | print(listByExample.json()) |
94 | 94 | assert listByExample.json()["code"]=="200","按接车员名称信息查询接车员测试失败" |
... | ... | @@ -96,7 +96,7 @@ class test_ZCBasic(unittest.TestCase): |
96 | 96 | |
97 | 97 | def test_transactionType(self): |
98 | 98 | """整车-整车创建:交易类型获取测试""" |
99 | - transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
99 | + transactionType = zcA.query_transactionType(session=session,host=self.gatewayHost) | |
100 | 100 | print(transactionType.json()) |
101 | 101 | assert transactionType.status_code==200,"交易类型信息获取测试失败" |
102 | 102 | assert transactionType.json()["rows"]!=[],"交易类型信息获取测试失败" |
... | ... | @@ -104,7 +104,7 @@ class test_ZCBasic(unittest.TestCase): |
104 | 104 | @unittest.skip |
105 | 105 | def test_getGoodsTag(self): |
106 | 106 | """整车-整车创建:货物标签获取测试""" |
107 | - goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
107 | + goodsTag = zcA.get_goodsTag(session=session,host=self.gatewayHost) | |
108 | 108 | print(goodsTag.json()) |
109 | 109 | assert goodsTag.status_code==200,"货物标签信息获取测试失败" |
110 | 110 | assert goodsTag.json()["data"]!=[],"货物标签信息获取测试失败" |
... | ... | @@ -112,7 +112,7 @@ class test_ZCBasic(unittest.TestCase): |
112 | 112 | def test_getAllAddress(self): |
113 | 113 | """整车-整车创建:按照省份查询产地""" |
114 | 114 | province = "四川省" |
115 | - address = zcA.get_address(host=self.gatewayHost,province=province) | |
115 | + address = zcA.get_address(session=session,host=self.gatewayHost,province=province) | |
116 | 116 | print(address.json()) |
117 | 117 | assert address.json()["code"] == "200","按照省份查询产地信息获取测试失败" |
118 | 118 | mergerNameList = [i["mergerName"] for i in address.json()["data"] if province not in i["mergerName"]] |
... | ... | @@ -123,7 +123,7 @@ class test_ZCBasic(unittest.TestCase): |
123 | 123 | province = "四川省" |
124 | 124 | city = "成都市" |
125 | 125 | area = "锦江区" |
126 | - address = zcA.get_address(host=self.gatewayHost,province=province,city=city,area=area) | |
126 | + address = zcA.get_address(session=session,host=self.gatewayHost,province=province,city=city,area=area) | |
127 | 127 | print(address.json()) |
128 | 128 | assert address.json()["code"]=="200","详细产地信息查询失败" |
129 | 129 | assert len(address.json()["data"])==1,"详细产地信息查询只能查询出一个结果,查询结果超过一个测试失败" |
... | ... | @@ -131,7 +131,7 @@ class test_ZCBasic(unittest.TestCase): |
131 | 131 | |
132 | 132 | def test_getAllDep(self): |
133 | 133 | """整车-整车创建:接车部门信息获取""" |
134 | - depRes = zcA.get_dep(host=self.gatewayHost) | |
134 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost) | |
135 | 135 | print(depRes.json()) |
136 | 136 | assert depRes.json()["code"]=="200","接车部门信息获取测试失败" |
137 | 137 | assert depRes.json()["data"] != [], "接车部门信息获取测试失败" |
... | ... | @@ -140,7 +140,7 @@ class test_ZCBasic(unittest.TestCase): |
140 | 140 | def test_getOneDep(self): |
141 | 141 | """整车-整车创建:查询指定接车部门信息""" |
142 | 142 | keyword="哈达测试部" |
143 | - depRes = zcA.get_dep(host=self.gatewayHost,keyword=keyword) | |
143 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost,keyword=keyword) | |
144 | 144 | print(depRes.json()) |
145 | 145 | assert depRes.json()["code"]=="200","查询指定接车部门信息获取测试失败" |
146 | 146 | assert len(depRes.json()["data"]) == 1, "查询指定接车部门信息获取测试失败" |
... | ... | @@ -148,14 +148,14 @@ class test_ZCBasic(unittest.TestCase): |
148 | 148 | |
149 | 149 | def test_getProveType(self): |
150 | 150 | """整车-整车创建:证明类型信息获取""" |
151 | - proveType = zcA.get_proveType(host=self.gatewayHost) | |
151 | + proveType = zcA.get_proveType(session=session,host=self.gatewayHost) | |
152 | 152 | print(proveType.json()) |
153 | 153 | assert proveType.json()["code"]=="200","证明类型信息获取测试失败" |
154 | 154 | assert proveType.json()["data"] != [], "证明类型信息获取测试失败" |
155 | 155 | |
156 | 156 | def test_getDuplicateToken(self): |
157 | 157 | """整车-整车创建:获取防重复token""" |
158 | - duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
158 | + duplicateTokenRes = zcA.get_duplicateToken(session=session,host=self.gatewayHost) | |
159 | 159 | print(duplicateTokenRes.json()) |
160 | 160 | assert duplicateTokenRes.json()["code"]=="200","获取防重复token测试失败" |
161 | 161 | assert duplicateTokenRes.json()["data"].isalnum(), "获取防重复token测试失败" | ... | ... |
testcase/heb/test_ZC/test_ZCCreate.py
... | ... | @@ -13,8 +13,11 @@ import json |
13 | 13 | import unittest |
14 | 14 | from commons.scripts.readConf import rC |
15 | 15 | from commons.api import zcApi as zcA |
16 | +from commons.MySession import sessionHeb | |
16 | 17 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 18 | import time,random |
19 | +from commons.MySession import sessionHeb | |
20 | +session = sessionHeb | |
18 | 21 | |
19 | 22 | class test_ZCCreate(unittest.TestCase): |
20 | 23 | """哈尔滨市场-整车-创建整车进门单""" |
... | ... | @@ -43,7 +46,7 @@ class test_ZCCreate(unittest.TestCase): |
43 | 46 | trailerNumber = plate |
44 | 47 | |
45 | 48 | # 获取车型 |
46 | - carType = zcA.get_carType(host=self.gatewayHost) | |
49 | + carType = zcA.get_carType(session=sessionHeb,host=self.gatewayHost) | |
47 | 50 | print(carType.text) |
48 | 51 | print(carType.json()["data"][0]) |
49 | 52 | carTypeCode = carType.json()["data"][0]["code"] |
... | ... | @@ -52,7 +55,7 @@ class test_ZCCreate(unittest.TestCase): |
52 | 55 | carTypeWeight = carType.json()["data"][0]["weight"] |
53 | 56 | |
54 | 57 | # 获取商品 |
55 | - categoryByCondition = zcA.get_listCategoryByCondition(host=self.gatewayHost) | |
58 | + categoryByCondition = zcA.get_listCategoryByCondition(session=sessionHeb,host=self.gatewayHost) | |
56 | 59 | print(categoryByCondition.json()) |
57 | 60 | cateId = categoryByCondition.json()["data"][0]["id"] |
58 | 61 | productId = categoryByCondition.json()["data"][0]["id"] |
... | ... | @@ -60,45 +63,45 @@ class test_ZCCreate(unittest.TestCase): |
60 | 63 | productCode = categoryByCondition.json()["data"][0]["keycode"] |
61 | 64 | |
62 | 65 | # 获取接车员 |
63 | - listByExample = zcA.get_listByExample(host=self.gatewayHost) | |
66 | + listByExample = zcA.get_listByExample(session=sessionHeb,host=self.gatewayHost) | |
64 | 67 | print(listByExample.json()) |
65 | 68 | inGreeterId = listByExample.json()["data"][0]["id"] |
66 | 69 | inGreeterName = listByExample.json()["data"][0]["realName"] |
67 | 70 | |
68 | 71 | # 获取交易类型 |
69 | - transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
72 | + transactionType = zcA.query_transactionType(session=sessionHeb,host=self.gatewayHost) | |
70 | 73 | print(transactionType.json()) |
71 | 74 | tradeType = transactionType.json()["rows"][0]["code"] |
72 | 75 | tradeTypeId = transactionType.json()["rows"][0]["id"] |
73 | 76 | tradeTypeName = transactionType.json()["rows"][0]["name"] |
74 | 77 | |
75 | 78 | # 获取货物标签 |
76 | - # goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
79 | + goodsTag = zcA.get_goodsTag(session=session,host=self.gatewayHost) | |
77 | 80 | # print(goodsTag.json()) |
78 | 81 | # goodsTagId = goodsTag.json()["data"][0]["id"] |
79 | 82 | goodsTagId = "" |
80 | 83 | |
81 | 84 | # 产地信息获取 |
82 | - address = zcA.get_address(host=self.gatewayHost) | |
85 | + address = zcA.get_address(session=sessionHeb,host=self.gatewayHost) | |
83 | 86 | print(address.json()) |
84 | 87 | originId = address.json()["data"][0]["id"] |
85 | 88 | origin = address.json()["data"][0]["name"] |
86 | 89 | originCode = address.json()["data"][0]["cityCode"] |
87 | 90 | |
88 | 91 | # 查询部门信息 |
89 | - depRes = zcA.get_dep(host=self.gatewayHost) | |
92 | + depRes = zcA.get_dep(session=sessionHeb,host=self.gatewayHost) | |
90 | 93 | print(depRes.json()) |
91 | 94 | feeDepId = depRes.json()["data"][0]["id"] |
92 | 95 | feeDepName = depRes.json()["data"][0]["name"] |
93 | 96 | |
94 | 97 | # 获取证明类型 |
95 | - proveType = zcA.get_proveType(host=self.gatewayHost) | |
98 | + proveType = zcA.get_proveType(session=sessionHeb,host=self.gatewayHost) | |
96 | 99 | print(proveType.json()) |
97 | 100 | proveTypeCode = proveType.json()["data"][0]["id"] |
98 | 101 | proveTypeName = proveType.json()["data"][0]["name"] |
99 | 102 | |
100 | 103 | # 获取防重token |
101 | - duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
104 | + duplicateTokenRes = zcA.get_duplicateToken(session=sessionHeb,host=self.gatewayHost) | |
102 | 105 | print(duplicateTokenRes.json()) |
103 | 106 | duplicateToken = duplicateTokenRes.json()["data"] |
104 | 107 | |
... | ... | @@ -113,7 +116,7 @@ class test_ZCCreate(unittest.TestCase): |
113 | 116 | weighmanRecord["grossWeightDate"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
114 | 117 | |
115 | 118 | # 创建进门单 |
116 | - cre_res = zcA.create_wholeCarWeighSave(host=self.gatewayHost, duplicateToken=duplicateToken, | |
119 | + cre_res = zcA.create_wholeCarWeighSave(session=sessionHeb,host=self.gatewayHost, duplicateToken=duplicateToken, | |
117 | 120 | carTypeCode=carTypeCode, carTypeId=carTypeId, |
118 | 121 | carTypeName=carTypeName, carTypeWeight=carTypeWeight, plate=plate, |
119 | 122 | productId=productId, productName=productName, | ... | ... |
testcase/heb/test_listPage/test_listPageOperation.py
... | ... | @@ -24,6 +24,9 @@ from commons.api.entranceFeeBillList import operationDoUpdate as oDUp |
24 | 24 | from commons.api.entranceFeeBillList import operationDoFreeze as oDF |
25 | 25 | import random |
26 | 26 | |
27 | +from commons.MySession import sessionHeb | |
28 | +session = sessionHeb | |
29 | + | |
27 | 30 | class test_listPage(unittest.TestCase): |
28 | 31 | """哈尔滨市场-进门单列表:进门但操作测试测试""" |
29 | 32 | def setUp(self) -> None: |
... | ... | @@ -36,7 +39,7 @@ class test_listPage(unittest.TestCase): |
36 | 39 | def setUpClass(cls) -> None: |
37 | 40 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
38 | 41 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
39 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
42 | + cls.ic = rC.returnOptionsItems("testInfo", "hd_cardNumRe_01") | |
40 | 43 | |
41 | 44 | @classmethod |
42 | 45 | def tearDownClass(cls) -> None: |
... | ... | @@ -44,20 +47,20 @@ class test_listPage(unittest.TestCase): |
44 | 47 | |
45 | 48 | def test_viewOrder(self): |
46 | 49 | """进门单列表-操作:查看进门单详情测试""" |
47 | - res = zcA.create_jmsf(host=self.gatewayHost) | |
50 | + res = zcA.create_jmsf(session=session,host=self.gatewayHost) | |
48 | 51 | orderId = res.json()["data"]["id"] |
49 | 52 | number = res.json()["data"]["number"] |
50 | - res = eFBL.get_orderView(host=self.jmsfHost,orderId=orderId) | |
53 | + res = eFBL.get_orderView(session=session,host=self.jmsfHost,orderId=orderId) | |
51 | 54 | assert str(number) in res.text,"获取订单详情查询失败" |
52 | 55 | |
53 | 56 | def test_doPayZC(self): |
54 | 57 | """进门单列表-操作:整车进门交费测试""" |
55 | 58 | plate = f"川A{random.randint(10000,99999)}" |
56 | 59 | goods = "雪莲果" |
57 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
60 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
58 | 61 | print(cre_res.json()) |
59 | 62 | number = cre_res.json()["data"]["number"] |
60 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
63 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
61 | 64 | assert res_pay.json()["code"]=="200","缴费失败" |
62 | 65 | assert res_pay.json()["message"] == "OK", "缴费失败" |
63 | 66 | |
... | ... | @@ -65,10 +68,10 @@ class test_listPage(unittest.TestCase): |
65 | 68 | """进门单列表-操作:修改进门单测试""" |
66 | 69 | plate = f"川A{random.randint(10000,99999)}" |
67 | 70 | goods = "雪莲果" |
68 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
71 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
69 | 72 | print(cre_res.json()) |
70 | 73 | number = cre_res.json()["data"]["number"] |
71 | - res_pay = oDUp.do_updateOrder(host=self.jmsfHost,attrValue=number) | |
74 | + res_pay = oDUp.do_updateOrder(session=session,host=self.jmsfHost,attrValue=number) | |
72 | 75 | assert res_pay.json()["success"]==True,"修改进门单失败" |
73 | 76 | assert res_pay.json()["message"] == "修改保存成功", "修改进门单失败" |
74 | 77 | |
... | ... | @@ -76,10 +79,10 @@ class test_listPage(unittest.TestCase): |
76 | 79 | """进门单列表-操作:散件进门交费测试""" |
77 | 80 | plate = f"川A{random.randint(10000,99999)}" |
78 | 81 | goods = "雪莲果" |
79 | - cre_res = sjApi.create_sj(host=self.gatewayHost,plate=plate,keyword=goods) | |
82 | + cre_res = sjApi.create_sj(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
80 | 83 | print(cre_res.json()) |
81 | 84 | number = cre_res.json()["data"]["number"] |
82 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
85 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
83 | 86 | assert res_pay.json()["code"]=="200","缴费失败" |
84 | 87 | assert res_pay.json()["message"] == "OK", "缴费失败" |
85 | 88 | |
... | ... | @@ -87,16 +90,16 @@ class test_listPage(unittest.TestCase): |
87 | 90 | """进门单列表-操作:散件进门交费测试""" |
88 | 91 | plate = f"川A{random.randint(10000,99999)}" |
89 | 92 | goods = "雪莲果" |
90 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
93 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
91 | 94 | print(cre_res.json()) |
92 | 95 | number = cre_res.json()["data"]["number"] |
93 | - res_pay = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
96 | + res_pay = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
94 | 97 | assert res_pay.json()["code"]=="200","缴费失败" |
95 | 98 | assert res_pay.json()["message"] == "OK", "缴费失败" |
96 | - res,tareWeight = hpApi.do_backSkinWeighSave(host=self.gatewayHost,number=number) | |
99 | + res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number) | |
97 | 100 | assert res.json()["code"]=="200","回皮失败" |
98 | 101 | assert "data" in res.text,"回皮失败" |
99 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number) | |
102 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number) | |
100 | 103 | print(resListPage.json()) |
101 | 104 | assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败" |
102 | 105 | assert resListPage.json()["rows"][0]["tareWeight"] == tareWeight,"按照收费单号查询失败" |
... | ... | @@ -106,10 +109,10 @@ class test_listPage(unittest.TestCase): |
106 | 109 | """进门单列表-操作:整车进门冻结测试""" |
107 | 110 | plate = f"川A{random.randint(10000,99999)}" |
108 | 111 | goods = "雪莲果" |
109 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
112 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
110 | 113 | print(cre_res.json()) |
111 | 114 | number = cre_res.json()["data"]["number"] |
112 | - res_pay = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
115 | + res_pay = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
113 | 116 | assert res_pay.json()["code"]=="200","冻结失败" |
114 | 117 | assert res_pay.json()["message"] == "OK", "冻结失败" |
115 | 118 | |
... | ... | @@ -117,34 +120,34 @@ class test_listPage(unittest.TestCase): |
117 | 120 | """进门单列表-操作:整车进门解冻测试""" |
118 | 121 | plate = f"川A{random.randint(10000,99999)}" |
119 | 122 | goods = "雪莲果" |
120 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
123 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
121 | 124 | print(cre_res.json()) |
122 | 125 | number = cre_res.json()["data"]["number"] |
123 | - oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
124 | - res_unfreezeOrder = eOp.do_unfreezeOrder(host=self.jmsfHost,attrValue=number) | |
126 | + oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
127 | + res_unfreezeOrder = eOp.do_unfreezeOrder(session=session,host=self.jmsfHost,attrValue=number) | |
125 | 128 | assert res_unfreezeOrder.json()["code"]=="200","解冻失败" |
126 | 129 | assert res_unfreezeOrder.json()["message"] == "OK", "解冻失败" |
127 | 130 | |
128 | 131 | def test_invalidOrder(self): |
129 | 132 | """进门单列表-操作:整车进门作废测试""" |
130 | 133 | plate = f"川A{random.randint(10000,99999)}" |
131 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate) | |
134 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate) | |
132 | 135 | print(cre_res.json()) |
133 | 136 | number = cre_res.json()["data"]["number"] |
134 | - res_unfreezeOrder = oDI.do_invalidOrder(host=self.jmsfHost,attrValue=number) | |
137 | + res_unfreezeOrder = oDI.do_invalidOrder(session=session,host=self.jmsfHost,attrValue=number) | |
135 | 138 | assert res_unfreezeOrder.json()["number"]==number,"作废测试失败" |
136 | 139 | assert res_unfreezeOrder.json()["message"] == "作废成功!", "作废测试失败" |
137 | 140 | |
138 | 141 | def test_correctOrder(self): |
139 | 142 | """进门单列表-操作:整车进门更正测试""" |
140 | 143 | plate = f"川A{random.randint(10000,99999)}" |
141 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate) | |
144 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate) | |
142 | 145 | print(cre_res.json()) |
143 | 146 | number = cre_res.json()["data"]["number"] |
144 | - res_unfreezeOrder,totalAmount = oDC.do_correctOrder(host=self.jmsfHost,attrValue=number) | |
147 | + res_unfreezeOrder,totalAmount = oDC.do_correctOrder(session=session,host=self.jmsfHost,attrValue=number) | |
145 | 148 | assert res_unfreezeOrder.json()["success"]==True,"更正测试失败" |
146 | 149 | assert res_unfreezeOrder.json()["msg"] == "操作成功", "更正测试失败" |
147 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number) | |
150 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number) | |
148 | 151 | print(resListPage.json()) |
149 | 152 | assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败" |
150 | 153 | assert resListPage.json()["rows"][0]["$_totalPrice"] == totalAmount,"更正后订单界错误与预期金额不一致" |
... | ... | @@ -152,10 +155,10 @@ class test_listPage(unittest.TestCase): |
152 | 155 | def test_amendOrder(self): |
153 | 156 | """进门单列表-操作:整车进门修正测试""" |
154 | 157 | plate = f"川A{random.randint(10000,99999)}" |
155 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate) | |
158 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate) | |
156 | 159 | print(cre_res.json()) |
157 | 160 | number = cre_res.json()["data"]["number"] |
158 | - res_unfreezeOrder = oDA.do_amendOrder(host=self.jmsfHost,attrValue=number) | |
161 | + res_unfreezeOrder = oDA.do_amendOrder(session=session,host=self.jmsfHost,attrValue=number) | |
159 | 162 | assert res_unfreezeOrder.json()["success"]==True,"修正操作失败" |
160 | 163 | assert res_unfreezeOrder.json()["message"] == "操作成功", "修正操作失败" |
161 | 164 | |
... | ... | @@ -163,9 +166,9 @@ class test_listPage(unittest.TestCase): |
163 | 166 | """进门单列表-操作:整车进门退款测试""" |
164 | 167 | plate = f"川A{random.randint(10000,99999)}" |
165 | 168 | goods = "雪莲果" |
166 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
169 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
167 | 170 | number = cre_res.json()["data"]["number"] |
168 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
169 | - res_undo = oDU.do_undoOrder(host=self.jmsfHost,attrValue=number) | |
171 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
172 | + res_undo = oDU.do_undoOrder(session=session,host=self.jmsfHost,attrValue=number) | |
170 | 173 | assert res_undo.json()["code"] == "200","退款失败" |
171 | 174 | assert res_undo.json()["message"] == "OK","退款失败" |
172 | 175 | \ No newline at end of file | ... | ... |
testcase/heb/test_listPage/test_searchByAttrName.py
... | ... | @@ -18,6 +18,8 @@ from commons import ConfigDB as CoDB |
18 | 18 | from commons.MySession import my |
19 | 19 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
20 | 20 | import time,random |
21 | +from commons.MySession import sessionHeb | |
22 | +session = sessionHeb | |
21 | 23 | |
22 | 24 | class test_listPage(unittest.TestCase): |
23 | 25 | """哈尔滨市场-进门单列表:attr进门单属性查询测试""" |
... | ... | @@ -32,7 +34,7 @@ class test_listPage(unittest.TestCase): |
32 | 34 | def setUpClass(cls) -> None: |
33 | 35 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
34 | 36 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
35 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
37 | + cls.ic = rC.returnOptionsItems("testInfo", "hd_cardNumRe_01") | |
36 | 38 | |
37 | 39 | @classmethod |
38 | 40 | def tearDownClass(cls) -> None: |
... | ... | @@ -42,9 +44,9 @@ class test_listPage(unittest.TestCase): |
42 | 44 | """进门单列表-查询:收费单号查询测试""" |
43 | 45 | plate = f"川A{random.randint(10000, 99999)}" |
44 | 46 | goods = "树番茄" |
45 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
47 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
46 | 48 | number = cre_res.json()["data"]["number"] |
47 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number) | |
49 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number) | |
48 | 50 | print(resListPage.json()) |
49 | 51 | assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败" |
50 | 52 | assert len(resListPage.json()["rows"]) == 1,"按照收费单号查询失败" |
... | ... | @@ -53,30 +55,32 @@ class test_listPage(unittest.TestCase): |
53 | 55 | """进门单列表-查询:车牌号查询测试""" |
54 | 56 | plate = f"川A{random.randint(10000, 99999)}" |
55 | 57 | goods = "雪莲果" |
56 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
57 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="车号",attrValue=plate) | |
58 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
59 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="车号",attrValue=plate) | |
58 | 60 | print(resListPage.json()) |
59 | 61 | assert resListPage.json()["rows"][0]["plate"] == plate,"按照车牌号查询失败" |
60 | 62 | |
61 | 63 | def test_searchByGoods(self): |
62 | 64 | """进门单列表-查询:商品查询测试""" |
63 | 65 | goods = "树番茄" |
64 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,keyword=goods) | |
65 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="商品",attrValue=goods) | |
66 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,keyword=goods) | |
67 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="商品",attrValue=goods) | |
66 | 68 | print(resListPage.json()) |
67 | 69 | assert resListPage.json()["rows"][0]["productName"] == goods,"按照商品查询失败" |
68 | 70 | |
71 | + @unittest.skip | |
69 | 72 | def test_searchByTollman(self): |
70 | 73 | """进门单列表-查询:收费员查询测试""" |
71 | 74 | plate = f"川A{random.randint(10000, 99999)}" |
72 | 75 | goods = "雪莲果" |
73 | 76 | userName = "hd_test" |
74 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods,userName=userName) | |
77 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods,userName=userName) | |
75 | 78 | number = cre_res.json()["data"]["number"] |
76 | 79 | # 进门单缴费 |
77 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
80 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
78 | 81 | payUser = my.userInfo["data"]["user"]["realName"] |
79 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="收费员",attrValue=payUser) | |
82 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="收费员",attrValue=payUser) | |
83 | + print(resListPage.json()) | |
80 | 84 | numberList = [i["number"] for i in resListPage.json()["rows"]] |
81 | 85 | numberStr = ",".join(numberList) |
82 | 86 | # 缴费状态验证 |
... | ... | @@ -89,15 +93,15 @@ class test_listPage(unittest.TestCase): |
89 | 93 | def test_searchByCname(self): |
90 | 94 | """进门单列表-查询:客户名称查询测试""" |
91 | 95 | ic = self.ic |
92 | - cName = eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
96 | + cName = eFBL.get_icCheck(session=session,host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
93 | 97 | # 创建进门单 |
94 | 98 | plate = f"川A{random.randint(10000, 99999)}" |
95 | 99 | goods = "雪莲果" |
96 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
100 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
97 | 101 | number = cre_res.json()["data"]["number"] |
98 | 102 | # 进门单缴费 |
99 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
100 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="客户姓名",attrValue=cName) | |
103 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
104 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="客户姓名",attrValue=cName) | |
101 | 105 | print(resListPage.json()) |
102 | 106 | cNameList = list(set([i["customerName"] for i in resListPage.json()["rows"]])) |
103 | 107 | print(cNameList) |
... | ... | @@ -112,10 +116,10 @@ class test_listPage(unittest.TestCase): |
112 | 116 | # 创建进门单 |
113 | 117 | plate = f"川A{random.randint(10000, 99999)}" |
114 | 118 | goods = "雪莲果" |
115 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
119 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
116 | 120 | number = cre_res.json()["data"]["number"] |
117 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
118 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="客户卡号",attrValue=ic) | |
121 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
122 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="客户卡号",attrValue=ic) | |
119 | 123 | print(resListPage.json()) |
120 | 124 | icList = list(set([i["ic"] for i in resListPage.json()["rows"]])) |
121 | 125 | print(icList) |
... | ... | @@ -127,15 +131,15 @@ class test_listPage(unittest.TestCase): |
127 | 131 | def test_searchByPhone(self): |
128 | 132 | """进门单列表-查询:手机号码询测试""" |
129 | 133 | ic = self.ic |
130 | - cPhone = eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerContactsPhone"] | |
134 | + cPhone = eFBL.get_icCheck(session=session,host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerContactsPhone"] | |
131 | 135 | # 创建进门单并缴费 |
132 | 136 | plate = f"川A{random.randint(10000, 99999)}" |
133 | 137 | goods = "雪莲果" |
134 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
138 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
135 | 139 | number = cre_res.json()["data"]["number"] |
136 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
140 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
137 | 141 | # 查询进门单 |
138 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="手机号码",attrValue=cPhone) | |
142 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="手机号码",attrValue=cPhone) | |
139 | 143 | numberList = [i["number"] for i in resListPage.json()["rows"]] |
140 | 144 | numberStr = ",".join(numberList) |
141 | 145 | cPhoneFromDb = CoDB.mysql_selectAll(f'SELECT customer_phone FROM entrance_fee_bill WHERE number in ({numberStr});') | ... | ... |
testcase/heb/test_listPage/test_searchByOther.py
... | ... | @@ -20,6 +20,8 @@ from commons.api.entranceFeeBillList import operationDoUndo as oDU |
20 | 20 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
21 | 21 | from commons.api.entranceFeeBillList import operationDoUpdate as oDUp |
22 | 22 | import time,random |
23 | +from commons.MySession import sessionHeb | |
24 | +session = sessionHeb | |
23 | 25 | |
24 | 26 | class test_listPage(unittest.TestCase): |
25 | 27 | """哈尔滨市场-进门单列表:attr进门单属性查询测试""" |
... | ... | @@ -34,13 +36,13 @@ class test_listPage(unittest.TestCase): |
34 | 36 | def setUpClass(cls) -> None: |
35 | 37 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
36 | 38 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
37 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
38 | - carTypeList = gLL.get_LookupList(host=cls.jmsfHost,providerName="车型").json()[1:] | |
39 | - categoryList = gLL.get_LookupList(host=cls.jmsfHost, providerName="货物品类").json()[1:] | |
40 | - authDepartmentList = zcA.get_dep(cls.gatewayHost).json()["data"] | |
41 | - entranceFeeBillTypeList = gLL.get_LookupList(host=cls.jmsfHost, providerName="称重类型").json()[1:] | |
42 | - entranceFeeBillStateList = gLL.get_LookupList(host=cls.jmsfHost, providerName="状态").json()[1:] | |
43 | - tradeTypeList = gLL.get_LookupList(host=cls.jmsfHost, providerName="交易类型").json()[1:] | |
39 | + cls.ic = rC.returnOptionsItems("testInfo", "hd_cardNumRe_01") | |
40 | + carTypeList = gLL.get_LookupList(session=session,host=cls.jmsfHost,providerName="车型").json()[1:] | |
41 | + categoryList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="货物品类").json()[1:] | |
42 | + authDepartmentList = zcA.get_dep(session=session,host=cls.gatewayHost).json()["data"] | |
43 | + entranceFeeBillTypeList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="称重类型").json()[1:] | |
44 | + entranceFeeBillStateList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="状态").json()[1:] | |
45 | + tradeTypeList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="交易类型").json()[1:] | |
44 | 46 | cls.carType = random.sample(carTypeList, 1)[0] |
45 | 47 | cls.category = random.sample(categoryList, 1)[0] |
46 | 48 | cls.authDepartment = random.sample(authDepartmentList, 1)[0] |
... | ... | @@ -55,9 +57,9 @@ class test_listPage(unittest.TestCase): |
55 | 57 | def test_searchByCardTepy(self): |
56 | 58 | """进门单列表-查询:车型查询测试""" |
57 | 59 | print(self.carType) |
58 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName=self.carType["text"]) | |
60 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,carTypeName=self.carType["text"]) | |
59 | 61 | number = cre_res.json()["data"]["number"] |
60 | - resListPage = eFBL.listPage(host=self.jmsfHost,carTypeId=self.carType["value"]) | |
62 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,carTypeId=self.carType["value"]) | |
61 | 63 | print(resListPage.json()) |
62 | 64 | carTypeList=list(set([i["carTypeName"] for i in resListPage.json()["rows"]])) |
63 | 65 | assert resListPage.json()["rows"][0]["number"] == number,"车型查询失败查询失败" |
... | ... | @@ -68,22 +70,22 @@ class test_listPage(unittest.TestCase): |
68 | 70 | """进门单列表-查询:货物品类查询测试""" |
69 | 71 | goods="雪莲果" |
70 | 72 | categoryName = "水果" |
71 | - res = gLL.get_LookupList(self.jmsfHost,providerName="货物品类") | |
73 | + res = gLL.get_LookupList(session=session,host=self.jmsfHost,providerName="货物品类") | |
72 | 74 | categoryId = [i["value"] for i in res.json() if i["text"]==categoryName] |
73 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,keyword=goods) | |
75 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,keyword=goods) | |
74 | 76 | number = cre_res.json()["data"]["number"] |
75 | - resListPage = eFBL.listPage(host=self.jmsfHost,categoryId=categoryId) | |
77 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,categoryId=categoryId) | |
76 | 78 | print(resListPage.json()) |
77 | 79 | assert resListPage.json()["rows"][0]["number"] == number,"货物品类查询失败" |
78 | 80 | |
79 | 81 | def test_searchByProductName(self): |
80 | 82 | """进门单列表-查询:商品查询测试""" |
81 | 83 | productName = "水生蔬菜" |
82 | - productId = gLL.get_product(self.jmsfHost,productName=productName).json()["data"][0]["id"] | |
84 | + productId = gLL.get_product(session=session,host=self.jmsfHost,productName=productName).json()["data"][0]["id"] | |
83 | 85 | print(productId) |
84 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,keyword=productName) | |
86 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,keyword=productName) | |
85 | 87 | number = cre_res.json()["data"]["number"] |
86 | - resListPage = eFBL.listPage(host=self.jmsfHost,productName=productName,productId=productId) | |
88 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,productName=productName,productId=productId) | |
87 | 89 | print(resListPage.json()) |
88 | 90 | productNameList=list(set([i["productName"] for i in resListPage.json()["rows"]])) |
89 | 91 | assert resListPage.json()["rows"][0]["number"] == number,"商品查询测试失败" |
... | ... | @@ -94,9 +96,9 @@ class test_listPage(unittest.TestCase): |
94 | 96 | """进门单列表-查询:部门查询查询测试""" |
95 | 97 | print(self.authDepartment) |
96 | 98 | print(self.authDepartment["name"]) |
97 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,depName=self.authDepartment["name"]) | |
99 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,depName=self.authDepartment["name"]) | |
98 | 100 | number = cre_res.json()["data"]["number"] |
99 | - resListPage = eFBL.listPage(host=self.jmsfHost,dep=self.authDepartment["id"]) | |
101 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,dep=self.authDepartment["id"]) | |
100 | 102 | # print(resListPage.json()) |
101 | 103 | depNameList=list(set([i["depName"] for i in resListPage.json()["rows"]])) |
102 | 104 | assert resListPage.json()["rows"][0]["number"] == number,"部门查询查询测试失败" |
... | ... | @@ -107,18 +109,18 @@ class test_listPage(unittest.TestCase): |
107 | 109 | """进门单列表-查询:部门查询查询测试""" |
108 | 110 | depName = "哈达测试部" |
109 | 111 | goods = "水生蔬菜" |
110 | - res = gLL.get_LookupList(self.jmsfHost,providerName="接车部门") | |
112 | + res = gLL.get_LookupList(session=session,host=self.jmsfHost,providerName="接车部门") | |
111 | 113 | dep = [i["value"] for i in res.json() if i["text"] == depName] |
112 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,depName=depName,keyword=goods) | |
114 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,depName=depName,keyword=goods) | |
113 | 115 | number = cre_res.json()["data"]["number"] |
114 | 116 | print(number) |
115 | 117 | orderId = cre_res.json()["data"]["id"] |
116 | - oDUp.do_updateOrder(host=self.jmsfHost,attrValue=number) | |
117 | - res = eFBL.get_orderView(host=self.jmsfHost,orderId=orderId) | |
118 | + oDUp.do_updateOrder(session=session,host=self.jmsfHost,attrValue=number) | |
119 | + res = eFBL.get_orderView(session=session,host=self.jmsfHost,orderId=orderId) | |
118 | 120 | # bs取值 |
119 | 121 | orderDetailsList = BeautifulSoup(res.text, "html.parser").findAll("input") |
120 | 122 | orderDetailsDict = {i.get("name"): i.get("value") for i in orderDetailsList} |
121 | - resListPage = eFBL.listPage(host=self.jmsfHost,dep=dep,regionId=orderDetailsDict["regionId"]) | |
123 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,dep=dep,regionId=orderDetailsDict["regionId"]) | |
122 | 124 | depNameList=list(set([i["depName"] for i in resListPage.json()["rows"]])) |
123 | 125 | print(depNameList) |
124 | 126 | assert resListPage.json()["rows"][0]["number"] == number,"部门查询查询测试失败" |
... | ... | @@ -127,7 +129,7 @@ class test_listPage(unittest.TestCase): |
127 | 129 | |
128 | 130 | def test_searchByBillType(self): |
129 | 131 | """进门单列表-查询:称重类型查询测试""" |
130 | - resListPage = eFBL.listPage(host=self.jmsfHost,type="1") | |
132 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,type="1") | |
131 | 133 | print(resListPage.json()) |
132 | 134 | resList=list(set([i["type"] for i in resListPage.json()["rows"]])) |
133 | 135 | assert len(resList) == 1,"称重类型查询测试失败" |
... | ... | @@ -136,9 +138,9 @@ class test_listPage(unittest.TestCase): |
136 | 138 | def test_searchByStatus(self): |
137 | 139 | """进门单列表-查询:交易状态查询测试""" |
138 | 140 | status = "4" |
139 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName=self.carType["text"]) | |
141 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,carTypeName=self.carType["text"]) | |
140 | 142 | number = cre_res.json()["data"]["number"] |
141 | - resListPage = eFBL.listPage(host=self.jmsfHost,status=status) | |
143 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,status=status) | |
142 | 144 | print(resListPage.json()) |
143 | 145 | statusList=list(set([i["status"] for i in resListPage.json()["rows"]])) |
144 | 146 | assert resListPage.json()["rows"][0]["number"] != number,"交易状态查询测试失败" |
... | ... | @@ -149,9 +151,9 @@ class test_listPage(unittest.TestCase): |
149 | 151 | def test_searchByTradeType(self): |
150 | 152 | """进门单列表-查询:交易类型查询测试""" |
151 | 153 | print(self.tradeType) |
152 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,transactionName=self.tradeType["text"]) | |
154 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,transactionName=self.tradeType["text"]) | |
153 | 155 | number = cre_res.json()["data"]["number"] |
154 | - resListPage = eFBL.listPage(host=self.jmsfHost,tradeTypeId=self.tradeType["value"]) | |
156 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,tradeTypeId=self.tradeType["value"]) | |
155 | 157 | print(resListPage.json()) |
156 | 158 | carTypeList=list(set([i["tradeTypeName"] for i in resListPage.json()["rows"]])) |
157 | 159 | assert resListPage.json()["rows"][0]["number"] == number,"交易类型查询测试失败" |
... | ... | @@ -163,11 +165,11 @@ class test_listPage(unittest.TestCase): |
163 | 165 | ic = self.ic |
164 | 166 | plate = f"川A{random.randint(10000, 99999)}" |
165 | 167 | goods = "雪莲果" |
166 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
168 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
167 | 169 | number = cre_res.json()["data"]["number"] |
168 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
169 | - createdTime = eFBL.listPage(host=self.jmsfHost,attrValue=number).json()["rows"][0]["created"] | |
170 | - resListPage = eFBL.listPage(host=self.jmsfHost,startTime=createdTime,endTime=createdTime) | |
170 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
171 | + createdTime = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number).json()["rows"][0]["created"] | |
172 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,startTime=createdTime,endTime=createdTime) | |
171 | 173 | print(resListPage.json()) |
172 | 174 | createdTimeList = list(set([i["created"] for i in resListPage.json()["rows"]])) |
173 | 175 | assert len(createdTimeList) == 1,"进场时间查询测试失败" |
... | ... | @@ -178,11 +180,11 @@ class test_listPage(unittest.TestCase): |
178 | 180 | ic = self.ic |
179 | 181 | plate = f"川A{random.randint(10000, 99999)}" |
180 | 182 | goods = "雪莲果" |
181 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
183 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
182 | 184 | number = cre_res.json()["data"]["number"] |
183 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
184 | - createdTime = eFBL.listPage(host=self.jmsfHost,attrValue=number).json()["rows"][0]["paymentTime"] | |
185 | - resListPage = eFBL.listPage(host=self.jmsfHost,startPayTime=createdTime,endPayTime=createdTime) | |
185 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
186 | + createdTime = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number).json()["rows"][0]["paymentTime"] | |
187 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,startPayTime=createdTime,endPayTime=createdTime) | |
186 | 188 | print(resListPage.json()) |
187 | 189 | createdTimeList = list(set([i["paymentTime"] for i in resListPage.json()["rows"]])) |
188 | 190 | assert len(createdTimeList) == 1,"缴费时间查询测试失败" |
... | ... | @@ -192,13 +194,13 @@ class test_listPage(unittest.TestCase): |
192 | 194 | """进门单列表-操作:退款时间查询""" |
193 | 195 | plate = f"川A{random.randint(10000,99999)}" |
194 | 196 | goods = "雪莲果" |
195 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
197 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
196 | 198 | number = cre_res.json()["data"]["number"] |
197 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
199 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
198 | 200 | time.sleep(3) |
199 | - res_undo = oDU.do_undoOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
201 | + res_undo = oDU.do_undoOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
200 | 202 | refundTime = msa(f'SELECT efbd.operator_time FROM entrance_fee_bill efb JOIN entrance_fee_bill_detail efbd ON efb.id=efbd.bill_id WHERE efb.number="{number}";')[0][0] |
201 | - resListPage = eFBL.listPage(host=self.jmsfHost, startRefundTime=refundTime, endRefundTime=refundTime) | |
203 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost, startRefundTime=refundTime, endRefundTime=refundTime) | |
202 | 204 | assert resListPage.json()["rows"][0]["number"]==number,"退款时间查询失败" |
203 | 205 | refundNumberList = list(set([i["number"] for i in resListPage.json()["rows"]])) |
204 | 206 | res_msa = [i[0] for i in msa(f'SELECT efb.number FROM entrance_fee_bill efb JOIN entrance_fee_bill_detail efbd ON efb.id=efbd.bill_id WHERE efbd.operator_time="{refundTime}";')] | ... | ... |
testcase/sy/test_HP/test_HP.py
... | ... | @@ -18,6 +18,9 @@ from commons.api.entranceFeeBillList import operationDoFreeze as oDF |
18 | 18 | from commons.api import hpApi |
19 | 19 | import time,random |
20 | 20 | |
21 | +from commons.MySession import sessionSy | |
22 | +session = sessionSy | |
23 | + | |
21 | 24 | class test_HPCreate(unittest.TestCase): |
22 | 25 | """沈阳市场-整车-车辆回皮""" |
23 | 26 | def setUp(self) -> None: |
... | ... | @@ -31,7 +34,7 @@ class test_HPCreate(unittest.TestCase): |
31 | 34 | def setUpClass(cls) -> None: |
32 | 35 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
33 | 36 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
34 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
37 | + cls.ic = rC.returnOptionsItems("testInfo", "sy_cardNumRe_01") | |
35 | 38 | |
36 | 39 | @classmethod |
37 | 40 | def tearDownClass(cls) -> None: |
... | ... | @@ -41,11 +44,11 @@ class test_HPCreate(unittest.TestCase): |
41 | 44 | """整车-车辆回皮:创建回皮进门单""" |
42 | 45 | plate = f"川B{random.randint(10000,99999)}" |
43 | 46 | goods = "雪莲果" |
44 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
47 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
45 | 48 | print(cre_res.json()) |
46 | 49 | number = cre_res.json()["data"]["number"] |
47 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
48 | - res,tareWeight = hpApi.do_backSkinWeighSave(host=self.gatewayHost,number=number) | |
50 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
51 | + res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number) | |
49 | 52 | assert res.json()["code"]=="200","回皮失败" |
50 | 53 | assert "data" in res.text,"回皮失败" |
51 | 54 | |
... | ... | @@ -53,11 +56,11 @@ class test_HPCreate(unittest.TestCase): |
53 | 56 | """整车-车辆回皮:根据车牌号查询""" |
54 | 57 | plate = f"川B{random.randint(10000,99999)}" |
55 | 58 | goods="火龙果" |
56 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
59 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
57 | 60 | print(cre_res.json()) |
58 | 61 | number = cre_res.json()["data"]["number"] |
59 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
60 | - res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,plate=plate) | |
62 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
63 | + res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,plate=plate) | |
61 | 64 | print(res.json()) |
62 | 65 | assert res.json()["code"]=="200","车号查询失败" |
63 | 66 | assert res.json()["data"][-1]["number"]==number,"车号查询失败" |
... | ... | @@ -66,11 +69,11 @@ class test_HPCreate(unittest.TestCase): |
66 | 69 | """整车-车辆回皮:根据收费单号查询""" |
67 | 70 | plate = f"川B{random.randint(10000,99999)}" |
68 | 71 | goods="火龙果" |
69 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
72 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
70 | 73 | print(cre_res.json()) |
71 | 74 | number = cre_res.json()["data"]["number"] |
72 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
73 | - res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,number=number) | |
75 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
76 | + res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,number=number) | |
74 | 77 | print(res.json()) |
75 | 78 | assert res.json()["code"]=="200","车号查询失败" |
76 | 79 | assert res.json()["data"][-1]["number"]==number,"车号查询失败" |
... | ... | @@ -80,13 +83,13 @@ class test_HPCreate(unittest.TestCase): |
80 | 83 | plate = f"川B{random.randint(10000,99999)}" |
81 | 84 | goods="雪莲果" |
82 | 85 | ic = self.ic |
83 | - customerName= eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
86 | + customerName= eFBL.get_icCheck(session=session,host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
84 | 87 | print(customerName) |
85 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
88 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
86 | 89 | print(cre_res.json()) |
87 | 90 | number = cre_res.json()["data"]["number"] |
88 | - aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
89 | - res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,customerName=customerName) | |
91 | + aa = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
92 | + res = hpApi.get_listBackSkinTrucks(session=session,host=self.gatewayHost,customerName=customerName) | |
90 | 93 | print(res.json()) |
91 | 94 | assert res.json()["code"]=="200","车号查询失败" |
92 | 95 | assert res.json()["data"][-1]["number"]==number,"车号查询失败" |
93 | 96 | \ No newline at end of file | ... | ... |
testcase/sy/test_SJ/test_SJ.py
... | ... | @@ -17,6 +17,9 @@ from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 17 | from commons.api import sjApi |
18 | 18 | import time,random |
19 | 19 | |
20 | +from commons.MySession import sessionSy | |
21 | +session = sessionSy | |
22 | + | |
20 | 23 | class test_ZCCreate(unittest.TestCase): |
21 | 24 | """沈阳市场-整车-创建整车进门单""" |
22 | 25 | def setUp(self) -> None: |
... | ... | @@ -46,7 +49,7 @@ class test_ZCCreate(unittest.TestCase): |
46 | 49 | |
47 | 50 | |
48 | 51 | # 获取车型 |
49 | - carType = zcA.get_carType(host=self.gatewayHost) | |
52 | + carType = zcA.get_carType(session=session,host=self.gatewayHost) | |
50 | 53 | print(carType.text) |
51 | 54 | print(carType.json()["data"][0]) |
52 | 55 | carTypeCode = carType.json()["data"][0]["code"] |
... | ... | @@ -54,51 +57,51 @@ class test_ZCCreate(unittest.TestCase): |
54 | 57 | carTypeName = carType.json()["data"][0]["carTypeName"] |
55 | 58 | |
56 | 59 | # 获取商品 |
57 | - categoryByCondition = zcA.get_listCategoryByCondition(host=self.gatewayHost) | |
60 | + categoryByCondition = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost) | |
58 | 61 | print(categoryByCondition.json()) |
59 | 62 | cateId = categoryByCondition.json()["data"][0]["id"] |
60 | 63 | productId = categoryByCondition.json()["data"][0]["id"] |
61 | 64 | productName = categoryByCondition.json()["data"][0]["name"] |
62 | 65 | |
63 | 66 | # 获取接车员 |
64 | - listByExample = zcA.get_listByExample(host=self.gatewayHost) | |
67 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost) | |
65 | 68 | print(listByExample.json()) |
66 | 69 | inGreeterId = listByExample.json()["data"][0]["id"] |
67 | 70 | inGreeterName = listByExample.json()["data"][0]["realName"] |
68 | 71 | |
69 | 72 | # 获取交易类型 |
70 | - transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
73 | + transactionType = zcA.query_transactionType(session=session,host=self.gatewayHost) | |
71 | 74 | print(transactionType.json()) |
72 | 75 | tradeType = transactionType.json()["rows"][0]["code"] |
73 | 76 | tradeTypeId = transactionType.json()["rows"][0]["id"] |
74 | 77 | tradeTypeName = transactionType.json()["rows"][0]["name"] |
75 | 78 | |
76 | 79 | # 获取货物标签 |
77 | - goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
80 | + goodsTag = zcA.get_goodsTag(session=session,host=self.gatewayHost) | |
78 | 81 | print(goodsTag.json()) |
79 | 82 | goodsTagId = goodsTag.json()["data"][0]["id"] |
80 | 83 | |
81 | 84 | # 产地信息获取 |
82 | - address = zcA.get_address(host=self.gatewayHost) | |
85 | + address = zcA.get_address(session=session,host=self.gatewayHost) | |
83 | 86 | print(address.json()) |
84 | 87 | originId = address.json()["data"][0]["id"] |
85 | 88 | origin = address.json()["data"][0]["name"] |
86 | 89 | originCode = address.json()["data"][0]["cityCode"] |
87 | 90 | |
88 | 91 | # 查询部门信息 |
89 | - depRes = zcA.get_dep(host=self.gatewayHost) | |
92 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost) | |
90 | 93 | print(depRes.json()) |
91 | 94 | feeDepId = depRes.json()["data"][0]["id"] |
92 | 95 | feeDepName = depRes.json()["data"][0]["name"] |
93 | 96 | |
94 | 97 | # 获取证明类型 |
95 | - proveType = zcA.get_proveType(host=self.gatewayHost) | |
98 | + proveType = zcA.get_proveType(session=session,host=self.gatewayHost) | |
96 | 99 | print(proveType.json()) |
97 | 100 | proveTypeCode = proveType.json()["data"][0]["id"] |
98 | 101 | proveTypeName = proveType.json()["data"][0]["name"] |
99 | 102 | |
100 | 103 | # 获取防重token |
101 | - duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
104 | + duplicateTokenRes = zcA.get_duplicateToken(session=session,host=self.gatewayHost) | |
102 | 105 | print(duplicateTokenRes.json()) |
103 | 106 | duplicateToken = duplicateTokenRes.json()["data"] |
104 | 107 | |
... | ... | @@ -106,7 +109,7 @@ class test_ZCCreate(unittest.TestCase): |
106 | 109 | weight = int(itemWeight) * int(qty) |
107 | 110 | |
108 | 111 | # 创建进门单 |
109 | - cre_res = sjApi.create_sparePartsWeighSave(host=self.gatewayHost, duplicateToken=duplicateToken, | |
112 | + cre_res = sjApi.create_sparePartsWeighSave(session=session,host=self.gatewayHost, duplicateToken=duplicateToken, | |
110 | 113 | carTypeCode=carTypeCode, carTypeId=carTypeId, |
111 | 114 | carTypeName=carTypeName, plate=plate, weight=weight, |
112 | 115 | productId=productId, productName=productName, proveTypeCode=proveTypeCode, | ... | ... |
testcase/sy/test_ZC/demo_b.py
... | ... | @@ -17,10 +17,14 @@ from commons.api.entranceFeeBillList import apiDemo |
17 | 17 | import time,random |
18 | 18 | |
19 | 19 | from commons.MySession import mysession |
20 | -session = mysession() | |
21 | -session.cliLogin() | |
20 | +session = mysession().cliLogin() | |
21 | + | |
22 | +global mk_sign | |
23 | +mk_sign = "hb" | |
22 | 24 | |
23 | 25 | class test_ZCCreate(unittest.TestCase): |
26 | + | |
27 | + | |
24 | 28 | """沈阳市场-整车-创建整车进门单""" |
25 | 29 | def setUp(self) -> None: |
26 | 30 | pass |
... | ... | @@ -47,10 +51,13 @@ class test_ZCCreate(unittest.TestCase): |
47 | 51 | trailerNumber = plate |
48 | 52 | |
49 | 53 | # 获取车型 |
50 | - carType = apiDemo.get_carType(session=session,host=self.gatewayHost) | |
54 | + carType = apiDemo.get_carType(host=self.gatewayHost) | |
51 | 55 | print(carType.text) |
52 | 56 | print(carType.json()["data"][0]) |
53 | 57 | |
54 | 58 | # 获取商品 |
55 | - categoryByCondition = apiDemo.get_listCategoryByCondition(session=session,host=self.gatewayHost) | |
56 | - print(categoryByCondition.json()) | |
57 | 59 | \ No newline at end of file |
60 | + categoryByCondition = apiDemo.get_listCategoryByCondition(host=self.gatewayHost) | |
61 | + print(categoryByCondition.json()) | |
62 | + | |
63 | +print("mk_sign",mk_sign) | |
64 | +print("apiDemo.mk_sign",apiDemo.mk_sign) | |
58 | 65 | \ No newline at end of file | ... | ... |
testcase/sy/test_ZC/test_ZCBasic.py
... | ... | @@ -13,9 +13,9 @@ import json |
13 | 13 | import unittest |
14 | 14 | from commons.scripts.readConf import rC |
15 | 15 | from commons.api import zcApi as zcA |
16 | -from commons.MySession import my | |
17 | -from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL | |
18 | -import time,random | |
16 | +from commons.basic import getLookupList as gLL | |
17 | +from commons.MySession import sessionSy | |
18 | +session = sessionSy | |
19 | 19 | |
20 | 20 | class test_ZCBasic(unittest.TestCase): |
21 | 21 | """沈阳市场-整车-创建整车进门单基础信息接口测试""" |
... | ... | @@ -38,7 +38,7 @@ class test_ZCBasic(unittest.TestCase): |
38 | 38 | def test_getCar(self): |
39 | 39 | """整车-整车创建:获取车型接口调用测试""" |
40 | 40 | # 获取车型 |
41 | - carType = zcA.get_carType(host=self.gatewayHost) | |
41 | + carType = zcA.get_carType(session=session,host=self.gatewayHost) | |
42 | 42 | print(carType.text) |
43 | 43 | assert carType.json()["code"] == "200" |
44 | 44 | assert carType.json()["data"] != [] |
... | ... | @@ -46,9 +46,9 @@ class test_ZCBasic(unittest.TestCase): |
46 | 46 | def test_getAllCategory(self): |
47 | 47 | """整车-整车创建:获取测试商品信息测试""" |
48 | 48 | # 获取 |
49 | - # print(my.userInfo["data"]["user"]["firmCode"]) | |
50 | - marketId = my.userInfo["data"]["user"]["firmId"] | |
51 | - resCategory = zcA.get_listCategoryByCondition(host=self.gatewayHost,marketId=marketId,keyword="") | |
49 | + # print(session.userInfo["data"]["user"]["firmCode"]) | |
50 | + marketId = session.userInfo["data"]["user"]["firmId"] | |
51 | + resCategory = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost,marketId=marketId,keyword="") | |
52 | 52 | print(resCategory.text) |
53 | 53 | assert resCategory.json()["code"] == "200","全商品查询失败" |
54 | 54 | assert resCategory.json()["data"] != [],"全商品查询失败,查询结果不应该为空" |
... | ... | @@ -56,8 +56,8 @@ class test_ZCBasic(unittest.TestCase): |
56 | 56 | def test_getOneCategory(self): |
57 | 57 | """整车-整车创建:获取测试商品信息测试""" |
58 | 58 | # 获取 |
59 | - marketId = my.userInfo["data"]["user"]["firmId"] | |
60 | - resCategory = zcA.get_listCategoryByCondition(host=self.gatewayHost,marketId=marketId,keyword="火龙果") | |
59 | + marketId = session.userInfo["data"]["user"]["firmId"] | |
60 | + resCategory = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost,marketId=marketId,keyword="火龙果") | |
61 | 61 | print(resCategory.text) |
62 | 62 | nameList = [i["name"] for i in resCategory.json()["data"]] |
63 | 63 | assert resCategory.json()["code"] == "200" |
... | ... | @@ -66,29 +66,29 @@ class test_ZCBasic(unittest.TestCase): |
66 | 66 | |
67 | 67 | def test_getAllExample(self): |
68 | 68 | """整车-整车创建:接车员信息获取测试""" |
69 | - # print(my.userInfo["data"]["user"]["departmentId"]) | |
70 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
71 | - departmentId = my.userInfo["data"]["user"]["departmentId"] | |
72 | - listByExample = zcA.get_listByExample(host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId) | |
69 | + # print(session.userInfo["data"]["user"]["departmentId"]) | |
70 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
71 | + departmentId = session.userInfo["data"]["user"]["departmentId"] | |
72 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId) | |
73 | 73 | print(listByExample.json()) |
74 | 74 | assert listByExample.json()["code"]=="200","接车员信息获取测试失败" |
75 | 75 | assert listByExample.json()["data"]!=[],"接车员信息获取测试失败" |
76 | 76 | |
77 | 77 | def test_getOneExample(self): |
78 | 78 | """整车-整车创建:按接车员名称信息查询接车员""" |
79 | - # print(my.userInfo["data"]["user"]["departmentId"]) | |
80 | - # firmCode = my.userInfo["data"]["user"]["firmCode"] | |
81 | - # departmentId = my.userInfo["data"]["user"]["departmentId"] | |
79 | + # print(session.userInfo["data"]["user"]["departmentId"]) | |
80 | + # firmCode = session.userInfo["data"]["user"]["firmCode"] | |
81 | + # departmentId = session.userInfo["data"]["user"]["departmentId"] | |
82 | 82 | |
83 | - firmCode = my.userInfo["data"]["user"]["firmCode"] | |
84 | - firmId = my.userInfo["data"]["user"]["firmId"] | |
83 | + firmCode = session.userInfo["data"]["user"]["firmCode"] | |
84 | + firmId = session.userInfo["data"]["user"]["firmId"] | |
85 | 85 | try: |
86 | - res_config = gLL.get_config(host=host, marketId=firmId) | |
86 | + res_config = gLL.get_config(session=session,host=self.gatewayHost, marketId=firmId) | |
87 | 87 | departmentId = [i["value"] for i in res_config.json()["rows"] if i["name"] == "DepartmentId"][0] |
88 | 88 | except: |
89 | 89 | departmentId = None |
90 | 90 | keyword="测试" |
91 | - listByExample = zcA.get_listByExample(host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId, | |
91 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost,firmCode=firmCode,departmentId=departmentId, | |
92 | 92 | keyword=keyword) |
93 | 93 | print(listByExample.json()) |
94 | 94 | assert listByExample.json()["code"]=="200","按接车员名称信息查询接车员测试失败" |
... | ... | @@ -96,14 +96,14 @@ class test_ZCBasic(unittest.TestCase): |
96 | 96 | |
97 | 97 | def test_transactionType(self): |
98 | 98 | """整车-整车创建:交易类型获取测试""" |
99 | - transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
99 | + transactionType = zcA.query_transactionType(session=session,host=self.gatewayHost) | |
100 | 100 | print(transactionType.json()) |
101 | 101 | assert transactionType.status_code==200,"交易类型信息获取测试失败" |
102 | 102 | assert transactionType.json()["rows"]!=[],"交易类型信息获取测试失败" |
103 | 103 | |
104 | 104 | def test_getGoodsTag(self): |
105 | 105 | """整车-整车创建:货物标签获取测试""" |
106 | - goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
106 | + goodsTag = zcA.get_goodsTag(session=session,host=self.gatewayHost) | |
107 | 107 | print(goodsTag.json()) |
108 | 108 | assert goodsTag.status_code==200,"货物标签信息获取测试失败" |
109 | 109 | assert goodsTag.json()["data"]!=[],"货物标签信息获取测试失败" |
... | ... | @@ -111,7 +111,7 @@ class test_ZCBasic(unittest.TestCase): |
111 | 111 | def test_getAllAddress(self): |
112 | 112 | """整车-整车创建:按照省份查询产地""" |
113 | 113 | province = "四川省" |
114 | - address = zcA.get_address(host=self.gatewayHost,province=province) | |
114 | + address = zcA.get_address(session=session,host=self.gatewayHost,province=province) | |
115 | 115 | print(address.json()) |
116 | 116 | assert address.json()["code"] == "200","按照省份查询产地信息获取测试失败" |
117 | 117 | mergerNameList = [i["mergerName"] for i in address.json()["data"] if province not in i["mergerName"]] |
... | ... | @@ -122,7 +122,7 @@ class test_ZCBasic(unittest.TestCase): |
122 | 122 | province = "四川省" |
123 | 123 | city = "成都市" |
124 | 124 | area = "锦江区" |
125 | - address = zcA.get_address(host=self.gatewayHost,province=province,city=city,area=area) | |
125 | + address = zcA.get_address(session=session,host=self.gatewayHost,province=province,city=city,area=area) | |
126 | 126 | print(address.json()) |
127 | 127 | assert address.json()["code"]=="200","详细产地信息查询失败" |
128 | 128 | assert len(address.json()["data"])==1,"详细产地信息查询只能查询出一个结果,查询结果超过一个测试失败" |
... | ... | @@ -130,7 +130,7 @@ class test_ZCBasic(unittest.TestCase): |
130 | 130 | |
131 | 131 | def test_getAllDep(self): |
132 | 132 | """整车-整车创建:接车部门信息获取""" |
133 | - depRes = zcA.get_dep(host=self.gatewayHost) | |
133 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost) | |
134 | 134 | print(depRes.json()) |
135 | 135 | assert depRes.json()["code"]=="200","接车部门信息获取测试失败" |
136 | 136 | assert depRes.json()["data"] != [], "接车部门信息获取测试失败" |
... | ... | @@ -139,7 +139,7 @@ class test_ZCBasic(unittest.TestCase): |
139 | 139 | def test_getOneDep(self): |
140 | 140 | """整车-整车创建:查询指定接车部门信息""" |
141 | 141 | keyword="水果部" |
142 | - depRes = zcA.get_dep(host=self.gatewayHost,keyword=keyword) | |
142 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost,keyword=keyword) | |
143 | 143 | print(depRes.json()) |
144 | 144 | assert depRes.json()["code"]=="200","查询指定接车部门信息获取测试失败" |
145 | 145 | assert len(depRes.json()["data"]) == 1, "查询指定接车部门信息获取测试失败" |
... | ... | @@ -147,14 +147,14 @@ class test_ZCBasic(unittest.TestCase): |
147 | 147 | |
148 | 148 | def test_getProveType(self): |
149 | 149 | """整车-整车创建:证明类型信息获取""" |
150 | - proveType = zcA.get_proveType(host=self.gatewayHost) | |
150 | + proveType = zcA.get_proveType(session=session,host=self.gatewayHost) | |
151 | 151 | print(proveType.json()) |
152 | 152 | assert proveType.json()["code"]=="200","证明类型信息获取测试失败" |
153 | 153 | assert proveType.json()["data"] != [], "证明类型信息获取测试失败" |
154 | 154 | |
155 | 155 | def test_getDuplicateToken(self): |
156 | 156 | """整车-整车创建:获取防重复token""" |
157 | - duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
157 | + duplicateTokenRes = zcA.get_duplicateToken(session=session,host=self.gatewayHost) | |
158 | 158 | print(duplicateTokenRes.json()) |
159 | 159 | assert duplicateTokenRes.json()["code"]=="200","获取防重复token测试失败" |
160 | 160 | assert duplicateTokenRes.json()["data"].isalnum(), "获取防重复token测试失败" | ... | ... |
testcase/sy/test_ZC/test_ZCCreate.py
... | ... | @@ -15,6 +15,8 @@ from commons.scripts.readConf import rC |
15 | 15 | from commons.api import zcApi as zcA |
16 | 16 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
17 | 17 | import time,random |
18 | +from commons.MySession import sessionSy | |
19 | +session = sessionSy | |
18 | 20 | |
19 | 21 | class test_ZCCreate(unittest.TestCase): |
20 | 22 | """沈阳市场-整车-创建整车进门单""" |
... | ... | @@ -43,7 +45,7 @@ class test_ZCCreate(unittest.TestCase): |
43 | 45 | trailerNumber = plate |
44 | 46 | |
45 | 47 | # 获取车型 |
46 | - carType = zcA.get_carType(host=self.gatewayHost) | |
48 | + carType = zcA.get_carType(session=session,host=self.gatewayHost) | |
47 | 49 | print(carType.text) |
48 | 50 | print(carType.json()["data"][0]) |
49 | 51 | carTypeCode = carType.json()["data"][0]["code"] |
... | ... | @@ -52,7 +54,7 @@ class test_ZCCreate(unittest.TestCase): |
52 | 54 | carTypeWeight = carType.json()["data"][0]["weight"] |
53 | 55 | |
54 | 56 | # 获取商品 |
55 | - categoryByCondition = zcA.get_listCategoryByCondition(host=self.gatewayHost) | |
57 | + categoryByCondition = zcA.get_listCategoryByCondition(session=session,host=self.gatewayHost) | |
56 | 58 | print(categoryByCondition.json()) |
57 | 59 | cateId = categoryByCondition.json()["data"][0]["id"] |
58 | 60 | productId = categoryByCondition.json()["data"][0]["id"] |
... | ... | @@ -60,44 +62,44 @@ class test_ZCCreate(unittest.TestCase): |
60 | 62 | productCode = categoryByCondition.json()["data"][0]["keycode"] |
61 | 63 | |
62 | 64 | # 获取接车员 |
63 | - listByExample = zcA.get_listByExample(host=self.gatewayHost) | |
65 | + listByExample = zcA.get_listByExample(session=session,host=self.gatewayHost) | |
64 | 66 | print(listByExample.json()) |
65 | 67 | inGreeterId = listByExample.json()["data"][0]["id"] |
66 | 68 | inGreeterName = listByExample.json()["data"][0]["realName"] |
67 | 69 | |
68 | 70 | # 获取交易类型 |
69 | - transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
71 | + transactionType = zcA.query_transactionType(session=session,host=self.gatewayHost) | |
70 | 72 | print(transactionType.json()) |
71 | 73 | tradeType = transactionType.json()["rows"][0]["code"] |
72 | 74 | tradeTypeId = transactionType.json()["rows"][0]["id"] |
73 | 75 | tradeTypeName = transactionType.json()["rows"][0]["name"] |
74 | 76 | |
75 | 77 | # 获取货物标签 |
76 | - goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
78 | + goodsTag = zcA.get_goodsTag(session=session,host=self.gatewayHost) | |
77 | 79 | print(goodsTag.json()) |
78 | 80 | goodsTagId = goodsTag.json()["data"][0]["id"] |
79 | 81 | |
80 | 82 | # 产地信息获取 |
81 | - address = zcA.get_address(host=self.gatewayHost) | |
83 | + address = zcA.get_address(session=session,host=self.gatewayHost) | |
82 | 84 | print(address.json()) |
83 | 85 | originId = address.json()["data"][0]["id"] |
84 | 86 | origin = address.json()["data"][0]["name"] |
85 | 87 | originCode = address.json()["data"][0]["cityCode"] |
86 | 88 | |
87 | 89 | # 查询部门信息 |
88 | - depRes = zcA.get_dep(host=self.gatewayHost) | |
90 | + depRes = zcA.get_dep(session=session,host=self.gatewayHost) | |
89 | 91 | print(depRes.json()) |
90 | 92 | feeDepId = depRes.json()["data"][0]["id"] |
91 | 93 | feeDepName = depRes.json()["data"][0]["name"] |
92 | 94 | |
93 | 95 | # 获取证明类型 |
94 | - proveType = zcA.get_proveType(host=self.gatewayHost) | |
96 | + proveType = zcA.get_proveType(session=session,host=self.gatewayHost) | |
95 | 97 | print(proveType.json()) |
96 | 98 | proveTypeCode = proveType.json()["data"][0]["id"] |
97 | 99 | proveTypeName = proveType.json()["data"][0]["name"] |
98 | 100 | |
99 | 101 | # 获取防重token |
100 | - duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
102 | + duplicateTokenRes = zcA.get_duplicateToken(session=session,host=self.gatewayHost) | |
101 | 103 | print(duplicateTokenRes.json()) |
102 | 104 | duplicateToken = duplicateTokenRes.json()["data"] |
103 | 105 | |
... | ... | @@ -112,7 +114,7 @@ class test_ZCCreate(unittest.TestCase): |
112 | 114 | weighmanRecord["grossWeightDate"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) |
113 | 115 | |
114 | 116 | # 创建进门单 |
115 | - cre_res = zcA.create_wholeCarWeighSave(host=self.gatewayHost, duplicateToken=duplicateToken, | |
117 | + cre_res = zcA.create_wholeCarWeighSave(session=session,host=self.gatewayHost, duplicateToken=duplicateToken, | |
116 | 118 | carTypeCode=carTypeCode, carTypeId=carTypeId, |
117 | 119 | carTypeName=carTypeName, carTypeWeight=carTypeWeight, plate=plate, |
118 | 120 | productId=productId, productName=productName, | ... | ... |
testcase/sy/test_listPage/test_listPageOperation.py
... | ... | @@ -24,6 +24,9 @@ from commons.api.entranceFeeBillList import operationDoUpdate as oDUp |
24 | 24 | from commons.api.entranceFeeBillList import operationDoFreeze as oDF |
25 | 25 | import random |
26 | 26 | |
27 | +from commons.MySession import sessionSy | |
28 | +session = sessionSy | |
29 | + | |
27 | 30 | class test_listPage(unittest.TestCase): |
28 | 31 | """沈阳市场-进门单列表:进门但操作测试测试""" |
29 | 32 | def setUp(self) -> None: |
... | ... | @@ -36,7 +39,7 @@ class test_listPage(unittest.TestCase): |
36 | 39 | def setUpClass(cls) -> None: |
37 | 40 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
38 | 41 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
39 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
42 | + cls.ic = rC.returnOptionsItems("testInfo", "sy_cardNumRe_01") | |
40 | 43 | |
41 | 44 | @classmethod |
42 | 45 | def tearDownClass(cls) -> None: |
... | ... | @@ -44,20 +47,20 @@ class test_listPage(unittest.TestCase): |
44 | 47 | |
45 | 48 | def test_viewOrder(self): |
46 | 49 | """进门单列表-操作:查看进门单详情测试""" |
47 | - res = zcA.create_jmsf(host=self.gatewayHost) | |
50 | + res = zcA.create_jmsf(session=session,host=self.gatewayHost) | |
48 | 51 | orderId = res.json()["data"]["id"] |
49 | 52 | number = res.json()["data"]["number"] |
50 | - res = eFBL.get_orderView(host=self.jmsfHost,orderId=orderId) | |
53 | + res = eFBL.get_orderView(session=session,host=self.jmsfHost,orderId=orderId) | |
51 | 54 | assert str(number) in res.text,"获取订单详情查询失败" |
52 | 55 | |
53 | 56 | def test_doPayZC(self): |
54 | 57 | """进门单列表-操作:整车进门交费测试""" |
55 | 58 | plate = f"川A{random.randint(10000,99999)}" |
56 | 59 | goods = "雪莲果" |
57 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
60 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
58 | 61 | print(cre_res.json()) |
59 | 62 | number = cre_res.json()["data"]["number"] |
60 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
63 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
61 | 64 | assert res_pay.json()["code"]=="200","缴费失败" |
62 | 65 | assert res_pay.json()["message"] == "OK", "缴费失败" |
63 | 66 | |
... | ... | @@ -65,11 +68,11 @@ class test_listPage(unittest.TestCase): |
65 | 68 | """进门单列表-操作:修改进门单测试""" |
66 | 69 | plate = f"川A{random.randint(10000,99999)}" |
67 | 70 | goods = "雪莲果" |
68 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
71 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
69 | 72 | print(cre_res.json()) |
70 | 73 | number = cre_res.json()["data"]["number"] |
71 | 74 | print(number) |
72 | - res_pay = oDUp.do_updateOrder(host=self.jmsfHost,attrValue=number) | |
75 | + res_pay = oDUp.do_updateOrder(session=session,host=self.jmsfHost,attrValue=number) | |
73 | 76 | assert res_pay.json()["success"]==True,"修改进门单失败" |
74 | 77 | assert res_pay.json()["message"] == "修改保存成功", "修改进门单失败" |
75 | 78 | |
... | ... | @@ -77,10 +80,10 @@ class test_listPage(unittest.TestCase): |
77 | 80 | """进门单列表-操作:散件进门交费测试""" |
78 | 81 | plate = f"川A{random.randint(10000,99999)}" |
79 | 82 | goods = "雪莲果" |
80 | - cre_res = sjApi.create_sj(host=self.gatewayHost,plate=plate,keyword=goods) | |
83 | + cre_res = sjApi.create_sj(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
81 | 84 | print(cre_res.json()) |
82 | 85 | number = cre_res.json()["data"]["number"] |
83 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
86 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
84 | 87 | assert res_pay.json()["code"]=="200","缴费失败" |
85 | 88 | assert res_pay.json()["message"] == "OK", "缴费失败" |
86 | 89 | |
... | ... | @@ -88,16 +91,16 @@ class test_listPage(unittest.TestCase): |
88 | 91 | """进门单列表-操作:散件进门交费测试""" |
89 | 92 | plate = f"川A{random.randint(10000,99999)}" |
90 | 93 | goods = "雪莲果" |
91 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
94 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
92 | 95 | print(cre_res.json()) |
93 | 96 | number = cre_res.json()["data"]["number"] |
94 | - res_pay = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
97 | + res_pay = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
95 | 98 | assert res_pay.json()["code"]=="200","缴费失败" |
96 | 99 | assert res_pay.json()["message"] == "OK", "缴费失败" |
97 | - res,tareWeight = hpApi.do_backSkinWeighSave(host=self.gatewayHost,number=number) | |
100 | + res,tareWeight = hpApi.do_backSkinWeighSave(session=session,host=self.gatewayHost,number=number) | |
98 | 101 | assert res.json()["code"]=="200","回皮失败" |
99 | 102 | assert "data" in res.text,"回皮失败" |
100 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number) | |
103 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number) | |
101 | 104 | print(resListPage.json()) |
102 | 105 | assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败" |
103 | 106 | assert resListPage.json()["rows"][0]["tareWeight"] == tareWeight,"按照收费单号查询失败" |
... | ... | @@ -107,10 +110,10 @@ class test_listPage(unittest.TestCase): |
107 | 110 | """进门单列表-操作:整车进门冻结测试""" |
108 | 111 | plate = f"川A{random.randint(10000,99999)}" |
109 | 112 | goods = "雪莲果" |
110 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
113 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
111 | 114 | print(cre_res.json()) |
112 | 115 | number = cre_res.json()["data"]["number"] |
113 | - res_pay = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
116 | + res_pay = oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
114 | 117 | assert res_pay.json()["code"]=="200","冻结失败" |
115 | 118 | assert res_pay.json()["message"] == "OK", "冻结失败" |
116 | 119 | |
... | ... | @@ -118,34 +121,34 @@ class test_listPage(unittest.TestCase): |
118 | 121 | """进门单列表-操作:整车进门解冻测试""" |
119 | 122 | plate = f"川A{random.randint(10000,99999)}" |
120 | 123 | goods = "雪莲果" |
121 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
124 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
122 | 125 | print(cre_res.json()) |
123 | 126 | number = cre_res.json()["data"]["number"] |
124 | - oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic) | |
125 | - res_unfreezeOrder = eOp.do_unfreezeOrder(host=self.jmsfHost,attrValue=number) | |
127 | + oDF.do_freezeOrder(session=session,host=self.jmsfHost,attrValue=number,ic=self.ic) | |
128 | + res_unfreezeOrder = eOp.do_unfreezeOrder(session=session,host=self.jmsfHost,attrValue=number) | |
126 | 129 | assert res_unfreezeOrder.json()["code"]=="200","解冻失败" |
127 | 130 | assert res_unfreezeOrder.json()["message"] == "OK", "解冻失败" |
128 | 131 | |
129 | 132 | def test_invalidOrder(self): |
130 | 133 | """进门单列表-操作:整车进门作废测试""" |
131 | 134 | plate = f"川A{random.randint(10000,99999)}" |
132 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate) | |
135 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate) | |
133 | 136 | print(cre_res.json()) |
134 | 137 | number = cre_res.json()["data"]["number"] |
135 | - res_unfreezeOrder = oDI.do_invalidOrder(host=self.jmsfHost,attrValue=number) | |
138 | + res_unfreezeOrder = oDI.do_invalidOrder(session=session,host=self.jmsfHost,attrValue=number) | |
136 | 139 | assert res_unfreezeOrder.json()["number"]==number,"作废测试失败" |
137 | 140 | assert res_unfreezeOrder.json()["message"] == "作废成功!", "作废测试失败" |
138 | 141 | |
139 | 142 | def test_correctOrder(self): |
140 | 143 | """进门单列表-操作:整车进门更正测试""" |
141 | 144 | plate = f"川A{random.randint(10000,99999)}" |
142 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate) | |
145 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate) | |
143 | 146 | print(cre_res.json()) |
144 | 147 | number = cre_res.json()["data"]["number"] |
145 | - res_unfreezeOrder,totalAmount = oDC.do_correctOrder(host=self.jmsfHost,attrValue=number) | |
148 | + res_unfreezeOrder,totalAmount = oDC.do_correctOrder(session=session,host=self.jmsfHost,attrValue=number) | |
146 | 149 | assert res_unfreezeOrder.json()["success"]==True,"更正测试失败" |
147 | 150 | assert res_unfreezeOrder.json()["msg"] == "操作成功", "更正测试失败" |
148 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number) | |
151 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number) | |
149 | 152 | print(resListPage.json()) |
150 | 153 | assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败" |
151 | 154 | assert resListPage.json()["rows"][0]["$_totalPrice"] == totalAmount,"更正后订单界错误与预期金额不一致" |
... | ... | @@ -153,10 +156,10 @@ class test_listPage(unittest.TestCase): |
153 | 156 | def test_amendOrder(self): |
154 | 157 | """进门单列表-操作:整车进门修正测试""" |
155 | 158 | plate = f"川A{random.randint(10000,99999)}" |
156 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate) | |
159 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate) | |
157 | 160 | print(cre_res.json()) |
158 | 161 | number = cre_res.json()["data"]["number"] |
159 | - res_unfreezeOrder = oDA.do_amendOrder(host=self.jmsfHost,attrValue=number) | |
162 | + res_unfreezeOrder = oDA.do_amendOrder(session=session,host=self.jmsfHost,attrValue=number) | |
160 | 163 | assert res_unfreezeOrder.json()["success"]==True,"修正操作失败" |
161 | 164 | assert res_unfreezeOrder.json()["message"] == "操作成功", "修正操作失败" |
162 | 165 | |
... | ... | @@ -164,9 +167,9 @@ class test_listPage(unittest.TestCase): |
164 | 167 | """进门单列表-操作:整车进门退款测试""" |
165 | 168 | plate = f"川A{random.randint(10000,99999)}" |
166 | 169 | goods = "雪莲果" |
167 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
170 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
168 | 171 | number = cre_res.json()["data"]["number"] |
169 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number) | |
170 | - res_undo = oDU.do_undoOrder(host=self.jmsfHost,attrValue=number) | |
172 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number) | |
173 | + res_undo = oDU.do_undoOrder(session=session,host=self.jmsfHost,attrValue=number) | |
171 | 174 | assert res_undo.json()["code"] == "200","退款失败" |
172 | 175 | assert res_undo.json()["message"] == "OK","退款失败" |
173 | 176 | \ No newline at end of file | ... | ... |
testcase/sy/test_listPage/test_searchByAttrName.py
... | ... | @@ -18,6 +18,8 @@ from commons import ConfigDB as CoDB |
18 | 18 | from commons.MySession import my |
19 | 19 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
20 | 20 | import time,random |
21 | +from commons.MySession import sessionSy | |
22 | +session = sessionSy | |
21 | 23 | |
22 | 24 | class test_listPage(unittest.TestCase): |
23 | 25 | """沈阳市场-进门单列表:attr进门单属性查询测试""" |
... | ... | @@ -32,7 +34,7 @@ class test_listPage(unittest.TestCase): |
32 | 34 | def setUpClass(cls) -> None: |
33 | 35 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
34 | 36 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
35 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
37 | + cls.ic = rC.returnOptionsItems("testInfo", "sy_cardNumRe_01") | |
36 | 38 | |
37 | 39 | @classmethod |
38 | 40 | def tearDownClass(cls) -> None: |
... | ... | @@ -42,9 +44,9 @@ class test_listPage(unittest.TestCase): |
42 | 44 | """进门单列表-查询:收费单号查询测试""" |
43 | 45 | plate = f"川A{random.randint(10000, 99999)}" |
44 | 46 | goods = "雪莲果" |
45 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
47 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
46 | 48 | number = cre_res.json()["data"]["number"] |
47 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrValue=number) | |
49 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number) | |
48 | 50 | print(resListPage.json()) |
49 | 51 | assert resListPage.json()["rows"][0]["number"] == number,"按照收费单号查询失败" |
50 | 52 | assert len(resListPage.json()["rows"]) == 1,"按照收费单号查询失败" |
... | ... | @@ -53,16 +55,16 @@ class test_listPage(unittest.TestCase): |
53 | 55 | """进门单列表-查询:车牌号查询测试""" |
54 | 56 | plate = f"川A{random.randint(10000, 99999)}" |
55 | 57 | goods = "雪莲果" |
56 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
57 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="车号",attrValue=plate) | |
58 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
59 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="车号",attrValue=plate) | |
58 | 60 | print(resListPage.json()) |
59 | 61 | assert resListPage.json()["rows"][0]["plate"] == plate,"按照车牌号查询失败" |
60 | 62 | |
61 | 63 | def test_searchByGoods(self): |
62 | 64 | """进门单列表-查询:商品查询测试""" |
63 | 65 | goods = "圣女果" |
64 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,keyword=goods) | |
65 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="商品",attrValue=goods) | |
66 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,keyword=goods) | |
67 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="商品",attrValue=goods) | |
66 | 68 | print(resListPage.json()) |
67 | 69 | assert resListPage.json()["rows"][0]["productName"] == goods,"按照商品查询失败" |
68 | 70 | |
... | ... | @@ -71,12 +73,12 @@ class test_listPage(unittest.TestCase): |
71 | 73 | plate = f"川A{random.randint(10000, 99999)}" |
72 | 74 | goods = "雪莲果" |
73 | 75 | userName = "ty_test" |
74 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods,userName=userName) | |
76 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods,userName=userName) | |
75 | 77 | number = cre_res.json()["data"]["number"] |
76 | 78 | # 进门单缴费 |
77 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number) | |
78 | - payUser = my.userInfo["data"]["user"]["realName"] | |
79 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="收费员",attrValue=payUser) | |
79 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number) | |
80 | + payUser = session.userInfo["data"]["user"]["realName"] | |
81 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="收费员",attrValue=payUser) | |
80 | 82 | numberList = [i["number"] for i in resListPage.json()["rows"]] |
81 | 83 | numberStr = ",".join(numberList) |
82 | 84 | # 缴费状态验证 |
... | ... | @@ -89,15 +91,15 @@ class test_listPage(unittest.TestCase): |
89 | 91 | def test_searchByCname(self): |
90 | 92 | """进门单列表-查询:客户名称查询测试""" |
91 | 93 | ic = self.ic |
92 | - cName = eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
94 | + cName = eFBL.get_icCheck(session=session,host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
93 | 95 | # 创建进门单 |
94 | 96 | plate = f"川A{random.randint(10000, 99999)}" |
95 | 97 | goods = "雪莲果" |
96 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
98 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
97 | 99 | number = cre_res.json()["data"]["number"] |
98 | 100 | # 进门单缴费 |
99 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
100 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="客户姓名",attrValue=cName) | |
101 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
102 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="客户姓名",attrValue=cName) | |
101 | 103 | print(resListPage.json()) |
102 | 104 | cNameList = list(set([i["customerName"] for i in resListPage.json()["rows"]])) |
103 | 105 | print(cNameList) |
... | ... | @@ -112,10 +114,10 @@ class test_listPage(unittest.TestCase): |
112 | 114 | # 创建进门单 |
113 | 115 | plate = f"川A{random.randint(10000, 99999)}" |
114 | 116 | goods = "雪莲果" |
115 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
117 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
116 | 118 | number = cre_res.json()["data"]["number"] |
117 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
118 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="客户卡号",attrValue=ic) | |
119 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
120 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="客户卡号",attrValue=ic) | |
119 | 121 | print(resListPage.json()) |
120 | 122 | icList = list(set([i["ic"] for i in resListPage.json()["rows"]])) |
121 | 123 | print(icList) |
... | ... | @@ -127,15 +129,15 @@ class test_listPage(unittest.TestCase): |
127 | 129 | def test_searchByPhone(self): |
128 | 130 | """进门单列表-查询:手机号码询测试""" |
129 | 131 | ic = self.ic |
130 | - cPhone = eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerContactsPhone"] | |
132 | + cPhone = eFBL.get_icCheck(session=session,host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerContactsPhone"] | |
131 | 133 | # 创建进门单并缴费 |
132 | 134 | plate = f"川A{random.randint(10000, 99999)}" |
133 | 135 | goods = "雪莲果" |
134 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
136 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
135 | 137 | number = cre_res.json()["data"]["number"] |
136 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
138 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
137 | 139 | # 查询进门单 |
138 | - resListPage = eFBL.listPage(host=self.jmsfHost,attrName="手机号码",attrValue=cPhone) | |
140 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,attrName="手机号码",attrValue=cPhone) | |
139 | 141 | numberList = [i["number"] for i in resListPage.json()["rows"]] |
140 | 142 | numberStr = ",".join(numberList) |
141 | 143 | cPhoneFromDb = CoDB.mysql_selectAll(f'SELECT customer_phone FROM entrance_fee_bill WHERE number in ({numberStr});') | ... | ... |
testcase/sy/test_listPage/test_searchByOther.py
... | ... | @@ -20,6 +20,8 @@ from commons.api.entranceFeeBillList import operationDoUndo as oDU |
20 | 20 | from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL |
21 | 21 | from commons.api.entranceFeeBillList import operationDoUpdate as oDUp |
22 | 22 | import time,random |
23 | +from commons.MySession import sessionSy | |
24 | +session = sessionSy | |
23 | 25 | |
24 | 26 | class test_listPage(unittest.TestCase): |
25 | 27 | """沈阳市场-进门单列表:attr进门单属性查询测试""" |
... | ... | @@ -34,13 +36,13 @@ class test_listPage(unittest.TestCase): |
34 | 36 | def setUpClass(cls) -> None: |
35 | 37 | cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") |
36 | 38 | cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") |
37 | - cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
38 | - carTypeList = gLL.get_LookupList(host=cls.jmsfHost,providerName="车型").json()[1:] | |
39 | - categoryList = gLL.get_LookupList(host=cls.jmsfHost, providerName="货物品类").json()[1:] | |
40 | - authDepartmentList = zcA.get_dep(cls.gatewayHost).json()["data"] | |
41 | - entranceFeeBillTypeList = gLL.get_LookupList(host=cls.jmsfHost, providerName="称重类型").json()[1:] | |
42 | - entranceFeeBillStateList = gLL.get_LookupList(host=cls.jmsfHost, providerName="状态").json()[1:] | |
43 | - tradeTypeList = gLL.get_LookupList(host=cls.jmsfHost, providerName="交易类型").json()[1:] | |
39 | + cls.ic = rC.returnOptionsItems("testInfo", "sy_cardNumRe_01") | |
40 | + carTypeList = gLL.get_LookupList(session=session,host=cls.jmsfHost,providerName="车型").json()[1:] | |
41 | + categoryList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="货物品类").json()[1:] | |
42 | + authDepartmentList = zcA.get_dep(session=session,host=cls.gatewayHost).json()["data"] | |
43 | + entranceFeeBillTypeList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="称重类型").json()[1:] | |
44 | + entranceFeeBillStateList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="状态").json()[1:] | |
45 | + tradeTypeList = gLL.get_LookupList(session=session,host=cls.jmsfHost, providerName="交易类型").json()[1:] | |
44 | 46 | cls.carType = random.sample(carTypeList, 1)[0] |
45 | 47 | cls.category = random.sample(categoryList, 1)[0] |
46 | 48 | cls.authDepartment = random.sample(authDepartmentList, 1)[0] |
... | ... | @@ -55,9 +57,9 @@ class test_listPage(unittest.TestCase): |
55 | 57 | def test_searchByCardTepy(self): |
56 | 58 | """进门单列表-查询:车型查询测试""" |
57 | 59 | print(self.carType) |
58 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName=self.carType["text"]) | |
60 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,carTypeName=self.carType["text"]) | |
59 | 61 | number = cre_res.json()["data"]["number"] |
60 | - resListPage = eFBL.listPage(host=self.jmsfHost,carTypeId=self.carType["value"]) | |
62 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,carTypeId=self.carType["value"]) | |
61 | 63 | print(resListPage.json()) |
62 | 64 | carTypeList=list(set([i["carTypeName"] for i in resListPage.json()["rows"]])) |
63 | 65 | assert resListPage.json()["rows"][0]["number"] == number,"车型查询失败查询失败" |
... | ... | @@ -68,22 +70,22 @@ class test_listPage(unittest.TestCase): |
68 | 70 | """进门单列表-查询:货物品类查询测试""" |
69 | 71 | goods="雪莲果" |
70 | 72 | categoryName = "水果" |
71 | - res = gLL.get_LookupList(self.jmsfHost,providerName="货物品类") | |
73 | + res = gLL.get_LookupList(session=session,host=self.jmsfHost,providerName="货物品类") | |
72 | 74 | categoryId = [i["value"] for i in res.json() if i["text"]==categoryName] |
73 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,keyword=goods) | |
75 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,keyword=goods) | |
74 | 76 | number = cre_res.json()["data"]["number"] |
75 | - resListPage = eFBL.listPage(host=self.jmsfHost,categoryId=categoryId) | |
77 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,categoryId=categoryId) | |
76 | 78 | print(resListPage.json()) |
77 | 79 | assert resListPage.json()["rows"][0]["number"] == number,"货物品类查询失败" |
78 | 80 | |
79 | 81 | def test_searchByProductName(self): |
80 | 82 | """进门单列表-查询:商品查询测试""" |
81 | 83 | productName = "蔬菜" |
82 | - productId = gLL.get_product(self.jmsfHost,productName=productName).json()["data"][0]["id"] | |
84 | + productId = gLL.get_product(session=session,host=self.jmsfHost,productName=productName).json()["data"][0]["id"] | |
83 | 85 | print(productId) |
84 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,keyword=productName) | |
86 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,keyword=productName) | |
85 | 87 | number = cre_res.json()["data"]["number"] |
86 | - resListPage = eFBL.listPage(host=self.jmsfHost,productName=productName,productId=productId) | |
88 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,productName=productName,productId=productId) | |
87 | 89 | print(resListPage.json()) |
88 | 90 | productNameList=list(set([i["productName"] for i in resListPage.json()["rows"]])) |
89 | 91 | assert resListPage.json()["rows"][0]["number"] == number,"商品查询测试失败" |
... | ... | @@ -94,9 +96,9 @@ class test_listPage(unittest.TestCase): |
94 | 96 | """进门单列表-查询:部门查询查询测试""" |
95 | 97 | print(self.authDepartment) |
96 | 98 | print(self.authDepartment["name"]) |
97 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,depName=self.authDepartment["name"]) | |
99 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,depName=self.authDepartment["name"]) | |
98 | 100 | number = cre_res.json()["data"]["number"] |
99 | - resListPage = eFBL.listPage(host=self.jmsfHost,dep=self.authDepartment["id"]) | |
101 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,dep=self.authDepartment["id"]) | |
100 | 102 | # print(resListPage.json()) |
101 | 103 | depNameList=list(set([i["depName"] for i in resListPage.json()["rows"]])) |
102 | 104 | assert resListPage.json()["rows"][0]["number"] == number,"部门查询查询测试失败" |
... | ... | @@ -106,18 +108,18 @@ class test_listPage(unittest.TestCase): |
106 | 108 | def test_searchByRegionId(self): |
107 | 109 | """进门单列表-查询:部门查询查询测试""" |
108 | 110 | depName = "水果部" |
109 | - res = gLL.get_LookupList(self.jmsfHost,providerName="接车部门") | |
111 | + res = gLL.get_LookupList(session=session,host=self.jmsfHost,providerName="接车部门") | |
110 | 112 | dep = [i["value"] for i in res.json() if i["text"] == depName] |
111 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,depName=depName) | |
113 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,depName=depName) | |
112 | 114 | number = cre_res.json()["data"]["number"] |
113 | 115 | print("number",number) |
114 | 116 | orderId = cre_res.json()["data"]["id"] |
115 | - oDUp.do_updateOrder(host=self.jmsfHost,attrValue=number) | |
116 | - res = eFBL.get_orderView(host=self.jmsfHost,orderId=orderId) | |
117 | + oDUp.do_updateOrder(session=session,host=self.jmsfHost,attrValue=number) | |
118 | + res = eFBL.get_orderView(session=session,host=self.jmsfHost,orderId=orderId) | |
117 | 119 | # bs取值 |
118 | 120 | orderDetailsList = BeautifulSoup(res.text, "html.parser").findAll("input") |
119 | 121 | orderDetailsDict = {i.get("name"): i.get("value") for i in orderDetailsList} |
120 | - resListPage = eFBL.listPage(host=self.jmsfHost,dep=dep,regionId=orderDetailsDict["regionId"]) | |
122 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,dep=dep,regionId=orderDetailsDict["regionId"]) | |
121 | 123 | depNameList=list(set([i["depName"] for i in resListPage.json()["rows"]])) |
122 | 124 | assert resListPage.json()["rows"][0]["number"] == number,"部门查询查询测试失败" |
123 | 125 | assert len(depNameList) == 1,"部门查询查询测试失败" |
... | ... | @@ -125,7 +127,7 @@ class test_listPage(unittest.TestCase): |
125 | 127 | |
126 | 128 | def test_searchByBillType(self): |
127 | 129 | """进门单列表-查询:称重类型查询测试""" |
128 | - resListPage = eFBL.listPage(host=self.jmsfHost,type="1") | |
130 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,type="1") | |
129 | 131 | print(resListPage.json()) |
130 | 132 | resList=list(set([i["type"] for i in resListPage.json()["rows"]])) |
131 | 133 | assert len(resList) == 1,"称重类型查询测试失败" |
... | ... | @@ -134,9 +136,9 @@ class test_listPage(unittest.TestCase): |
134 | 136 | def test_searchByStatus(self): |
135 | 137 | """进门单列表-查询:交易状态查询测试""" |
136 | 138 | status = "4" |
137 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName=self.carType["text"]) | |
139 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,carTypeName=self.carType["text"]) | |
138 | 140 | number = cre_res.json()["data"]["number"] |
139 | - resListPage = eFBL.listPage(host=self.jmsfHost,status=status) | |
141 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,status=status) | |
140 | 142 | print(resListPage.json()) |
141 | 143 | statusList=list(set([i["status"] for i in resListPage.json()["rows"]])) |
142 | 144 | assert resListPage.json()["rows"][0]["number"] != number,"交易状态查询测试失败" |
... | ... | @@ -146,9 +148,9 @@ class test_listPage(unittest.TestCase): |
146 | 148 | def test_searchByTradeType(self): |
147 | 149 | """进门单列表-查询:交易类型查询测试""" |
148 | 150 | print(self.tradeType) |
149 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,transactionName=self.tradeType["text"]) | |
151 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,transactionName=self.tradeType["text"]) | |
150 | 152 | number = cre_res.json()["data"]["number"] |
151 | - resListPage = eFBL.listPage(host=self.jmsfHost,tradeTypeId=self.tradeType["value"]) | |
153 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,tradeTypeId=self.tradeType["value"]) | |
152 | 154 | print(resListPage.json()) |
153 | 155 | carTypeList=list(set([i["tradeTypeName"] for i in resListPage.json()["rows"]])) |
154 | 156 | assert resListPage.json()["rows"][0]["number"] == number,"交易类型查询测试失败" |
... | ... | @@ -160,11 +162,11 @@ class test_listPage(unittest.TestCase): |
160 | 162 | ic = self.ic |
161 | 163 | plate = f"川A{random.randint(10000, 99999)}" |
162 | 164 | goods = "雪莲果" |
163 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
165 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
164 | 166 | number = cre_res.json()["data"]["number"] |
165 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
166 | - createdTime = eFBL.listPage(host=self.jmsfHost,attrValue=number).json()["rows"][0]["created"] | |
167 | - resListPage = eFBL.listPage(host=self.jmsfHost,startTime=createdTime,endTime=createdTime) | |
167 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
168 | + createdTime = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number).json()["rows"][0]["created"] | |
169 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,startTime=createdTime,endTime=createdTime) | |
168 | 170 | print(resListPage.json()) |
169 | 171 | createdTimeList = list(set([i["created"] for i in resListPage.json()["rows"]])) |
170 | 172 | assert len(createdTimeList) == 1,"进场时间查询测试失败" |
... | ... | @@ -175,11 +177,11 @@ class test_listPage(unittest.TestCase): |
175 | 177 | ic = self.ic |
176 | 178 | plate = f"川A{random.randint(10000, 99999)}" |
177 | 179 | goods = "雪莲果" |
178 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
180 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
179 | 181 | number = cre_res.json()["data"]["number"] |
180 | - eFBL.do_payOrder(host=self.jmsfHost,attrValue=number,ic=ic) | |
181 | - createdTime = eFBL.listPage(host=self.jmsfHost,attrValue=number).json()["rows"][0]["paymentTime"] | |
182 | - resListPage = eFBL.listPage(host=self.jmsfHost,startPayTime=createdTime,endPayTime=createdTime) | |
182 | + eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number,ic=ic) | |
183 | + createdTime = eFBL.listPage(session=session,host=self.jmsfHost,attrValue=number).json()["rows"][0]["paymentTime"] | |
184 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost,startPayTime=createdTime,endPayTime=createdTime) | |
183 | 185 | print(resListPage.json()) |
184 | 186 | createdTimeList = list(set([i["paymentTime"] for i in resListPage.json()["rows"]])) |
185 | 187 | assert len(createdTimeList) == 1,"缴费时间查询测试失败" |
... | ... | @@ -189,13 +191,13 @@ class test_listPage(unittest.TestCase): |
189 | 191 | """进门单列表-操作:退款时间查询""" |
190 | 192 | plate = f"川A{random.randint(10000,99999)}" |
191 | 193 | goods = "雪莲果" |
192 | - cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
194 | + cre_res = zcA.create_jmsf(session=session,host=self.gatewayHost,plate=plate,keyword=goods) | |
193 | 195 | number = cre_res.json()["data"]["number"] |
194 | - res_pay = eFBL.do_payOrder(host=self.jmsfHost,attrValue=number) | |
196 | + res_pay = eFBL.do_payOrder(session=session,host=self.jmsfHost,attrValue=number) | |
195 | 197 | time.sleep(3) |
196 | - res_undo = oDU.do_undoOrder(host=self.jmsfHost,attrValue=number) | |
198 | + res_undo = oDU.do_undoOrder(session=session,host=self.jmsfHost,attrValue=number) | |
197 | 199 | refundTime = msa(f'SELECT efbd.operator_time FROM entrance_fee_bill efb JOIN entrance_fee_bill_detail efbd ON efb.id=efbd.bill_id WHERE efb.number="{number}";')[0][0] |
198 | - resListPage = eFBL.listPage(host=self.jmsfHost, startRefundTime=refundTime, endRefundTime=refundTime) | |
200 | + resListPage = eFBL.listPage(session=session,host=self.jmsfHost, startRefundTime=refundTime, endRefundTime=refundTime) | |
199 | 201 | assert resListPage.json()["rows"][0]["number"]==number,"退款时间查询失败" |
200 | 202 | refundNumberList = list(set([i["number"] for i in resListPage.json()["rows"]])) |
201 | 203 | res_msa = [i[0] for i in msa(f'SELECT efb.number FROM entrance_fee_bill efb JOIN entrance_fee_bill_detail efbd ON efb.id=efbd.bill_id WHERE efbd.operator_time="{refundTime}";')] | ... | ... |