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
8f79f88d
Commit
8f79f88d
authored
Sep 06, 2024
by
xiao-hesheng
Browse files
流程八脚本提交
parent
306d6f13
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 @
8f79f88d
...
...
@@ -4,6 +4,7 @@ import traceback
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.public1.public1.public1
import
*
from
common.db.sql.sql_tools
import
check_mcms_dept_buy_sql
,
get_login_user_uxid_bydb
,
get_create_time
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
...
...
@@ -19,6 +20,68 @@ python runner_test.py tag id2303-11 debug mdm3
"""
def
check_mcms_operation_apply
():
#检查跟台申请单
branch_id
=
get_branch_id
()
sql
=
" select * from mcms_operation_apply where branch_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
#获取入库单主键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
)
#获取order_no
sql
=
" select order_no from mcms_operation_apply where id='%s';"
%
(
ID
)
order_no
=
get_id
(
sql
)
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
()
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'
)
...
...
@@ -32,7 +95,9 @@ try:
# # # # 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
herpService_mcmsDeptGoodsInfo_getByProvIdPage
()
time
.
sleep
(
6
)
operationApply
()
# 手术跟台申请单提交
check_mcms_operation_apply
()
# 手术跟台申请单数据库检查
approval_center
()
# 审批手术跟台申请单
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
approval_center1
()
# 再次审批手术跟台申请单
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
8f79f88d
...
...
@@ -291,4 +291,7 @@
#二级库向中心库请领,二级科室入库单主表
"mcms_psi_dept_in_1_0905": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "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}'
"mcms_psi_dept_in_2_0905": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "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}'
"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}'
\ No newline at end of file
"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"}
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