Commit 31bea28aac6070941e220c71503419ab095ee9ed

Authored by liujiqiang
1 parent eb9c8c02

进门缴费

commons/api/addJmsfDemo.py deleted 100644 → 0
1   -# -*- coding: utf-8 -*-
2   -
3   -# @Time : 2021/7/27 16:36
4   -# @Author : Ljq
5   -# @File : jmsf.py
6   -# @Software: PyCharm
7   -
8   -"""
9   -三种接口定义方式
10   -"""
11   -
12   -import json
13   -from commons.scripts import dealContentType as dct
14   -from commons import common
15   -from commons.MySession import my
16   -
17   -# 使用def的方式直接定义
18   -def get_carType(host="",**kwargs):
19   - url = host + "/jmsf-web/api/jmsf/query/listCarType"
20   - data = {"businessCode":"jmsf"}
21   - headers = dct.jsonCode()
22   - data=dict(data,**kwargs)
23   - res = my.useHeadersRequests(method="POST",url=url,data=json.dumps(data),headers=headers)
24   - return res
25   -
26   -
27   -
28   -# 使用类的方式将参数聚合
29   -class get_carTypeClass(object):
30   - def __init__(self,host):
31   - self.method = "post"
32   - self.url = host + "/jmsf-web/api/jmsf/query/listCarType"
33   - self.data = {"businessCode": "jmsf"}
34   - self.headers = dct.jsonCode()
35   -
36   -# 使用类的方式将参数聚合
37   -class get_carTypeClassB(object):
38   - url = "http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCarType"
39   - method = "post"
40   - data = {"businessCode": "jmsf"}
41   - headers = dct.jsonCode()
42   -
43   - def __init__(self):
44   - self.url = get_carTypeClassB.url.replace("http://test.", common.get_global_config("global_data", "environment", "en"))
45   - # self.header = get_carTypeClassB.headers
46   - # self.method = get_carTypeClassB.method
47   - # self.data = get_carTypeClassB.data
48 0 \ No newline at end of file
commons/api/entranceFeeBillList.py
... ... @@ -14,6 +14,7 @@ from commons.scripts import dealContentType as dct
14 14 from commons.scripts import jsonToUrlcode
15 15 from commons.MySession import my
16 16 from bs4 import BeautifulSoup
  17 +import urllib.parse
17 18  
18 19 def listPage(host="",attrName="收费单号",attrValue=None,**kwargs):
19 20 """
... ... @@ -181,15 +182,15 @@ calcFeeDepId:
181 182 data = {"protocolId": "", "pwd": "", "clientRedirectTag": "", "viewType": "pay", "optType": "optType", "optUrl": "",
182 183 "correctInfo": "correctInfo", "weightType": "weightType", "id": "orderId", "goodsId": "goodsId",
183 184 "number": "number", "modified": "time", "status": "status", "source": "source", "updateFeeItems": "",
184   - "correctDiscount": "correctDiscount", "totalAmount": "", "customerId": "0", "fundAccount": "", "ic": "",
185   - "customerName": "", "customerPhone": "", "payway": "刷卡", "plate": "plate",
  185 + "correctDiscount": "correctDiscount", "totalAmount": "", "customerId": "0", "fundAccount": "",
  186 + "accountId":"","ic": "","customerName": "", "customerPhone": "", "payway": "刷卡", "plate": "plate",
186 187 "autocomplete-cartype": "carTypeCode(carTypeName)", "carTypeName": "carTypeName",
187 188 "carTypeCode": "carTypeCode", "carTypeId": "carTypeId", "carTypeWeight": "carTypeWeight",
188 189 "storeTareWeight": "", "proveType": "proveTypeCode", "grossWeight": "grossWeight",
189 190 "tareWeight": "tareWeight", "weight": "grossWeight", "goodsNum": "", "itemWeight": "",
190 191 "productPrice": "1.00000", "unitPrice": "unitPrice", "depName": "feeDepName", "calcDepId": "feeDepId",
191 192 "regionName": "", "regionId": "0", "productName": "productName", "productId": "productId",
192   - "productArea": "万州区", "parentId": "", "levelType": "", "originId": "originId", "tradeTypeId": "tradeTypeId",
  193 + "productArea": "重庆,重庆市,万州区", "parentId": "", "levelType": "", "originId": "originId", "tradeTypeId": "tradeTypeId",
193 194 "chargeTotalAmount": "", "chargeTotalAmountYuan": "", "freezeMoneySymbol": "", "comparisonFreezeAmount": "",
194 195 "created": "created", "remark": "false", "goodsTagIds": "goodsTagIds", "shareRatio": "shareRatio",
195 196 "handlingTeam": "", "handlingRatio": "", "handActualAmount": "", "handManageAmount": "",
... ... @@ -239,14 +240,16 @@ def do_doPay(host="",autocompletecartype=None,fee_str="",**kwargs):
239 240 data = dict(data, **kwargs)
240 241 print("get_calculateRes", data)
241 242 data_uc = jsonToUrlcode.jsonToUrlcode(data_json=data)+fee_str
  243 + # data_uc = urllib.parse.urlencode(data)+"&"+fee_str
242 244 print(data_uc)
  245 + # data_uc = urllib.parse.quote(data_uc)
243 246 print("================开始请求================")
244 247 res = my.useHeadersRequests("post", url=url, data=data_uc, headers=headers)
245 248 return res
246 249  
247 250  
248 251  
249   -a = listPage(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108040900002")
  252 +a = listPage(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202108050900003")
250 253 print("listPage",a.json())
251 254 orderId = a.json()["rows"][0]["id"]
252 255 number = a.json()["rows"][0]["number"]
... ... @@ -275,6 +278,7 @@ tradeTypeId = re.findall('input type="hidden" class="form-control" name="tradeTy
275 278 shareRatio = re.findall('input type="hidden" id="shareRatioVal" name="shareRatio" value="(.*?)"',res.text)[0]
276 279 regionName = re.findall('" bind-name="(.*?)"',res.text)[0]
277 280  
  281 +
278 282 # 用户信息获取
279 283 ic=888810032426
280 284 res = get_icCheck(host="http://test.jmsf.diligrp.com:8385",ic=ic)
... ... @@ -292,29 +296,30 @@ parentId = res.json()["suggestions"][0]["parentId"]
292 296 value = res.json()["suggestions"][0]["value"]
293 297  
294 298 # 获取缴费金额
295   -plate="川B00002"
  299 +plate="川B00001"
296 300 host="http://test.jmsf.diligrp.com:8385"
297 301 modified=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
298 302 carTypeName="板车"
299 303 carTypeCode = "003"
300 304 carTypeId = "53"
301 305 carTypeWeight = "333"
302   -proveTypeCode = "665"
  306 +proveTypeCode = "1621"
303 307 proveType = proveTypeCode
304 308 grossWeight="353"
305 309 newWeight="20"
306 310 tareWeight="333"
307   -depName="水果部"
308   -feeDepId="53"
309   -productName="蔬菜"
310   -productId="14152"
  311 +depName="接车部"
  312 +feeDepId="103"
  313 +productName="雪莲果"
  314 +productId="14158"
311 315 grossWeightDate=created
312 316 tareWeightDate=created
313   -weight=grossWeight
314   -weight=weight
  317 +weight=newWeight
315 318 calcDepId=feeDepId
316   -categoryName=productName
317   -categoryId=productId
  319 +categoryName="水果"
  320 +categoryId="14436"
  321 +inGreeterName="通用测试"
  322 +inGreeterId="274"
318 323  
319 324 autocompletecartype = f"{carTypeCode}({carTypeName})"
320 325 print(autocompletecartype)
... ... @@ -323,11 +328,12 @@ res = get_calculateRes(host=host,autocompletecartype=autocompletecartype,optType
323 328 weightType=weightType,id=orderId,goodsId=goodsId,number=number,modified=modified,status=status,
324 329 source=source,correctDiscount=correctDiscount,plate=plate,carTypeName=carTypeName,carTypeCode=carTypeCode,
325 330 carTypeId=carTypeId,carTypeWeight=carTypeWeight,proveType=proveType,grossWeight=grossWeight,
326   - newWeight=newWeight,tareWeight=tareWeight,unitPrice=unitPrice,depName=depName,productName=productName,
  331 + tareWeight=tareWeight,unitPrice=unitPrice,depName=depName,productName=productName,
327 332 productId=productId,originId=originId,tradeTypeId=tradeTypeId,created=created,goodsTagIds=goodsTagIds,
328 333 shareRatio=shareRatio,categoryName=categoryName,categoryId=categoryId,grossWeightDate=grossWeightDate,
329   - tareWeightDate=tareWeightDate,sumPrice=sumPrice,calcDepId=calcDepId,weight=weight)
330   -# print(res.text)
  334 + tareWeightDate=tareWeightDate,sumPrice=sumPrice,calcDepId=calcDepId,weight=weight,
  335 + inGreeterName=inGreeterName,inGreeterId=inGreeterId)
  336 +
331 337 # backSkinTwo = re.findall('name="backSkinTwo" value="(.*?)" >',res.text)[0]
332 338 # 缴费信息
333 339 totalMoney = re.findall('name="totalMoney" value="(.*?)">',res.text)[0]
... ... @@ -343,48 +349,54 @@ receivable = re.findall('id="creceivableLong" name="receivable" value="(.*?)">',
343 349 soup = BeautifulSoup(res.text, "html.parser")
344 350 # 查找dl标签class为包含'ui-font-'字符的所有dl标签
345 351 fee_str = "correctDiscount=1&billItems=&billItemsDic="
  352 +fee_int = 0
346 353 for tag in soup.findAll("div", class_="d-flex align-items-center"):
347 354 print("=============================================")
348 355 c = tag.findAll("input")
349 356 for i in c:
350 357 print(i)
351   - print(i.get("name"))
  358 + # print(i.get("name"))
352 359 if i.get("name") != None:
353   - fee_str = fee_str + "&" + i.get("name") + "=" + i.get("value")
  360 + fee_str = fee_str + "&" + i.get("name") + "=" + urllib.parse.quote(i.get("value"))
  361 + if i.get("type") == "text":
  362 + print("---------------- f 2 s----------------")
  363 + fee_int = fee_int+int(float(i.get("value")))
  364 + print("---------------- f 2 e----------------")
  365 + # fee_int = fee_int+int(i.get("value"))
354 366 print(fee_str)
  367 +print(fee_int)
355 368  
356   -pwd = "111111"
357   -id = orderId
358   -totalAmount = totalMoney
359   -customerPhone=mobile
360   -productPrice="1.00000"
361   -dep=feeDepId
362   -productArea = "重庆,重庆市,万州区"
363   -chargeTotalAmount = totalMoney
364   -chargeTotalAmountYuan = "9"
365   -chargeTotalAmountYuan= chargeTotalAmountYuan
366   -freezeMoneySymbol =chargeTotalAmountYuan
367   -comparisonFreezeAmount = chargeTotalAmountYuan
368   -modified = created
369   -firmCode = "9"
370   -marketFlag=firmCode
371   -collectionPrice=discountAmount
372   -itemReceivableAmount=receivable
373   -receivableAmount=receivable
374   -tareWeightDate=tareWeightDate
375   -aa = do_doPay(host=host,autocompletecartype=autocompletecartype,fee_str=fee_str,pwd=pwd,optType=optType,
376   - weightType=weightType,id=id,goodsId=goodsId,number=number,created=created,status=status,source=source,
377   - correctDiscount=correctDiscount,totalAmount=totalAmount,customerId=customerId,fundAccount=accountId,
378   - accountId=accountId,ic=ic,customerName=customerName,customerPhone=customerPhone,plate=plate,
379   - carTypeName=carTypeName,carTypeCode=carTypeCode,carTypeId=carTypeId,carTypeWeight=carTypeWeight,
380   - proveType=proveType,grossWeight=grossWeight,tareWeight=tareWeight,weight=weight,productPrice=productPrice,
381   - unitPrice=unitPrice,depName=depName,calcDepId=calcDepId,dep=dep,regionName=regionName,regionId=regionId,
382   - productName=productName,productId=productId,productArea=productArea,originId=originId,
383   - tradeTypeId=tradeTypeId,correctInfo=correctInfo,chargeTotalAmount=chargeTotalAmount,
384   - freezeMoneySymbol=freezeMoneySymbol,comparisonFreezeAmount=comparisonFreezeAmount,modified=modified,
385   - goodsTagIds=goodsTagIds,marketFlag=marketFlag,totalMoney=totalMoney,receivable=receivable,
386   - collectionPrice=collectionPrice,discountAmount=discountAmount,handReceivableAmount=handReceivableAmount,
387   - itemReceivableAmount=itemReceivableAmount,receivableAmount=receivableAmount,categoryName=categoryName,
388   - categoryId=carTypeId,grossWeightDate=grossWeightDate,tareWeightDate=tareWeightDate,sumPrice=sumPrice)
389   -
390   -print(res.text)
391 369 \ No newline at end of file
  370 +# pwd = "111111"
  371 +# id = orderId
  372 +# totalAmount = totalMoney
  373 +# customerPhone=mobile
  374 +# productPrice="1.00000"
  375 +# dep=feeDepId
  376 +# productArea = "重庆,重庆市,万州区"
  377 +# chargeTotalAmount = totalMoney
  378 +# chargeTotalAmountYuan = int(chargeTotalAmount)/100
  379 +# freezeMoneySymbol =
  380 +# comparisonFreezeAmount =
  381 +# modified = created
  382 +# firmCode = "9"
  383 +# marketFlag=firmCode
  384 +# collectionPrice=discountAmount
  385 +# itemReceivableAmount=receivable
  386 +# receivableAmount=receivable
  387 +# tareWeightDate=tareWeightDate
  388 +# aa = do_doPay(host=host,autocompletecartype=autocompletecartype,fee_str=fee_str,pwd=pwd,optType=optType,
  389 +# weightType=weightType,id=id,goodsId=goodsId,number=number,created=created,status=status,source=source,
  390 +# correctDiscount=correctDiscount,totalAmount=totalAmount,customerId=customerId,fundAccount=accountId,
  391 +# accountId=accountId,ic=ic,customerName=customerName,customerPhone=customerPhone,plate=plate,
  392 +# carTypeName=carTypeName,carTypeCode=carTypeCode,carTypeId=carTypeId,carTypeWeight=carTypeWeight,
  393 +# proveType=proveType,grossWeight=grossWeight,tareWeight=tareWeight,weight=weight,productPrice=productPrice,
  394 +# unitPrice=unitPrice,depName=depName,calcDepId=calcDepId,dep=dep,regionName=regionName,regionId=regionId,
  395 +# productName=productName,productId=productId,productArea=productArea,originId=originId,
  396 +# tradeTypeId=tradeTypeId,correctInfo=correctInfo,chargeTotalAmount=chargeTotalAmount,
  397 +# freezeMoneySymbol=freezeMoneySymbol,comparisonFreezeAmount=comparisonFreezeAmount,modified=modified,
  398 +# goodsTagIds=goodsTagIds,marketFlag=marketFlag,totalMoney=totalMoney,receivable=receivable,
  399 +# collectionPrice=collectionPrice,discountAmount=discountAmount,handReceivableAmount=handReceivableAmount,
  400 +# itemReceivableAmount=itemReceivableAmount,receivableAmount=receivableAmount,categoryName=categoryName,
  401 +# categoryId=carTypeId,grossWeightDate=grossWeightDate,tareWeightDate=tareWeightDate,sumPrice=sumPrice)
  402 +#
  403 +# print(aa.text)
392 404 \ No newline at end of file
... ...
commons/api/zcApi.py
... ... @@ -217,6 +217,8 @@ def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transa
217 217 productId = categoryByCondition.json()["data"][0]["id"]
218 218 productName = categoryByCondition.json()["data"][0]["name"]
219 219 productCode = categoryByCondition.json()["data"][0]["keycode"]
  220 + print(productName)
  221 + print(productId)
220 222  
221 223 # 获取接车员信息
222 224 listByExample = get_listByExample(host=host)
... ...
commons/scripts/jsonToUrlcode.py
... ... @@ -9,11 +9,13 @@
9 9  
10 10 """
11 11  
  12 +import urllib.parse
  13 +
12 14 def jsonToUrlcode(data_json={}):
13 15 """json格式数据转换未urlcode格式数据"""
14 16 data_uc = ""
15 17 for k, v in data_json.items():
16   - data_uc = data_uc + str(k) + "=" + str(v) + "&"
  18 + data_uc = data_uc + str(k) + "=" + urllib.parse.quote(str(v)) + "&"
17 19 print(data_uc)
18 20 return data_uc
19 21  
... ...
report/test.log
1   -[2021-08-04 17:04:36] [INFO] : ======================================================================================
2   -[2021-08-04 17:04:36] [INFO] : http://test.jmsf.diligrp.com:8385/entranceFeeBill/listPage.action
3   -{'rows': '10', 'page': '1', 'sort': 'et.created', 'order': 'desc', 'metadata[created]': '{"provider": "datetimeProvider", "index": 10, "field": "created"}', 'metadata[totalPrice]': '{"provider": "moneyProvider", "index": 20, "field": "totalPrice"}', 'metadata[paymentTime]': '{"provider": "datetimeProvider", "index": 30, "field": "paymentTime"}', 'metadata[type]': '{"provider": "entranceFeeBillTypeProvider", "index": 40, "field": "type"}', 'metadata[status]': '{"provider": "entranceFeeBillStateProvider", "index": 50, "field": "status"}', 'attr': 'number', 'attrValue': '202108040900002'}
4   -{}
5   -
6   -[2021-08-04 17:04:37] [INFO] : ======================================================================================
7   -[2021-08-04 17:04:37] [INFO] : http://test.jmsf.diligrp.com:8385/entranceFeeBill/pay/3710.action
  1 +[2021-08-05 18:25:26] [INFO] : ======================================================================================
  2 +[2021-08-05 18:25:26] [INFO] : http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/add.action
  3 +b'id=40&name=\xe5\x86\x9c\xe4\xba\xa4&mobile=18828281176&cardNumber=888810054630& relationCardTemp=210720133001&relationalCard[0].cardNumber=210720131533'
8 4 None
9   -{}
10   -
11   -[2021-08-04 17:04:38] [INFO] : ======================================================================================
12   -[2021-08-04 17:04:38] [INFO] : http://test.jmsf.diligrp.com:8385/api/jmsf/ajax/icCheck?ic=888810032426
13   -None
14   -{}
15   -
16   -[2021-08-04 17:04:39] [INFO] : ======================================================================================
17   -[2021-08-04 17:04:39] [INFO] : http://test.jmsf.diligrp.com:8385/api/jmsf/ajax/city/?name=万州&query=万州
18   -None
19   -{}
20   -
21   -[2021-08-04 17:04:39] [INFO] : ======================================================================================
22   -[2021-08-04 17:04:39] [INFO] : http://test.jmsf.diligrp.com:8385/calculate/index.action
23   -{'protocolId': '', 'pwd': '', 'clientRedirectTag': '', 'viewType': 'pay', 'optType': '0', 'optUrl': '', 'correctInfo': '1', 'weightType': '1', 'id': 3710, 'goodsId': '3724', 'number': '202108040900002', 'modified': '2021-08-04 17:04:39', 'status': '2', 'source': '1', 'updateFeeItems': '', 'correctDiscount': '1', 'totalAmount': '', 'customerId': '0', 'fundAccount': '', 'ic': '', 'customerName': '', 'customerPhone': '', 'payway': '刷卡', 'plate': '川B00002', 'autocomplete-cartype': '003(板车)', 'carTypeName': '板车', 'carTypeCode': '003', 'carTypeId': '53', 'carTypeWeight': '333', 'storeTareWeight': '', 'proveType': '665', 'grossWeight': '353', 'tareWeight': '333', 'weight': '353', 'goodsNum': '', 'itemWeight': '', 'productPrice': '1.00000', 'unitPrice': '100.0', 'depName': '水果部', 'calcDepId': '53', 'regionName': '', 'regionId': '0', 'productName': '蔬菜', 'productId': '14152', 'productArea': '万州区', 'parentId': '', 'levelType': '', 'originId': 500101, 'tradeTypeId': '71', 'chargeTotalAmount': '', 'chargeTotalAmountYuan': '', 'freezeMoneySymbol': '', 'comparisonFreezeAmount': '', 'created': '2021-08-04 10:11:31', 'remark': 'false', 'goodsTagIds': '1900', 'shareRatio': '0', 'handlingTeam': '', 'handlingRatio': '', 'handActualAmount': '', 'handManageAmount': '', 'handCollectionAmount': '', 'receivableAmount': '', 'categoryName': '蔬菜', 'categoryId': '14152', 'driverTel': '', 'grossWeightDate': '2021-08-04 10:11:31', 'tareWeightDate': '2021-08-04 10:11:31', 'grossPathName': '', 'grossPathId': '', 'tarePathId': '', 'goodsRemark': '', 'inGreeterName': '', 'inGreeterId': '0', 'outGreeterId': '', 'sumPrice': '2000', 'shipperName': '', 'shipperId': '', 'shipperPhone': '', 'feeDepName': '', 'calcFeeDepId': '', 'newWeight': '20'}
24   -{}
25   -
26   -[2021-08-04 17:04:40] [INFO] : ======================================================================================
27   -[2021-08-04 17:04:40] [INFO] : http://test.jmsf.diligrp.com:8385/entranceTrade/doPay.action
28   -protocolId=&pwd=111111&clientRedirectTag=&viewType=pay&optType=0&optUrl=&correctInfo=1&weightType=1&id=3710&goodsId=3724&number=202108040900002&modified=2021-08-04 10:11:31&status=2&source=1&updateFeeItems=&correctDiscount=1&totalAmount=600&customerId=389&fundAccount=105847&ic=888810032426&customerName=长歌买家省内啊啊啊嘿&customerPhone=18011501258&payway=刷卡&plate=川B00002&autocomplete-cartype=003(板车)&carTypeName=板车&carTypeCode=003&carTypeId=53&carTypeWeight=333&storeTareWeight=&proveType=665&grossWeight=353&tareWeight=333&weight=353&goodsNum=&itemWeight=&productPrice=1.00000&unitPrice=100.0&depName=水果部&calcDepId=53&dep=53&regionName=A1区&regionId=72&productName=蔬菜&productId=14152&productArea=重庆,重庆市,万州区&parentId=&levelType=&originId=500101&tradeTypeId=71&chargeTotalAmount=600&chargeTotalAmountYuan={chargeTotalAmountYuan}&freezeMoneySymbol=9&comparisonFreezeAmount=9&created=2021-08-04 10:11:31&remark=&goodsTagIds=1900&marketFlag=9&totalMoney=600&receivable=1300&collectionPrice=500&discountAmount=500&handReceivableAmount=10000&itemReceivableAmount=1300&shareRatio=0&handlingTeam=&handActualAmount=0&handManageAmount=0&handCollectionAmount=0&receivableAmount=1300&categoryName=蔬菜&categoryId=53&driverTel=&grossWeightDate=2021-08-04 10:11:31&tareWeightDate=2021-08-04 10:11:31&grossPathName=&grossPathId=&tarePathId=&goodsRemark=&inGreeterName=&inGreeterId=0&outGreeterId=&sumPrice=2000&shipperName=&shipperId=&shipperPhone=&feeDepName=&calcFeeDepId=&feeDepId=&accountId=105847&correctDiscount=1&billItems=&billItemsDic=&billItemCheckIds=103&103=10.00&billItems={"discount":500,"id":103,"name":"交易管理费","receivable":1000,"require":1}&billItemDicCheckIds=105&billItemsDic={"discount":0,"id":105,"name":"优惠收费","receivable":500,"require":0}&billItemCheckIds=106&106=3.00&billItems={"discount":0,"id":106,"name":"检测费","receivable":300,"require":1}
29   -{}
30   -
  5 +{'headers': {'Host': 'test.jmsf.diligrp.com:8385', 'Connection': 'keep-alive', 'Content-Length': '148', 'Accept': 'application/json,text/javascript,*/*;q=0.01', 'Origin': 'http://test.jmsf.diligrp.com:8385', 'X-Requested-With': 'XMLHttpRequest', 'User-Agent': 'Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36', 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Referer': 'http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list', 'Accept-Encoding': 'gzip,deflate', 'Cookie': 'UAP_refreshToken=0e205e78-a656-4a85-a2ba-7226ce898ae5; UAP_firmId=9; UAP_accessToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJXRUIiLCJuYmYiOjE2Mjc4NzAyMzUsImRhdGEiOiJ7XCJjZWxscGhvbmVcIjpcIjE1NTI2MzY0NDU2XCIsXCJjcmVhdGVkXCI6MTYwODc5NTk0OTAwMCxcImRlcGFydG1lbnRJZFwiOjU2LFwiZW1haWxcIjpcInNoZW55YW5nQGRpbGlncnAuY29tXCIsXCJmaXJtQ29kZVwiOlwic3lcIixcImZpcm1JZFwiOjksXCJmaXJtTmFtZVwiOlwi5rKI6Ziz5Zyw5Yip5Yac5om55biC5Zy65a6i5oi355S15a2Q57uT566X5Lit5b-DXCIsXCJpZFwiOjI1MSxcImxhc3RMb2dpblRpbWVcIjoxNjI3ODY1NTc3OTg5LFwibWV0YWRhdGFcIjp7fSxcIm1vZGlmaWVkXCI6MTYyNjE2MzAwNDAwMCxcInBhc3N3b3JkXCI6XCIxODk2NUVCNzJDOTJBNTQ5RERcIixcInJlYWxOYW1lXCI6XCLmsojpmLNcIixcInNlcmlhbE51bWJlclwiOlwiMDAwXCIsXCJzdGF0ZVwiOjEsXCJzeXN0ZW1UeXBlXCI6MSxcInVzZXJOYW1lXCI6XCI0NDQ0NDRcIn0iLCJpc3MiOiJVQVBfQVVUSDAiLCJleHAiOjE2Mjc4NzIwMzUsImlhdCI6MTYyNzg3MDIzNSwianRpIjoiNDc3MDU5N2YtMGRjZi00OGIwLTg5YjQtNmVhODFiZjVhNTJjIn0.nso2DlyjXlOnwFp5D-N9jvyEKHJJ76K-BIzTdT-1UQAbqKD_9m4ZKXESxh-9333GWtYHORsnbav6MXI6h1Si4Ee_6rxB1DrkqxXoohavvAPutNr5byXjIUejLfFv_YTyCuXCkjiSCUlribURiqG_jKccr5BfIVUigSLkB9ff3f4'}}
... ...
testcase/test_ZC/demo.py
... ... @@ -9,5 +9,10 @@
9 9  
10 10 """
11 11 import json
  12 +import urllib
12 13 import urllib.parse
13 14  
  15 +a = {"a":"b","c":"阿三大苏打"}
  16 +print(urllib.parse.urlencode(a))
  17 +b = "a=b&c=d"
  18 +# print(urllib.unquote)
... ...
testcase/test_ZC/test_ZC.py
... ... @@ -122,7 +122,7 @@ class test_demo(unittest.TestCase):
122 122  
123 123 def test_cre(self):
124 124 """调用方法1"""
125   - cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName="车",plate="川B00001",keyword="雪莲果",
  125 + cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName="车",plate="川B00001",keyword="雪莲果",
126 126 userName="ty_test",transactionName="沈阳2号",newWeight=20,
127 127 depName="接车部",goodsTagName="货物标签测试",proveName="绿色蔬菜")
128 128 print(cre_res.json())
... ...
testcase/test_demo/__init__.py deleted 100644 → 0
1   -# -*- coding: utf-8 -*-
2   -
3   -# @Time : 2021/7/27 16:43
4   -# @Author : Ljq
5   -# @File : __init__.py.py
6   -# @Software: PyCharm
7   -
8   -"""
9   -
10   -"""
testcase/test_demo/test_demo_class.py deleted 100644 → 0
1   -# -*- coding: utf-8 -*-
2   -
3   -# @Time : 2021/7/27 17:33
4   -# @Author : Ljq
5   -# @File : test_demo_class.py
6   -# @Software: PyCharm
7   -
8   -"""
9   -测试get_carTypeClass
10   -"""
11   -
12   -import json
13   -import unittest
14   -from commons.scripts.readConf import rC
15   -from commons.MySession import my
16   -from commons.api import addJmsfDemo as aJ
17   -gCTC = aJ.get_carTypeClass(host=rC.returnOptionsItems("host","gatewayHost"))
18   -
19   -
20   -class test_demo(unittest.TestCase):
21   - def setUp(self) -> None:
22   - pass
23   -
24   - def tearDown(self) -> None:
25   - pass
26   -
27   - @classmethod
28   - def setUpClass(cls) -> None:
29   - pass
30   -
31   - @classmethod
32   - def tearDownClass(cls) -> None:
33   - pass
34   -
35   - def test_check_class(self):
36   - res = my.useHeadersRequests(method=gCTC.method,url=gCTC.url,headers=gCTC.headers,data=json.dumps(gCTC.data))
37   - print(res.text)
38   -
39   -if __name__ == "__main__":
40   - unittest.main()
41 0 \ No newline at end of file
testcase/test_demo/test_demo_classB.py deleted 100644 → 0
1   -# -*- coding: utf-8 -*-
2   -
3   -# @Time : 2021/7/27 17:44
4   -# @Author : Ljq
5   -# @File : test_demo_classB.py
6   -# @Software: PyCharm
7   -
8   -"""
9   -测试get_carTypeClassB类
10   -"""
11   -
12   -import json
13   -import unittest
14   -from commons.scripts.readConf import rC
15   -from commons.MySession import my
16   -from commons.api import addJmsfDemo as aJ
17   -gCTC = aJ.get_carTypeClassB()
18   -
19   -
20   -class test_demo(unittest.TestCase):
21   - def setUp(self) -> None:
22   - pass
23   -
24   - def tearDown(self) -> None:
25   - pass
26   -
27   - @classmethod
28   - def setUpClass(cls) -> None:
29   - pass
30   -
31   - @classmethod
32   - def tearDownClass(cls) -> None:
33   - pass
34   -
35   - def test_check_class(self):
36   - res = my.useHeadersRequests(method=gCTC.method,url=gCTC.url,headers=gCTC.headers,data=json.dumps(gCTC.data))
37   - print(res.text)
38   -
39   -if __name__ == "__main__":
40   - unittest.main()
41 0 \ No newline at end of file
testcase/test_demo/test_demo_def.py deleted 100644 → 0
1   -# -*- coding: utf-8 -*-
2   -
3   -# @Time : 2021/7/27 16:43
4   -# @Author : Ljq
5   -# @File : test_demo.py
6   -# @Software: PyCharm
7   -
8   -"""
9   -测试get_carType方法
10   -"""
11   -
12   -import json
13   -import unittest
14   -from commons.scripts.readConf import rC
15   -from commons.api import addJmsfDemo as aJ
16   -
17   -class test_demo(unittest.TestCase):
18   - def setUp(self) -> None:
19   - pass
20   -
21   - def tearDown(self) -> None:
22   - pass
23   -
24   -
25   - @classmethod
26   - def setUpClass(cls) -> None:
27   - cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")
28   - print("self.gatewayHost", cls.gatewayHost)
29   -
30   - @classmethod
31   - def tearDownClass(cls) -> None:
32   - pass
33   -
34   - def test_check_def(self):
35   - res = aJ.get_carType(host=self.gatewayHost)
36   - print(res.text)
37   -
38   -if __name__ == "__main__":
39   - unittest.main()
40 0 \ No newline at end of file