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
1db7efb0
Commit
1db7efb0
authored
Jul 17, 2024
by
xiao-hesheng
Browse files
数据库验证流程十一脚本编写
parent
480efd2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air/a_b4流程十一请领业务流_二级库向直送.py
View file @
1db7efb0
...
@@ -348,10 +348,10 @@ def purchase_module_process():
...
@@ -348,10 +348,10 @@ def purchase_module_process():
closeStatus
=
commonFuc
().
analysis_json
(
'closeStatus'
,
data1
)
closeStatus
=
commonFuc
().
analysis_json
(
'closeStatus'
,
data1
)
id2
=
commonFuc
().
analysis_json
(
'id'
,
data1
)
id2
=
commonFuc
().
analysis_json
(
'id'
,
data1
)
inSettlement
=
1
inSettlement
=
1
planPkgQty
=
commonFuc
().
analysis_json
(
'planPkgQty'
,
data1
)
#
planPkgQty = commonFuc().analysis_json('planPkgQty', data1)
planPkgQty
=
int
(
float
(
planPkgQty
))
#
planPkgQty = int(float(planPkgQty))
pkgDefQty
=
commonFuc
().
analysis_json
(
'pkgDefQty'
,
data1
)
#
pkgDefQty = commonFuc().analysis_json('pkgDefQty', data1)
pkgDefQty
=
int
(
float
(
pkgDefQty
))
#
pkgDefQty = int(float(pkgDefQty))
provId
=
commonFuc
().
analysis_json
(
'provId'
,
data1
)
provId
=
commonFuc
().
analysis_json
(
'provId'
,
data1
)
provName
=
commonFuc
().
analysis_json
(
'provName'
,
data1
)
provName
=
commonFuc
().
analysis_json
(
'provName'
,
data1
)
subProvId
=
commonFuc
().
analysis_json
(
'subProvId'
,
data1
)
subProvId
=
commonFuc
().
analysis_json
(
'subProvId'
,
data1
)
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
View file @
1db7efb0
...
@@ -516,10 +516,14 @@ def check_mcms_mcms_pur_plan(type=16):
...
@@ -516,10 +516,14 @@ def check_mcms_mcms_pur_plan(type=16):
info
=
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"库区信息"
,
'message22'
)
info
=
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"库区信息"
,
'message22'
)
list_a
=
info
[
'list_a'
]
list_a
=
info
[
'list_a'
]
area_code
=
commonFuc
().
analysis_json
(
'shelfCode'
,
list_a
)
area_code
=
commonFuc
().
analysis_json
(
'shelfCode'
,
list_a
)
area_name
=
'默认库区'
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_name
=
process_tuple
(
get_id
(
sql1
))
source_id
=
id1
source_id
=
id1
rec_user
=
get_login_user_uxid
()
rec_user
=
get_login_user_uxid
()
rec_addr
=
'自动化测试'
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
)
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;"
%
(
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
)
branch_id
,
id1
)
print
(
sql
)
print
(
sql
)
...
@@ -1084,6 +1088,7 @@ def check_mcms_purchase_out_and_in(type=1):
...
@@ -1084,6 +1088,7 @@ def check_mcms_purchase_out_and_in(type=1):
continue
continue
def
check_hdi_distr
(
type
=
16
):
def
check_hdi_distr
(
type
=
16
):
from
common.db.sql.sql_tools_out
import
check_mcms_pur_plan_sql
,
get_id
branch_id
=
get_branch_id
()
branch_id
=
get_branch_id
()
#验证配送单主表
#验证配送单主表
sql
=
"select * from hdi_distr where branch_id = '%s' and bill_mode='%s'order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
sql
=
"select * from hdi_distr where branch_id = '%s' and bill_mode='%s'order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
)
...
@@ -1091,23 +1096,69 @@ def check_hdi_distr(type=16):
...
@@ -1091,23 +1096,69 @@ def check_hdi_distr(type=16):
actual
=
check_mcms_pur_plan_sql
(
sql
)
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
hos_id
=
get_hosid
()
hos_id
=
get_hosid
()
# 获取采购订单id
purchase_id
=
get_id
(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
# 查询配送单主键
distr_main_key
=
get_id
(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
# 查询配送单order_no
distr_order_no
=
get_id
(
"select order_no from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
distr_main_key
,
type
))
#从采购订单获取source_id
source_id
=
get_id
(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
pur_bill_id
=
source_id
rec_user
=
'自动化测试w&vqF'
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;"
%
(
branch_id
,
type
)
print
(
sql
)
buyBillId
=
process_tuple
(
get_dept_buy_id
(
sql
))
purBillDate
distrBillId
distrOrderNo
distrUser
=
'p1e35e:UID-052165'
create_user
=
'p1e35e:UID-052165'
create_user_name
=
'国药集团公司S57ui'
create_time
last_modified_user
if
type
==
16
:
if
type
==
16
:
# 验证子表数据
# 验证子表数据
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
#获取采购订单id
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
purchase_id
=
get_id
(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
#查询配送单主键
distr_main_key
=
get_id
(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"
%
(
branch_id
,
type
))
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
))
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
)
purOrderNo
=
process_tuple
(
get_dept_buy_id
(
sql
))
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
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_purchase'
,
id1
,
order_no
,
hos_id
,
'mcms_purchase'
,
distr_main_key
,
distr_order_no
,
hos_id
,
get_hosname
(),
get_branch_id
(),
source_id
,
pur_bill_id
,
prov_id
,
prov_name
,
exe_prov_id
,
exe_prov_name
,
pur_dept_id
,
pur_dept_name
,
rec_org_id
,
rec_org_name
,
rec_user
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
:
elif
type
==
20
:
...
@@ -1215,49 +1266,49 @@ try:
...
@@ -1215,49 +1266,49 @@ try:
from
a_b4流程十一请领业务流_二级库向直送
import
check_accept_order
from
a_b4流程十一请领业务流_二级库向直送
import
check_accept_order
for
i
in
range
(
1
):
for
i
in
range
(
1
):
#
goods_move2() # 设置产品出库渠道为直送
goods_move2
()
# 设置产品出库渠道为直送
# #
#
低值
# # 低值
#
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message2'
)[
'hosGoodsId'
],
1
)
#
check_mcms_dept_buy_car(1)
check_mcms_dept_buy_car
(
1
)
# #
#
高值
# # 高值
#
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message1'
)[
'hosGoodsId'
],
2
)
#
check_mcms_dept_buy_car(2)
check_mcms_dept_buy_car
(
2
)
# #
#
试剂
# # 试剂
#
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
second_dept_Request
(
FileUtils
().
r_info8
(
"b5_spd3_core_business_flow"
,
"产品审核信息"
,
'message3'
)[
'hosGoodsId'
],
3
)
#
check_mcms_dept_buy_car(3)
check_mcms_dept_buy_car
(
3
)
#
BuyCarSubmit() # 请领车提交
BuyCarSubmit
()
# 请领车提交
#
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_dept_buy(int(i))
check_mcms_dept_buy
(
int
(
i
))
#
mcms_dept_buy_detail(int(i))
mcms_dept_buy_detail
(
int
(
i
))
#
for i in range(6): # 三个单据共审批6次
for
i
in
range
(
6
):
# 三个单据共审批6次
#
approval_center()
approval_center
()
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_dept_buy_approval_after(int(i))
check_mcms_dept_buy_approval_after
(
int
(
i
))
#
mcms_dept_buy_detail_approval_after(int(i))
mcms_dept_buy_detail_approval_after
(
int
(
i
))
#
#
#
检查自动生成的采购计划数据
# 检查自动生成的采购计划数据
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_mcms_pur_plan(int(i))
check_mcms_mcms_pur_plan
(
int
(
i
))
#
#
采购模块处理
# 采购模块处理
#
purchase_module_process()
purchase_module_process
()
#
#
for i in range(3): # 三个单据共审批3次
for
i
in
range
(
3
):
# 三个单据共审批3次
#
approval_center()
approval_center
()
#
#
list_data = ['16', '20', '66']
list_data
=
[
'16'
,
'20'
,
'66'
]
#
for i in list_data:
for
i
in
list_data
:
#
check_mcms_purchase(int(i))
check_mcms_purchase
(
int
(
i
))
#
#
#检查同步到外网的采购订单数据跟内网的是否一致
#检查同步到外网的采购订单数据跟内网的是否一致
#
check_mcms_purchase_out_and_in(1)
check_mcms_purchase_out_and_in
(
1
)
#
check_mcms_purchase_out_and_in(2)
check_mcms_purchase_out_and_in
(
2
)
#
order_dp(1) # 1低值
order_dp
(
1
)
# 1低值
#
order_dp(2) # 2高值
order_dp
(
2
)
# 2高值
#
order_dp(3) # 3试剂
order_dp
(
3
)
# 3试剂
# 上面暂时注释=========================================
# 上面暂时注释=========================================
check_hdi_distr
()
check_hdi_distr
()
check_accept_order
(
1
)
# 低值
check_accept_order
(
1
)
# 低值
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
1db7efb0
...
@@ -40,4 +40,4 @@
...
@@ -40,4 +40,4 @@
"mcms_purchase2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":20}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"mcms_purchase2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":20}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"mcms_purchase3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":60}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"mcms_purchase3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":60}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"hdi_distr": '{"id": "PSh0347202407160001", "order_no": "PSh0347202407160001", "bill_mode": "16", "rec_type": "YND", "hos_id": "h0347", "hos_name": "邹城市人民医院(test)", "branch_id": "h0347-3755", "source_id": "Ch034720240716000007", "source_type": "CGD", "pur_bill_id": "Ch034720240716000007", "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "sub_send_flag": 10, "exe_prov_id": "p1e35e", "exe_prov_name": "国药集团公司S57ui", "settlement": None, "pur_dept_id": "63c734f07fcc422ea80f49ca8e5bbd95", "pur_dept_name": "设备科001", "rec_org_id": "63c734f07fcc422ea80f49ca8e5bbd95", "rec_org_name": "设备科001", "rec_user": "自动化测试w&vqF", "rec_phone": "xhs", "rec_addr": "自动化测试", "bill_relation_json": "{"planBillId":"Ph034720240716029565","planOrderNo":"PLAN2024071632920","purOrderNo":"CG2024071621454","purBillId":"Ch034720240716000007","purBillDate":"2024-07-16 08:11:19","distrBillId":"PSh0347202407160001","distrOrderNo":"PSh0347202407160001"}", "ext_info": "{"epidemicFlag":0,"purMode":10,"distrUser":"p1e35e:UID-052165"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 40, "tb_status": 25, "create_user": "p1e35e:UID-052165", "create_user_name": "国药集团公司S57ui", "create_time": datetime.datetime(2024, 7, 16, 8, 11, 42), "last_modified": datetime.datetime(2024, 7, 16, 8, 12, 53), "last_modified_user": "h0347_UID-051420", "version": 2, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
"hdi_distr": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "None", "rec_addr": "设备科001", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":10,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 40, "tb_status": 25, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
\ 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