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
b3788760
Commit
b3788760
authored
Sep 12, 2024
by
xiao-hesheng
Browse files
流程八脚本提交
parent
2789d0c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air/a_b1流程八_高值跟台业务流程.py
View file @
b3788760
...
@@ -330,10 +330,24 @@ def out_return_gt():
...
@@ -330,10 +330,24 @@ def out_return_gt():
print
(
'跟台退货出库确认——中心库==,result'
,
result
)
print
(
'跟台退货出库确认——中心库==,result'
,
result
)
def
dept2_set
():
#设置部门用户
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_new
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid2"
])
# 设置二级科室负责人
get_stockAreaId_new
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
],
2
)
deptName2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
set_stockShelf_Linkman
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid2"
],
get_stockAreaId2_new_fromDb
(
deptName2
,
2
))
# 设置库区联系人
# 跟台退货出库确认========================
# 跟台退货出库确认========================
def
main
():
def
main
():
try
:
try
:
set_dept_lead
()
# 设置二级科室负责人
# set_dept_lead() # 设置二级科室负责人
dept2_set
()
# # # # 设置默认科室,切换到二级科室,使用科室管理功能
# # # # 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
herpService_mcmsDeptGoodsInfo_getByProvIdPage
()
herpService_mcmsDeptGoodsInfo_getByProvIdPage
()
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b1流程八_高值跟台业务流程_数据库验证.air/a_b1流程八_高值跟台业务流程_数据库验证.py
View file @
b3788760
...
@@ -411,6 +411,7 @@ def check_hdi_distr(type=25):
...
@@ -411,6 +411,7 @@ def check_hdi_distr(type=25):
last_modified_user
=
distrUser
last_modified_user
=
distrUser
# 验证子表数据
# 验证子表数据
time
.
sleep
(
6
)
check_hdi_distr_detail
(
distr_main_key
,
type
)
check_hdi_distr_detail
(
distr_main_key
,
type
)
prov_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
prov_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
...
@@ -730,39 +731,212 @@ def check_hdi_distr_detail_in(distr_main_key, type):
...
@@ -730,39 +731,212 @@ def check_hdi_distr_detail_in(distr_main_key, type):
else
:
else
:
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_check
(
type
=
1
):
if
type
==
1
:
bill_mode
=
16
elif
type
==
2
:
bill_mode
=
20
else
:
bill_mode
=
66
print
(
'检查验收单数据库写值'
)
check_no
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'验收单号'
,
'message15'
)[
'CHECK_NO1'
]
sql
=
"select * from mcms_check where id = '%s';"
%
check_no
order_no
=
get_id
(
"select order_no from mcms_check where id = '%s';"
%
check_no
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
if
type
==
1
:
source_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'低值配送单号'
,
'message10'
)[
'distrBillId1'
]
elif
type
==
2
:
source_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'高值配送单号'
,
'message10'
)[
'distrBillId1'
]
else
:
source_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'试剂配送单号'
,
'message10'
)[
'distrBillId1'
]
source_no
=
source_id
prov_id
=
get_prov_id
()
prov_name
=
get_prov_name
()
rec_org_id
=
get_rec_org_id
(
2
)
rec_org_name
=
get_rec_org_name
(
2
)
dept_id
=
rec_org_id
dept_name
=
rec_org_name
branch_id
=
get_branch_id
()
buyBillId
=
get_buyBillId
(
branch_id
,
bill_mode
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
bill_mode
)
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
2
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
else
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
planBillId
=
get_planBillId
(
hos_goods_id
)
planOrderNo
=
get_planOrderNo
(
hos_goods_id
)
purOrderNo
=
get_purOrderNo
(
branch_id
,
bill_mode
)
purBillId
=
get_purBillId
(
branch_id
,
bill_mode
)
bill_relation_json
=
get_mcms_chek_purBillDate
(
branch_id
,
bill_mode
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
distrBillId
=
get_distrBillId
(
branch_id
,
bill_mode
)
distrOrderNo
=
get_distrOrderNo
(
branch_id
,
bill_mode
)
checkBillId
=
check_no
checkOrderNo
=
order_no
create_user
=
get_login_user_uxid
()
sql
=
"select create_time from mcms_check where id='%s';"
%
check_no
create_time
=
get_create_time
(
sql
)
sql
=
"select last_modified from mcms_check where id='%s';"
%
check_no
last_modified
=
get_create_time
(
sql
)
last_modified_user
=
create_user
if
type
==
1
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
2
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check1'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check2'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
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
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
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'
)
def
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
):
print
(
'数据库检查验收单子表'
)
if
type
==
1
:
bill_mode
=
16
elif
type
==
2
:
bill_mode
=
20
else
:
bill_mode
=
66
sql
=
"select * from mcms_check_batch where pid='%s'"
%
check_no
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from mcms_check_batch where pid='%s'"
%
check_no
)
pid
=
check_no
branch_id
=
get_branch_id
()
distr_detail_id
=
get_distr_detail_id
(
branch_id
,
bill_mode
)
source_detail_id
=
distr_detail_id
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
sql
=
"select id from hdi_barcode where code_type='%s' and branch_id='%s' order by create_time desc LIMIT 1;"
%
(
bill_mode
,
branch_id
)
barcode_id
=
get_id
(
sql
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified
=
get_create_time
(
"select last_modified from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified_user
=
create_user
if
type
==
1
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
2
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch1'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch2'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
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
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
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
()
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
print
(
'pro_path'
,
pro_path
)
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air'
)
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'
)
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
from
a_b1流程八_高值跟台业务流程
import
dept2_set
,
operationApply
,
second_dept_in_warehouse
,
out_return_gt
try
:
try
:
# set_dept_lead() # 设置二级科室负责人
dept2_set
()
# # # # # 设置默认科室,切换到二级科室,使用科室管理功能
# # # # 设置默认科室,切换到二级科室,使用科室管理功能
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
# herpService_mcmsDeptGoodsInfo_getByProvIdPage()
herpService_mcmsDeptGoodsInfo_getByProvIdPage
()
# time.sleep(6)
# operationApply() # 手术跟台申请单提交
# time.sleep(6)
# check_mcms_operation_apply()# 手术跟台申请单数据库检查
# approval_center() # 二级科室审批审批手术跟台申请单
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
# approval_center1() # 中心库再次审批手术跟台申请单
# time.sleep(6)
# check_mcms_operation_apply_approval_after() # 手术跟台申请单审批后的数据库检查
# # #内网查询手术通知单号
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
# time.sleep(6)
# check_mcms_operation_notice()# 手术通知单数据库检查
# time.sleep(6)
# orderno = Search_OrderNO() # 手术通知单接口查询单号
# height_value_order_dp(orderno) # 高值跟台外网配送
# time.sleep(6)
check_hdi_distr
()
# 外网配送单数据库检查
time
.
sleep
(
6
)
time
.
sleep
(
6
)
check_hdi_distr_in
()
# 内网配送单数据库检查
operationApply
()
# 手术跟台申请单提交
time
.
sleep
(
6
)
check_mcms_operation_apply
()
# 手术跟台申请单数据库检查
approval_center
()
# 二级科室审批审批手术跟台申请单
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
approval_center1
()
# 中心库再次审批手术跟台申请单
time
.
sleep
(
6
)
check_mcms_operation_apply_approval_after
()
# 手术跟台申请单审批后的数据库检查
# #内网查询手术通知单号
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
time
.
sleep
(
6
)
check_mcms_operation_notice
()
# 手术通知单数据库检查
time
.
sleep
(
6
)
orderno
=
Search_OrderNO
()
# 手术通知单接口查询单号
height_value_order_dp
(
orderno
)
# 高值跟台外网配送
time
.
sleep
(
6
)
check_hdi_distr
()
# 外网配送单数据库检查
time
.
sleep
(
6
)
time
.
sleep
(
6
)
check_accept_order
()
# 内网验收
check_accept_order
()
# 内网验收
time
.
sleep
(
6
)
check_mcms_check
(
3
)
#高值跟台验收检查验收表数据
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
2
))
# 设置登录账号默认权限是二级库
second_dept_in_warehouse
()
# 二级科室入库
second_dept_in_warehouse
()
# 二级科室入库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是中心库
...
...
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