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
297b5abc
Commit
297b5abc
authored
Sep 19, 2024
by
xiao-hesheng
Browse files
流程五脚本提交
parent
30cc5989
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b0流程七_中心库入库结算_正负结算_数据库验证.air/a_b0流程七_中心库入库结算_正负结算_数据库验证.py
View file @
297b5abc
...
@@ -386,6 +386,7 @@ def check_mcms_out_balance(type=1, OBh_ID=""):
...
@@ -386,6 +386,7 @@ def check_mcms_out_balance(type=1, OBh_ID=""):
check_mcms_out_balance_detail
(
type
,
id
)
check_mcms_out_balance_detail
(
type
,
id
)
check_mcms_out_balance_detail2
(
type
,
id
)
check_mcms_out_balance_detail2
(
type
,
id
)
def
check_mcms_out_balance_detail
(
type
=
1
,
pid
=
""
):
def
check_mcms_out_balance_detail
(
type
=
1
,
pid
=
""
):
print
(
'===检查结算数据子表======'
)
print
(
'===检查结算数据子表======'
)
if
type
==
1
:
if
type
==
1
:
...
@@ -450,7 +451,7 @@ def check_mcms_out_balance_detail(type=1, pid=""):
...
@@ -450,7 +451,7 @@ def check_mcms_out_balance_detail(type=1, pid=""):
account_date
=
get_account_date1
(
"select account_date from mcms_out_balance_detail where id='%s';"
%
id
)
account_date
=
get_account_date1
(
"select account_date from mcms_out_balance_detail where id='%s';"
%
id
)
un_settle_id
=
get_id
(
un_settle_id
=
get_id
(
"select id from mcms_out_un_balance where branch_id='%s' and from_kind='CK_TH' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
"select id from mcms_out_un_balance where branch_id='%s' and from_kind='CK_TH' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
hos_goods_id
))
branch_id
,
hos_goods_id
))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_out_balance_detail_0918_1'
,
id
,
'check_mcms_out_balance_detail_0918_1'
,
id
,
pid
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
out_dept_id
,
pid
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
out_dept_id
,
...
@@ -478,6 +479,7 @@ def check_mcms_out_balance_detail(type=1, pid=""):
...
@@ -478,6 +479,7 @@ def check_mcms_out_balance_detail(type=1, pid=""):
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_out_balance_detail2
(
type
=
1
,
pid
=
""
):
def
check_mcms_out_balance_detail2
(
type
=
1
,
pid
=
""
):
print
(
'===检查结算数据子表======'
)
print
(
'===检查结算数据子表======'
)
if
type
==
1
:
if
type
==
1
:
...
@@ -536,7 +538,6 @@ def check_mcms_out_balance_detail2(type=1, pid=""):
...
@@ -536,7 +538,6 @@ def check_mcms_out_balance_detail2(type=1, pid=""):
last_modified
=
get_create_time
(
"select last_modified from mcms_out_balance_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_out_balance_detail where id='%s';"
%
id
)
last_modified_user
=
create_user
last_modified_user
=
create_user
out_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
out_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
out_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
out_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
sub_prov_name
=
prov_name
sub_prov_name
=
prov_name
...
@@ -575,6 +576,7 @@ def check_mcms_out_balance_detail2(type=1, pid=""):
...
@@ -575,6 +576,7 @@ def check_mcms_out_balance_detail2(type=1, pid=""):
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_out_balance_approve_after
(
type
=
1
,
OBh_ID
=
""
):
def
check_mcms_out_balance_approve_after
(
type
=
1
,
OBh_ID
=
""
):
print
(
'===检查结算数据======'
)
print
(
'===检查结算数据======'
)
if
type
==
1
:
if
type
==
1
:
...
@@ -647,13 +649,13 @@ def check_mcms_out_balance_approve_after(type=1, OBh_ID=""):
...
@@ -647,13 +649,13 @@ def check_mcms_out_balance_approve_after(type=1, OBh_ID=""):
commonFuc
().
check_text_exist_result_text
(
'success'
,
'success'
)
commonFuc
().
check_text_exist_result_text
(
'success'
,
'success'
)
else
:
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'success'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'success'
)
check_user
=
create_user
check_user
=
create_user
check_time
=
get_create_time
(
"select check_time from mcms_out_balance where id='%s';"
%
id
)
check_time
=
get_create_time
(
"select check_time from mcms_out_balance where id='%s';"
%
id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_out_balance_0919'
,
id
,
'check_mcms_out_balance_0919'
,
id
,
order_no
,
branch_id
,
hos_id
,
prov_id
,
prov_name
,
settle_month
,
order_no
,
branch_id
,
hos_id
,
prov_id
,
prov_name
,
settle_month
,
settle_start_time
,
settle_end_time
,
create_user
,
create_time
,
settle_start_time
,
settle_end_time
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
check_user
,
check_time
last_modified
,
last_modified_user
,
check_user
,
check_time
)
)
# 对比预期值和实际值是否一致
# 对比预期值和实际值是否一致
...
@@ -679,6 +681,7 @@ def check_mcms_out_balance_approve_after(type=1, OBh_ID=""):
...
@@ -679,6 +681,7 @@ def check_mcms_out_balance_approve_after(type=1, OBh_ID=""):
check_mcms_out_balance_detail_approve_after
(
type
,
id
)
check_mcms_out_balance_detail_approve_after
(
type
,
id
)
check_mcms_out_balance_detail_approve_after2
(
type
,
id
)
check_mcms_out_balance_detail_approve_after2
(
type
,
id
)
def
check_mcms_out_balance_detail_approve_after
(
type
=
1
,
pid
=
""
):
def
check_mcms_out_balance_detail_approve_after
(
type
=
1
,
pid
=
""
):
print
(
'===检查结算数据子表======'
)
print
(
'===检查结算数据子表======'
)
if
type
==
1
:
if
type
==
1
:
...
@@ -743,7 +746,7 @@ def check_mcms_out_balance_detail_approve_after(type=1, pid=""):
...
@@ -743,7 +746,7 @@ def check_mcms_out_balance_detail_approve_after(type=1, pid=""):
account_date
=
get_account_date1
(
"select account_date from mcms_out_balance_detail where id='%s';"
%
id
)
account_date
=
get_account_date1
(
"select account_date from mcms_out_balance_detail where id='%s';"
%
id
)
un_settle_id
=
get_id
(
un_settle_id
=
get_id
(
"select id from mcms_out_un_balance where branch_id='%s' and from_kind='CK_TH' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
"select id from mcms_out_un_balance where branch_id='%s' and from_kind='CK_TH' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
hos_goods_id
))
branch_id
,
hos_goods_id
))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_out_balance_detail_0919_1'
,
id
,
'check_mcms_out_balance_detail_0919_1'
,
id
,
pid
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
out_dept_id
,
pid
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
out_dept_id
,
...
@@ -771,6 +774,7 @@ def check_mcms_out_balance_detail_approve_after(type=1, pid=""):
...
@@ -771,6 +774,7 @@ def check_mcms_out_balance_detail_approve_after(type=1, pid=""):
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_out_balance_detail_approve_after2
(
type
=
1
,
pid
=
""
):
def
check_mcms_out_balance_detail_approve_after2
(
type
=
1
,
pid
=
""
):
print
(
'===检查结算数据子表======'
)
print
(
'===检查结算数据子表======'
)
if
type
==
1
:
if
type
==
1
:
...
@@ -829,7 +833,6 @@ def check_mcms_out_balance_detail_approve_after2(type=1, pid=""):
...
@@ -829,7 +833,6 @@ def check_mcms_out_balance_detail_approve_after2(type=1, pid=""):
last_modified
=
get_create_time
(
"select last_modified from mcms_out_balance_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_out_balance_detail where id='%s';"
%
id
)
last_modified_user
=
create_user
last_modified_user
=
create_user
out_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
out_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
out_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
out_dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
sub_prov_name
=
prov_name
sub_prov_name
=
prov_name
...
@@ -867,7 +870,9 @@ def check_mcms_out_balance_detail_approve_after2(type=1, pid=""):
...
@@ -867,7 +870,9 @@ def check_mcms_out_balance_detail_approve_after2(type=1, pid=""):
else
:
else
:
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_invoice
():
def
check_mcms_invoice
():
print
(
'检查发票数据'
)
print
(
'检查发票数据'
)
prov_id
=
get_prov_id
()
prov_id
=
get_prov_id
()
# if type == 1:
# if type == 1:
...
@@ -888,19 +893,19 @@ def check_mcms_invoice():
...
@@ -888,19 +893,19 @@ def check_mcms_invoice():
hos_id
=
get_hosid
()
hos_id
=
get_hosid
()
prov_name
=
get_prov_name
()
prov_name
=
get_prov_name
()
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
# create_user = account_user_id
# create_user = account_user_id
create_time
=
get_create_time
(
"select create_time from mcms_invoice where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from mcms_invoice where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice where id='%s';"
%
id
)
last_modified_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
last_modified_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
year
,
month
=
dateUtils
().
get_year_month
(
dateUtils
().
get_current_time
())
year
,
month
=
dateUtils
().
get_year_month
(
dateUtils
().
get_current_time
())
if
month
<
10
:
if
month
<
10
:
month
=
"0"
+
str
(
month
)
month
=
"0"
+
str
(
month
)
year_month
=
str
(
year
)
+
str
(
month
)
year_month
=
str
(
year
)
+
str
(
month
)
settle_months
=
year_month
settle_months
=
year_month
invoice_date
=
get_account_date1
(
"select invoice_date from mcms_invoice where id='%s';"
%
id
)
invoice_date
=
get_account_date1
(
"select invoice_date from mcms_invoice where id='%s';"
%
id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_invoice_0918'
,
id
,
'check_mcms_invoice_0918'
,
id
,
hos_id
,
prov_id
,
prov_name
,
invoice_date
,
settle_months
,
create_user
,
hos_id
,
prov_id
,
prov_name
,
invoice_date
,
settle_months
,
create_user
,
...
@@ -925,10 +930,12 @@ def check_mcms_invoice():
...
@@ -925,10 +930,12 @@ def check_mcms_invoice():
else
:
else
:
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
#检查发票子表数据
#
检查发票子表数据
check_mcms_invoice_detail
(
1
,
id
)
check_mcms_invoice_detail
(
1
,
id
)
check_mcms_invoice_detail2
(
1
,
id
)
check_mcms_invoice_detail2
(
1
,
id
)
def
check_mcms_invoice_detail
(
type
=
1
,
pid
=
""
):
def
check_mcms_invoice_detail
(
type
=
1
,
pid
=
""
):
print
(
'检查发票子表数据'
)
print
(
'检查发票子表数据'
)
if
type
==
1
:
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
...
@@ -963,9 +970,9 @@ def check_mcms_invoice_detail(type=1,pid=""):
...
@@ -963,9 +970,9 @@ def check_mcms_invoice_detail(type=1,pid=""):
else
:
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'success'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'success'
)
account_user_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
account_user_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
create_time
=
get_create_time
(
"select create_time from mcms_invoice_detail where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from mcms_invoice_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice_detail where id='%s';"
%
id
)
last_modified_user
=
create_user
last_modified_user
=
create_user
...
@@ -974,11 +981,12 @@ def check_mcms_invoice_detail(type=1,pid=""):
...
@@ -974,11 +981,12 @@ def check_mcms_invoice_detail(type=1,pid=""):
if
month
<
10
:
if
month
<
10
:
month
=
"0"
+
str
(
month
)
month
=
"0"
+
str
(
month
)
settle_month
=
str
(
year
)
+
str
(
month
)
settle_month
=
str
(
year
)
+
str
(
month
)
hobd_id
=
get_id
(
"select id from mcms_out_balance_detail where prov_id='%s' order by id desc LIMIT 1 OFFSET 1;"
%
(
hobd_id
=
get_id
(
"select id from mcms_out_balance_detail where prov_id='%s' order by id desc LIMIT 1 OFFSET 1;"
%
(
prov_id
))
prov_id
))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_invoice_detail_0919_1'
,
id
,
'check_mcms_invoice_detail_0919_1'
,
id
,
pid
,
hobd_id
,
branch_id
,
hos_goods_id
,
settle_month
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
hos_id
pid
,
hobd_id
,
branch_id
,
hos_goods_id
,
settle_month
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
hos_id
)
)
# 对比预期值和实际值是否一致
# 对比预期值和实际值是否一致
...
@@ -1000,7 +1008,8 @@ def check_mcms_invoice_detail(type=1,pid=""):
...
@@ -1000,7 +1008,8 @@ def check_mcms_invoice_detail(type=1,pid=""):
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_invoice_detail2
(
type
=
1
,
pid
=
""
):
def
check_mcms_invoice_detail2
(
type
=
1
,
pid
=
""
):
print
(
'检查发票子表数据'
)
print
(
'检查发票子表数据'
)
if
type
==
1
:
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
...
@@ -1035,9 +1044,9 @@ def check_mcms_invoice_detail2(type=1,pid=""):
...
@@ -1035,9 +1044,9 @@ def check_mcms_invoice_detail2(type=1,pid=""):
else
:
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'success'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'success'
)
account_user_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
account_user_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
create_time
=
get_create_time
(
"select create_time from mcms_invoice_detail where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from mcms_invoice_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice_detail where id='%s';"
%
id
)
last_modified_user
=
create_user
last_modified_user
=
create_user
...
@@ -1046,11 +1055,12 @@ def check_mcms_invoice_detail2(type=1,pid=""):
...
@@ -1046,11 +1055,12 @@ def check_mcms_invoice_detail2(type=1,pid=""):
if
month
<
10
:
if
month
<
10
:
month
=
"0"
+
str
(
month
)
month
=
"0"
+
str
(
month
)
settle_month
=
str
(
year
)
+
str
(
month
)
settle_month
=
str
(
year
)
+
str
(
month
)
hobd_id
=
get_id
(
"select id from mcms_out_balance_detail where prov_id='%s' order by id desc LIMIT 1;"
%
(
hobd_id
=
get_id
(
"select id from mcms_out_balance_detail where prov_id='%s' order by id desc LIMIT 1;"
%
(
prov_id
))
prov_id
))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_invoice_detail_0919_2'
,
id
,
'check_mcms_invoice_detail_0919_2'
,
id
,
pid
,
hobd_id
,
branch_id
,
hos_goods_id
,
settle_month
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
hos_id
pid
,
hobd_id
,
branch_id
,
hos_goods_id
,
settle_month
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
hos_id
)
)
# 对比预期值和实际值是否一致
# 对比预期值和实际值是否一致
...
@@ -1071,6 +1081,126 @@ def check_mcms_invoice_detail2(type=1,pid=""):
...
@@ -1071,6 +1081,126 @@ def check_mcms_invoice_detail2(type=1,pid=""):
else
:
else
:
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_invoice_ext
():
print
(
'检查付款单数据'
)
prov_id
=
get_prov_id
()
# if type == 1:
# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# elif type == 2:
# 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"]
sql
=
"select * from mcms_invoice_ext where prov_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
prov_id
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
sql
=
"select id from mcms_invoice_ext where prov_id='%s' order by CREATE_TIME desc LIMIT 1;"
%
(
prov_id
)
id
=
get_id
(
sql
)
hos_id
=
get_hosid
()
prov_name
=
get_prov_name
()
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
# create_user = account_user_id
create_time
=
get_create_time
(
"select create_time from mcms_invoice_ext where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice_ext where id='%s';"
%
id
)
last_modified_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
create_user
=
last_modified_user
year
,
month
=
dateUtils
().
get_year_month
(
dateUtils
().
get_current_time
())
if
month
<
10
:
month
=
"0"
+
str
(
month
)
year_month
=
str
(
year
)
+
str
(
month
)
settle_months
=
year_month
pay_date
=
get_account_date1
(
"select pay_date from mcms_invoice_ext where id='%s';"
%
id
)
pay_user
=
create_user
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_invoice_ext_0919'
,
id
,
hos_id
,
prov_id
,
prov_name
,
pay_date
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
pay_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'
)
# 检查子表数据
check_mcms_invoice_ext_detail
(
1
,
id
)
def
check_mcms_invoice_ext_detail
(
type
=
1
,
pid
=
""
):
print
(
'检查付款单子表数据'
)
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
2
:
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"
]
branch_id
=
get_branch_id
()
sql
=
"select * from mcms_invoice_ext_detail where pid='%s';"
%
(
pid
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
sql
=
"select id from mcms_invoice_ext_detail where pid='%s';"
%
(
pid
)
id
=
get_id
(
sql
)
hos_id
=
get_hosid
()
prov_id
=
get_prov_id
()
account_user_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"供货关系申请2"
,
'message'
)[
'e_username'
])
create_time
=
get_create_time
(
"select create_time from mcms_invoice_ext_detail where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_invoice_ext_detail where id='%s';"
%
id
)
last_modified_user
=
create_user
invoice_id
=
get_id
(
"select id from mcms_invoice where prov_id='p1e3cd' order by CREATE_TIME desc LIMIT 1;"
%
(
prov_id
))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_invoice_ext_detail_0919_1'
,
id
,
pid
,
invoice_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
hos_id
)
# 对比预期值和实际值是否一致
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'
)
pro_path
=
commonFuc
().
get_pro_path2
()
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
print
(
'pro_path'
,
pro_path
)
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b0流程七_中心库入库结算_正负结算.air'
)
sys
.
path
.
append
(
pro_path
+
r
'/air_case/b5_spd3_core_business_flow/a_b0流程七_中心库入库结算_正负结算.air'
)
...
@@ -1103,8 +1233,11 @@ try:
...
@@ -1103,8 +1233,11 @@ try:
# time.sleep(3)
# time.sleep(3)
# invoice(3, OBh_ID) # type=2 传递结算单号,外网查询开票
# invoice(3, OBh_ID) # type=2 传递结算单号,外网查询开票
# time.sleep(3)
# time.sleep(3)
#检查最终的发票数据,过程数据在流程五中检查
# 检查最终的发票数据,过程数据在流程五中检查
check_mcms_invoice
()
# check_mcms_invoice()
# time.sleep(3)
# 检查付款单数据
check_mcms_invoice_ext
()
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
Exception
as
e
:
except
Exception
as
e
:
# 打印错误信息
# 打印错误信息
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
297b5abc
...
@@ -383,6 +383,14 @@
...
@@ -383,6 +383,14 @@
"check_mcms_invoice_0918": '{"id": "%s", "hos_id": "%s", "branch_id": None, "invoice_code": "1", "invoice_number": "test", "invoice_num": 1, "prov_id": "%s", "prov_name": "%s", "invoice_amount": Decimal("0.000000"), "tb_status": 50, "invoice_date": %s, "settle_months": "%s", "tax_amount": None, "payment_bill_id": None, "yxpt_order_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 6, "invoice_qty": Decimal("0.0000"), "remarks": "", "invoice_tag": None, "ext_info": None}'
"check_mcms_invoice_0918": '{"id": "%s", "hos_id": "%s", "branch_id": None, "invoice_code": "1", "invoice_number": "test", "invoice_num": 1, "prov_id": "%s", "prov_name": "%s", "invoice_amount": Decimal("0.000000"), "tb_status": 50, "invoice_date": %s, "settle_months": "%s", "tax_amount": None, "payment_bill_id": None, "yxpt_order_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 6, "invoice_qty": Decimal("0.0000"), "remarks": "", "invoice_tag": None, "ext_info": None}'
#中心库入库结算_正负结算_开票数据
字
表
#中心库入库结算_正负结算_开票数据
子
表
"check_mcms_invoice_detail_0919_1": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("-100.00"), "invoice_amount": Decimal("-9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}'
"check_mcms_invoice_detail_0919_1": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("-100.00"), "invoice_amount": Decimal("-9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}'
"check_mcms_invoice_detail_0919_2": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("100.00"), "invoice_amount": Decimal("9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}'
"check_mcms_invoice_detail_0919_2": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("100.00"), "invoice_amount": Decimal("9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}'
\ No newline at end of file
#中心库入库结算_正负结算_付款单主表
"check_mcms_invoice_ext_0919": '{"id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "payment_status": 20, "pay_channel": "YGPT", "pay_amount": Decimal("0.0000"), "remain_pay_amount": Decimal("0.0000"), "remark": None, "pay_date": %s, "pay_count": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "pay_user": "%s"}'
#中心库入库结算_正负结算_付款单子表
"check_mcms_invoice_ext_detail_0919_1": '{"id": "%s", "pid": "%s", "invoice_id": "%s", "remark": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "hos_id": "%s"}'
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