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
e9d805ed
Commit
e9d805ed
authored
Jul 24, 2024
by
xiao-hesheng
Browse files
数据库验证流程十二脚本编写
parent
01888f18
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.air/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.py
View file @
e9d805ed
...
@@ -169,17 +169,17 @@ def check_accept_order(type=1):
...
@@ -169,17 +169,17 @@ def check_accept_order(type=1):
break
break
# ==============================查看订单详情==================
# ==============================查看订单详情==================
# ========设置验收全部合格
# ========设置验收全部合格
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
url
2
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
print
(
'check_barcode_save_url'
,
url
)
print
(
'check_barcode_save_url'
,
url
2
)
sourceBillId
=
sourceId
sourceBillId
=
sourceId
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
sourceBillId
,
viewId
)
request_body
2
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
sourceBillId
,
viewId
)
print
(
'设置验收全部合格request_body'
,
request_body
)
print
(
'设置验收全部合格request_body'
,
request_body
2
)
# 发送请求
# 发送请求
time
.
sleep
(
6
)
time
.
sleep
(
6
)
while
True
:
while
True
:
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
2
,
request_body
2
,
headers
)
print
(
'result'
,
result
)
print
(
'result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
...
@@ -218,6 +218,10 @@ def check_accept_order(type=1):
...
@@ -218,6 +218,10 @@ def check_accept_order(type=1):
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
0
:
if
code
==
0
:
break
break
else
:
result2
=
commonFuc
().
http_post
(
url2
,
request_body2
,
headers
)
print
(
'result2'
,
result2
)
continue
info
=
(
CHECK_NO
,
CHECK_NO
)
info
=
(
CHECK_NO
,
CHECK_NO
)
titlename
=
(
'CHECK_NO1'
,
'CHECK_NO2'
)
titlename
=
(
'CHECK_NO1'
,
'CHECK_NO2'
)
...
...
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
View file @
e9d805ed
...
@@ -291,23 +291,29 @@ def check_mcms_dept_buy(type=16):
...
@@ -291,23 +291,29 @@ def check_mcms_dept_buy(type=16):
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_psi_dept_batch
(
type
,
DR_ID
):
def
check_mcms_psi_dept_batch
(
type
,
DR_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
)
print
(
'actual'
,
actual
)
batch_main_key
=
get_id
(
"select id from mcms_psi_dept_batch where pid='%s';"
%
DR_ID
)
pid
=
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'
if
type
==
16
:
if
type
==
16
:
#子表检查
check_mcms_psi_dept_batch
(
type
,
DR_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'
,
'mcms_psi_dept1'
,
DR_ID
'mcms_psi_dept_batch1'
,
batch_main_key
,
pid
,
order_no
)
)
elif
type
==
20
:
elif
type
==
20
:
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
2'
,
DR_ID
)
'mcms_psi_dept
_batch2'
,
batch_main_key
,
pid
)
else
:
else
:
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
3'
,
DR_ID
)
'mcms_psi_dept
_batch3'
,
batch_main_key
,
pid
)
print
(
'expected'
,
expected
)
print
(
'expected'
,
expected
)
print
(
'aaaaaaaaaaaaaaaaa'
)
print
(
'aaaaaaaaaaaaaaaaa'
)
...
@@ -413,6 +419,14 @@ def check_mcms_psi_dept(type=16):
...
@@ -413,6 +419,14 @@ def check_mcms_psi_dept(type=16):
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_pick
(
type
=
16
):
branch_id
=
get_branch_id
()
print
(
'拣货单验证'
)
sql
=
" select * from mcms_pick where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_SL' order by CREATE_TIME desc LIMIT 1;"
%
(
branch_id
,
type
)
actual
=
check_mcms_dept_buy_sql
(
sql
)
print
(
actual
)
try
:
try
:
pro_path
=
commonFuc
().
get_pro_path2
()
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
print
(
'pro_path'
,
pro_path
)
...
@@ -474,9 +488,11 @@ try:
...
@@ -474,9 +488,11 @@ try:
# # # 低值拣货执行
# # # 低值拣货执行
# pick_execute()
# pick_execute()
# 上面暂时注释========================
# 上面暂时注释========================
#检查拣货单
check_mcms_pick
(
16
)
#检查出库单
#检查出库单
#
check_mcms_psi_dept(16)
check_mcms_psi_dept
(
16
)
#
check_mcms_psi_dept(20)
check_mcms_psi_dept
(
20
)
check_mcms_psi_dept
(
66
)
check_mcms_psi_dept
(
66
)
second_dept_one_key_in
(
5
)
second_dept_one_key_in
(
5
)
second_dept_one_key_in
(
5
)
second_dept_one_key_in
(
5
)
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
e9d805ed
...
@@ -75,4 +75,7 @@
...
@@ -75,4 +75,7 @@
"mcms_psi_dept1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
\ No newline at end of file
"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