Commit 0923a292 authored by liguangyu06's avatar liguangyu06
Browse files

生成结算数据

parent 36a52ed2
...@@ -25,7 +25,6 @@ import json ...@@ -25,7 +25,6 @@ import json
module = "b2_herp3_bs" module = "b2_herp3_bs"
u_id = str(uuid.uuid4()) u_id = str(uuid.uuid4())
u_random = random.randint(1000, 100000000000000) u_random = random.randint(1000, 100000000000000)
...@@ -42,61 +41,67 @@ headers = commonFuc().get_business_data(module, "json_headers_pur", token) ...@@ -42,61 +41,67 @@ headers = commonFuc().get_business_data(module, "json_headers_pur", token)
print(headers) print(headers)
n = 0 # 第二步发起站点资料变更
if n < 2: url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "pur_get_goods_url")
# 第二步发起站点资料变更 print(url)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "pur_get_goods_url") request_body = commonFuc().get_business_data(module, "payload_pur")
print(url) """
request_body = commonFuc().get_business_data(module, "payload_pur")
"""
场景: 站点资料申请变更功能验证 场景: 站点资料申请变更功能验证
用例名称:站点资料申请变更功能验证 用例名称:站点资料申请变更功能验证
输出:{"success":true,"code":"200","message":"OK","data":"success"} 输出:{"success":true,"code":"200","message":"OK","data":"success"}
""" """
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间 # 获取接口响应时间
result = json.loads(result.content) result = json.loads(result.content)
print(len(result["data"]["data"]))
len = random.randint(0, len(result["data"]["data"]) - 1) print(len(result["data"]["data"]))
# 获取产品信息 # len = random.randint(0, len(result["data"]["data"]) - 1)
detail_list = result["data"]["data"][len] # # 获取产品信息
print(detail_list["hosGoodsCode"]) # detail_list = result["data"]["data"][len]
# print(detail_list["hosGoodsCode"])
pkg_def_id = result["data"]["data"][0]["pkgDefVOList"][0]["pkgDefId"]
detail_list["inSettlement"] = 1 for i in result["data"]["data"]:
pkg_def_id = i["pkgDefVOList"][0]["pkgDefId"]
print(i["hosGoodsCode"])
i["inSettlement"] = 1
# pkg_def_id = result["data"]["data"][0]["pkgDefVOList"][0]["pkgDefId"]
# detail_list["inSettlement"] = 1
initStockBatchVOS = [ initStockBatchVOS = [
{ {
"batchCode": u_random, "batchCode": u_random,
"productDate": "2025-04-01", "productDate": "2025-04-01",
"expdtDate": "2029-04-30", "expdtDate": "2029-04-30",
"stockQty": 1, "stockQty": 1,
"viewId": u_id, "viewId": u_id,
"pkgDefId": pkg_def_id, "pkgDefId": pkg_def_id,
"pkgDefName": "大包", "pkgDefName": "大包",
"pkgDefQty": 20 "pkgDefQty": 20
} }
] ]
batchVOS = [ batchVOS = [
{ {
"batchCode": u_random, "batchCode": u_random,
"productDate": "2025-04-01", "productDate": "2025-04-01",
"expdtDate": "2029-04-30", "expdtDate": "2029-04-30",
"stockQty": 1, "stockQty": 1,
"viewId": u_id, "viewId": u_id,
"pkgDefId": pkg_def_id, "pkgDefId": pkg_def_id,
"pkgDefName": "大包", "pkgDefName": "大包",
"pkgDefQty": 20 "pkgDefQty": 20
} }
] ]
detail_list["initStockBatchVOS"] = initStockBatchVOS i["initStockBatchVOS"] = initStockBatchVOS
detail_list["batchVOS"] = batchVOS i["batchVOS"] = batchVOS
detail_list["stockQty"] = 1 i["stockQty"] = 1
json1 = { json1 = {
"areaCode": "area0379", "areaCode": "area0379",
...@@ -110,7 +115,7 @@ if n < 2: ...@@ -110,7 +115,7 @@ if n < 2:
"attachmentList": [] "attachmentList": []
} }
json1["detailVOS"] = [detail_list] json1["detailVOS"] = [i]
payload_pur = json1 payload_pur = json1
# 手工入库 # 手工入库
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "pur_submit_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "pur_submit_url")
...@@ -122,9 +127,4 @@ if n < 2: ...@@ -122,9 +127,4 @@ if n < 2:
print(result) print(result)
n = n + 1
...@@ -208,7 +208,7 @@ json_headers_pur: { ...@@ -208,7 +208,7 @@ json_headers_pur: {
"queryObject": { "queryObject": {
"branchId": "h0347-2013", "branchId": "h0347-2013",
"deptId": "391d5e06d0ba4cb39a3a7ee2e7934ae7", "deptId": "391d5e06d0ba4cb39a3a7ee2e7934ae7",
"stockId": "b278f988a25c4678a1448fb08c3b4a41", "goodsName": "性能测试",
"provId": "p00002a0c", "provId": "p00002a0c",
"subProvId": "p00002a0c", "subProvId": "p00002a0c",
"purMode": "60", "purMode": "60",
...@@ -216,7 +216,10 @@ json_headers_pur: { ...@@ -216,7 +216,10 @@ json_headers_pur: {
"stockLevel": "" "stockLevel": ""
}, },
"pageNum": 1, "pageNum": 1,
"pageSize": 500000 "pageSize": 1500
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment