Commit 7616f3c7949f7d286a472b292e09ebef2e7334be

Authored by lixi
1 parent e37539e6

上传收费单明细封装代码

commons/api/entranceFeeBill_details.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_details():
  10 + "收费单标记-查询"
  11 + url = "http://test.jmsf.diligrp.com:8385/entranceFeeBill/details.action"
  12 + header = {
  13 + "Connection": "keep-alive",
  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/json",
  18 + "Accept-Language": "zh-CN,zh;q=0.9",
  19 + "Accept-Encoding": "gzip, deflate"}
  20 + url_tail = """?rows=10&page=1
  21 + &metadata[charge_total_amount]={"provider":"moneyProvider","index":10,"field":"charge_total_amount"}
  22 + &metadata[discount]={"provider":"moneyProvider","index":20,"field":"discount"}
  23 + &metadata[freeze_price]={"provider":"moneyProvider","index":30,"field":"freeze_price"}
  24 + &metadata[trx_sum]={"provider":"moneyProvider","index":40,"field":"trx_sum"}
  25 + &metadata[itemFee103]={"provider":"moneyProvider","index":50,"field":"itemFee103"}
  26 + &metadata[itemFee106]={"provider":"moneyProvider","index":60,"field":"itemFee106"}
  27 + &metadata[payment_time]={"provider":"datetimeProvider","index":70,"field":"payment_time"}
  28 + &metadata[status]={"provider":"entranceFeeBillStateProvider","index":80,"field":"status"}
  29 + &metadata[CREATED]={"provider":"datetimeProvider","index":90,"field":"CREATED"}
  30 + &metadata[gross_weight_date]={"provider":"datetimeProvider","index":100,"field":"gross_weight_date"}
  31 + &metadata[tare_weight_date]={"provider":"datetimeProvider","index":110,"field":"tare_weight_date"}
  32 + &carTypeId=53
  33 + &categoryId=14436
  34 + &dep=58
  35 + &regionId=72
  36 + &status=4
  37 + &type=1
  38 + &backSkinStatus=-1
  39 + &tag=20
  40 + &companyId=9
  41 + &startTime=2020-08-11 00:00:00&endTime=2025-08-13 00:00:00
  42 + &startPayTime=2020-08-11 00:00:00&endPayTime=2025-08-13 00:00:00
  43 + &attr=number&attrValue=202108120900001"""
  44 +
  45 + def __init__(self):
  46 + self.url = entranceFeeBill_details.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
  47 + self.url =self.url + entranceFeeBill_details.url_tail.replace('\n', '')
  48 + self.header = entranceFeeBill_details.header
  49 + self.sql="""SELECT
  50 + a.car_type_id, #0车型
  51 + b.category_id, #1品类
  52 + a.dep, #2接车部
  53 + b.region_id ,#3货物区域
  54 + a.`status`, #4状态
  55 + a.type ,#5称重类型
  56 + a.back_skin_status, #6回皮状态
  57 + b.tags, #7货物标签-F
  58 + a.company_id, #8子公司
  59 + a.number, #9收费单号
  60 + a.plate, #10车牌号
  61 + b.product_name , #11商品
  62 + a.cashier_name , #12收费员
  63 + a.customer_name, #13客户姓名
  64 + a.customer_phone, #14客户手机号
  65 + a.ic #15客户卡号
  66 + FROM entrance_fee_bill a ,goods b
  67 + WHERE a.goods_id=b.id
  68 + AND a.market_id={}
  69 + AND a.`status`=4
  70 + ORDER BY a.id DESC LIMIT 1;""".format(sy1.user["sy_user01"]["firmId"])
  71 +
  72 +
  73 +# tt=entranceFeeBill_details()
  74 +# re=sy1.get(url=tt.url,headers=tt.header)
  75 +# print(str(re.json()).replace(" ",""))
0 \ No newline at end of file 76 \ No newline at end of file