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

流程七脚本编写

parent 498b01e2
...@@ -80,19 +80,17 @@ def operationApply(): # 高值跟台申请 ...@@ -80,19 +80,17 @@ def operationApply(): # 高值跟台申请
try: try:
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2) set_dept_lead()#设置科室负责人
# 设置默认科室,切换到二级科室,使用科室管理功能
# set_dept_lead()#设置科室负责人 updateUserLoginDefaultRange(get_listUserMgrRangePage(2))
# # 设置默认科室,切换到二级科室,使用科室管理功能 herpService_mcmsDeptGoodsInfo_getByProvIdPage()
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) operationApply()
# herpService_mcmsDeptGoodsInfo_getByProvIdPage() approval_center()
# operationApply() updateUserLoginDefaultRange(get_listUserMgrRangePage(1))
# approval_center() approval_center1()
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1))
# approval_center()
# #内网查询手术通知单号 # #内网查询手术通知单号
# orderno=Search_OrderNO() orderno=Search_OrderNO()
# height_value_order_dp(orderno) height_value_order_dp(orderno)
commonFuc().check_text_exist_result_text('succeed', 'succeed') commonFuc().check_text_exist_result_text('succeed', 'succeed')
except: except:
commonFuc().check_text_exist_result_text('error', '1') commonFuc().check_text_exist_result_text('error', '1')
...@@ -60,10 +60,12 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'): ...@@ -60,10 +60,12 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'):
print(request_body) print(request_body)
# # # 发送请求 # # # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
data = commonFuc().analysis_json('data', result) data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', result) total = commonFuc().analysis_json('total', data)
if total == 0: if total == 0:
request_body = commonFuc().get_business_data(module, "payload50_6") request_body = commonFuc().get_business_data(module, "payload50_6")
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
...@@ -98,6 +100,63 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'): ...@@ -98,6 +100,63 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'):
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
def approval_center1():
module = "b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = 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()
# 登录获取用户id等信息,使用创建的用户登录============结束
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "apprCenter_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"))
# 请求体
request_body = commonFuc().get_business_data(module, "payload50_6")
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', result)
data1 = commonFuc().analysis_json('data', data)
commonFuc().check_text_exist(0, result)
taskId = commonFuc().analysis_json('taskId', data1[0])
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "approvalBatch_url")
# 请求体
request_body = commonFuc().get_business_data(module, "payload50_7", taskId)
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', result)
if code >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def login(username, password, type=1): def login(username, password, type=1):
print('username,password', username, password) print('username,password', username, password)
...@@ -1163,10 +1222,52 @@ def get_listUserMgrRangePage(type=1): # 查询权限id ...@@ -1163,10 +1222,52 @@ def get_listUserMgrRangePage(type=1): # 查询权限id
request_body = commonFuc().get_business_data('b5_spd3_core_business_flow', "payload23", uxid) request_body = commonFuc().get_business_data('b5_spd3_core_business_flow', "payload23", uxid)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)) data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
print('data1',data1)
list2=[]
mgrRangeName_list=[]
for i in data1:
mgrRangeName=i['mgrRangeName']
mgrRangeName_list.append(mgrRangeName)
print('mgrRangeName_list',mgrRangeName_list)
for i in mgrRangeName_list:
print(i)
if i=='设备科001':
list2.append(i)
for i in mgrRangeName_list:
if i == '二级检验科002':
list2.append(i)
else:
continue
for i in mgrRangeName_list:
if i == '三级检测组003':
list2.append(i)
else:
continue
for i in mgrRangeName_list:
if i == '科室004':
list2.append(i)
else:
continue
print('list2',list2)
if type == 1: if type == 1:
return commonFuc().analysis_json('id', data1[1]) for i in data1:
elif type == 2: if i['mgrRangeName']==list2[0]:
return commonFuc().analysis_json('id', data1[0]) return commonFuc().analysis_json('id', i)
elif type==2:
for i in data1:
if i['mgrRangeName']==list2[1]:
return commonFuc().analysis_json('id', i)
elif type == 3:
for i in data1:
if i['mgrRangeName']==list2[2]:
return commonFuc().analysis_json('id', i)
elif type == 4:
for i in data1:
if i['mgrRangeName']==list2[3]:
return commonFuc().analysis_json('id', i)
def get_stockAreaId_new(dept_id, deptName, type=1): def get_stockAreaId_new(dept_id, deptName, type=1):
......
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分8</td> <td class='details-col-elapsed'>0分55</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">0.0%</td>
</tr> </tr>
</table> </table>
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/a_b1流程八_高值跟台业务流程/log.html' target='_blank'>a_b1流程八_高值跟台业务流程</a></td> <td class="details-col-elapsed"><a href='../log/a_b1流程八_高值跟台业务流程/log.html' target='_blank'>a_b1流程八_高值跟台业务流程</a></td>
<td class="success">成功</td> <td class="fail">失败</td>
<td class="details-col-elapsed">8.057</td> <td class="details-col-elapsed">55.533</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </tr>
......
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