Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
779736f8
Commit
779736f8
authored
1 month ago
by
liguangyu06
Browse files
Options
Download
Email Patches
Plain Diff
新增期初导入脚本
parent
2694d2e5
core_flow
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
air_case/b2_herp3_bs/期初导入.air/期初导入.py
+55
-33
air_case/b2_herp3_bs/期初导入.air/期初导入.py
with
55 additions
and
33 deletions
+55
-33
air_case/b2_herp3_bs/期初导入.air/期初导入.py
+
55
-
33
View file @
779736f8
...
...
@@ -39,43 +39,43 @@ def l_gen1():
# print( token,projectCode,uxid,corpId,info)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers_pur"
,
token
)
# 生成期初任务
url
=
"http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/insertInitStock"
# print(url)
request_body
=
{
"stockId"
:
"1d7a43f605574af3bc69c6a24250718e"
,
"areaCode"
:
"area0389"
,
"purMode"
:
"60"
,
"hosId"
:
"h0347"
,
"branchId"
:
"h0347-2013"
}
"""
场景: 期初导入
"""
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
# 获取接口响应时间
result
=
json
.
loads
(
result
.
content
)
# 获取期初任务id
qc_id
=
result
[
"data"
]
orderNo
=
qc_id
.
replace
(
"h0347"
,
""
)
#
#
生成期初任务
#
url = "http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/insertInitStock"
#
#
print(url)
#
request_body = {
#
"stockId": "1d7a43f605574af3bc69c6a24250718e",
#
"areaCode": "area0389",
#
"purMode": "60",
#
"hosId": "h0347",
#
"branchId": "h0347-2013"
#
}
#
"""
#
场景: 期初导入
#
"""
#
#
#
发送请求
#
result = requests.post(url, json=request_body, headers=headers)
#
#
获取接口响应时间
#
result = json.loads(result.content)
#
#
获取期初任务id
#
qc_id = result["data"]
#
orderNo = qc_id.replace("h0347", "")
# 获取产品信息
url
=
"http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/getMcmsGoodsInfoVOS"
# print(url)
request_body
=
{
"queryObject"
:
{
"id"
:
qc_id
,
"hosId"
:
"h0347"
,
"deptId"
:
"177b66929d40480d910ed7a3177dbd6f"
,
"stockId"
:
"1d7a43f605574af3bc69c6a24250718e"
,
"orderNo"
:
orderNo
,
"purMode"
:
60
,
"goodsSpec"
:
"Test-001"
},
"pageNum"
:
1
,
"pageSize"
:
1
2
00
}
"queryObject"
:
{
"id"
:
"QCh034720250511001976"
,
"hosId"
:
"h0347"
,
"deptId"
:
"177b66929d40480d910ed7a3177dbd6f"
,
"stockId"
:
"1d7a43f605574af3bc69c6a24250718e"
,
"orderNo"
:
"QC202505111978"
,
"purMode"
:
60
,
"goodsSpec"
:
"Test-001"
},
"pageNum"
:
1
,
"pageSize"
:
1
5
00
}
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
# 获取接口响应时间
...
...
@@ -90,6 +90,28 @@ def l_gen1():
hosGoodsCode
=
i
[
"hosGoodsCode"
]
pkgDefId
=
i
[
"pkgDefId"
]
# 生成期初任务
url
=
"http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/insertInitStock"
# print(url)
request_body
=
{
"stockId"
:
"1d7a43f605574af3bc69c6a24250718e"
,
"areaCode"
:
"area0389"
,
"purMode"
:
"60"
,
"hosId"
:
"h0347"
,
"branchId"
:
"h0347-2013"
}
"""
场景: 期初导入
"""
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
# 获取接口响应时间
result
=
json
.
loads
(
result
.
content
)
# 获取期初任务id
qc_id
=
result
[
"data"
]
orderNo
=
qc_id
.
replace
(
"h0347"
,
""
)
# 期初导入
url
=
"http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/generate"
# print(url)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets