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
a658a3bd
Commit
a658a3bd
authored
Jul 23, 2024
by
xiao-hesheng
Browse files
数据库验证流程十二脚本编写
parent
6a98de66
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air/a_b5流程十二请领业务流_二级库向二级库.py
View file @
a658a3bd
...
...
@@ -213,6 +213,14 @@ def BuyCarSubmit():
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'创建领车交易,result'
,
result
)
currentTaskList
=
commonFuc
().
analysis_json
(
'currentTaskList'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
businessNo_list
=
[]
for
i
in
currentTaskList
:
businessNo
=
commonFuc
().
analysis_json
(
'businessNo'
,
i
)
businessNo_list
.
append
(
businessNo
)
#将请领单号写入文件
info
=
(
businessNo_list
[
0
],
businessNo_list
[
1
],
businessNo_list
[
2
])
titlename
=
(
'buy_NO1'
,
'buy_NO2'
,
'buy_NO3'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'二级库向二级库请领单号'
,
titlename
,
'message25'
)
def
add_dept2
():
...
...
@@ -354,66 +362,77 @@ def pick_execute():
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
url1
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_buyPage_url"
)
print
(
'请领出库列表页面================='
,
url1
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload46_1"
,
get_branch_id
())
print
(
'请领出库列表页面'
,
'request_body'
,
request_body1
)
result1
=
commonFuc
().
http_post
(
url1
,
request_body1
,
headers
)
print
(
'请领出库列表页面,result1'
,
result1
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result1
))
for
i
in
data1
:
# 获取id
BH_ID
=
commonFuc
().
analysis_json
(
'id'
,
i
)
version
=
commonFuc
().
analysis_json
(
'version'
,
i
)
deptBuyDetailVOList
=
commonFuc
().
analysis_json
(
'deptBuyDetailVOList'
,
i
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
deptBuyDetailVOList
)
# 生成拣货单列表查询===============================================
# 生成拣货单列表锁定===============================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_use_updateLock_url"
)
print
(
'请领出库列表列表页面锁定================='
,
url
)
# version=int(version)+1
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload49_1"
,
BH_ID
,
version
)
print
(
'请领出库列表列表页面锁定'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'请领出库列表列表页面锁定,result1'
,
result
)
# 生成拣货单列表锁定===============================================
# 拣货==============================
if
purMode
==
10
:
udi_code
=
get_udi2
(
1
)
# 获取条码 低值1 高值2 试剂3
elif
purMode
==
20
:
udi_code
=
get_udi2
(
2
)
# 获取条码 低值1 高值2 试剂3
elif
purMode
==
60
:
udi_code
=
get_udi2
(
3
)
# 获取条码 低值1 高值2 试剂3
else
:
udi_code
=
'udi_code'
print
(
'udi_code'
,
udi_code
)
if
purMode
==
10
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
1
)
# 低值
elif
purMode
==
20
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
2
)
# 高值
elif
purMode
==
60
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
3
)
# 试剂
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"二级库向二级库请领单号"
,
'message25'
)
# print(info)
for
i
in
range
(
1
,
4
):
if
i
==
1
:
orderNo
=
info
[
'buy_NO1'
]
elif
i
==
2
:
orderNo
=
info
[
'buy_NO2'
]
elif
i
==
3
:
orderNo
=
info
[
'buy_NO3'
]
else
:
targetAreaCode
=
'targetAreaCode'
sourceId
=
'sourceId'
# 提交领用出库单
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_use_submit_url"
)
print
(
'提交拣货执行单================='
,
url
)
if
purMode
==
10
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_1"
,
targetAreaCode
,
sourceId
)
elif
purMode
==
20
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_2"
,
targetAreaCode
,
sourceId
)
elif
purMode
==
60
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_3"
,
targetAreaCode
,
sourceId
)
print
(
'提交拣货执行单'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
' 提交拣货执行单,result1'
,
result
)
orderNo
=
'orderNo'
print
(
'请领出库列表页面================='
,
url1
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload46_1"
,
orderNo
,
get_branch_id
())
print
(
'请领出库列表页面'
,
'request_body'
,
request_body1
)
result1
=
commonFuc
().
http_post
(
url1
,
request_body1
,
headers
)
print
(
'请领出库列表页面,result1'
,
result1
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
commonFuc
().
analysis_json
(
'data'
,
result1
))
for
i
in
data1
:
# 获取id
BH_ID
=
commonFuc
().
analysis_json
(
'id'
,
i
)
version
=
commonFuc
().
analysis_json
(
'version'
,
i
)
deptBuyDetailVOList
=
commonFuc
().
analysis_json
(
'deptBuyDetailVOList'
,
i
)
billMode
=
commonFuc
().
analysis_json
(
'billMode'
,
data1
)
# 生成拣货单列表查询===============================================
# 生成拣货单列表锁定===============================================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_use_updateLock_url"
)
print
(
'请领出库列表列表页面锁定================='
,
url
)
# version=int(version)+1
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload49_1"
,
BH_ID
,
version
)
print
(
'请领出库列表列表页面锁定'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'请领出库列表列表页面锁定,result1'
,
result
)
# 生成拣货单列表锁定===============================================
# 拣货==============================
if
billMode
==
'16'
:
udi_code
=
get_udi2
(
1
)
# 获取条码 低值1 高值2 试剂3
elif
billMode
==
'20'
:
udi_code
=
get_udi2
(
2
)
# 获取条码 低值1 高值2 试剂3
elif
billMode
==
'66'
:
udi_code
=
get_udi2
(
3
)
# 获取条码 低值1 高值2 试剂3
else
:
udi_code
=
'udi_code'
print
(
'udi_code'
,
udi_code
)
if
billMode
==
'16'
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
1
)
# 低值
elif
billMode
==
'20'
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
2
)
# 高值
elif
billMode
==
'66'
:
targetAreaCode
,
sourceId
=
pickScan2
(
BH_ID
,
udi_code
,
3
)
# 试剂
else
:
targetAreaCode
=
'targetAreaCode'
sourceId
=
'sourceId'
# 提交领用出库单
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_stock_out_use_submit_url"
)
print
(
'提交拣货执行单================='
,
url
)
if
purMode
==
10
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_1"
,
targetAreaCode
,
sourceId
)
elif
purMode
==
20
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_2"
,
targetAreaCode
,
sourceId
)
elif
purMode
==
60
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_3"
,
targetAreaCode
,
sourceId
)
print
(
'提交拣货执行单'
,
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
' 提交拣货执行单,result1'
,
result
)
# 复核===================================
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
View file @
a658a3bd
...
...
@@ -303,53 +303,54 @@ 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
))
# 设置登录账号默认权限是新二级库
# # 低值
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
()
# 请领车提交
time
.
sleep
(
6
)
list_data
=
[
'16'
,
'20'
,
'66'
]
for
i
in
list_data
:
check_mcms_dept_buy
(
int
(
i
))
mcms_dept_buy_detail
(
int
(
i
))
for
i
in
range
(
6
):
# 三个单据共审批6次
approval_center
()
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
2
))
# 设置登录账号默认权限是二级库
#
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)) # 设置登录账号默认权限是新二级库
#
# #
#
低值
#
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() # 请领车提交
#
time.sleep(6)
#
list_data = ['16', '20', '66']
#
for i in list_data:
#
check_mcms_dept_buy(int(i))
#
mcms_dept_buy_detail(int(i))
#
for i in range(6): # 三个单据共审批6次
#
approval_center()
#
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
# 二级科室领用出库
# 上面暂时注释========================
# 低值拣货执行
pick_execute
()
...
...
data/b5_spd3_core_business_flow/data
View file @
a658a3bd
...
...
@@ -149,7 +149,7 @@ json_headers2: {
"payload45": {"dtos":"%s","opinion":1}
"payload46": {"pageNum":1,"pageSize":50,"queryObject":{"deptId":"","auditStartTime":null,"auditEndTime":null,"startBillExpectDate":null,"endBillExpectDate":null,"priorityList":[],"orderNo":"","keyword":"","goodsSpec":"","shelfName":"","address":""}}
"payload46_1": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","priorityList":[],"branchId":"%s"}}
"payload46_1": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"
%s
","priorityList":[],"branchId":"%s"}}
"payload47": {"generateAll":false,"ids":["%s"],"allBillFlag":0}
"payload48": {"pageNum":1,"pageSize":50,"queryObject":{"pickType":"KS","id":"","pickerName":"","targetDeptName":"","priorityList":[],"areaCode":"","keyword":"%s","goodsSpec":""}}
...
...
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