Commit e6a8626c authored by xiao-hesheng's avatar xiao-hesheng
Browse files

脚本优化

parent b87632bb
...@@ -233,7 +233,7 @@ try: ...@@ -233,7 +233,7 @@ try:
test2()# 科室添加产品信息(产品是从外网同步过来的) test2()# 科室添加产品信息(产品是从外网同步过来的)
dept_query_all()# 科室查询,将科室id写入文件中 dept_query_all()# 科室查询,将科室id写入文件中
grants_user()#给用户授权 grants_user()#给用户授权
set_dept_lead1() # 设置一级科室负责人
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
commonFuc().check_text_exist_result_text('succees','error') commonFuc().check_text_exist_result_text('succees','error')
......
...@@ -1385,6 +1385,43 @@ def SaveCacheBatch2(headers): ...@@ -1385,6 +1385,43 @@ def SaveCacheBatch2(headers):
result = commonFuc().http_post(url, request_body4, headers) result = commonFuc().http_post(url, request_body4, headers)
print('result', result) print('result', result)
def set_dept_lead1(): # 设置一级科室负责人
module = 'b2_herp3_bs'
username = FileUtils().r_info8(module, '用户名信息', 'message3')["username1"]
## print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
# print(list_id)
# for i in list_id:
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "deptProcOrder_update__url")
# url=url+userid
print(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"))
dept1_id = FileUtils().r_info8(module, '所有科室id', 'message6')["deptid1"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload61_5", uxid, dept1_id)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
cname = commonFuc().analysis_json('cname', data1)
# print(len(data1))
if code == 0 and data == 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def set_dept_lead(): # 设置二级科室负责人 def set_dept_lead(): # 设置二级科室负责人
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