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
beadb526
Commit
beadb526
authored
Jul 29, 2024
by
xiao-hesheng
Browse files
数据库验证流程十三脚本编写
parent
a495c4b4
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b5流程十二请领业务流_二级库向二级库.air/a_b5流程十二请领业务流_二级库向二级库.py
View file @
beadb526
...
...
@@ -437,7 +437,7 @@ def pick_execute():
DR_id
=
commonFuc
().
analysis_json
(
'data'
,
result
)
DRNo_list
.
append
(
DR_id
)
# 将
请领单号
写入文件
# 将
拣货单id
写入文件
info
=
(
DRNo_list
[
0
],
DRNo_list
[
1
],
DRNo_list
[
2
])
titlename
=
(
'DR_NO1'
,
'DR_NO2'
,
'DR_NO3'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'拣货单id'
,
titlename
,
'message26'
)
...
...
air_case/b5_spd3_core_business_flow/a_b6流程十三请领业务流_三级库向二级库.air/a_b6流程十三请领业务流_三级库向二级库.py
View file @
beadb526
...
...
@@ -207,7 +207,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
,
'message27'
)
def
edit_goods_target
(
currentDeptId
,
targetDeptId
):
module
=
"b2_herp3_bs"
...
...
@@ -274,66 +281,85 @@ 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'
,
"三级库向二级库请领单号"
,
'message27'
)
DRNo_list
=
[]
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
billMode
==
16
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_1"
,
targetAreaCode
,
sourceId
)
elif
billMode
==
20
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload51_1_2"
,
targetAreaCode
,
sourceId
)
elif
billMode
==
66
:
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
)
DR_id
=
commonFuc
().
analysis_json
(
'data'
,
result
)
DRNo_list
.
append
(
DR_id
)
# 将拣货单id写入文件
info
=
(
DRNo_list
[
0
],
DRNo_list
[
1
],
DRNo_list
[
2
])
titlename
=
(
'DR_NO1'
,
'DR_NO2'
,
'DR_NO3'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'拣货单id'
,
titlename
,
'message28'
)
def
main
():
try
:
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b6流程十三请领业务流_三级库向二级库_数据库验证.air/a_b6流程十三请领业务流_三级库向二级库_数据库验证.py
View file @
beadb526
...
...
@@ -47,9 +47,9 @@ def check_mcms_dept_buy_car(type=1):
# 要验证的sql,取自数据库的表中
actual_value1
=
check_mcms_dept_buy_car_sql
(
sql
)
print
(
actual_value1
)
deptid
2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid
5
'
]
deptname
2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid
5
'
]
areaCode
=
get_stockAreaId_new_fromDb
(
deptname
2
,
2
)
deptid
3
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid
3
'
]
deptname
3
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid
3
'
]
areaCode
=
get_stockAreaId_new_fromDb
(
deptname
3
,
3
)
areaName
=
'默认库区'
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
...
...
@@ -67,23 +67,23 @@ def check_mcms_dept_buy_car(type=1):
if
type
==
1
:
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_dept_buy_car'
,
id
,
get_hosid
(),
branch_id
,
deptid
2
,
deptname
2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
deptid
3
,
deptname
3
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
goodsCode
,
pkgDefId
,
pkgDefName
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
2
:
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_dept_buy_car2'
,
id
,
get_hosid
(),
branch_id
,
deptid
2
,
deptname
2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
deptid
3
,
deptname
3
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
goodsCode
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected_value2
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_dept_buy_car3'
,
id
,
get_hosid
(),
branch_id
,
deptid
2
,
deptname
2
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
deptid
3
,
deptname
3
,
areaCode
,
areaName
,
hos_goods_id
,
mdm_goods_code
,
goodsCode
,
pkgDefId
,
pkgDefName
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# print('expected_value2', expected_value2)
...
...
@@ -103,32 +103,552 @@ def check_mcms_dept_buy_car(type=1):
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
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' and buy_kind='LY' order by create_time desc LIMIT 1;
"""
%
(
branch_id
,
type
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
# 获取主键id
sql
=
"select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
id1
=
get_dept_buy_id
(
sql
)
# 获取order_no
sql1
=
"select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
order_no1
=
get_dept_buy_id
(
sql1
)
print
(
process_tuple
(
id1
),
process_tuple
(
order_no1
))
id1
=
process_tuple
(
id1
)
order_no1
=
process_tuple
(
order_no1
)
deptid2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid3'
]
deptname2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid3'
]
deptname5
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
target_stock_name
=
deptname5
+
"库房"
# target_dept_id=FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
# area_code = get_stockAreaId_new(deptid2, deptname2, 2)
# info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
# list_a = info['list_a']
area_code
=
get_stockAreaId_new_fromDb
(
deptname2
,
2
)
area_name
=
'默认库区'
# 读取文件中的信息
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"三级库向二级库请领产品信息"
,
'message24'
)
list_a
=
info
[
'list_a'
]
target_dept_id
=
commonFuc
().
analysis_json
(
'targetDeptId'
,
list_a
)
target_dept_name
=
commonFuc
().
analysis_json
(
'targetDeptName'
,
list_a
)
pur_mode
=
commonFuc
().
analysis_json
(
'purMode'
,
list_a
)
goodsCode
=
commonFuc
().
analysis_json
(
'goodsCode'
,
list_a
)
pkgDefId
=
commonFuc
().
analysis_json
(
'pkgDefId'
,
list_a
)
pkgDefName
=
commonFuc
().
analysis_json
(
'pkgDefName'
,
list_a
)
bill_expdt_date
=
get_expdt_date
(
"select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
rec_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
# rec_addr='二级检验科002'
create_user
=
rec_user
create_time
=
get_create_time
(
"select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
last_modified
=
get_create_time
(
"select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
last_modified_user
=
rec_user
last_auditor
=
rec_user
last_audit_time
=
get_create_time
(
"select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
rec_addr
=
deptname2
dept_id1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
dept_name1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
stock_name
=
dept_name1
+
"库房"
target_stock_id
=
get_stockId_fromdb
(
stock_name
)
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy6'
,
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
,
rec_addr
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy6_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
,
rec_addr
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy6_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
,
rec_addr
,
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'
)
def
mcms_dept_buy_detail
(
type
=
16
):
branch_id
=
get_branch_id
()
# 获取主表主键
sql
=
"select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
id1
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 获取order_no
sql1
=
"select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
order_no1
=
get_dept_buy_id
(
sql1
)
order_no1
=
process_tuple
(
order_no1
)
# 子表sql
sql1
=
"select * from mcms_dept_buy_detail where pid='%s';"
%
id1
# 从数据库中获取实际值
actual
=
check_mcms_dept_buy_sql
(
sql1
)
print
(
'actual'
,
actual
)
if
type
==
16
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
20
:
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"
]
# print(hos_goods_id,process_tuple(hos_goods_id))
# 获取子表id
detail_id
=
get_id
(
"select id from mcms_dept_buy_detail where pid='%s';"
%
id1
)
print
(
'detail_id'
,
detail_id
)
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"二级库请领产品信息"
,
'message21'
)
list_a
=
info
[
'list_a'
]
mdm_goods_code
=
process_tuple
(
get_mdm_goods_code
(
"select mdm_goods_code from mcms_goods_info where id='%s';"
%
hos_goods_id
))
goods_code
=
process_tuple
(
get_mdm_goods_code
(
"select hos_goods_code from mcms_goods_info where id='%s';"
%
hos_goods_id
))
pkg_def_id
=
process_tuple
(
get_id
(
"select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;"
%
hos_goods_id
))
if
pkg_def_id
==
'None'
:
print
(
pkg_def_id
)
pkg_def_id
=
pkg_def_id
.
replace
(
"'"
,
""
)
print
(
pkg_def_id
)
pkg_def_name
=
process_tuple
(
get_id
(
"select pkg_def_name from mcms_pkg where hos_goods_id='%s' LIMIT 1;"
%
hos_goods_id
))
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_dept_buy_detail where pid='%s';"
%
id1
)
last_modified
=
create_time
last_modified_user
=
create_user
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy_detail'
,
detail_id
,
id1
,
order_no1
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
pkg_def_name
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy_detail1'
,
detail_id
,
id1
,
order_no1
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
pkg_def_name
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_dept_buy_detail2'
,
detail_id
,
id1
,
order_no1
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
pkg_def_name
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
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_pick_detail
(
pid
,
type
,
order_no
):
branch_id
=
get_branch_id
()
print
(
'拣货单子表检查'
)
sql
=
" select * from mcms_pick_detail where pid='%s';"
%
(
pid
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
id
=
get_id
(
"select id from mcms_pick_detail where pid='%s';"
%
(
pid
))
source_id
=
get_buyBillId
(
branch_id
,
type
)
if
type
==
16
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
20
:
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"
]
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
pkg_def_id
=
get_pkg_def_id
(
hos_goods_id
)
picker_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"用户名信息"
,
'message3'
)[
'username1'
]
picker
=
get_login_user_uxid_bydb
(
picker_name
)
create_user
=
picker
create_time
=
get_create_time
(
"select create_time from mcms_pick_detail where pid='%s';"
%
(
pid
))
last_modified
=
get_create_time
(
"select last_modified from mcms_pick_detail where pid='%s';"
%
(
pid
))
last_modified_user
=
create_user
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick_detail1'
,
id
,
pid
,
order_no
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
picker
,
picker_name
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
pkg_def_id
=
None
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick_detail2'
,
id
,
pid
,
order_no
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
picker
,
picker_name
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick_detail3'
,
id
,
pid
,
order_no
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
picker
,
picker_name
,
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'
)
def
check_mcms_pick
(
type
=
16
):
branch_id
=
get_branch_id
()
print
(
'拣货单验证'
)
sql
=
" select * from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
id
=
get_id
(
"select id from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
))
order_no
=
get_id
(
"select order_no from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
))
source_id
=
get_buyBillId
(
branch_id
,
type
)
dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
stock_id
=
get_stockId_fromdb
(
dept_name
+
'库房'
)
area_code
=
get_stockAreaId_new_fromDb
(
dept_name
,
2
)
target_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
]
target_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
target_stock_id
=
get_stockId_fromdb
(
target_dept_name
+
'库房'
)
target_area_code
=
get_stockAreaId_new_fromDb
(
target_dept_name
,
2
)
username
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"用户名信息"
,
'message3'
)[
'username1'
]
reviewer
=
get_login_user_uxid_bydb
(
username
)
review_date
=
get_expdt_date
(
"select review_date from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
))
buyBillId
=
get_buyBillId
(
branch_id
,
type
)
pickOrderNo
=
order_no
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
type
)
pickBillId
=
id
create_user
=
reviewer
create_time
=
get_expdt_date
(
"select create_time from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
))
last_modified
=
get_expdt_date
(
"select last_modified from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
))
last_modified_user
=
create_user
picker
=
create_user
picker_name
=
username
if
type
==
16
:
#检查拣货单子表
check_mcms_pick_detail
(
id
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick1'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
dept_id
,
dept_name
,
stock_id
,
area_code
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_area_code
,
reviewer
,
review_date
,
buyBillId
,
pickOrderNo
,
buyOrderNo
,
pickBillId
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
)
elif
type
==
20
:
# 检查拣货单子表
check_mcms_pick_detail
(
id
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick2'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
dept_id
,
dept_name
,
stock_id
,
area_code
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_area_code
,
reviewer
,
review_date
,
buyBillId
,
pickOrderNo
,
buyOrderNo
,
pickBillId
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
)
else
:
# 检查拣货单子表
check_mcms_pick_detail
(
id
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick3'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
dept_id
,
dept_name
,
stock_id
,
area_code
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_area_code
,
reviewer
,
review_date
,
buyBillId
,
pickOrderNo
,
buyOrderNo
,
pickBillId
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
)
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'
)
def
check_mcms_psi_dept_batch
(
DR_ID
,
type
,
order_no
):
branch_id
=
get_branch_id
()
sql
=
" select * from mcms_psi_dept_batch where pid='%s';"
%
(
DR_ID
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
'actual'
,
actual
)
batch_main_key
=
get_id
(
"select id from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
pid
=
DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
source_detail_id
=
get_pick_detail_id
(
branch_id
,
type
)
pick_detail_id
=
source_detail_id
if
type
==
16
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
20
:
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"
]
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
pkg_def_id
=
get_pkg_def_id
(
hos_goods_id
)
picker_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"用户名信息"
,
'message3'
)[
'username1'
]
picker
=
get_login_user_uxid_bydb
(
picker_name
)
source_batch_id
=
get_id
(
"select source_batch_id from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
target_batch_id
=
source_batch_id
if
check_batch_id
(
source_batch_id
)
==
True
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
barcode_id
=
get_id
(
"select barcode_id from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
if
check_barcode_id
(
barcode_id
)
==
True
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
shelf_code
=
get_stockAreaId_new_fromDb
(
dept_name
,
2
)
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_psi_dept_batch where pid='%s';"
%
DR_ID
)
last_modified
=
get_create_time
(
"select last_modified from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
last_modified_user
=
create_user
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept_batch1'
,
batch_main_key
,
pid
,
order_no
,
source_detail_id
,
pick_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
source_batch_id
,
target_batch_id
,
barcode_id
,
shelf_code
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept_batch2'
,
batch_main_key
,
pid
,
order_no
,
source_detail_id
,
pick_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
source_batch_id
,
target_batch_id
,
barcode_id
,
shelf_code
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept_batch3'
,
batch_main_key
,
pid
,
order_no
,
source_detail_id
,
pick_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
source_batch_id
,
target_batch_id
,
barcode_id
,
shelf_code
,
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'
)
def
check_mcms_psi_dept
(
type
=
16
):
branch_id
=
get_branch_id
()
sql
=
" select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_SL' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"拣货单id"
,
'message26'
)
# print(info)
if
type
==
16
:
DR_ID
=
info
[
'DR_NO2'
]
elif
type
==
20
:
DR_ID
=
info
[
'DR_NO3'
]
else
:
DR_ID
=
info
[
'DR_NO1'
]
DR_ID
=
''
.
join
(
DR_ID
)
sql
=
"select order_no from mcms_psi_dept where id='%s';"
%
DR_ID
order_no
=
get_id
(
sql
)
target_corp_id
=
get_hosid
()
target_branch_id
=
get_branch_id
()
target_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid5'
]
target_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid5'
]
target_stock_id
=
get_stockId_fromdb
(
target_dept_name
+
'库房'
)
target_area_code
=
get_stockAreaId_new_fromDb
(
target_dept_name
,
2
)
PICK_id
=
get_PICK_id
(
branch_id
,
type
)
source_id
=
PICK_id
source_corp_id
=
get_hosid
()
source_branch_id
=
get_branch_id
()
source_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
source_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
source_stock_id
=
get_stockId_fromdb
(
source_dept_name
+
'库房'
)
source_area_code
=
get_stockAreaId_new_fromDb
(
source_dept_name
,
2
)
buyBillId
=
get_buyBillId
(
branch_id
,
type
)
pickOrderNo
=
get_PICK_order_no
(
branch_id
,
type
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
type
)
pickBillId
=
get_PICK_id
(
branch_id
,
type
)
psiDeptOutBillId
=
DR_ID
psiDeptOutOrderNo
=
order_no
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_psi_dept where id='%s';"
%
DR_ID
)
last_modified
=
get_create_time
(
"select last_modified from mcms_psi_dept where id='%s';"
%
DR_ID
)
last_modified_user
=
create_user
if
type
==
16
:
# 子表检查
check_mcms_psi_dept_batch
(
DR_ID
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept1'
,
DR_ID
,
order_no
,
target_corp_id
,
target_branch_id
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_area_code
,
source_id
,
source_corp_id
,
source_branch_id
,
source_dept_id
,
source_dept_name
,
source_stock_id
,
source_area_code
,
buyBillId
,
pickOrderNo
,
buyOrderNo
,
pickBillId
,
psiDeptOutBillId
,
psiDeptOutOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
# 子表检查
check_mcms_psi_dept_batch
(
DR_ID
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept2'
,
DR_ID
,
order_no
,
target_corp_id
,
target_branch_id
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_area_code
,
source_id
,
source_corp_id
,
source_branch_id
,
source_dept_id
,
source_dept_name
,
source_stock_id
,
source_area_code
,
buyBillId
,
pickOrderNo
,
buyOrderNo
,
pickBillId
,
psiDeptOutBillId
,
psiDeptOutOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
# 子表检查
check_mcms_psi_dept_batch
(
DR_ID
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept3'
,
DR_ID
,
order_no
,
target_corp_id
,
target_branch_id
,
target_dept_id
,
target_dept_name
,
target_stock_id
,
target_area_code
,
source_id
,
source_corp_id
,
source_branch_id
,
source_dept_id
,
source_dept_name
,
source_stock_id
,
source_area_code
,
buyBillId
,
pickOrderNo
,
buyOrderNo
,
pickBillId
,
psiDeptOutBillId
,
psiDeptOutOrderNo
,
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'
)
try
:
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_b6流程十三请领业务流_三级库向二级库.air'
)
using
(
pro_path
+
r
'//air_case/b5_spd3_core_business_flow/a_b6流程十三请领业务流_三级库向二级库.air'
)
from
a_b6流程十三请领业务流_三级库向二级库
import
add_dept2
from
a_b6流程十三请领业务流_三级库向二级库
import
add_new_deptinfo
,
edit_goods_target
,
second_dept_Request
from
a_b6流程十三请领业务流_三级库向二级库
import
edit_goods_target
,
second_dept_Request
from
a_b6流程十三请领业务流_三级库向二级库
import
BuyCarSubmit
,
pick_execute
# 设置部门用户
set_dept_user
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid3'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid3'
],
3
)
# 设置部门负责人
set_dept_lead_new
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid3"
])
# 设置二级科室负责人
get_stockAreaId_new
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid3'
],
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid3'
],
3
)
deptName3
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid3'
]
# 设置库区联系人
set_stockShelf_Linkman
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
'所有科室id'
,
'message6'
)[
"deptid3"
],
get_stockAreaId2_new_fromDb
(
deptName3
,
3
))
# 设置库区联系人
#三级科室产品分配
dept_goods_distribute
(
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid3'
])
#
#
设置部门用户
#
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],
#
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'], 3)
#
#
设置部门负责人
#
set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid3"]) # 设置二级科室负责人
#
get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],
#
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'], 3)
#
deptName3 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3']
#
#
设置库区联系人
#
set_stockShelf_Linkman(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid3"],
#
get_stockAreaId2_new_fromDb(deptName3, 3)) # 设置库区联系人
#
#三级科室产品分配
#
dept_goods_distribute(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'])
# 上面暂时注释===================================
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
3
))
# 设置登录账号默认权限是三级库
# # # 低值
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
...
...
@@ -139,13 +659,29 @@ try:
# # # 试剂
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
()
# 检查拣货单
list_data
=
[
'16'
,
'20'
,
'66'
]
for
i
in
list_data
:
check_mcms_pick
(
int
(
i
))
# 检查出库单
check_mcms_psi_dept
(
16
)
check_mcms_psi_dept
(
20
)
check_mcms_psi_dept
(
66
)
updateUserLoginDefaultRange
(
get_listUserMgrRangePage1
(
3
))
#设置登录账号默认权限是三级库
second_dept_one_key_in
(
3
)
second_dept_one_key_in
(
3
)
...
...
data/b5_spd3_core_business_flow/message15
View file @
beadb526
验收单号
:
CHECK_NO1
:
CHECKh034720240729000
02
CHECK_NO2
:
CHECKh034720240729000
02
CHECK_NO1
:
CHECKh034720240729000
31
CHECK_NO2
:
CHECKh034720240729000
31
data/b6_spd3_core_business_flow_database_check/data
View file @
beadb526
...
...
@@ -138,4 +138,10 @@
#批次信息
"check_mcms_hos_batch1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "stock_id": "%s", "batch_type": 40, "batch_price": Decimal("99.999900"), "src_batch_id": "%s", "src_batch_price": Decimal("99.999900"), "settlement": 1, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "10", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "batch_code": "333", "expdt_date": %s, "product_date": %s, "bill_type": "RK_YS", "distr_id": "%s", "distr_detail_id": "%s", "distr_price": Decimal("99.999900"), "pur_bill_id": "%s", "certificate_code": "", "in_time": %s, "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":"","contractId":"","normalContractId":"","normalDetailId":"","fcatId":"","fcatName":"","goodsKindId":"","goodsKindName":"","miTwentysevenCode":"","focus_control":"0","focus_control_type":null}", "tb_status": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "multi_charge_flag": 0, "use_frequency": 1, "charge_unit": None}'
"check_mcms_hos_batch2": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "stock_id": "%s", "batch_type": 40, "batch_price": Decimal("99.999900"), "src_batch_id": "%s", "src_batch_price": Decimal("99.999900"), "settlement": 1, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "20", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "batch_code": "222", "expdt_date": %s, "product_date": %s, "bill_type": "RK_YS", "distr_id": "%s", "distr_detail_id": "%s", "distr_price": Decimal("99.999900"), "pur_bill_id": "%s", "certificate_code": "", "in_time": %s, "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":"","contractId":"","normalContractId":"","normalDetailId":"","fcatId":"","fcatName":"","goodsKindId":"","goodsKindName":"","miTwentysevenCode":"","focus_control":"0","focus_control_type":null}", "tb_status": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "multi_charge_flag": 0, "use_frequency": 1, "charge_unit": None}'
"check_mcms_hos_batch3": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "stock_id": "%s", "batch_type": 40, "batch_price": Decimal("99.999900"), "src_batch_id": "%s", "src_batch_price": Decimal("99.999900"), "settlement": 1, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "batch_code": "4444", "expdt_date": %s, "product_date": %s, "bill_type": "RK_YS", "distr_id": "%s", "distr_detail_id": "%s", "distr_price": Decimal("99.999900"), "pur_bill_id": "%s", "certificate_code": "", "in_time": %s, "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":"","contractId":"","normalContractId":"","normalDetailId":"","fcatId":"%s","fcatName":"财务试剂","goodsKindId":"","goodsKindName":"","miTwentysevenCode":"","focus_control":"0","focus_control_type":null}", "tb_status": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "multi_charge_flag": 0, "use_frequency": 1, "charge_unit": None}'
\ No newline at end of file
"check_mcms_hos_batch3": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "stock_id": "%s", "batch_type": 40, "batch_price": Decimal("99.999900"), "src_batch_id": "%s", "src_batch_price": Decimal("99.999900"), "settlement": 1, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "batch_code": "4444", "expdt_date": %s, "product_date": %s, "bill_type": "RK_YS", "distr_id": "%s", "distr_detail_id": "%s", "distr_price": Decimal("99.999900"), "pur_bill_id": "%s", "certificate_code": "", "in_time": %s, "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":"","contractId":"","normalContractId":"","normalDetailId":"","fcatId":"%s","fcatName":"财务试剂","goodsKindId":"","goodsKindName":"","miTwentysevenCode":"","focus_control":"0","focus_control_type":null}", "tb_status": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "multi_charge_flag": 0, "use_frequency": 1, "charge_unit": None}'
#三级科室请领单
"mcms_dept_buy6": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "null", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}'
"mcms_dept_buy6_2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "null", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}'
"mcms_dept_buy6_3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "null", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}'
\ 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