Commit bb414ba8be60aa9e6203c9561dc495e8034facc1

Authored by liujiqiang
1 parent 6103b277

进门单列表方法更新

commons/api/entranceFeeBillList.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/7/29 16:48
  4 +# @Author : Ljq
  5 +# @File : entranceFeeBillList.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +进门单列表接口封装
  10 +"""
  11 +
  12 +import json,time,random
  13 +from commons.scripts import dealContentType as dct
  14 +from commons.MySession import my
  15 +import urllib3
  16 +
  17 +def listPage(host="",attrName="收费单号",attrValue=None,**kwargs):
  18 + """
  19 + 进门单列表查询接口
  20 + :param kwargs:
  21 + rows=10
  22 + page=1
  23 + sort=et.created
  24 + order=desc
  25 + attr=number
  26 + attrValue=11
  27 + carTypeId=53
  28 + categoryId=14152
  29 + productName=1
  30 + status=2
  31 + tradeTypeId=70
  32 + tareOperatorName=11
  33 + startTime=2021-07-29 00:00:00
  34 + endTime=2021-07-29 23:59:59
  35 + startPayTime=2021-07-29 00:00:00
  36 + endPayTime=2021-07-29 23:59:59
  37 + startRefundTime=2021-07-29 00:00:00
  38 + endRefundTime=2021-07-29 23:59:59
  39 + """
  40 +
  41 + headers = dct.urlCode()
  42 + url = host + "/entranceFeeBill/listPage.action"
  43 + attr_list = {"收费单号": "number", "车号": "likePlate", "商品": "goods", "收费员": "pay", "客户姓名": "cname",
  44 + "客户卡号": "ic", "手机号码": "phone"}
  45 + data = {"rows": "10", "page": "1", "sort": "et.created", "order": "desc",
  46 + "metadata[created]": {"provider": "datetimeProvider", "index": 10, "field": "created"},
  47 + "metadata[totalPrice]": {"provider": "moneyProvider", "index": 20, "field": "totalPrice"},
  48 + "metadata[paymentTime]": {"provider": "datetimeProvider", "index": 30, "field": "paymentTime"},
  49 + "metadata[type]": {"provider": "entranceFeeBillTypeProvider", "index": 40, "field": "type"},
  50 + "metadata[status]": {"provider": "entranceFeeBillStateProvider", "index": 50, "field": "status"},
  51 + "attr": "number"}
  52 +
  53 + # 查询类型处理
  54 + attr = attr_list[attrName]
  55 + data["attr"] = attr
  56 + if attrValue != None:
  57 + data["attrValue"]=attrValue
  58 +
  59 + # 参数替换与部分参数数据格式处理
  60 + data = dict(data, **kwargs)
  61 + data["metadata[created]"] = json.dumps(data["metadata[created]"])
  62 + data["metadata[totalPrice]"] = json.dumps(data["metadata[totalPrice]"])
  63 + data["metadata[paymentTime]"] = json.dumps(data["metadata[paymentTime]"])
  64 + data["metadata[type]"] = json.dumps(data["metadata[type]"])
  65 + data["metadata[status]"] = json.dumps(data["metadata[status]"])
  66 +
  67 + # 请求接口
  68 + res = my.useHeadersRequests(method="POST", url=url, data=data, headers=headers)
  69 + return res
  70 +
  71 +def get_OrderDetails(host="",orderId=None):
  72 + """获取订单详情"""
  73 + headers = dct.urlCode()
  74 + url = host + f"/entranceFeeBill/pay/{orderId}.action"
  75 + res = my.useHeadersRequests("get", url=url, headers=headers)
  76 + return res
  77 +
  78 +def get_icCheck(host="",ic=None):
  79 + """进门缴费单详情页面刷卡刷卡"""
  80 + headers = dct.urlCode()
  81 + url = host + f"/api/jmsf/ajax/icCheck?ic={ic}"
  82 + res = my.useHeadersRequests("get", url=url,headers=headers)
  83 + return res
  84 +
  85 +def get_city(host="",name=None):
  86 + """进门缴费单详情页面获取产地信息"""
  87 + headers = dct.urlCode()
  88 + url = host + f"/api/jmsf/ajax/city/?name={name}&query={name}"
  89 + res = my.useHeadersRequests("get", url=url,headers=headers)
  90 + return res
  91 +
  92 +# a = listPage(host="http://test.jmsf.diligrp.com:8385",attrName="收费单号",attrValue="202107290900021")
  93 +# print(a.json())
  94 +# orderId = a.json()["rows"][0]["id"]
  95 +# print(orderId)
  96 +# res = getOrderDetails(host="http://test.jmsf.diligrp.com:8385",orderId=orderId)
  97 +# print(res.text)
  98 +# res = get_icCheck(host="http://test.jmsf.diligrp.com:8385",ic=888810032426)
  99 +# print(res.text)
  100 +# res = get_city(host="http://test.jmsf.diligrp.com:8385",name="万州")
  101 +# print(res.text)
0 \ No newline at end of file 102 \ No newline at end of file
commons/api/zcApi.py
@@ -190,7 +190,7 @@ def create_wholeCarWeighSave(host="",duplicateToken=None,**kwargs): @@ -190,7 +190,7 @@ def create_wholeCarWeighSave(host="",duplicateToken=None,**kwargs):
190 res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) 190 res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers)
191 return res 191 return res
192 192
193 -def create_jmsf(host=None,keyword="蔬菜",**kwargs): 193 +def create_jmsf(host=None,keyword="蔬菜",newWeight=99,plate="川A12345"):
194 """ 194 """
195 195
196 """ 196 """
@@ -254,18 +254,18 @@ def create_jmsf(host=None,keyword="蔬菜",**kwargs): @@ -254,18 +254,18 @@ def create_jmsf(host=None,keyword="蔬菜",**kwargs):
254 duplicateToken = duplicateTokenRes.json()["data"] 254 duplicateToken = duplicateTokenRes.json()["data"]
255 255
256 # 创建生成进门单 256 # 创建生成进门单
257 - plate = "川A12323" 257 + plate = plate
258 productState = "1" 258 productState = "1"
259 trailerNumber = plate 259 trailerNumber = plate
260 260
261 # 重量信息准备 261 # 重量信息准备
262 - grossWeight = random.randint(carTypeWeight, carTypeWeight + 100) 262 + newWeight = newWeight
263 tareWeight = carTypeWeight 263 tareWeight = carTypeWeight
264 weighmanRecord = {"grossWeight": None, "grossWeightDate": "", "newWeight": None, "tareWeight": None, 264 weighmanRecord = {"grossWeight": None, "grossWeightDate": "", "newWeight": None, "tareWeight": None,
265 "tareWeightDate": None, "weighImgs": []} 265 "tareWeightDate": None, "weighImgs": []}
266 - weighmanRecord["grossWeight"] = grossWeight 266 + weighmanRecord["grossWeight"] = carTypeWeight+newWeight
267 weighmanRecord["tareWeight"] = carTypeWeight 267 weighmanRecord["tareWeight"] = carTypeWeight
268 - weighmanRecord["newWeight"] = grossWeight - carTypeWeight 268 + weighmanRecord["newWeight"] = newWeight
269 weighmanRecord["grossWeightDate"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 269 weighmanRecord["grossWeightDate"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
270 270
271 # 创建进门单 271 # 创建进门单
@@ -278,4 +278,5 @@ def create_jmsf(host=None,keyword="蔬菜",**kwargs): @@ -278,4 +278,5 @@ def create_jmsf(host=None,keyword="蔬菜",**kwargs):
278 tradeType=tradeType, tradeTypeName=tradeTypeName, productState=productState, 278 tradeType=tradeType, tradeTypeName=tradeTypeName, productState=productState,
279 tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId, 279 tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId,
280 inGreeterName=inGreeterName, dep=feeDepId, weighmanRecord=weighmanRecord) 280 inGreeterName=inGreeterName, dep=feeDepId, weighmanRecord=weighmanRecord)
281 - print(cre_res.json())  
282 \ No newline at end of file 281 \ No newline at end of file
  282 + print(cre_res.json())
  283 + return cre_res
283 \ No newline at end of file 284 \ No newline at end of file
config/marketConfig/test_config_hg.conf
@@ -17,4 +17,5 @@ loginPwd=111111 @@ -17,4 +17,5 @@ loginPwd=111111
17 [host] 17 [host]
18 cardHost=http://test.card.diligrp.com:8386 18 cardHost=http://test.card.diligrp.com:8386
19 uapHost=http://test.uap.diligrp.com 19 uapHost=http://test.uap.diligrp.com
20 -gatewayHost=http://test.gateway.diligrp.com:8285  
21 \ No newline at end of file 20 \ No newline at end of file
  21 +gatewayHost=http://test.gateway.diligrp.com:8285
  22 +jmsfHost=http://test.jmsf.diligrp.com:8385
22 \ No newline at end of file 23 \ No newline at end of file
report/test.log
1 -[2021-07-29 15:59:06] [INFO] : ======================================================================================  
2 -[2021-07-29 15:59:06] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCarType  
3 -{"businessCode": "jmsf"}  
4 -{}  
5 -  
6 -[2021-07-29 15:59:06] [INFO] : ======================================================================================  
7 -[2021-07-29 15:59:06] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree  
8 -{"marketId": 9, "state": 1, "keyword": "\u5c71\u836f"}  
9 -{}  
10 -  
11 -[2021-07-29 15:59:06] [INFO] : ======================================================================================  
12 -[2021-07-29 15:59:06] [INFO] : http://test.gateway.diligrp.com:8285/dili-uap/userApi/listByExample.api  
13 -{"firmCode": "sy", "departmentId": 58, "keyword": ""}  
14 -{}  
15 -  
16 -[2021-07-29 15:59:06] [INFO] : ======================================================================================  
17 -[2021-07-29 15:59:06] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/tradeType/query  
18 -{"pageNum": 100, "pageSize": 100, "marketId": 9}  
19 -{}  
20 -  
21 -[2021-07-29 15:59:06] [INFO] : ======================================================================================  
22 -[2021-07-29 15:59:06] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid  
23 -None  
24 -{'params': {'pid': 'goods_tag'}}  
25 -  
26 -[2021-07-29 15:59:07] [INFO] : ======================================================================================  
27 -[2021-07-29 15:59:07] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/address  
28 -{"province": "C", "city": null, "area": null}  
29 -{}  
30 -  
31 -[2021-07-29 15:59:07] [INFO] : ======================================================================================  
32 -[2021-07-29 15:59:07] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/dep  
33 -{"keyword": ""}  
34 -{}  
35 -  
36 -[2021-07-29 15:59:07] [INFO] : ======================================================================================  
37 -[2021-07-29 15:59:07] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid  
38 -None  
39 -{'params': {'pid': 'prove_type'}}  
40 -  
41 -[2021-07-29 15:59:08] [INFO] : ======================================================================================  
42 -[2021-07-29 15:59:08] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/appCommon/duplicateToken.action 1 +[2021-07-29 18:13:25] [INFO] : ======================================================================================
  2 +[2021-07-29 18:13:25] [INFO] : http://test.jmsf.diligrp.com:8385/api/jmsf/ajax/city/?name=万州&query=万州
43 None 3 None
44 {} 4 {}
45 5
46 -[2021-07-29 15:59:08] [INFO] : ======================================================================================  
47 -[2021-07-29 15:59:08] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/entrace/wholeCarWeighSave  
48 -{"carTypeCode": "003", "carTypeId": 53, "carTypeName": "\u677f\u8f66", "carTypeWeight": 333, "plate": "\u5dddA12323", "inGreeterId": 223, "inGreeterName": "\u6d4b\u8bd5\u6c88\u9633", "productId": 14156, "productName": "\u5c71\u836f", "proveTypeCode": 665, "proveTypeName": "\u98df\u54c1\u5b89\u5168", "weighRemark": "\u5907\u6ce8", "weighmanRecord": {"grossWeight": 391, "grossWeightDate": "2021-07-29 15:59:08", "newWeight": 58, "tareWeight": 333, "tareWeightDate": null, "weighImgs": []}, "productCode": null, "trailerNumber": "\u5dddA12323", "pathAddress": "A4-BB-6D-0A-F4-13", "haveTruckWeight": false, "source": 4, "entryPlateInputType": 1, "dep": 58, "depName": "\u6c34\u679c\u90e8", "cateId": 14156, "notice": 0, "backSkinTwo": -1, "recordOriginId": 0, "recordOriginName": null, "recordProductId": 0, "recordProductName": null, "recordWeight": null, "codeIc": null, "codeId": 0, "difference": 0, "bindRecordSign": 0, "recordDesc": null, "hasCodeItems": false, "customerId": 0, "customerName": "", "driverIc": null, "driverName": null, "totalPrice": null, "originId": 500101, "origin": "\u4e07\u5dde\u533a", "originCode": "023", "tradeType": "9001", "tradeTypeName": "\u6c88\u96331\u53f7", "weight": 2.0, "pwd": "", "type": 1, "ic": "", "boothNumber": "210728154359", "productState": "1", "accountId": 0, "passCheckId": 0, "passCheckName": null, "tradeTypeId": 70, "id": 0, "protocolId": null, "goodsTagId": 663}  
49 -{}  
50 -  
51 -[2021-07-29 15:59:09] [INFO] : ======================================================================================  
52 -[2021-07-29 15:59:09] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCarType  
53 -{"businessCode": "jmsf"}  
54 -{}  
55 -  
56 -[2021-07-29 15:59:09] [INFO] : ======================================================================================  
57 -[2021-07-29 15:59:09] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree  
58 -{"marketId": 9, "state": 1, "keyword": "\u852c\u83dc"}  
59 -{}  
60 -  
61 -[2021-07-29 15:59:09] [INFO] : ======================================================================================  
62 -[2021-07-29 15:59:09] [INFO] : http://test.gateway.diligrp.com:8285/dili-uap/userApi/listByExample.api  
63 -{"firmCode": "sy", "departmentId": 58, "keyword": ""}  
64 -{}  
65 -  
66 -[2021-07-29 15:59:09] [INFO] : ======================================================================================  
67 -[2021-07-29 15:59:09] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/tradeType/query  
68 -{"pageNum": 100, "pageSize": 100, "marketId": 9}  
69 -{}  
70 -  
71 -[2021-07-29 15:59:10] [INFO] : ======================================================================================  
72 -[2021-07-29 15:59:10] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid  
73 -None  
74 -{'params': {'pid': 'goods_tag'}}  
75 -  
76 -[2021-07-29 15:59:10] [INFO] : ======================================================================================  
77 -[2021-07-29 15:59:10] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/address  
78 -{"province": "C", "city": null, "area": null}  
79 -{}  
80 -  
81 -[2021-07-29 15:59:11] [INFO] : ======================================================================================  
82 -[2021-07-29 15:59:11] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/dep  
83 -{"keyword": ""}  
84 -{}  
85 -  
86 -[2021-07-29 15:59:11] [INFO] : ======================================================================================  
87 -[2021-07-29 15:59:11] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid  
88 -None  
89 -{'params': {'pid': 'prove_type'}}  
90 -  
91 -[2021-07-29 15:59:12] [INFO] : ======================================================================================  
92 -[2021-07-29 15:59:12] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/appCommon/duplicateToken.action  
93 -None  
94 -{}  
95 -  
96 -[2021-07-29 15:59:12] [INFO] : ======================================================================================  
97 -[2021-07-29 15:59:12] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/entrace/wholeCarWeighSave  
98 -{"carTypeCode": "003", "carTypeId": 53, "carTypeName": "\u677f\u8f66", "carTypeWeight": 333, "plate": "\u5dddA12323", "inGreeterId": 223, "inGreeterName": "\u6d4b\u8bd5\u6c88\u9633", "productId": 14152, "productName": "\u852c\u83dc", "proveTypeCode": 665, "proveTypeName": "\u98df\u54c1\u5b89\u5168", "weighRemark": "\u5907\u6ce8", "weighmanRecord": {"grossWeight": 412, "grossWeightDate": "2021-07-29 15:59:12", "newWeight": 79, "tareWeight": 333, "tareWeightDate": null, "weighImgs": []}, "productCode": null, "trailerNumber": "\u5dddA12323", "pathAddress": "A4-BB-6D-0A-F4-13", "haveTruckWeight": false, "source": 4, "entryPlateInputType": 1, "dep": 58, "depName": "\u6c34\u679c\u90e8", "cateId": 14152, "notice": 0, "backSkinTwo": -1, "recordOriginId": 0, "recordOriginName": null, "recordProductId": 0, "recordProductName": null, "recordWeight": null, "codeIc": null, "codeId": 0, "difference": 0, "bindRecordSign": 0, "recordDesc": null, "hasCodeItems": false, "customerId": 0, "customerName": "", "driverIc": null, "driverName": null, "totalPrice": null, "originId": 500101, "origin": "\u4e07\u5dde\u533a", "originCode": "023", "tradeType": "9001", "tradeTypeName": "\u6c88\u96331\u53f7", "weight": 2.0, "pwd": "", "type": 1, "ic": "", "boothNumber": "210728154359", "productState": "1", "accountId": 0, "passCheckId": 0, "passCheckName": null, "tradeTypeId": 70, "id": 0, "protocolId": null, "goodsTagId": 663}  
99 -{}  
100 -  
testcase/test_ZC/demo.py
@@ -11,8 +11,10 @@ @@ -11,8 +11,10 @@
11 11
12 import json 12 import json
13 import datetime,time 13 import datetime,time
  14 +import urllib
14 15
15 # print(time.localtime()) 16 # print(time.localtime())
  17 +import urllib3
16 18
17 print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) 19 print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
18 20
@@ -28,3 +30,7 @@ print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) @@ -28,3 +30,7 @@ print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
28 # b = dict(a,**kwargs) 30 # b = dict(a,**kwargs)
29 # print(b) 31 # print(b)
30 32
  33 +a = {"收费单号":"number","车号":"likePlate","商品":"goods","收费员":"pay","客户姓名":"cname","客户卡号":"ic","手机号码":"phone"}
  34 +print(a["收费单号"])
  35 +urllib3
  36 +
testcase/test_ZC/test_ZC.py
@@ -27,11 +27,13 @@ class test_demo(unittest.TestCase): @@ -27,11 +27,13 @@ class test_demo(unittest.TestCase):
27 @classmethod 27 @classmethod
28 def setUpClass(cls) -> None: 28 def setUpClass(cls) -> None:
29 cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") 29 cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")
  30 + cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost")
30 31
31 @classmethod 32 @classmethod
32 def tearDownClass(cls) -> None: 33 def tearDownClass(cls) -> None:
33 pass 34 pass
34 35
  36 + @unittest.skip
35 def test_get_carType(self): 37 def test_get_carType(self):
36 """整车-整车创建:获取车型接口调用测试""" 38 """整车-整车创建:获取车型接口调用测试"""
37 # 获取车型 39 # 获取车型
@@ -120,7 +122,9 @@ class test_demo(unittest.TestCase): @@ -120,7 +122,9 @@ class test_demo(unittest.TestCase):
120 122
121 def test_cre(self): 123 def test_cre(self):
122 """调用方法1""" 124 """调用方法1"""
123 - zcA.create_jmsf(host=self.gatewayHost,keyword="山药") 125 + cre_res = zcA.create_jmsf(host=self.gatewayHost,plate="川B00001",keyword="山药",newWeight=20)
  126 + print(cre_res.json())
  127 +
124 128
125 129
126 130