Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
3915b26c
Commit
3915b26c
authored
9 months ago
by
xiao-hesheng
Browse files
Options
Download
Email Patches
Plain Diff
数据库验证流程十一脚本编写
parent
4c1279b8
master
core_flow
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
+57
-46
...4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
+0
-0
...程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
air_case/public1/public1/public1.py
+16
-9
air_case/public1/public1/public1.py
with
73 additions
and
55 deletions
+73
-55
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
+
57
-
46
View file @
3915b26c
...
...
@@ -1414,6 +1414,7 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_check
(
type
=
1
):
if
type
==
1
:
bill_mode
=
16
...
...
@@ -1441,9 +1442,9 @@ def check_mcms_check(type=1):
rec_org_name
=
get_rec_org_name
(
2
)
dept_id
=
rec_org_id
dept_name
=
rec_org_name
branch_id
=
get_branch_id
()
buyBillId
=
get_buyBillId
(
branch_id
,
bill_mode
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
bill_mode
)
branch_id
=
get_branch_id
()
buyBillId
=
get_buyBillId
(
branch_id
,
bill_mode
)
buyOrderNo
=
get_buyOrderNo
(
branch_id
,
bill_mode
)
if
type
==
1
:
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
elif
type
==
2
:
...
...
@@ -1452,30 +1453,32 @@ def check_mcms_check(type=1):
hos_goods_id
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message3'
)[
"hosGoodsId"
]
planBillId
=
get_planBillId
(
hos_goods_id
)
planOrderNo
=
get_planOrderNo
(
hos_goods_id
)
purOrderNo
=
get_purOrderNo
(
branch_id
,
bill_mode
)
purBillId
=
get_purBillId
(
branch_id
,
bill_mode
)
bill_relation_json
=
get_purBillDate
(
branch_id
,
bill_mode
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
distrBillId
=
get_distrBillId
(
branch_id
,
bill_mode
)
distrOrderNo
=
get_distrOrderNo
(
branch_id
,
bill_mode
)
checkBillId
=
check_no
checkOrderNo
=
order_no
create_user
=
get_login_user_uxid
()
sql
=
"select create_time from mcms_check where id='%s';"
%
check_no
create_time
=
get_create_time
(
sql
)
sql
=
"select last_modified from mcms_check where id='%s';"
%
check_no
last_modified
=
get_create_time
(
sql
)
last_modified_user
=
create_user
if
type
==
1
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
purOrderNo
=
get_purOrderNo
(
branch_id
,
bill_mode
)
purBillId
=
get_purBillId
(
branch_id
,
bill_mode
)
bill_relation_json
=
get_purBillDate
(
branch_id
,
bill_mode
)
purBillDate
=
reGetString
(
bill_relation_json
,
r
'purBillDate":"'
,
r
'""distrBillId'
)
distrBillId
=
get_distrBillId
(
branch_id
,
bill_mode
)
distrOrderNo
=
get_distrOrderNo
(
branch_id
,
bill_mode
)
checkBillId
=
check_no
checkOrderNo
=
order_no
create_user
=
get_login_user_uxid
()
sql
=
"select create_time from mcms_check where id='%s';"
%
check_no
create_time
=
get_create_time
(
sql
)
sql
=
"select last_modified from mcms_check where id='%s';"
%
check_no
last_modified
=
get_create_time
(
sql
)
last_modified_user
=
create_user
if
type
==
1
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
planBillId
,
planOrderNo
,
buyOrderNo
,
purOrderNo
,
purBillId
,
purBillDate
,
distrBillId
,
distrOrderNo
,
checkBillId
,
checkOrderNo
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
2
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
elif
type
==
2
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check1'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
...
...
@@ -1485,7 +1488,7 @@ def check_mcms_check(type=1):
create_time
,
last_modified
,
last_modified_user
)
else
:
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check2'
,
check_no
,
order_no
,
get_hosid
(),
get_branch_id
(),
source_id
,
source_no
,
prov_id
,
prov_name
,
rec_org_id
,
rec_org_name
,
dept_id
,
dept_name
,
buyBillId
,
...
...
@@ -1513,7 +1516,9 @@ def check_mcms_check(type=1):
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
):
def
check_mcms_check_batch
(
type
,
check_no
,
order_no
,
hos_goods_id
):
print
(
'数据库检查验收单子表'
)
if
type
==
1
:
bill_mode
=
16
...
...
@@ -1521,41 +1526,45 @@ def check_mcms_check_batch(type,check_no,order_no,hos_goods_id):
bill_mode
=
20
else
:
bill_mode
=
66
sql
=
"select * from mcms_check_batch where pid='%s'"
%
check_no
sql
=
"select * from mcms_check_batch where pid='%s'"
%
check_no
# 获取实际值
actual
=
check_mcms_pur_plan_sql
(
sql
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from mcms_check_batch where pid='%s'"
%
check_no
)
pid
=
check_no
branch_id
=
get_branch_id
()
distr_detail_id
=
get_distr_detail_id
(
branch_id
,
bill_mode
)
source_detail_id
=
distr_detail_id
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
sql
=
"select id from hdi_barcode where code_type='%s'order by create_time desc LIMIT 1;"
%
bill_mode
barcode_id
=
get_id
(
sql
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified
=
get_create_time
(
"select last_modified from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified_user
=
create_user
if
type
==
1
:
id
=
get_id
(
"select id from mcms_check_batch where pid='%s'"
%
check_no
)
pid
=
check_no
branch_id
=
get_branch_id
()
distr_detail_id
=
get_distr_detail_id
(
branch_id
,
bill_mode
)
source_detail_id
=
distr_detail_id
mdm_goods_code
=
get_mdm_goods_code1
(
hos_goods_id
)
goods_code
=
get_goods_code1
(
hos_goods_id
)
sql
=
"select id from hdi_barcode where code_type='%s'order by create_time desc LIMIT 1;"
%
bill_mode
barcode_id
=
get_id
(
sql
)
create_user
=
get_login_user_uxid
()
create_time
=
get_create_time
(
"select create_time from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified
=
get_create_time
(
"select last_modified from mcms_check_batch where pid='%s'"
%
check_no
)
last_modified_user
=
create_user
if
type
==
1
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
elif
type
==
2
:
elif
type
==
2
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch1'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'mcms_check_batch2'
,
id
,
pid
,
order_no
,
source_detail_id
,
distr_detail_id
,
hos_goods_id
,
mdm_goods_code
,
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
goods_code
,
barcode_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
...
...
@@ -1576,6 +1585,8 @@ def check_mcms_check_batch(type,check_no,order_no,hos_goods_id):
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
try
:
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
...
...
@@ -1632,7 +1643,7 @@ try:
for
i
in
list_data
:
check_mcms_purchase
(
int
(
i
))
#检查同步到外网的采购订单数据跟内网的是否一致
#
检查同步到外网的采购订单数据跟内网的是否一致
check_mcms_purchase_out_and_in
(
1
)
print
(
'检查同步到外网的采购订单数据跟内网的是否一致'
)
check_mcms_purchase_out_and_in
(
2
)
...
...
This diff is collapsed.
Click to expand it.
air_case/b6_spd3_core_business_flow_database_check/a_b5流程十二请领业务流_二级库向二级库_数据库验证.air/a_b5流程十二请领业务流_二级库向二级库_数据库验证.py
+
0
-
0
View file @
3915b26c
This diff is collapsed.
Click to expand it.
air_case/public1/public1/public1.py
+
16
-
9
View file @
3915b26c
...
...
@@ -2356,20 +2356,20 @@ def check_accept_order():
break
# ==============================查看订单详情==================
# ========设置验收全部合格
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
print
(
'check_barcode_save_url'
,
url
)
url
2
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"check_barcode_save_url"
)
print
(
'check_barcode_save_url'
,
url
2
)
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
2
'
,
request_body
2
)
# 发送请求
time
.
sleep
(
6
)
while
True
:
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
result
2
=
commonFuc
().
http_post
(
url
,
request_body
2
,
headers
)
print
(
'result
2
'
,
result
2
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
2
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
2
)
print
(
code
)
if
code
==
0
and
len
(
data
)
>=
1
:
break
...
...
@@ -2411,7 +2411,14 @@ def check_accept_order():
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
0
:
break
else
:
result2
=
commonFuc
().
http_post
(
url
,
request_body2
,
headers
)
print
(
'result2'
,
result2
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result2
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result2
)
print
(
code
)
if
code
==
0
and
len
(
data
)
>=
1
:
break
info
=
(
CHECK_NO
,
CHECK_NO
)
titlename
=
(
'CHECK_NO1'
,
'CHECK_NO2'
)
FileUtils
().
w_info8
(
info
,
'b5_spd3_core_business_flow'
,
'验收单号'
,
titlename
,
'message15'
)
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets