Commit f96aff14 authored by liguangyu06's avatar liguangyu06
Browse files

新增期初导入脚本

parent 9c79b8e5
......@@ -14,7 +14,7 @@ import threading
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_e2用户管理_角色管理_角色列表展示,id20250429,id20250412-id20250429,sit,on
case_tag:api,herp-web,r_e2用户管理_角色管理_角色列表展示,id20250514,id20250412-id20250514,sit,on
内网:生成采购单
"""
......@@ -38,32 +38,82 @@ def l_pur():
# print( token,projectCode,uxid,corpId,info)
headers = commonFuc().get_business_data(module, "json_headers_pur", token)
# 暂存
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "pur_insert_url")
# 获取产品信息
url = 'http://spdtest.cmic.com.cn:8080/api/herpService/mcmsManualStock/getGoodsList'
# print(url)
request_body = commonFuc().get_business_data(module, "json_headers_pur_insert")
request_body = {
"queryObject": {
"branchId": "h0347-2013",
"deptId": "177b66929d40480d910ed7a3177dbd6f",
"stockId": "1d7a43f605574af3bc69c6a24250718e",
"provId": "p10d95",
"subProvId": "p10d95",
"purMode": "60",
"purModeName": "检验试剂",
"stockLevel": "2",
"goodsName": "浙江性能测试试剂产品"
},
"pageNum": 1,
"pageSize": 1000
}
"""
场景: 采购单
场景: 手工入库
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
result = json.loads(result.content)
# 获取暂存采购计划
pid = result["data"]
# 采购计划提交
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "pur_sub_url")
# print(url)
request_body = commonFuc().get_business_data(module, "payload_sub", pid)
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
result = json.loads(result.content)
print(result)
# 获取产品信息
for i in result["data"]["data"]:
u_random = random.randint(1000, 100000000000000)
i["batchVOS"] = [
{
"batchCode": u_random,
"productDate": "2025-05-01",
"expdtDate": "2025-05-31",
"stockQty": 1,
"viewId": "4a75660d-5580-4b7a-fb3a-0f2b",
"pkgDefId": None,
"pkgDefName": None,
"pkgDefQty": 1
}
]
i["initStockBatchVOS"] = [
{
"batchCode": u_random,
"productDate": "2025-05-01",
"expdtDate": "2025-05-31",
"stockQty": 1,
"viewId": "4a75660d-5580-4b7a-fb3a-0f2b",
"pkgDefId": None,
"pkgDefName": None,
"pkgDefQty": 1
}
]
# 手工入库
url = 'http://spdtest.cmic.com.cn:8080/api/herpService/mcmsManualStock/submit'
# print(url)
request_body = {
"areaCode": "area0389",
"deptId": "177b66929d40480d910ed7a3177dbd6f",
"provId": "p10d95",
"purMode": "60",
"remark": "",
"sourceType": 3,
"stockId": "1d7a43f605574af3bc69c6a24250718e",
"subProvId": "p10d95",
"attachmentList": [],
"ignoreValidExpDate": True
}
request_body["detailVOS"] = [i]
# print(request_body)
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
result = json.loads(result.content)
print(result)
n = 0
while n < 500:
l_pur()
n = n + 1
print(n)
l_pur()
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