Commit 598c12f3b16c70d5ce9aa7842e1b43de4937d0ac

Authored by lixi
2 parents a6d68e45 24a11893

Merge remote-tracking branch 'origin/master'

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