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
13248b6e
Commit
13248b6e
authored
Jul 17, 2024
by
xiao-hesheng
Browse files
数据库验证流程十一脚本编写
parent
8793bb93
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_b4流程十一请领业务流_二级库向直送_数据库验证.air/a_b4流程十一请领业务流_二级库向直送_数据库验证.py
View file @
13248b6e
...
@@ -6,7 +6,8 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
...
@@ -6,7 +6,8 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
from
air_case.public1.public1.public1
import
*
from
air_case.public1.public1.public1
import
*
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_tools
import
get_create_time
,
check_mcms_dept_buy_car_sql
,
get_dept_buy_id
,
\
from
common.db.sql.sql_tools
import
get_create_time
,
check_mcms_dept_buy_car_sql
,
get_dept_buy_id
,
\
check_mcms_dept_buy_sql
,
get_mdm_goods_code
,
get_expdt_date
,
check_mcms_pur_plan_sql
check_mcms_dept_buy_sql
,
get_mdm_goods_code
,
get_expdt_date
,
check_mcms_pur_plan_sql
,
check_in_check_mcms_purchase
from
common.db.sql.sql_tools_out
import
check_out_check_mcms_purchase
from
common.fileUtls
import
FileUtils
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
from
common.run_cmd_script
import
execute_command
...
@@ -1053,6 +1054,32 @@ def check_mcms_purchase_detail(id, type, planOrderNo):
...
@@ -1053,6 +1054,32 @@ def check_mcms_purchase_detail(id, type, planOrderNo):
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_purchase_out_and_in
():
sql
=
"select * from mcms_purchase order by create_time desc LIMIT 3;"
result_in
=
check_in_check_mcms_purchase
(
sql
)
result_out
=
check_out_check_mcms_purchase
(
sql
)
result
=
(
compare_text_index
(
result_in
,
result_out
))
print
(
result
)
print
(
result_in
)
print
(
result_out
)
i
=
0
while
True
:
if
i
==
1000
:
print
(
'采购订单同步到外网已经过去16分钟未完成,请检查同步是否出现问题'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
break
result_in
=
check_in_check_mcms_purchase
(
sql
)
result_out
=
check_out_check_mcms_purchase
(
sql
)
if
result_in
==
result_out
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
break
else
:
print
(
'error'
)
time
.
sleep
(
10
)
i
=
1
+
10
continue
try
:
try
:
...
@@ -1104,12 +1131,14 @@ try:
...
@@ -1104,12 +1131,14 @@ try:
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
()
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_accept_order
(
1
)
# 低值
check_accept_order
(
1
)
# 低值
...
...
air_case/public1/public1/public1.py
View file @
13248b6e
...
@@ -3193,10 +3193,11 @@ def second_dept_one_key_in(type=2):
...
@@ -3193,10 +3193,11 @@ def second_dept_one_key_in(type=2):
# # # # 发送请求
# # # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'一键入库result'
,
result
)
print
(
'一键入库result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
1010
:
if
code
==
1010
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
return
data
# 一键入库====================================================
# 一键入库====================================================
...
...
common/db/sql/sql_tools.py
View file @
13248b6e
...
@@ -176,5 +176,17 @@ def get_mdm_goods_code(sql):
...
@@ -176,5 +176,17 @@ def get_mdm_goods_code(sql):
results
=
cursor
.
fetchall
()
results
=
cursor
.
fetchall
()
cursor
.
close
()
cursor
.
close
()
return
results
return
results
def
check_in_check_mcms_purchase
(
sql
):
db
,
cursor
=
get_sql_conn
()
cursor
.
execute
(
sql
)
results
=
cursor
.
fetchone
()
str1
=
str
(
results
)
new_str1
=
str1
.
replace
(
',)'
,
''
)
new_str1
=
new_str1
.
replace
(
'('
,
''
)
new_str1
=
new_str1
.
replace
(
','
,
''
)
new_str1
=
new_str1
.
replace
(
"'"
,
''
)
# print(new_str1)
cursor
.
close
()
return
new_str1
# hos_goods_id = 'h034700004220'
# hos_goods_id = 'h034700004220'
# main2(hos_goods_id)
# main2(hos_goods_id)
\ No newline at end of file
common/db/sql/sql_tools_out.py
View file @
13248b6e
...
@@ -120,5 +120,17 @@ def get_mdm_goods_code(sql):
...
@@ -120,5 +120,17 @@ def get_mdm_goods_code(sql):
results
=
cursor
.
fetchall
()
results
=
cursor
.
fetchall
()
cursor
.
close
()
cursor
.
close
()
return
results
return
results
def
check_out_check_mcms_purchase
(
sql
):
db
,
cursor
=
get_sql_conn
()
cursor
.
execute
(
sql
)
results
=
cursor
.
fetchone
()
str1
=
str
(
results
)
new_str1
=
str1
.
replace
(
',)'
,
''
)
new_str1
=
new_str1
.
replace
(
'('
,
''
)
new_str1
=
new_str1
.
replace
(
','
,
''
)
new_str1
=
new_str1
.
replace
(
"'"
,
''
)
# print(new_str1)
cursor
.
close
()
return
new_str1
# hos_goods_id = 'h034700004220'
# hos_goods_id = 'h034700004220'
# main2(hos_goods_id)
# main2(hos_goods_id)
\ 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