Commit 779736f8 authored by liguangyu06's avatar liguangyu06
Browse files

新增期初导入脚本

parent 2694d2e5
...@@ -39,43 +39,43 @@ def l_gen1(): ...@@ -39,43 +39,43 @@ def l_gen1():
# print( token,projectCode,uxid,corpId,info) # print( token,projectCode,uxid,corpId,info)
headers = commonFuc().get_business_data(module, "json_headers_pur", token) headers = commonFuc().get_business_data(module, "json_headers_pur", token)
# 生成期初任务 # # 生成期初任务
url = "http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/insertInitStock" # url = "http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/insertInitStock"
# print(url) # # print(url)
request_body = { # request_body = {
"stockId": "1d7a43f605574af3bc69c6a24250718e", # "stockId": "1d7a43f605574af3bc69c6a24250718e",
"areaCode": "area0389", # "areaCode": "area0389",
"purMode": "60", # "purMode": "60",
"hosId": "h0347", # "hosId": "h0347",
"branchId": "h0347-2013" # "branchId": "h0347-2013"
} # }
""" # """
场景: 期初导入 # 场景: 期初导入
""" # """
#
# 发送请求 # # 发送请求
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)
# 获取期初任务id # # 获取期初任务id
qc_id = result["data"] # qc_id = result["data"]
orderNo = qc_id.replace("h0347", "") # orderNo = qc_id.replace("h0347", "")
# 获取产品信息 # 获取产品信息
url = "http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/getMcmsGoodsInfoVOS" url = "http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/getMcmsGoodsInfoVOS"
# print(url) # print(url)
request_body = { request_body = {
"queryObject": { "queryObject": {
"id": qc_id , "id": "QCh034720250511001976",
"hosId": "h0347", "hosId": "h0347",
"deptId": "177b66929d40480d910ed7a3177dbd6f", "deptId": "177b66929d40480d910ed7a3177dbd6f",
"stockId": "1d7a43f605574af3bc69c6a24250718e", "stockId": "1d7a43f605574af3bc69c6a24250718e",
"orderNo": orderNo, "orderNo": "QC202505111978",
"purMode": 60, "purMode": 60,
"goodsSpec": "Test-001" "goodsSpec": "Test-001"
}, },
"pageNum": 1, "pageNum": 1,
"pageSize": 1200 "pageSize": 1500
} }
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间 # 获取接口响应时间
...@@ -90,6 +90,28 @@ def l_gen1(): ...@@ -90,6 +90,28 @@ def l_gen1():
hosGoodsCode = i["hosGoodsCode"] hosGoodsCode = i["hosGoodsCode"]
pkgDefId = i["pkgDefId"] 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" url = "http://spdtest.cmic.com.cn:8080/api/herpService/mcmsInitStock/generate"
# print(url) # print(url)
......
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