Commit 13248b6e authored by xiao-hesheng's avatar xiao-hesheng
Browse files

数据库验证流程十一脚本编写

parent 8793bb93
...@@ -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) # 低值
......
...@@ -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
# 一键入库==================================================== # 一键入库====================================================
......
...@@ -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
...@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment