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
16370cad
Commit
16370cad
authored
Jul 24, 2024
by
xiao-hesheng
Browse files
数据库验证流程十二脚本编写
parent
bc465df8
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
View file @
16370cad
...
@@ -294,18 +294,21 @@ def check_mcms_dept_buy(type=16):
...
@@ -294,18 +294,21 @@ def check_mcms_dept_buy(type=16):
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_psi_dept_batch
(
type
,
DR_ID
):
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';"
%
(
sql
=
" select * from mcms_psi_dept_batch where pid='%s';"
%
(
DR_ID
)
DR_ID
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
batch_main_key
=
get_id
(
"select id from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
batch_main_key
=
get_id
(
"select id from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
pid
=
DR_ID
pid
=
DR_ID
order_no
=
get_id
(
"select order_no from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
#
order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
source_detail_id
=
'source
_detail_id
'
source_detail_id
=
get_pick
_detail_id
(
branch_id
,
type
)
if
type
==
16
:
if
type
==
16
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_psi_dept_batch1'
,
batch_main_key
,
pid
,
order_no
'mcms_psi_dept_batch1'
,
batch_main_key
,
pid
,
order_no
,
source_detail_id
,
)
)
elif
type
==
20
:
elif
type
==
20
:
...
@@ -379,7 +382,7 @@ def check_mcms_psi_dept(type=16):
...
@@ -379,7 +382,7 @@ def check_mcms_psi_dept(type=16):
last_modified_user
=
create_user
last_modified_user
=
create_user
if
type
==
16
:
if
type
==
16
:
# 子表检查
# 子表检查
check_mcms_psi_dept_batch
(
type
,
DR_ID
)
check_mcms_psi_dept_batch
(
DR_ID
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
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
,
'mcms_psi_dept1'
,
DR_ID
,
order_no
,
target_corp_id
,
target_branch_id
,
target_dept_id
,
target_dept_name
,
target_stock_id
target_dept_id
,
target_dept_name
,
target_stock_id
...
@@ -461,6 +464,7 @@ def check_mcms_pick_detail(pid,type,order_no):
...
@@ -461,6 +464,7 @@ def check_mcms_pick_detail(pid,type,order_no):
)
)
elif
type
==
20
:
elif
type
==
20
:
pkg_def_id
=
None
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick_detail2'
,
id
,
pid
,
order_no
,
source_id
,
hos_goods_id
'mcms_pick_detail2'
,
id
,
pid
,
order_no
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
picker
,
picker_name
,
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
picker
,
picker_name
,
...
@@ -535,6 +539,7 @@ def check_mcms_pick(type=16):
...
@@ -535,6 +539,7 @@ def check_mcms_pick(type=16):
picker
=
create_user
picker
=
create_user
picker_name
=
username
picker_name
=
username
if
type
==
16
:
if
type
==
16
:
#检查拣货单子表
check_mcms_pick_detail
(
id
,
type
,
order_no
)
check_mcms_pick_detail
(
id
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick1'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
'mcms_pick1'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
...
@@ -545,6 +550,8 @@ def check_mcms_pick(type=16):
...
@@ -545,6 +550,8 @@ def check_mcms_pick(type=16):
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
)
)
elif
type
==
20
:
elif
type
==
20
:
# 检查拣货单子表
check_mcms_pick_detail
(
id
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick2'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
'mcms_pick2'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
dept_id
,
dept_id
,
...
@@ -554,6 +561,8 @@ def check_mcms_pick(type=16):
...
@@ -554,6 +561,8 @@ def check_mcms_pick(type=16):
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
create_user
,
create_time
,
last_modified
,
last_modified_user
,
picker
,
picker_name
)
)
else
:
else
:
# 检查拣货单子表
check_mcms_pick_detail
(
id
,
type
,
order_no
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pick3'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
'mcms_pick3'
,
id
,
get_hosid
(),
get_branch_id
(),
order_no
,
source_id
,
dept_id
,
dept_id
,
...
@@ -644,11 +653,11 @@ try:
...
@@ -644,11 +653,11 @@ try:
# # # 二级科室领用出库
# # # 二级科室领用出库
# # # 低值拣货执行
# # # 低值拣货执行
# pick_execute()
# pick_execute()
# # 检查拣货单
# list_data = ['16', '20', '66']
# for i in list_data:
# check_mcms_pick(int(i))
# 上面暂时注释========================
# 上面暂时注释========================
# 检查拣货单
list_data
=
[
'16'
,
'20'
,
'66'
]
for
i
in
list_data
:
check_mcms_pick
(
int
(
i
))
# 检查出库单
# 检查出库单
check_mcms_psi_dept
(
16
)
check_mcms_psi_dept
(
16
)
check_mcms_psi_dept
(
20
)
check_mcms_psi_dept
(
20
)
...
...
common/db/sql/sql_tools.py
View file @
16370cad
...
@@ -272,6 +272,12 @@ def get_PICK_id(branch_id,bill_mode):
...
@@ -272,6 +272,12 @@ def get_PICK_id(branch_id,bill_mode):
branch_id
,
bill_mode
)
branch_id
,
bill_mode
)
print
(
sql
)
print
(
sql
)
return
process_tuple
(
get_dept_buy_id
(
sql
))
return
process_tuple
(
get_dept_buy_id
(
sql
))
def
get_pick_detail_id
(
branch_id
,
bill_mode
):
main_id
=
get_PICK_id
(
branch_id
,
bill_mode
)
sql
=
"select id from mcms_pick_detail where pid='%s';"
%
(
main_id
)
print
(
sql
)
return
process_tuple
(
get_dept_buy_id
(
sql
))
def
get_PICK_order_no
(
branch_id
,
bill_mode
):
def
get_PICK_order_no
(
branch_id
,
bill_mode
):
PICK_id
=
get_PICK_id
(
branch_id
,
bill_mode
)
PICK_id
=
get_PICK_id
(
branch_id
,
bill_mode
)
sql
=
"select order_no from mcms_pick where id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
sql
=
"select order_no from mcms_pick where id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
16370cad
...
@@ -83,9 +83,9 @@
...
@@ -83,9 +83,9 @@
"mcms_pick2": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "20", "create_type": "ZD", "pick_type": "KS_SL", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "默认库区", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 0, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 4, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
"mcms_pick2": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "20", "create_type": "ZD", "pick_type": "KS_SL", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "默认库区", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 0, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 4, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
"mcms_pick3": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "66", "create_type": "ZD", "pick_type": "KS_SL", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "默认库区", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 4, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
"mcms_pick3": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "66", "create_type": "ZD", "pick_type": "KS_SL", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "默认库区", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 4, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
#拣货单子表
#拣货单子表
"mcms_pick_detail1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s
0001
", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "pur_mode":
1
0, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id":
"
%s
"
, "pkg_def_name":
"100"
, "pkg_def_qty": Decimal("1
00
.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s
0001
", "pur_mode":
2
0, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": %s, "pkg_def_name":
None
, "pkg_def_qty": Decimal("1.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "pur_mode":
1
0, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s
0001
", "pur_mode":
6
0, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
#出库单
#出库单
"mcms_psi_dept_batch1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "5ec2e516d7b4420ca2557eb44b7b03ca", "pick_detail_id": "5ec2e516d7b4420ca2557eb44b7b03ca", "pur_mode": 10, "hos_goods_id": "h034700004601", "mdm_goods_code": "11661563", "goods_code": "00004601", "source_batch_id": "Ph034724071800020", "target_batch_id": "Ph034724071800020", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("100.00"), "unit_name": "100支/100", "barcode_id": "100000142024071800000628", "sub_barcode_id": None, "shelf_code": "areah03472781-A-01-01", "tb_status": 0, "charge_flag": 1, "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 23, 15, 58, 32), "last_modified": datetime.datetime(2024, 7, 23, 15, 58, 32), "last_modified_user": "h0347_UID-051420", "version": 0}'
"mcms_psi_dept_batch1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "5ec2e516d7b4420ca2557eb44b7b03ca", "pick_detail_id": "5ec2e516d7b4420ca2557eb44b7b03ca", "pur_mode": 10, "hos_goods_id": "h034700004601", "mdm_goods_code": "11661563", "goods_code": "00004601", "source_batch_id": "Ph034724071800020", "target_batch_id": "Ph034724071800020", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("100.00"), "unit_name": "100支/100", "barcode_id": "100000142024071800000628", "sub_barcode_id": None, "shelf_code": "areah03472781-A-01-01", "tb_status": 0, "charge_flag": 1, "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 23, 15, 58, 32), "last_modified": datetime.datetime(2024, 7, 23, 15, 58, 32), "last_modified_user": "h0347_UID-051420", "version": 0}'
\ 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