Commit 1f796a603c9ca92e0cd8f9f9c9d2ec313ad513a0

Authored by liujiqiang
1 parent dcf78fa2

结算管理-批号交易过程新增

commons/api/hg/settlement/sellingGoods.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/10 11:06
  4 +# @Author : Ljq
  5 +# @File : sellingGoods.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +商品售卖
  10 +"""
  11 +
  12 +import json,time,random,re
  13 +from commons.scripts import dealContentType as dct
  14 +from commons.scripts import jsonToUrlCode
  15 +from commons.scripts import replaceJsonData as rJD
  16 +import urllib.parse
  17 +from commons.MySession import sessionHg
  18 +
  19 +host = "http://test.gateway.diligrp.com:8285"
  20 +
  21 +def queryRegister(session=None,host=None,**kwargs):
  22 + """
  23 + 查询登记单
  24 + :param batchCode:登记单号
  25 + """
  26 + url = host+"/hg-trading/api/registerRecord/queryRegister"
  27 + headers = {}
  28 + data = {"recordQueryDto":{"batchCode":"2109000250"}}
  29 + data = rJD.replaceJsonData(json=data,data=kwargs)
  30 + res = session.useHeadersRequests(method="post",url=url,data=json.dumps(data),headers=headers)
  31 + return res
  32 +
  33 +res = queryRegister(session=sessionHg,host=host,batchCode="2109000266")
  34 +print(res.json())
0 35 \ No newline at end of file
... ...
config/marketConfig/conf_test.conf
... ... @@ -12,6 +12,7 @@ sy_cardNumRe_01=888810033081
12 12 hd_cardNumRe_01=210823173732
13 13 #hg
14 14 hg_cardNumRe_01=888800010591
  15 +hg_cardNumRe_02=888800010592
15 16  
16 17  
17 18 [host]
... ...
report/test.log
1   -[2021-09-10 10:56:27] [INFO] : ======================================================================================
2   -[2021-09-10 10:56:27] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb
3   -[2021-09-10 10:56:27] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb
4   -{'data': None, 'json': {'userName': '111222', 'password': 'nr5/VixilW97NAW/OSKzjYCOmiALEs0DO5zOF4U4cofwjUUJxwgnZZUHeo0txa0Zp57PhbMVJD463Bn4nI0tBtKqqmjTi2c0EAQVWclAVP7XpQyY6qNT3vTRgAlwph34jYDSkxGeZQu5trWNiFVD0L9NI73rz39Tw9eBNonLH0U='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}}
5   -
6   -[2021-09-10 10:56:27] [INFO] : ======================================================================================
7   -[2021-09-10 10:56:27] [INFO] : http://test.uap.diligrp.com/login/login.action
8   -[2021-09-10 10:56:27] [INFO] : http://10.28.12.150:80/login/login.action
  1 +[2021-09-10 11:18:07] [INFO] : ======================================================================================
  2 +[2021-09-10 11:18:07] [INFO] : http://test.uap.diligrp.com/api/authenticationApi/loginWeb
  3 +[2021-09-10 11:18:07] [INFO] : http://10.28.12.150:80/api/authenticationApi/loginWeb
  4 +{'data': None, 'json': {'userName': '111222', 'password': 'HgXZPyFq/MmgAGgi+yghB+PkqkZ2mCl3P5pS61n4LvwFIGfClsQBjUfonZc6M+LdAdQozqg073HtWsZdabvM2IqNJ+DmxDQSfW/9kS2UovsVE739RaPT2aH/0MKgQ3EvpYdN5mYQ1vD2Dm+avuEXEMPzyfQjOaH6qb0i1Ro2DQA='}, 'headers': {'Content-Type': 'text/plain;charset=utf-8', 'Host': 'test.uap.diligrp.com', 'Content-Length': '209', 'Expect': '100-continue'}}
  5 +
  6 +[2021-09-10 11:18:07] [INFO] : ======================================================================================
  7 +[2021-09-10 11:18:07] [INFO] : http://test.uap.diligrp.com/login/login.action
  8 +[2021-09-10 11:18:07] [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-10 10:56:28] [INFO] : ======================================================================================
12   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/businessChargeItem/listBusinessChargeItem
13   -{"marketId": 15, "businessType": "501"}
  11 +[2021-09-10 11:18:07] [INFO] : ======================================================================================
  12 +[2021-09-10 11:18:07] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/queryRegister
  13 +{"recordQueryDto": {"batchCode": "2109000266"}}
14 14 {}
15 15  
16   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
17   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/card-web/accountQuery/simpleInfo.action
18   -None
19   -{'params': {'cardNo': '888800010591'}}
20   -
21   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
22   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/cusCategory/getTree
23   -{"marketId": 15, "keyword": "\u8461\u8404", "state": 1}
24   -{}
25   -
26   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
27   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/city/listByKeywordsWithCityCode
28   -{"allLevelKeyword": "\u4e07\u5dde"}
29   -{}
30   -
31   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
32   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/assets-service/api/district/search
33   -{"marketId": 15, "nameLike": "\u897f\u533a"}
34   -{}
35   -
36   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
37   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
38   -{"businessType": "501", "chargeItem": 518, "marketId": 15}
39   -{}
40   -
41   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
42   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/dili-rule/api/chargeRule/queryFee
43   -{"businessType": "501", "chargeItem": 520, "marketId": 15}
44   -{}
45   -
46   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
47   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/registerRecord/save
48   -{"accountId": 107796, "cardNo": "888800010591", "customerId": 142000, "customerCode": "00131702", "customerName": "\u53f2\u4e1c\u6676", "fixedphoneNumber": null, "mobilephoneNumber": "18080008020", "identityCardAddress": "", "identityCardNo": "110101202109024587", "identityCardType": "ID", "registerDetailDtoList": [{"id": 0, "areaId": 272, "areaName": "\u897f\u533a", "quantity": 0, "productId": 754107, "registerRecordId": 0, "remark": null, "weight": 100, "weightType": 0, "created": null, "createdById": 0, "createdByName": null, "createdByDepartmentId": 0, "createdByDepartmentName": null, "registerCertificateList": null, "product": null, "registerCertificateDtoList": null, "productDto": {"id": 0, "originId": 500101, "originName": "\u4e07\u5dde\u533a", "pieceWeight": 0, "categoryId": 754107, "categoryCode": 754107, "categoryName": "\u8461\u8404", "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   -{}
50   -
51   -[2021-09-10 10:56:28] [INFO] : ======================================================================================
52   -[2021-09-10 10:56:28] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/settle/changeBatchCodeState
53   -{"batchCode": "2109000240", "state": 2}
54   -{}
55   -
56   -[2021-09-10 10:56:29] [INFO] : ======================================================================================
57   -[2021-09-10 10:56:29] [INFO] : http://test.gateway.diligrp.com:8285/hg-trading/api/settle/batchCodeQuery
58   -None
59   -{'params': {'batchCode': '2109000240', '_t': '1631094801343'}}
60   -
... ...
testcase/hg/test_batchSettlement/__init__.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/10 11:00
  4 +# @Author : Ljq
  5 +# @File : __init__.py.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +
  10 +"""
... ...
testcase/hg/test_batchSettlement/test_batchSettlement.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +
  3 +# @Time : 2021/9/10 11:01
  4 +# @Author : Ljq
  5 +# @File : test_batchSettlement.py
  6 +# @Software: PyCharm
  7 +
  8 +"""
  9 +杭果市场-结算管理-批号管理
  10 +"""
  11 +
  12 +from commons.MySession import sessionHg as session
  13 +from commons.api.hg.CheckIn import CheckIn
  14 +from commons.api.hg.settlement import batch
  15 +from commons.scripts.readConf import rC
  16 +import unittest,random
  17 +
  18 +class test_batch(unittest.TestCase):
  19 + """杭果市场-结算管理-批号管理"""
  20 + def setUp(self) -> None:
  21 + pass
  22 +
  23 + def tearDown(self) -> None:
  24 + pass
  25 +
  26 + @classmethod
  27 + def setUpClass(cls) -> None:
  28 + cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")
  29 + cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost")
  30 + cls.ic = rC.returnOptionsItems("testInfo", "hg_cardNumRe_01")
  31 +
  32 + @classmethod
  33 + def tearDownClass(cls) -> None:
  34 + pass
  35 +
  36 + def test_searchState_1(self):
  37 + """
  38 + 批号管理--查询--输入【在售】状态的完整批号,查询出该批号下的相关数据
  39 + """
  40 + # 创建初始数据
  41 + resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)
  42 + self.batchCode = resBatchCode.json()["data"]["batchCode"]
  43 + print("test_searchState_1 --> self.batchCode:", self.batchCode)
0 44 \ No newline at end of file
... ...