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
6a98de66
Commit
6a98de66
authored
Jul 23, 2024
by
xiao-hesheng
Browse files
数据库验证流程十二脚本编写
parent
b8731673
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
View file @
6a98de66
...
...
@@ -190,7 +190,7 @@ def mcms_dept_buy_detail(type=16):
# 检查二级库请领单审批前的主表数据
def
check_mcms_dept_buy
(
type
=
16
):
branch_id
=
get_branch_id
()
sql
=
"""select * from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;
sql
=
"""select * from mcms_dept_buy where branch_id='%s' and bill_mode='%s'
and buy_kind='LY'
order by create_time desc LIMIT 1;
"""
%
(
branch_id
,
type
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
...
...
@@ -258,7 +258,7 @@ def check_mcms_dept_buy(type=16):
last_modified
,
last_modified_user
)
elif
type
==
20
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy_
direct_sending
2'
,
id1
,
order_no1
,
get_hosid
(),
'mcms_dept_buy
5
_2'
,
id1
,
order_no1
,
get_hosid
(),
branch_id
,
deptid2
,
deptname2
,
area_code
,
area_name
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_stock_name
,
bill_expdt_date
,
rec_user
,
...
...
@@ -266,7 +266,7 @@ def check_mcms_dept_buy(type=16):
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy_
direct_sending
3'
,
id1
,
order_no1
,
get_hosid
(),
'mcms_dept_buy
5
_3'
,
id1
,
order_no1
,
get_hosid
(),
branch_id
,
deptid2
,
deptname2
,
area_code
,
area_name
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_stock_name
,
bill_expdt_date
,
rec_user
,
...
...
@@ -303,44 +303,45 @@ try:
from
a_b5流程十二请领业务流_二级库向二级库
import
add_new_deptinfo
,
edit_goods_target
,
second_dept_Request
from
a_b5流程十二请领业务流_二级库向二级库
import
BuyCarSubmit
,
pick_execute
#========下面暂时注释
# add_dept2() # 新增一个二级科室
# add_new_deptinfo() # 写入科室信息到文件中
# grants_user_new() # 新增授权
# # 同步库房信息
# execute_command("python runner_test.py tag id2263-221 debug sit")
# # 设置部门用户
# set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5'],
# FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5'], 2)
# # 设置部门负责人
# set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid5"]) # 设置二级科室负责人
# get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5'],
# FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5'], 2)
#
# # 设置库区联系人
# deptName5 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5']
#
# set_stockShelf_Linkman(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid5"],
# get_stockAreaId2_new_fromDb(deptName5, 2))
# #新建科室产品分配
# dept_goods_distribute(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5'])
# #编辑产品请领目标为二级检验科002
# currentDeptId = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5']
# targetDeptId = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
# edit_goods_target(currentDeptId, targetDeptId)
#
# updateUserLoginDefaultRange(get_listUserMgrRangePage1(5)) # 设置登录账号默认权限是新二级库
add_dept2
()
# 新增一个二级科室
add_new_deptinfo
()
# 写入科室信息到文件中
grants_user_new
()
# 新增授权
# 同步库房信息
execute_command
(
"python runner_test.py tag id2263-221 debug sit"
)
# 设置部门用户
set_dept_user
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
],
2
)
# 设置部门负责人
set_dept_lead_new
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
])
# 设置二级科室负责人
get_stockAreaId_new
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
],
2
)
# # # 低值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
# check_mcms_dept_buy_car(1)
# # # # 高值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
# check_mcms_dept_buy_car(2)
# # # # 试剂
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
# check_mcms_dept_buy_car(3)
# 设置库区联系人
deptName5
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
set_stockShelf_Linkman
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid5"
],
get_stockAreaId2_new_fromDb
(
deptName5
,
2
))
#新建科室产品分配
dept_goods_distribute
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
])
#编辑产品请领目标为二级检验科002
currentDeptId
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
]
targetDeptId
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
edit_goods_target
(
currentDeptId
,
targetDeptId
)
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
5
))
# 设置登录账号默认权限是新二级库
# # 低值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
check_mcms_dept_buy_car
(
1
)
# # # 高值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message1'
)[
'hosGoodsId'
],
2
)
check_mcms_dept_buy_car
(
2
)
# # # 试剂
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message3'
)[
'hosGoodsId'
],
3
)
check_mcms_dept_buy_car
(
3
)
# 上面暂时注释========================
# BuyCarSubmit() # 请领车提交
BuyCarSubmit
()
# 请领车提交
time
.
sleep
(
6
)
list_data
=
[
'16'
,
'20'
,
'66'
]
for
i
in
list_data
:
check_mcms_dept_buy
(
int
(
i
))
...
...
@@ -351,6 +352,7 @@ try:
# 二级科室领用出库
# 低值拣货执行
pick_execute
()
second_dept_one_key_in
(
5
)
second_dept_one_key_in
(
5
)
second_dept_one_key_in
(
5
)
...
...
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