Commit 0c3a54b8 authored by liguangyu06's avatar liguangyu06
Browse files

脚本优化

parent 6278d6cc
......@@ -14,8 +14,8 @@ import threading
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_e2用户管理_角色管理_角色列表展示,id20250514,id20250412-id20250514,sit,on
内网:生成采购单
case_tag:api,herp-web,r_e2用户管理_角色管理_角色列表展示,id20250820,id20250412-id20250514,sit,on
内网:手工入库
"""
from common.common_func import commonFuc
......@@ -23,6 +23,7 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
import requests
import uuid
import json
import threading
module = "b2_herp3_bs"
......@@ -44,17 +45,18 @@ def l_pur():
request_body = {
"queryObject": {
"branchId": "h0347-2013",
"deptId": "177b66929d40480d910ed7a3177dbd6f",
"stockId": "1d7a43f605574af3bc69c6a24250718e",
"deptId": "391d5e06d0ba4cb39a3a7ee2e7934ae7",
"stockId": "b278f988a25c4678a1448fb08c3b4a41",
"provId": "p10d95",
"subProvId": "p10d95",
"purMode": "60",
"purModeName": "检验试剂",
"stockLevel": "2",
"goodsName": "浙江性能测试试剂产品"
"stockLevel": "",
"checkAreaCode": "area0381",
"goodsSpec": "YYTZM"
},
"pageNum": 1,
"pageSize": 1000
"pageSize": 10
}
"""
场景: 手工入库
......@@ -71,7 +73,7 @@ def l_pur():
{
"batchCode": u_random,
"productDate": "2025-05-01",
"expdtDate": "2025-05-31",
"expdtDate": "2025-10-31",
"stockQty": 1,
"viewId": "4a75660d-5580-4b7a-fb3a-0f2b",
"pkgDefId": None,
......@@ -83,7 +85,7 @@ def l_pur():
{
"batchCode": u_random,
"productDate": "2025-05-01",
"expdtDate": "2025-05-31",
"expdtDate": "2025-10-31",
"stockQty": 1,
"viewId": "4a75660d-5580-4b7a-fb3a-0f2b",
"pkgDefId": None,
......@@ -96,13 +98,14 @@ def l_pur():
# print(url)
request_body = {
"areaCode": "area0389",
"deptId": "177b66929d40480d910ed7a3177dbd6f",
"areaCode": "area0381",
"checkAreaCode": "area0381",
"deptId": "391d5e06d0ba4cb39a3a7ee2e7934ae7",
"provId": "p10d95",
"purMode": "60",
"remark": "",
"sourceType": 3,
"stockId": "1d7a43f605574af3bc69c6a24250718e",
"stockId": "b278f988a25c4678a1448fb08c3b4a41",
"subProvId": "p10d95",
"attachmentList": [],
"ignoreValidExpDate": True
......@@ -117,13 +120,11 @@ def l_pur():
# 创建多线程
threads = []
for _ in range(6):
t = threading.Thread(target=l_pur())
threads.append(t)
t.start()
# 创建线程
thread1 = threading.Thread(target=l_pur(), args=("Thread-1", 1))
# 启动线程
thread1.start()
# 等待所有线程完成
for t in threads:
t.join()
# 等待线程结束
thread1.join()
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