Commit 420146680af82513b0290bca7ffd140d8857659a

Authored by liujiqiang
1 parent 84b7a768

结算管理相关模块添加

commons/api/hg/CheckIn/CheckIn.py
... ... @@ -96,6 +96,7 @@ def save_registerRecord(session=None,host=None,**kwargs):
96 96 "created": None, "createdById": 0, "createdByName": None, "settleDate": None, "isBehalf": 0,
97 97 "registerLoadingFeeExtDto": None}], "tradePassword": "111111"}
98 98 data = rJD.replaceJsonData(json=data,data=kwargs)
  99 + print(data)
99 100 res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers)
100 101 return res
101 102  
... ... @@ -103,7 +104,8 @@ def create_registerRecord(session=None,host=None,ic="888800010591",goodsName="è‘
103 104 allLevelKeyword="万州",tradePassword="111111",weight=100):
104 105 """创建进门登记å•å¹¶ç¼´è´¹"""
105 106 # 获å–费用信æ¯
106   - res = get_chargeItem(session=session,host=host)
  107 + marketId = session.userInfo["data"]["user"]["firmId"]
  108 + res = get_chargeItem(session=session,host=host,marketId=marketId)
107 109 chargeItemId = [i["id"] for i in res.json()["data"] if i["chargeItem"] == "其他收费"][0]
108 110 chargeItemIdChild = [i["id"] for i in res.json()["data"] if "parentId" in i.keys() and i["parentId"] == chargeItemId][0]
109 111  
... ... @@ -118,7 +120,7 @@ def create_registerRecord(session=None,host=None,ic="888800010591",goodsName="è‘
118 120 identityCardNo = resSimpleInfo.json()["data"]["accountInfo"]["customerCertificateNumber"]
119 121  
120 122 # 获å–商å“ä¿¡æ¯
121   - resTree = get_tree(session=session,host=host,keyword=goodsName)
  123 + resTree = get_tree(session=session,host=host,keyword=goodsName,marketId=marketId)
122 124 productId = resTree.json()["data"][0]["id"]
123 125 categoryId = productId
124 126 categoryCode = productId
... ... @@ -130,13 +132,13 @@ def create_registerRecord(session=None,host=None,ic="888800010591",goodsName="è‘
130 132 originName = resCity.json()["data"][0]["name"]
131 133  
132 134 # 获å–区域信æ¯
133   - resArea = get_searchArea(session=session,host=host,nameLike=nameLike)
  135 + resArea = get_searchArea(session=session,host=host,nameLike=nameLike,marketId=marketId)
134 136 areaId = resArea.json()["data"][0]["id"]
135 137 areaName = resArea.json()["data"][0]["name"]
136 138  
137 139 # 采用其他收费时获å–应收金é¢,优惠金é¢ï¼Œå®žé™…金é¢
138   - receivableFee = int(get_queryFee(session=session,host=host,chargeItem=chargeItemId).json()["data"]["totalFee"])*100
139   - discountFee = int(get_queryFee(session=session, host=host, chargeItem=chargeItemIdChild).json()["data"]["totalFee"])*100
  140 + receivableFee = int(get_queryFee(session=session,host=host,chargeItem=chargeItemId,marketId=marketId).json()["data"]["totalFee"])*100
  141 + discountFee = int(get_queryFee(session=session, host=host, chargeItem=chargeItemIdChild,marketId=marketId).json()["data"]["totalFee"])*100
140 142 actualFee = receivableFee - discountFee
141 143  
142 144  
... ... @@ -153,5 +155,5 @@ def create_registerRecord(session=None,host=None,ic="888800010591",goodsName="è‘
153 155  
154 156  
155 157 # res = create_registerRecord(session=sessionHg,ic="888800010592",host=host,goodsName="苹果",allLevelKeyword="金牛区",
156   -# nameLike="北区",tradePassword="111111",weight="50")
  158 +# nameLike="西区",tradePassword="111111",weight="50")
157 159 # print(res.text)
158 160 \ No newline at end of file
... ...
commons/api/hg/settlement/batch.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/8 17:45
  4 +# @Author : Ljq
  5 +# @File : batch.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +批号管理业务相关接口
  10 +"""
  11 +
  12 +
  13 +import json,time,random,re
  14 +from commons.scripts import dealContentType as dct
  15 +from commons.scripts import jsonToUrlCode
  16 +from commons.scripts import replaceJsonData as rJD
  17 +import urllib.parse
  18 +from commons.MySession import sessionHg
  19 +
  20 +host = "http://test.gateway.diligrp.com:8285"
  21 +
  22 +def batchCodeQuery(session=None,host=None,**kwargs):
  23 + """
  24 + 登记单状态变更
  25 + :param batchCode:等级单号
  26 + :param _t:时间戳
  27 + """
  28 + url = host+"/hg-trading/api/settle/batchCodeQuery"
  29 + headers = {}
  30 + data = {"batchCode":"2109000198","_t":"1631094801343"}
  31 + data = dict(data,**kwargs)
  32 + res = session.useHeadersRequests(method="GET",url=url,params=data,headers=headers)
  33 + return res
  34 +
  35 +# res = get_batchCodeQuery(session=sessionHg,host=host,batchCode="2109000202")
  36 +# print(res.json())
  37 +
  38 +def changeBatchCodeState(session=None,host=None,**kwargs):
  39 + """
  40 + 登记单状态变更
  41 + :param batchCode:等级单号
  42 + :param state:变更状态,1继续,2停止
  43 + """
  44 + url = host+"/hg-trading/api/settle/changeBatchCodeState"
  45 + headers = {}
  46 + data = {"batchCode":"2109000198","state":2}
  47 + data = dict(data,**kwargs)
  48 + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers)
  49 + return res
  50 +
  51 +# res = changeBatchCodeState(session=sessionHg,host=host,batchCode="2109000202",state=1)
  52 +# print(res.json())
... ...
commons/api/hg/settlement/batchQuery.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/8 17:50
  4 +# @Author : Ljq
  5 +# @File : batchQuery.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +批号查询页面
  10 +"""
... ...
commons/api/hg/settlement/batchSettlement.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/8 17:51
  4 +# @Author : Ljq
  5 +# @File : batchSettlement.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +批号结算页面
  10 +"""
... ...
report/test.log
1   -[2021-09-08 17:00:39] [INFO] : ======================================================================================
2   -[2021-09-08 17:00:39] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb
3   -[2021-09-08 17:00:39] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb
4   -{'data': None, 'json': {'userName': '111222', 'password': 'V5YY3yKqXugN9gZ8+NL2XUS58kMm56ie/WsAuys3dQ6ujCU049Nnb6O7uzo+ceG+hO7AknVYyPP8OpUTU15/O6d8ldw1k5q85YQoHUhd+yBMIt8ywGNnXrm28at1S1VOeOv1DAZHhGM1FkE3SVYaqmE2J1egyl4B5Iwbo+bP4PM='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}}
5   -
6   -[2021-09-08 17:00:39] [INFO] : ======================================================================================
7   -[2021-09-08 17:00:39] [INFO] : http://test.uap.diligrp.com/login/login.action
8   -[2021-09-08 17:00:39] [INFO] : http://10.28.12.150:80/login/login.action
  1 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  2 +[2021-09-08 18:19:16] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb
  3 +[2021-09-08 18:19:16] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb
  4 +{'data': None, 'json': {'userName': '111222', 'password': 'UQq2o0Q6W7XIaDqnez/Hyq3gDuBAZUuOnWAy97RA2s99LIQtVP4tTXJdRLOWCNfF3dS+elBLSKoAPfXygUuoPFrSODa6QYZQ3L4Aufl3fk4wn9ei3l2WczKg0rc030FbxfDUBzKL7QMfjRp2oCfpSH+/r6fVPM1UcZXWRhoxfnU='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}}
  5 +
  6 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  7 +[2021-09-08 18:19:16] [INFO] : http://test.uap.diligrp.com/login/login.action
  8 +[2021-09-08 18:19:16] [INFO] : http://10.28.12.150:80/login/login.action
9 9 {'data': b'userName=111222&password=111111', 'json': None, 'headers': {'Host': 'test.uap.diligrp.com', 'Connection': 'keep-alive', 'Content-Length': '33', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1', 'Origin': 'http://test.uap.diligrp.com', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Referer': 'http://test.uap.diligrp.com/login/index.html', 'Accept-Encoding': 'gzip,deflate', 'Accept-Language': 'zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7', 'Cookie': 'UAP_accessToken=;UAP_refreshToken=;UAP_loginPath='}, 'allow_redirects': False}
10 10  
11   -[2021-09-08 17:00:39] [INFO] : ======================================================================================
12   -[2021-09-08 17:00:39] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/businessChargeItem/listBusinessChargeItem
  11 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  12 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/businessChargeItem/listBusinessChargeItem
13 13 {"marketId": 15, "businessType": "501"}
14 14 {}
15 15  
16   -[2021-09-08 17:00:39] [INFO] : ======================================================================================
17   -[2021-09-08 17:00:39] [INFO] : http://test.gateway.diligrp.com:8285/card-web/accountQuery/simpleInfo.action
  16 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  17 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/card-web/accountQuery/simpleInfo.action
18 18 None
19 19 {'params': {'cardNo': '888800010592'}}
20 20  
21   -[2021-09-08 17:00:39] [INFO] : ======================================================================================
22   -[2021-09-08 17:00:39] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree
  21 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  22 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree
23 23 {"marketId": 15, "keyword": "\u82f9\u679c", "state": 1}
24 24 {}
25 25  
26   -[2021-09-08 17:00:39] [INFO] : ======================================================================================
27   -[2021-09-08 17:00:39] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/city/listByKeywordsWithCityCode
  26 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  27 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/city/listByKeywordsWithCityCode
28 28 {"allLevelKeyword": "\u91d1\u725b\u533a"}
29 29 {}
30 30  
31   -[2021-09-08 17:00:40] [INFO] : ======================================================================================
32   -[2021-09-08 17:00:40] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/district/search
33   -{"marketId": 15, "nameLike": "\u5317\u533a"}
  31 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  32 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/district/search
  33 +{"marketId": 15, "nameLike": "\u897f\u533a"}
34 34 {}
35 35  
36   -[2021-09-08 17:00:40] [INFO] : ======================================================================================
37   -[2021-09-08 17:00:40] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
  36 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  37 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
38 38 {"businessType": "501", "chargeItem": 518, "marketId": 15}
39 39 {}
40 40  
41   -[2021-09-08 17:00:40] [INFO] : ======================================================================================
42   -[2021-09-08 17:00:40] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
  41 +[2021-09-08 18:19:16] [INFO] : ======================================================================================
  42 +[2021-09-08 18:19:16] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
43 43 {"businessType": "501", "chargeItem": 520, "marketId": 15}
44 44 {}
45 45  
46   -[2021-09-08 17:00:40] [INFO] : ======================================================================================
47   -[2021-09-08 17:00:40] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save
48   -{"accountId": 107667, "cardNo": "888800010592", "customerId": 141963, "customerCode": "00131684", "customerName": "\u676d\u679c\u5ba2\u6237\u957f\u6b4c\u4e00", "fixedphoneNumber": null, "mobilephoneNumber": "18080018009", "identityCardAddress": "", "identityCardNo": "110101202108265741", "identityCardType": "ID", "registerDetailDtoList": [{"id": 0, "areaId": 278, "areaName": "\u5317\u533a\u7684\u5317\u533a\u7684\u5317\u533a\u7684", "quantity": 0, "productId": 374690, "registerRecordId": 0, "remark": null, "weight": "50", "weightType": 0, "created": null, "createdById": 0, "createdByName": null, "createdByDepartmentId": 0, "createdByDepartmentName": null, "registerCertificateList": null, "product": null, "registerCertificateDtoList": null, "productDto": {"id": 0, "originId": 510106, "originName": "\u91d1\u725b\u533a", "pieceWeight": 0, "categoryId": 374690, "categoryCode": 374690, "categoryName": "\u82f9\u679c", "created": null}}], "registerFeeDtoList": [{"id": 0, "actualFee": 200, "receivableFee": 1300, "discountFee": 1100, "registerRecordId": 0, "payStatus": 0, "chargeItemName": "\u5176\u4ed6\u6536\u8d39", "chargeType": 1, "chargeItemId": 518, "registerFeeType": 999, "created": null, "createdById": 0, "createdByName": null, "settleDate": null, "isBehalf": 0, "registerLoadingFeeExtDto": null}], "tradePassword": "111111"}
  46 +[2021-09-08 18:19:17] [INFO] : ======================================================================================
  47 +[2021-09-08 18:19:17] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save
  48 +{"accountId": 107667, "cardNo": "888800010592", "customerId": 141963, "customerCode": "00131684", "customerName": "\u676d\u679c\u5ba2\u6237\u957f\u6b4c\u4e00", "fixedphoneNumber": null, "mobilephoneNumber": "18080018009", "identityCardAddress": "", "identityCardNo": "110101202108265741", "identityCardType": "ID", "registerDetailDtoList": [{"id": 0, "areaId": 272, "areaName": "\u897f\u533a", "quantity": 0, "productId": 374690, "registerRecordId": 0, "remark": null, "weight": "50", "weightType": 0, "created": null, "createdById": 0, "createdByName": null, "createdByDepartmentId": 0, "createdByDepartmentName": null, "registerCertificateList": null, "product": null, "registerCertificateDtoList": null, "productDto": {"id": 0, "originId": 510106, "originName": "\u91d1\u725b\u533a", "pieceWeight": 0, "categoryId": 374690, "categoryCode": 374690, "categoryName": "\u82f9\u679c", "created": null}}], "registerFeeDtoList": [{"id": 0, "actualFee": 200, "receivableFee": 1300, "discountFee": 1100, "registerRecordId": 0, "payStatus": 0, "chargeItemName": "\u5176\u4ed6\u6536\u8d39", "chargeType": 1, "chargeItemId": 518, "registerFeeType": 999, "created": null, "createdById": 0, "createdByName": null, "settleDate": null, "isBehalf": 0, "registerLoadingFeeExtDto": null}], "tradePassword": "111111"}
49 49 {}
50 50  
... ...
testcase/hg/test_batch/__init__.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/8 17:46
  4 +# @Author : Ljq
  5 +# @File : __init__.py.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +
  10 +"""
... ...