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
34b817c8
Commit
34b817c8
authored
Sep 27, 2024
by
xiao-hesheng
Browse files
流程五脚本提交
parent
baffec21
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_a5流程五_中心库入库结算_正结算1_提交采购计划_数据库验证.air/a_a5流程五_中心库入库结算_正结算1_提交采购计划_数据库验证.py
View file @
34b817c8
...
...
@@ -4,7 +4,8 @@ import traceback
from
air_case.public1.public1.public1
import
updateUserLoginDefaultRange
,
get_listUserMgrRangePage
,
call_login
,
\
get_branch_id
,
process_tuple
,
get_dept_buy_id
,
check_mcms_pur_plan_sql
,
get_hosid
,
get_id
,
\
get_stockAreaId_new_fromDb
,
get_login_user_uxid
,
get_expdt_date
,
get_create_time
,
get_process_list2
,
\
compare_text_index
compare_text_index
,
check_mcms_pur_sql
,
check_source_id
,
get_mdm_goods_code1
,
get_goods_code1
,
get_supply_id
,
\
get_pkg_def_id
,
get_goods_gg
,
get_goods_name
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
...
...
@@ -27,6 +28,12 @@ import time
# 检查采购计划主表
def
check_mcms_mcms_pur_plan
(
type
=
16
):
branch_id
=
get_branch_id
()
# 要验证的数据sql
sql1
=
"select * from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql1
)
print
(
'actual'
,
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
)
...
...
@@ -37,78 +44,74 @@ def check_mcms_mcms_pur_plan(type=16):
print
(
sql
)
buyOrderNo1
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 根据请领单的id获取采购计划单主表主键
sql
=
"select id from mcms_pur_plan where branch_id='%s'
and source_id='%s'
order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
sql
=
"select id from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
)
id2
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 采购计划主表主键
sql
=
"select order_no from mcms_pur_plan where branch_id='%s'
and source_id='%s'
order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
sql
=
"select order_no from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
)
PLAN_order_no
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 采购计划主表order_no
# 要验证的数据sql
sql1
=
"select * from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql1
)
print
(
'actual'
,
actual
)
hos_id
=
get_hosid
()
dept_id1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
dept_name1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
dept_name2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
rec_org_id
=
process_tuple
(
get_id
(
"select id from sys_org where branch_id='%s' and ename='%s';"
%
(
branch_id
,
dept_name
2
)))
rec_org_name
=
dept_name
2
get_id
(
"select id from sys_org where branch_id='%s' and ename='%s';"
%
(
branch_id
,
dept_name
1
)))
rec_org_name
=
dept_name
1
info
=
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"库区信息"
,
'message22'
)
list_a
=
info
[
'list_a'
]
area_code
=
get_stockAreaId_new_fromDb
(
dept_name
2
,
2
)
sql1
=
"select area_name from mcms_pur_plan where branch_id='%s'
and source_id='%s'
order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
area_code
=
get_stockAreaId_new_fromDb
(
dept_name
1
,
1
)
sql1
=
"select area_name from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
)
area_name
=
process_tuple
(
get_id
(
sql1
))
source_id
=
id1
source_id
=
None
rec_user
=
get_login_user_uxid
()
sql1
=
"select rec_addr from mcms_pur_plan where branch_id='%s'
and source_id='%s'
order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
sql1
=
"select rec_addr from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
)
rec_addr
=
process_tuple
(
get_id
(
sql1
))
sql
=
"select bill_expdt_date from mcms_pur_plan where branch_id='%s'
and source_id='%s'
order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
sql
=
"select bill_expdt_date from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
)
print
(
sql
)
bill_expdt_date
=
get_expdt_date
(
sql
)
bill_expdt_date
=
None
buyBillId
=
id1
planBillId
=
id2
buyOrderNo
=
buyOrderNo1
create_user
=
rec_user
create_time
=
get_create_time
(
"select create_time from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
))
last_modified
=
create_time
"select create_time from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
))
last_modified
=
get_create_time
(
"select last_modified from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
))
last_modified_user
=
create_user
planOrderNo
=
PLAN_order_no
if
type
==
16
:
# 验证子表数据
check_mcms_mcms_pur_plan_detail
(
id2
,
type
,
planOrderNo
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pur_plan'
,
id2
,
PLAN_order_no
,
hos_id
,
'mcms_pur_plan
_0927
'
,
id2
,
PLAN_order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
source_id
,
rec_user
,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
rec_addr
,
bill_expdt_date
,
planBillId
,
planOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
20
:
check_mcms_mcms_pur_plan_detail
(
id2
,
type
,
planOrderNo
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pur_plan2'
,
id2
,
PLAN_order_no
,
hos_id
,
'mcms_pur_plan2
_0927
'
,
id2
,
PLAN_order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
source_id
,
rec_user
,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
rec_addr
,
bill_expdt_date
,
planBillId
,
planOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
66
:
check_mcms_mcms_pur_plan_detail
(
id2
,
type
,
planOrderNo
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pur_plan3'
,
id2
,
PLAN_order_no
,
hos_id
,
'mcms_pur_plan3
_0927
'
,
id2
,
PLAN_order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
source_id
,
rec_user
,
rec_addr
,
bill_expdt_date
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
rec_addr
,
bill_expdt_date
,
planBillId
,
planOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
None
...
...
@@ -182,13 +185,15 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
create_time
=
get_create_time
(
"select create_time from mcms_pur_plan_detail where id='%s';"
%
(
id2
))
last_modified
=
create_time
last_modified
=
get_create_time
(
"select last_modified from mcms_pur_plan_detail where id='%s';"
%
(
id2
))
sub_prov_name
=
prov_name
source_id
=
process_tuple
(
get_id
(
"select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';"
%
(
hos_goods_id
,
id2
)))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pur_plan_detail'
,
id2
,
pid
,
planOrderNo
,
source_id
,
hos_goods_id
,
'mcms_pur_plan_detail
_0927
'
,
id2
,
pid
,
planOrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
supply_id
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
create_user
,
create_time
,
last_modified
,
last_modified_user
...
...
@@ -220,7 +225,7 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
get_id
(
"select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';"
%
(
hos_goods_id
,
id2
)))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pur_plan_detail2'
,
id2
,
pid
,
planOrderNo
,
source_id
,
'mcms_pur_plan_detail2
_0927
'
,
id2
,
pid
,
planOrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
supply_id
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
...
...
@@ -255,7 +260,7 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
get_id
(
"select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';"
%
(
hos_goods_id
,
id2
)))
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_pur_plan_detail3'
,
id2
,
pid
,
planOrderNo
,
source_id
,
'mcms_pur_plan_detail3
_0927
'
,
id2
,
pid
,
planOrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
pkg_def_id
,
supply_id
,
prov_id
,
prov_name
,
sub_prov_id
,
sub_prov_name
,
...
...
@@ -279,7 +284,304 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
# 检查采购订单
def
check_mcms_purchase
(
type
=
16
):
branch_id
=
get_branch_id
()
# 获取采购订单主键id
sql
=
"select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
print
(
sql
)
id1
=
process_tuple
(
get_dept_buy_id
(
sql
))
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
)
print
(
sql
)
order_no
=
process_tuple
(
get_dept_buy_id
(
sql
))
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
)
print
(
sql
)
buyBillId
=
process_tuple
(
get_dept_buy_id
(
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;"
%
(
branch_id
,
type
,
id1
)
print
(
sql1
)
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql1
)
print
(
'actual'
,
actual
)
hos_id
=
get_hosid
()
dept_id1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
dept_name1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
dept_name2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
rec_org_id
=
process_tuple
(
get_id
(
"select id from sys_org where branch_id='%s' and ename='%s';"
%
(
branch_id
,
dept_name2
)))
rec_org_name
=
dept_name2
info
=
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"库区信息"
,
'message22'
)
list_a
=
info
[
'list_a'
]
area_code
=
get_stockAreaId_new_fromDb
(
dept_name2
,
2
)
sql1
=
"select area_name from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
area_name
=
process_tuple
(
get_id
(
sql1
))
rec_user
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
]
# rec_user = get_login_user_uxid()
sql1
=
"select rec_addr from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
)
rec_addr
=
process_tuple
(
get_id
(
sql1
))
sql
=
"select bill_expdt_date from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
buyBillId
)
print
(
sql
)
bill_expdt_date
=
get_expdt_date
(
sql
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
))
last_modified
=
get_create_time
(
"select last_modified from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
))
last_modified_user
=
create_user
last_auditor
=
rec_user
last_audit_time
=
get_create_time
(
"select last_audit_time from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
id1
))
if
type
==
16
:
# 验证子表数据
check_mcms_purchase_detail
(
id1
,
type
,
order_no
)
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
planBillId
=
process_tuple
(
get_id
(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
planOrderNo
=
process_tuple
(
get_id
(
"select order_no from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
sql
=
"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
)
print
(
sql
)
buyOrderNo
=
process_tuple
(
get_dept_buy_id
(
sql
))
purOrderNo
=
order_no
purBillId
=
id1
prov_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
prov_name
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
exe_prov_id
=
prov_id
exe_prov_name
=
prov_name
close_date
=
get_create_time
(
"select close_date from mcms_purchase where id='%s';"
%
(
id1
))
source_id
=
planBillId
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_purchase'
,
id1
,
order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
bill_expdt_date
,
source_id
,
rec_user
,
rec_addr
,
prov_id
,
prov_name
,
exe_prov_id
,
exe_prov_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
close_date
,
create_user
,
create_time
,
last_modified
,
last_auditor
,
last_audit_time
)
elif
type
==
20
:
# 检查采购订单子表
check_mcms_purchase_detail
(
id1
,
type
,
order_no
)
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message1'
)[
"hosGoodsId"
]
planBillId
=
process_tuple
(
get_id
(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
planOrderNo
=
process_tuple
(
get_id
(
"select order_no from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
sql
=
"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
)
print
(
sql
)
buyOrderNo
=
process_tuple
(
get_dept_buy_id
(
sql
))
purOrderNo
=
order_no
purBillId
=
id1
prov_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
prov_name
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
exe_prov_id
=
prov_id
exe_prov_name
=
prov_name
close_date
=
get_create_time
(
"select close_date from mcms_purchase where id='%s';"
%
(
id1
))
source_id
=
planBillId
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_purchase2'
,
id1
,
order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
bill_expdt_date
,
source_id
,
rec_user
,
rec_addr
,
prov_id
,
prov_name
,
exe_prov_id
,
exe_prov_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
close_date
,
create_user
,
create_time
,
last_modified
,
last_auditor
,
last_audit_time
)
elif
type
==
66
:
# 检查采购订单子表数据
check_mcms_purchase_detail
(
id1
,
type
,
order_no
)
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
planBillId
=
process_tuple
(
get_id
(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
planOrderNo
=
process_tuple
(
get_id
(
"select order_no from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
sql
=
"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
)
print
(
sql
)
buyOrderNo
=
process_tuple
(
get_dept_buy_id
(
sql
))
purOrderNo
=
order_no
purBillId
=
id1
prov_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_corpId"
]
prov_name
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
]
exe_prov_id
=
prov_id
exe_prov_name
=
prov_name
close_date
=
get_create_time
(
"select close_date from mcms_purchase where id='%s';"
%
(
id1
))
source_id
=
planBillId
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_purchase3'
,
id1
,
order_no
,
hos_id
,
get_branch_id
(),
dept_id1
,
dept_name1
,
rec_org_id
,
rec_org_name
,
area_code
,
area_name
,
bill_expdt_date
,
source_id
,
rec_user
,
rec_addr
,
prov_id
,
prov_name
,
exe_prov_id
,
exe_prov_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
close_date
,
create_user
,
create_time
,
last_modified
,
last_auditor
,
last_audit_time
)
else
:
expected
=
None
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_purchase_detail
(
id
,
type
,
OrderNo
):
branch_id
=
get_branch_id
()
# 根据采购订单主表的id获取采购订单子表主键
sql
=
"select id from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"
%
(
id
)
detail_main_key
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 采购订单单子表主键
sql
=
"select order_no from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"
%
(
id
)
PLAN_order_no
=
process_tuple
(
get_dept_buy_id
(
sql
))
# 采购计划单子表order_no
# 要验证的数据sql
sql1
=
"select * from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"
%
(
id
)
# 获取实际值
actual
=
check_mcms_pur_sql
(
sql1
)
print
(
'actual'
,
actual
)
hos_id
=
get_hosid
()
dept_id1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
dept_name1
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid1'
]
dept_name2
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
rec_org_id
=
process_tuple
(
get_id
(
"select id from sys_org where branch_id='%s' and ename='%s';"
%
(
branch_id
,
dept_name2
)))
rec_user
=
get_login_user_uxid
()
create_user
=
rec_user
# last_modified = create_time
last_modified_user
=
create_user
pid
=
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"
]
source_id
=
get_id
(
"select source_id from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"
%
id
)
if
check_source_id
(
hos_goods_id
,
source_id
)
==
True
:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
supply_id
=
get_supply_id
(
hos_goods_id
)
pkg_def_id
=
get_pkg_def_id
(
hos_goods_id
)
planBillId
=
process_tuple
(
get_id
(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;"
%
(
hos_goods_id
)))
sql
=
"select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
get_branch_id
(),
type
)
print
(
sql
)
buyBillId
=
process_tuple
(
get_dept_buy_id
(
sql
))
buyDetailId
=
get_id
(
"select id from mcms_dept_buy_detail where pid='%s';"
%
buyBillId
)
planDetailId
=
get_id
(
"select id from spd3_herp_test2.mcms_pur_plan_detail where pid='%s';"
%
planBillId
)
source_id
=
planDetailId
goodsGg
=
get_goods_gg
(
hos_goods_id
)
goodsCode
=
get_goods_code1
(
hos_goods_id
)
goodsName
=
get_goods_name
(
hos_goods_id
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_purchase_detail where id='%s';"
%
detail_main_key
)
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_purchase_detail'
,
detail_main_key
,
pid
,
OrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
supply_id
,
pkg_def_id
,
planBillId
,
buyDetailId
,
planDetailId
,
goodsGg
,
goodsCode
,
goodsName
,
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_purchase_detail1'
,
detail_main_key
,
pid
,
OrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
supply_id
,
pkg_def_id
,
planBillId
,
buyDetailId
,
planDetailId
,
goodsGg
,
goodsCode
,
goodsName
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_purchase_detail2'
,
detail_main_key
,
pid
,
OrderNo
,
source_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
supply_id
,
pkg_def_id
,
planBillId
,
buyDetailId
,
planDetailId
,
goodsGg
,
goodsCode
,
goodsName
,
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'
)
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
...
...
@@ -288,50 +590,29 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a5流程五_中心库
from
a_a5流程五_中心库入库结算_正结算1_提交采购计划
import
goods_move3
,
get_GoodsPkgDef
,
low_vaule_purchase_plan
,
approval_center
,
hight_vaule_purchase_plan
,
reagent_purchase_plan
def
main
():
token
,
projectCode1
,
uxid1
,
corpId1
,
info1
=
call_login
(
2
)
updateUserLoginDefaultRange
(
get_listUserMgrRangePage
(
1
))
# 设置登录账号默认权限是1级库
try
:
goods_move3
(
token
)
# 获取低值的hosGoodsId
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
get_GoodsPkgDef
(
hosGoodsId
,
token
)
# 获取单元包id
except
:
print
(
'流程五获取hosGoodsId出现错误,请检查脚本或者数据'
)
try
:
low_vaule_purchase_plan
(
token
,
uxid1
)
# token, projectCode1, uxid1, corpId1, info1 = call_login(2)
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是1级库
# goods_move3(token)
# # 获取低值的hosGoodsId
# hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# get_GoodsPkgDef(hosGoodsId,token) # 获取单元包id
# low_vaule_purchase_plan(token,uxid1)#低值采购计划提交
# time.sleep(6)
# check_mcms_mcms_pur_plan(16)#低值采购计划数据检查
# #审批
# approval_center(token)
# time.sleep(6)
check_mcms_purchase
(
16
)
#检查采购订单数据
hight_vaule_purchase_plan
(
token
,
uxid1
)
#高值采购计划提交
time
.
sleep
(
6
)
check_mcms_mcms_pur_plan
(
16
)
#低值采购计划数据检查
except
Exception
as
e
:
print
(
'低值采购计划提交出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
traceback
.
print_exc
()
#审批
try
:
approval_center
(
token
)
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
hight_vaule_purchase_plan
(
token
,
uxid1
)
except
Exception
as
e
:
print
(
'高值采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
(
token
)
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
reagent_purchase_plan
(
token
,
uxid1
)
except
Exception
as
e
:
print
(
'试剂采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
(
token
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
'出现错误,请检查脚本或者数据'
)
print
(
f
"发生错误:
{
e
}
"
)
print
(
"发生异常:"
,
str
(
e
))
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
main
()
\ No newline at end of file
report/summary.html
View file @
34b817c8
...
...
@@ -95,7 +95,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/r_b8库房管理_库区设置_同步库房信息/log.html'
target=
'_blank'
>
r_b8库房管理_库区设置_同步库房信息
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
8.
392
</td>
<td
class=
"details-col-elapsed"
>
8.
705
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
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