Skip to content
GitLab
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
d8dcb3e8
Commit
d8dcb3e8
authored
Sep 06, 2024
by
xiao-hesheng
Browse files
流程八脚本提交
parent
8f79f88d
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b1流程八_高值跟台业务流程_数据库验证.air/a_b1流程八_高值跟台业务流程_数据库验证.py
View file @
d8dcb3e8
...
...
@@ -27,7 +27,7 @@ def check_mcms_operation_apply():#检查跟台申请单
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
#获取
入库单
主键ID
#获取
主表
主键ID
sql
=
" select id from mcms_operation_apply where branch_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
)
ID
=
get_id
(
sql
)
...
...
@@ -56,6 +56,8 @@ def check_mcms_operation_apply():#检查跟台申请单
hos_id
=
get_hosid
()
hos_name
=
get_hosname
()
branch_name
=
get_branch_name
()
#子表检查
check_mcms_operation_apply_list
(
ID
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_operation_apply'
,
ID
,
hos_id
,
hos_name
,
branch_id
,
branch_name
,
order_no
,
rec_dept_id
,
rec_dept_name
,
rec_address_id
,
oper_date
,
expire_date
...
...
@@ -83,20 +85,82 @@ def check_mcms_operation_apply():#检查跟台申请单
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_operation_apply_list
(
pid
):
branch_id
=
get_branch_id
()
sql
=
" select * from mcms_operation_apply_list where pid='%s';"
%
(
pid
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
# 获取子表主键ID
sql
=
" select id from mcms_operation_apply_list where pid='%s';"
%
(
pid
)
ID
=
get_id
(
sql
)
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
prov_id
=
get_prov_id
()
sub_prov_id
=
get_prov_id
()
rec_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
rec_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
target_stock_id
=
get_stockId_fromdb
(
rec_dept_name
+
'库房'
)
rec_address_id
=
get_stockAreaId_new_fromDb
(
rec_dept_name
,
2
)
source_corp_id
=
get_hosid
()
source_branch_id
=
get_branch_id
()
source_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
source_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
source_stock_id
=
get_stockId_fromdb
(
get_branch_name
()
+
'中心库房'
)
source_area_code
=
get_stockAreaId_new_fromDb
(
source_dept_name
,
1
)
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
create_time
=
get_create_time
(
"select create_time from mcms_operation_apply where id='%s';"
%
ID
)
last_modified
=
get_create_time
(
"select last_modified from mcms_operation_apply where id='%s';"
%
ID
)
oper_date
=
get_create_time
(
"select oper_date from mcms_operation_apply where id='%s';"
%
ID
)
expire_date
=
get_create_time
(
"select expire_date from mcms_operation_apply where id='%s';"
%
ID
)
last_modified_user
=
create_user
hos_id
=
get_hosid
()
hos_name
=
get_hosname
()
branch_name
=
get_branch_name
()
# 子表检查
check_mcms_operation_apply_list
(
ID
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_operation_apply'
,
ID
,
hos_id
,
hos_name
,
branch_id
,
branch_name
,
order_no
,
rec_dept_id
,
rec_dept_name
,
rec_address_id
,
oper_date
,
expire_date
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
print
(
'expected'
,
expected
)
print
(
'aaaaaaaaaaaaaaaaa'
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
expected_value2
=
expected_value1
.
replace
(
" "
,
""
)
# print('actual_value2',actual_value2)
print
(
'expected_value2'
)
print
(
expected_value2
)
print
(
'actual_value2'
)
print
(
actual_value2
)
print
(
compare_text_index
(
actual_value2
,
expected_value2
))
if
actual_value2
==
expected_value2
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air'
)
using
(
pro_path
+
r
'//air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air'
)
from
a_b1流程八_高值跟台业务流程
import
operationApply
,
second_dept_in_warehouse
,
out_return_gt
try
:
set_dept_lead
()
# 设置二级科室负责人
# # # # 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
herpService_mcmsDeptGoodsInfo_getByProvIdPage
()
time
.
sleep
(
6
)
operationApply
()
# 手术跟台申请单提交
#
set_dept_lead() # 设置二级科室负责人
# # # #
#
设置默认科室,切换到二级科室,使用科室管理功能
#
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
#
herpService_mcmsDeptGoodsInfo_getByProvIdPage()
#
time.sleep(6)
#
operationApply() # 手术跟台申请单提交
check_mcms_operation_apply
()
# 手术跟台申请单数据库检查
approval_center
()
# 审批手术跟台申请单
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
d8dcb3e8
...
...
@@ -294,4 +294,7 @@
"mcms_psi_dept_in_3_0905": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "psi_flag": 1, "psi_kind": "102", "stock_kind": "RK_QL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": "%s", "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "自动化测试", "consume_type": 0, "patient_id": None, "patient_name": None, "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": "%s", "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiOutBillId":"%s","psiOutOrderNo":"%s","psiDeptInBillId":"%s","psiDeptInOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"check_mcms_operation_apply": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "branch_name": "%s", "order_no": "%s", "rec_dept_id": "%s", "rec_dept_name": "%s", "rec_address_id": "%s", "rec_address": "默认库区", "remark": "自动化测试", "patient_in_hos_id": "123456", "patient_id": None, "patient_name": "张三", "sex": 1, "age": 44, "oper_name": "血管扩张术", "oper_doctor": "李四", "oper_date": %s, "bed_num": "2", "opration_house": "设备科一手术间", "sur_dept_id": None, "sur_dept_name": "", "tb_status": 10, "is_operation_pkg": 0, "operation_apply_mode": 0, "expire_date": %s, "source_type": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s"}
#跟台手术申请单主表
"check_mcms_operation_apply": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "branch_name": "%s", "order_no": "%s", "rec_dept_id": "%s", "rec_dept_name": "%s", "rec_address_id": "%s", "rec_address": "默认库区", "remark": "自动化测试", "patient_in_hos_id": "123456", "patient_id": None, "patient_name": "张三", "sex": 1, "age": 44, "oper_name": "血管扩张术", "oper_doctor": "李四", "oper_date": %s, "bed_num": "2", "opration_house": "设备科一手术间", "sur_dept_id": None, "sur_dept_name": "", "tb_status": 10, "is_operation_pkg": 0, "operation_apply_mode": 0, "expire_date": %s, "source_type": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s"}'
#跟台手术申请单子表
\ No newline at end of file
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