Commit a82f9e0e9f73558946e44d11e3d60be3926e04f3
Merge remote-tracking branch 'origin/master'
Showing
6 changed files
with
160 additions
and
47 deletions
commons/api/entranceFeeBillList.py
... | ... | @@ -93,7 +93,7 @@ def get_city(host="",name=None): |
93 | 93 | # print(a.json()) |
94 | 94 | # orderId = a.json()["rows"][0]["id"] |
95 | 95 | # print(orderId) |
96 | -# res = getOrderDetails(host="http://test.jmsf.diligrp.com:8385",orderId=orderId) | |
96 | +# res = get_OrderDetails(host="http://test.jmsf.diligrp.com:8385",orderId=orderId) | |
97 | 97 | # print(res.text) |
98 | 98 | # res = get_icCheck(host="http://test.jmsf.diligrp.com:8385",ic=888810032426) |
99 | 99 | # print(res.text) | ... | ... |
commons/api/zcApi.py
... | ... | @@ -190,18 +190,23 @@ def create_wholeCarWeighSave(host="",duplicateToken=None,**kwargs): |
190 | 190 | res = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers) |
191 | 191 | return res |
192 | 192 | |
193 | -def create_jmsf(host=None,keyword="蔬菜",newWeight=99,plate="川A12345"): | |
193 | +def create_jmsf(host=None,carTypeName=None,keyword="蔬菜",userName=None,transactionName=None, | |
194 | + newWeight=99,plate="川A12345",goodsTagName=None,depName=None,proveName=None): | |
194 | 195 | """ |
195 | 196 | |
196 | 197 | """ |
197 | 198 | # 获取车型 |
198 | 199 | carType = get_carType(host=host) |
199 | 200 | print(carType.text) |
200 | - print(carType.json()["data"][0]) | |
201 | - carTypeCode = carType.json()["data"][0]["code"] | |
202 | - carTypeId = carType.json()["data"][0]["id"] | |
203 | - carTypeName = carType.json()["data"][0]["carTypeName"] | |
204 | - carTypeWeight = carType.json()["data"][0]["weight"] | |
201 | + if carTypeName ==None: | |
202 | + carTypeIndex = 0 | |
203 | + else: | |
204 | + carTypeIndex = carType.json()["data"].index( | |
205 | + [i for i in carType.json()["data"] if i["carTypeName"] == carTypeName][0]) | |
206 | + carTypeCode = carType.json()["data"][carTypeIndex]["code"] | |
207 | + carTypeId = carType.json()["data"][carTypeIndex]["id"] | |
208 | + carTypeName = carType.json()["data"][carTypeIndex]["carTypeName"] | |
209 | + carTypeWeight = carType.json()["data"][carTypeIndex]["weight"] | |
205 | 210 | |
206 | 211 | # 获取商品 |
207 | 212 | categoryByCondition = get_listCategoryByCondition(host=host,keyword=keyword) |
... | ... | @@ -211,23 +216,39 @@ def create_jmsf(host=None,keyword="蔬菜",newWeight=99,plate="川A12345"): |
211 | 216 | productName = categoryByCondition.json()["data"][0]["name"] |
212 | 217 | productCode = categoryByCondition.json()["data"][0]["keycode"] |
213 | 218 | |
214 | - # 获取商品 | |
219 | + # 获取接车员信息 | |
215 | 220 | listByExample = get_listByExample(host=host) |
216 | 221 | print(listByExample.json()) |
217 | - inGreeterId = listByExample.json()["data"][0]["id"] | |
218 | - inGreeterName = listByExample.json()["data"][0]["realName"] | |
222 | + if userName ==None: | |
223 | + listByExampleIndex = 0 | |
224 | + else: | |
225 | + listByExampleIndex = listByExample.json()["data"].index( | |
226 | + [i for i in listByExample.json()["data"] if i["userName"] == userName][0]) | |
227 | + inGreeterId = listByExample.json()["data"][listByExampleIndex]["id"] | |
228 | + inGreeterName = listByExample.json()["data"][listByExampleIndex]["realName"] | |
219 | 229 | |
220 | 230 | # 获取交易类型 |
221 | 231 | transactionType = query_transactionType(host=host) |
222 | 232 | print(transactionType.json()) |
223 | - tradeType = transactionType.json()["rows"][0]["code"] | |
224 | - tradeTypeId = transactionType.json()["rows"][0]["id"] | |
225 | - tradeTypeName = transactionType.json()["rows"][0]["name"] | |
233 | + print("交易类型") | |
234 | + if transactionName ==None: | |
235 | + transactionTypeIndex = 0 | |
236 | + else: | |
237 | + transactionTypeIndex = transactionType.json()["rows"].index( | |
238 | + [i for i in transactionType.json()["rows"] if i["name"] == transactionName][0]) | |
239 | + tradeType = transactionType.json()["rows"][transactionTypeIndex]["code"] | |
240 | + tradeTypeId = transactionType.json()["rows"][transactionTypeIndex]["id"] | |
241 | + tradeTypeName = transactionType.json()["rows"][transactionTypeIndex]["name"] | |
226 | 242 | |
227 | 243 | # 获取货物标签 |
228 | 244 | goodsTag = get_goodsTag(host=host) |
229 | 245 | print(goodsTag.json()) |
230 | - goodsTagId = goodsTag.json()["data"][0]["id"] | |
246 | + if goodsTagName ==None: | |
247 | + transactionTypeIndex = 0 | |
248 | + else: | |
249 | + transactionTypeIndex = goodsTag.json()["data"].index( | |
250 | + [i for i in goodsTag.json()["data"] if i["name"] == goodsTagName][0]) | |
251 | + goodsTagId = goodsTag.json()["data"][transactionTypeIndex]["id"] | |
231 | 252 | |
232 | 253 | # 产地信息获取 |
233 | 254 | address = get_address(host=host) |
... | ... | @@ -239,14 +260,24 @@ def create_jmsf(host=None,keyword="蔬菜",newWeight=99,plate="川A12345"): |
239 | 260 | # 查询部门信息 |
240 | 261 | depRes = get_dep(host=host) |
241 | 262 | print(depRes.json()) |
242 | - feeDepId = depRes.json()["data"][0]["id"] | |
243 | - feeDepName = depRes.json()["data"][0]["name"] | |
263 | + if depName ==None: | |
264 | + depResIndex = 0 | |
265 | + else: | |
266 | + depResIndex = depRes.json()["data"].index( | |
267 | + [i for i in depRes.json()["data"] if i["name"] == depName][0]) | |
268 | + feeDepId = depRes.json()["data"][depResIndex]["id"] | |
269 | + feeDepName = depRes.json()["data"][depResIndex]["name"] | |
244 | 270 | |
245 | 271 | # 获取证明类型 |
246 | 272 | proveType = get_proveType(host=host) |
247 | 273 | print(proveType.json()) |
248 | - proveTypeCode = proveType.json()["data"][0]["id"] | |
249 | - proveTypeName = proveType.json()["data"][0]["name"] | |
274 | + if depName ==None: | |
275 | + proveTypeIndex = 0 | |
276 | + else: | |
277 | + proveTypeIndex = proveType.json()["data"].index( | |
278 | + [i for i in proveType.json()["data"] if i["name"] == proveName][0]) | |
279 | + proveTypeCode = proveType.json()["data"][proveTypeIndex]["id"] | |
280 | + proveTypeName = proveType.json()["data"][proveTypeIndex]["name"] | |
250 | 281 | |
251 | 282 | # 获取防重token |
252 | 283 | duplicateTokenRes = get_duplicateToken(host=host) |
... | ... | @@ -278,5 +309,5 @@ def create_jmsf(host=None,keyword="蔬菜",newWeight=99,plate="川A12345"): |
278 | 309 | tradeType=tradeType, tradeTypeName=tradeTypeName, productState=productState, |
279 | 310 | tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId, |
280 | 311 | inGreeterName=inGreeterName, dep=feeDepId, weighmanRecord=weighmanRecord) |
281 | - print(cre_res.json()) | |
312 | + # print(cre_res.json()) | |
282 | 313 | return cre_res |
283 | 314 | \ No newline at end of file | ... | ... |
config/marketConfig/test_config_hg2.conf deleted
100644 → 0
1 | -#沈阳市场信息 | |
2 | -[loginInfo] | |
3 | -userName=scgy | |
4 | -password=DYdgRcAyx2bPboAmu0tgIYBM1kMxFAuDty7IQk4162Zh+8KKa8jtu6xIjG9W4yauTfPiuP1sqxDatskXFqCOz76ea14AqRCYEBz53xVr+vLfcz9zOB2d1T3aIlJbEk8yi2c21pd/MFkBw+Fhd0tky/6eN8kJA8mtsj3uDwSb9qo= | |
5 | - | |
6 | -[testInfo] | |
7 | -#已添加的身份证号 | |
8 | -cCNum=11010119990307865X | |
9 | -cCNumB=110101199903077593 | |
10 | -#入库未开卡的卡号 | |
11 | -cardNum=210607113166 | |
12 | -#已开卡的卡号 | |
13 | -cardNumRe=888800001207 | |
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 | 0 | \ No newline at end of file |
report/test.log
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=万州 | |
1 | +[2021-08-02 16:53:41] [INFO] : ====================================================================================== | |
2 | +[2021-08-02 16:53:41] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCarType | |
3 | +{"businessCode": "jmsf"} | |
4 | +{} | |
5 | + | |
6 | +[2021-08-02 16:53:41] [INFO] : ====================================================================================== | |
7 | +[2021-08-02 16:53:41] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree | |
8 | +{"marketId": 9, "state": 1, "keyword": "\u5c71\u836f"} | |
9 | +{} | |
10 | + | |
11 | +[2021-08-02 16:53:41] [INFO] : ====================================================================================== | |
12 | +[2021-08-02 16:53:41] [INFO] : http://test.gateway.diligrp.com:8285/dili-uap/userApi/listByExample.api | |
13 | +{"firmCode": "sy", "departmentId": 58, "keyword": ""} | |
14 | +{} | |
15 | + | |
16 | +[2021-08-02 16:53:42] [INFO] : ====================================================================================== | |
17 | +[2021-08-02 16:53:42] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/tradeType/query | |
18 | +{"pageNum": 100, "pageSize": 100, "marketId": 9} | |
19 | +{} | |
20 | + | |
21 | +[2021-08-02 16:53:42] [INFO] : ====================================================================================== | |
22 | +[2021-08-02 16:53:42] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid | |
23 | +None | |
24 | +{'params': {'pid': 'goods_tag'}} | |
25 | + | |
26 | +[2021-08-02 16:53:42] [INFO] : ====================================================================================== | |
27 | +[2021-08-02 16:53:42] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/address | |
28 | +{"province": "C", "city": null, "area": null} | |
29 | +{} | |
30 | + | |
31 | +[2021-08-02 16:53:42] [INFO] : ====================================================================================== | |
32 | +[2021-08-02 16:53:42] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/dep | |
33 | +{"keyword": ""} | |
34 | +{} | |
35 | + | |
36 | +[2021-08-02 16:53:43] [INFO] : ====================================================================================== | |
37 | +[2021-08-02 16:53:43] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid | |
38 | +None | |
39 | +{'params': {'pid': 'prove_type'}} | |
40 | + | |
41 | +[2021-08-02 16:53:43] [INFO] : ====================================================================================== | |
42 | +[2021-08-02 16:53:43] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/appCommon/duplicateToken.action | |
3 | 43 | None |
4 | 44 | {} |
5 | 45 | |
46 | +[2021-08-02 16:53:43] [INFO] : ====================================================================================== | |
47 | +[2021-08-02 16:53:43] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/entrace/wholeCarWeighSave | |
48 | +{"carTypeCode": "gc", "carTypeId": 59, "carTypeName": "\u6302\u8f66", "carTypeWeight": 1, "plate": "\u5dddB00001", "inGreeterId": 274, "inGreeterName": "\u901a\u7528\u6d4b\u8bd5", "productId": 14156, "productName": "\u5c71\u836f", "proveTypeCode": 1621, "proveTypeName": "\u7eff\u8272\u852c\u83dc", "weighRemark": "\u5907\u6ce8", "weighmanRecord": {"grossWeight": 21, "grossWeightDate": "2021-08-02 16:53:43", "newWeight": 20, "tareWeight": 1, "tareWeightDate": null, "weighImgs": []}, "productCode": null, "trailerNumber": "\u5dddB00001", "pathAddress": "A4-BB-6D-0A-F4-13", "haveTruckWeight": false, "source": 4, "entryPlateInputType": 1, "dep": 103, "depName": "\u63a5\u8f66\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": "9002", "tradeTypeName": "\u6c88\u96332\u53f7", "weight": 2.0, "pwd": "", "type": 1, "ic": "", "boothNumber": "210728154359", "productState": "1", "accountId": 0, "passCheckId": 0, "passCheckName": null, "tradeTypeId": 71, "id": 0, "protocolId": null, "goodsTagId": 1900} | |
49 | +{} | |
50 | + | |
51 | +[2021-08-02 16:53:44] [INFO] : ====================================================================================== | |
52 | +[2021-08-02 16:53:44] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCarType | |
53 | +{"businessCode": "jmsf"} | |
54 | +{} | |
55 | + | |
56 | +[2021-08-02 16:53:44] [INFO] : ====================================================================================== | |
57 | +[2021-08-02 16:53:44] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree | |
58 | +{"marketId": 9, "state": 1, "keyword": "\u852c\u83dc"} | |
59 | +{} | |
60 | + | |
61 | +[2021-08-02 16:53:45] [INFO] : ====================================================================================== | |
62 | +[2021-08-02 16:53:45] [INFO] : http://test.gateway.diligrp.com:8285/dili-uap/userApi/listByExample.api | |
63 | +{"firmCode": "sy", "departmentId": 58, "keyword": ""} | |
64 | +{} | |
65 | + | |
66 | +[2021-08-02 16:53:45] [INFO] : ====================================================================================== | |
67 | +[2021-08-02 16:53:45] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/tradeType/query | |
68 | +{"pageNum": 100, "pageSize": 100, "marketId": 9} | |
69 | +{} | |
70 | + | |
71 | +[2021-08-02 16:53:45] [INFO] : ====================================================================================== | |
72 | +[2021-08-02 16:53:45] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid | |
73 | +None | |
74 | +{'params': {'pid': 'goods_tag'}} | |
75 | + | |
76 | +[2021-08-02 16:53:45] [INFO] : ====================================================================================== | |
77 | +[2021-08-02 16:53:45] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/address | |
78 | +{"province": "C", "city": null, "area": null} | |
79 | +{} | |
80 | + | |
81 | +[2021-08-02 16:53:46] [INFO] : ====================================================================================== | |
82 | +[2021-08-02 16:53:46] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/dep | |
83 | +{"keyword": ""} | |
84 | +{} | |
85 | + | |
86 | +[2021-08-02 16:53:46] [INFO] : ====================================================================================== | |
87 | +[2021-08-02 16:53:46] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/jmsf/query/listCodeByPid | |
88 | +None | |
89 | +{'params': {'pid': 'prove_type'}} | |
90 | + | |
91 | +[2021-08-02 16:53:46] [INFO] : ====================================================================================== | |
92 | +[2021-08-02 16:53:46] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/appCommon/duplicateToken.action | |
93 | +None | |
94 | +{} | |
95 | + | |
96 | +[2021-08-02 16:53:47] [INFO] : ====================================================================================== | |
97 | +[2021-08-02 16:53:47] [INFO] : http://test.gateway.diligrp.com:8285/jmsf-web/api/entrace/wholeCarWeighSave | |
98 | +{"carTypeCode": "003", "carTypeId": 53, "carTypeName": "\u677f\u8f66", "carTypeWeight": 333, "plate": "\u5dddB00002", "inGreeterId": 223, "inGreeterName": "\u6d4b\u8bd5\u6c88\u9633", "productId": 14152, "productName": "\u852c\u83dc", "proveTypeCode": 665, "proveTypeName": "\u98df\u54c1\u5b89\u5168", "weighRemark": "\u5907\u6ce8", "weighmanRecord": {"grossWeight": 353, "grossWeightDate": "2021-08-02 16:53:47", "newWeight": 20, "tareWeight": 333, "tareWeightDate": null, "weighImgs": []}, "productCode": null, "trailerNumber": "\u5dddB00002", "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
... | ... | @@ -16,7 +16,7 @@ import urllib |
16 | 16 | # print(time.localtime()) |
17 | 17 | import urllib3 |
18 | 18 | |
19 | -print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) | |
19 | +# print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) | |
20 | 20 | |
21 | 21 | # a = {"aa":"阿三大苏打","bb":"bb","cc":{"cc1":"啊实打","cc2":"ad"}} |
22 | 22 | # print(a) |
... | ... | @@ -30,7 +30,10 @@ print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) |
30 | 30 | # b = dict(a,**kwargs) |
31 | 31 | # print(b) |
32 | 32 | |
33 | -a = {"收费单号":"number","车号":"likePlate","商品":"goods","收费员":"pay","客户姓名":"cname","客户卡号":"ic","手机号码":"phone"} | |
34 | -print(a["收费单号"]) | |
35 | -urllib3 | |
36 | - | |
33 | +a = {"code":"200","data":[{"autoPass":2,"autoSave":1,"carTypeName":"板车","code":"003","id":53,"number":"0007","remark":"","status":1,"tag":"jmsf","weight":333},{"autoPass":1,"autoSave":1,"carTypeName":"挂车","code":"gc","id":59,"number":"0030","remark":"","status":1,"tag":"jmsf","weight":1},{"autoPass":2,"carTypeName":"柜车","code":"23","id":60,"number":"0031","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":1,"autoSave":1,"carTypeName":"地排车","code":"008","id":87,"number":"0001","remark":"","status":1,"tag":"jmsf","weight":2},{"autoPass":2,"autoSave":1,"carTypeName":"玉玺","code":"888","id":128,"number":"0042","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":2,"carTypeName":"军车","code":"555","id":61,"number":"0013","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":2,"carTypeName":"小面包","code":"","id":142,"number":"0008","remark":"","status":1,"tag":"jmsf","weight":22},{"autoPass":1,"autoSave":1,"carTypeName":"小轿车","code":"001","id":51,"number":"0002","remark":"","status":1,"tag":"jmsf","weight":0},{"autoPass":2,"carTypeName":"123456789012345","code":"1245","id":160,"number":"0044","remark":"","status":1,"tag":"jmsf","weight":11},{"autoPass":2,"carTypeName":"111111111222222","code":"6432","id":161,"number":"0045","remark":"","status":1,"tag":"jmsf","weight":22},{"autoPass":2,"autoSave":1,"carTypeName":"test0731","code":"12345","id":162,"number":"0047","remark":"asdf g hgsaf","status":1,"tag":"jmsf","weight":11}],"message":"OK","result":"OK","success":True} | |
34 | +print(a["data"]) | |
35 | +# lambda file_name: os.path.getmtime(report_path + file_name) | |
36 | +b = a["data"].index([i for i in a["data"] if i["carTypeName"]=="地排车"][0]) | |
37 | +print(b) | |
38 | +# c ="2" if b !=None else "1" | |
39 | +# print(c) | |
37 | 40 | \ No newline at end of file | ... | ... |
testcase/test_ZC/test_ZC.py
... | ... | @@ -122,7 +122,11 @@ 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,plate="川B00001",keyword="山药",newWeight=20) | |
125 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName="挂车",plate="川B00001",keyword="山药", | |
126 | + userName="ty_test",transactionName="沈阳2号",newWeight=20, | |
127 | + depName="接车部",goodsTagName="货物标签测试",proveName="绿色蔬菜") | |
128 | + print(cre_res.json()) | |
129 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,plate="川B00002",newWeight=20) | |
126 | 130 | print(cre_res.json()) |
127 | 131 | |
128 | 132 | ... | ... |