entranceFeeBill_provesPage.py
2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import sy1
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class entranceFeeBill_provesPage():
url = "http://test.jmsf.diligrp.com:8385/entranceFeeBill/provesPage.action"
header = {
"Connection": "keep-alive",
"Content-Length": "485",
"Accept": "application/json, text/javascript, */*; q=0.01",
"X-Requested-With": "XMLHttpRequest",
"User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded",
"Accept-Language": "zh-CN,zh;q=0.9",
"Accept-Encoding": "gzip, deflate"}
body = """rows=10&page=1&sort=et.created&order=desc
&metadata[actualPrice]={"provider":"moneyProvider","index":10,"field":"actualPrice"}
&metadata[created]={"provider":"datetimeProvider","index":20,"field":"created"}
&metadata[status]={"provider":"entranceFeeBillStateProvider","index":30,"field":"status"}
&attr=number&attrValue=202108110900139&categoryId=14436&productName=雪莲果&productId=14158
&dep=103&proveTypeCode=1621&companyId=9&startTime=2020-08-11 00:00:00&endTime=2025-08-13 23:59:59"""
def __init__(self):
self.url = entranceFeeBill_provesPage.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
self.header = entranceFeeBill_provesPage.header
self.body= entranceFeeBill_provesPage.body.replace('\n', '')
self.sql="""SELECT
a.dep,
a.number,
a.plate,
a.customer_name,
a.customer_phone,
a.ic,
a.company_id,
a.goods_id,
b.prove_type_code,
b.category_id,
b.product_id,
b.product_name ,
c.fee_bill_id
FROM entrance_fee_bill a ,goods b ,bill_fee_item c
WHERE a.goods_id=b.id
AND a.id = c.fee_bill_id
AND a.market_id={}
AND a.yn=1
AND c.fee_item_name LIKE "%检测费%"
ORDER BY a.id DESC LIMIT 1;""".format(sy1.user["sy_user01"]["firmId"])
# tt=entranceFeeBill_provesPage()
# re=sy1.post(url=tt.url,headers=tt.header,data=tt.body)
# print(re.json())