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
ad2dbe99
Commit
ad2dbe99
authored
Jul 16, 2024
by
xiao-hesheng
Browse files
数据库验证流程十一脚本编写
parent
cae6b4e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
View file @
ad2dbe99
...
@@ -724,7 +724,7 @@ def check_mcms_purchase(type=16):
...
@@ -724,7 +724,7 @@ def check_mcms_purchase(type=16):
sql
=
"select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;"
%
(
sql
=
"select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
,
id1
)
branch_id
,
type
,
id1
)
print
(
sql
)
print
(
sql
)
buyOrderNo1
=
process_tuple
(
get_dept_buy_id
(
sql
))
order_no
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 要验证的数据sql
# 要验证的数据sql
sql1
=
"select * from mcms_purchase where branch_id='%s' and bill_mode='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
sql1
=
"select * from mcms_purchase where branch_id='%s' and bill_mode='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
...
@@ -733,6 +733,8 @@ def check_mcms_purchase(type=16):
...
@@ -733,6 +733,8 @@ def check_mcms_purchase(type=16):
actual
=
check_mcms_pur_plan_sql
(
sql1
)
actual
=
check_mcms_pur_plan_sql
(
sql1
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
hos_id
=
get_hosid
()
hos_id
=
get_hosid
()
dept_id1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
dept_id1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
dept_name1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
dept_name1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
dept_name2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
dept_name2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
...
@@ -762,34 +764,34 @@ def check_mcms_purchase(type=16):
...
@@ -762,34 +764,34 @@ def check_mcms_purchase(type=16):
planOrderNo
=
PLAN_order_no
planOrderNo
=
PLAN_order_no
if
type
==
16
:
if
type
==
16
:
# 验证子表数据
# 验证子表数据
check_mcms_mcms_pur_plan_detail
(
id2
,
type
,
planOrderNo
)
#
check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
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_pur
_plan
'
,
id
2
,
PLAN_
order_no
,
hos_id
,
'mcms_pur
chase
'
,
id
1
,
order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
source_id
,
rec_user
,
area_code
,
area_name
,
source_id
,
rec_user
,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
buyOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
#
elif type == 20:
check_mcms_mcms_pur_plan_detail
(
id2
,
type
,
planOrderNo
)
#
check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
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_pur_plan2'
,
id
2
,
PLAN_order_no
,
hos_id
,
#
'mcms_pur_plan2', id
1
, PLAN_order_no, hos_id,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
#
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code
,
area_name
,
source_id
,
rec_user
,
#
area_code, area_name, source_id, rec_user,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
#
rec_addr, bill_expdt_date, buyBillId, planBillId, planOrderNo,
buyOrderNo
,
#
buyOrderNo,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
#
create_user, create_time, last_modified, last_modified_user)
elif
type
==
66
:
#
elif type == 66:
check_mcms_mcms_pur_plan_detail
(
id2
,
type
,
planOrderNo
)
#
check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
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_pur_plan3'
,
id
2
,
PLAN_order_no
,
hos_id
,
#
'mcms_pur_plan3', id
1
, PLAN_order_no, hos_id,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
#
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code
,
area_name
,
source_id
,
rec_user
,
#
area_code, area_name, source_id, rec_user,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
#
rec_addr, bill_expdt_date, buyBillId, planBillId, planOrderNo,
buyOrderNo
,
#
buyOrderNo,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
#
create_user, create_time, last_modified, last_modified_user)
else
:
#
else:
expected
=
None
#
expected = None
actual_value1
=
get_process_list2
(
actual
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
expected_value1
=
get_process_list2
(
expected
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
ad2dbe99
...
@@ -36,4 +36,4 @@
...
@@ -36,4 +36,4 @@
"mcms_pur_plan_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("1.00"), "plan_qty": Decimal("100.00"), "pkg_qty": Decimal("1.00"), "price": Decimal("99.999900"), "qty": Decimal("100.00"), "in_settlement": None, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "coding_type": 0}'
"mcms_pur_plan_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("1.00"), "plan_qty": Decimal("100.00"), "pkg_qty": Decimal("1.00"), "price": Decimal("99.999900"), "qty": Decimal("100.00"), "in_settlement": None, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "coding_type": 0}'
"mcms_purchase": '{"id": "Ch034720240716000019", "order_no": "CG2024071621466", "bill_mode": "16", "rec_type": "HDI", "hos_id": "h0347", "branch_id": "h0347-3755", "dept_id": "63c734f07fcc422ea80f49ca8e5bbd95", "dept_name": "设备科001", "rec_org_id": "b12c7c6ca56e4b46b418b319cbadbea5", "rec_org_name": "二级检验科002", "area_code": "areah03472781", "area_name": "默认库区", "bill_expdt_date": datetime.datetime(2024, 8, 16, 0, 0), "source_id": "Ph034720240716029571", "source_type": "CGJH", "in_settlement": None, "rec_user": "自动化测试w&vqF", "rec_phone": "None", "rec_addr": "自动化测试", "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "sub_send_flag": 10, "exe_prov_id": "p1e35e", "exe_prov_name": "国药集团公司S57ui", "bill_relation_json": "{"buyBillId":"Bh03472024071600022","planBillId":"Ph034720240716029571","planOrderNo":"PLAN2024071632926","buyOrderNo":"BUY2024071609399","purOrderNo":"CG2024071621466","purBillId":"Ch034720240716000019"}", "ext_info": "{"epidemicFlag":0,"purMode":10}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": datetime.datetime(2024, 7, 17, 15, 20, 54), "up_status": 0, "tb_status": 30, "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 16, 15, 20, 54), "last_modified": datetime.datetime(2024, 7, 16, 15, 20, 54), "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "自动化测试w&vqF", "last_audit_time": datetime.datetime(2024, 7, 16, 15, 20, 54)}'
"mcms_purchase": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "HDI", "hos_id": "h0347", "branch_id": "h0347-3755", "dept_id": "63c734f07fcc422ea80f49ca8e5bbd95", "dept_name": "设备科001", "rec_org_id": "b12c7c6ca56e4b46b418b319cbadbea5", "rec_org_name": "二级检验科002", "area_code": "areah03472781", "area_name": "默认库区", "bill_expdt_date": datetime.datetime(2024, 8, 16, 0, 0), "source_id": "Ph034720240716029571", "source_type": "CGJH", "in_settlement": None, "rec_user": "自动化测试w&vqF", "rec_phone": "None", "rec_addr": "自动化测试", "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "sub_send_flag": 10, "exe_prov_id": "p1e35e", "exe_prov_name": "国药集团公司S57ui", "bill_relation_json": "{"buyBillId":"Bh03472024071600022","planBillId":"Ph034720240716029571","planOrderNo":"PLAN2024071632926","buyOrderNo":"BUY2024071609399","purOrderNo":"CG2024071621466","purBillId":"Ch034720240716000019"}", "ext_info": "{"epidemicFlag":0,"purMode":10}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": datetime.datetime(2024, 7, 17, 15, 20, 54), "up_status": 0, "tb_status": 30, "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 16, 15, 20, 54), "last_modified": datetime.datetime(2024, 7, 16, 15, 20, 54), "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "自动化测试w&vqF", "last_audit_time": datetime.datetime(2024, 7, 16, 15, 20, 54)}'
\ No newline at end of file
\ 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