Commit 6110983b7d59cf8285b862fd997add692932d734
1 parent
7e684970
上传证明类型接口封装代码
Showing
2 changed files
with
56 additions
and
6 deletions
commons/api/entranceFeeBill_provesPage.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import urllib3 | |
4 | +from commons import common as com | |
5 | +from commons.MySession import sy1 | |
6 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
7 | + | |
8 | + | |
9 | +class entranceFeeBill_provesPage(): | |
10 | + url = "http://test.jmsf.diligrp.com:8385/entranceFeeBill/provesPage.action" | |
11 | + header = { | |
12 | + "Connection": "keep-alive", | |
13 | + "Content-Length": "485", | |
14 | + "Accept": "application/json, text/javascript, */*; q=0.01", | |
15 | + "X-Requested-With": "XMLHttpRequest", | |
16 | + "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36", | |
17 | + "Content-Type": "application/x-www-form-urlencoded", | |
18 | + "Accept-Language": "zh-CN,zh;q=0.9", | |
19 | + "Accept-Encoding": "gzip, deflate"} | |
20 | + body = """rows=10&page=1&sort=et.created&order=desc | |
21 | + &metadata[actualPrice]={"provider":"moneyProvider","index":10,"field":"actualPrice"} | |
22 | + &metadata[created]={"provider":"datetimeProvider","index":20,"field":"created"} | |
23 | + &metadata[status]={"provider":"entranceFeeBillStateProvider","index":30,"field":"status"} | |
24 | + &attr=number&attrValue=202108110900139&categoryId=14436&productName=雪莲果&productId=14158 | |
25 | + &dep=103&proveTypeCode=1621&companyId=9&startTime=2020-08-11 00:00:00&endTime=2025-08-13 23:59:59""" | |
26 | + | |
27 | + def __init__(self): | |
28 | + self.url = entranceFeeBill_provesPage.url.replace("http://test.", com.get_global_config("global_data", "environment", "en")) | |
29 | + self.header = entranceFeeBill_provesPage.header | |
30 | + self.body= entranceFeeBill_provesPage.body.replace('\n', '') | |
31 | + self.sql="""SELECT | |
32 | + a.dep, | |
33 | + a.number, | |
34 | + a.plate, | |
35 | + a.customer_name, | |
36 | + a.customer_phone, | |
37 | + a.ic, | |
38 | + a.company_id, | |
39 | + a.goods_id, | |
40 | + b.prove_type_code, | |
41 | + b.category_id, | |
42 | + b.product_id, | |
43 | + b.product_name , | |
44 | + c.fee_bill_id | |
45 | + FROM entrance_fee_bill a ,goods b ,bill_fee_item c | |
46 | + WHERE a.goods_id=b.id | |
47 | + AND a.id = c.fee_bill_id | |
48 | + AND a.market_id={} | |
49 | + AND a.yn=1 | |
50 | + AND c.fee_item_name LIKE "%检测费%" | |
51 | + ORDER BY a.id DESC LIMIT 1;""".format(sy1.user["sy_user01"]["firmId"]) | |
52 | + | |
53 | + | |
54 | +# tt=entranceFeeBill_provesPage() | |
55 | +# re=sy1.post(url=tt.url,headers=tt.header,data=tt.body) | |
56 | +# print(re.json()) | |
0 | 57 | \ No newline at end of file | ... | ... |
testcase/weightBizBill/test_weighingServiceSave.py
... | ... | @@ -25,7 +25,6 @@ class test_weighingServiceSave(unittest.TestCase): |
25 | 25 | @unittest.case_mark(my.mark()) |
26 | 26 | def test_weighingServiceSave_01(self): |
27 | 27 | "称重服务:成功新增一条称重服务单" |
28 | - print(self.__doc__) | |
29 | 28 | body=we.body.copy() |
30 | 29 | car=li.car_list()["data"] |
31 | 30 | body["carTypeId"]=car[0]["id"] |
... | ... | @@ -36,11 +35,6 @@ class test_weighingServiceSave(unittest.TestCase): |
36 | 35 | self.assertEqual(re.status_code, 200) |
37 | 36 | self.assertTrue("'message':'交费成功','result':'交费成功','success':True" in str(re.json()).replace(" ","")) |
38 | 37 | |
39 | - @unittest.case_mark(my.mark()) | |
40 | - def test_weighingServiceSave_02(self): | |
41 | - "称重服务:成功新增一条称重服务单" | |
42 | - print("11111111111111111111111111111111111") | |
43 | - | |
44 | 38 | if __name__ == "__main__": |
45 | 39 | |
46 | 40 | # unittest.main(verbosity=2) | ... | ... |