Commit 5b6d7ead authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程一脚本提交

parent 0ae3cab3
...@@ -110,29 +110,47 @@ def import_goods(hosGoodsId): ...@@ -110,29 +110,47 @@ def import_goods(hosGoodsId):
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode # 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token() token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "importGoods_url") #查询产品信息===========================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "mcmsBranchGoodsInfo_unBindPage_url")
# 获取请求头信息 # 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2", headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token, commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# 获取院区id # 获取院区id
branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
while True: while True:
# #请求体 # #请求体
request_body = commonFuc().get_business_data(module, "payload35", hosGoodsId, branch_id) request_body = commonFuc().get_business_data(module, "payload33_1", branch_id,hosGoodsId)
print(request_body) print(request_body)
# # # 发送请求 # # # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('导入新增的产品result', result) print('result', result)
code= commonFuc().analysis_json('code',result) total=commonFuc().analysis_json('total',result)
if code==1004: if total==0:
time.sleep(10)
continue continue
elif code==0: else:
break break
# 查询产品信息=========================================
#导入院区产品
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "importGoods_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# 获取院区id
branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# #请求体
request_body = commonFuc().get_business_data(module, "payload35", hosGoodsId, branch_id)
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('导入新增的产品result', result)
def check_import_goods(hosGoodsId): def check_import_goods(hosGoodsId):
module = "b2_herp3_bs" module = "b2_herp3_bs"
......
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