Commit c7d39393 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent e49dbfbc
...@@ -890,5 +890,8 @@ def main(): ...@@ -890,5 +890,8 @@ def main():
try: try:
main() main()
except: except Exception as e:
commonFuc().check_text_exist_result_text('error ', '1') # 打印错误信息
print(f"发生错误: {e}")
commonFuc().check_text_exist_result_text('error', '1')
...@@ -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 check_mcms_dept_buy_sql, get_PICK_id, get_buyBillId, get_PICK_order_no, \ from common.db.sql.sql_tools import check_mcms_dept_buy_sql, get_PICK_id, get_buyBillId, get_PICK_order_no, \
get_buyOrderNo, get_login_user_uxid_bydb, get_create_time, get_account_date get_buyOrderNo, get_login_user_uxid_bydb, get_create_time, get_account_date, get_pick_detail_id, \
get_mdm_goods_code1, get_goods_code1, get_pkg_def_id, check_batch_id, check_barcode_id
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
...@@ -310,18 +311,17 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -310,18 +311,17 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
branch_id, type1) branch_id, type1)
actual = check_mcms_dept_buy_sql(sql) actual = check_mcms_dept_buy_sql(sql)
print(actual) print(actual)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单id", 'message26') DR_ID=get_id(" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_CB' order by CREATE_TIME desc LIMIT 1;" % (
DR_ID=get_id(" select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_CB' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type1)) branch_id, type1))
sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID
order_no = get_id(sql) order_no = get_id(sql)
target_corp_id = get_hosid() target_corp_id = get_hosid()
target_branch_id = get_branch_id() target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5'] target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5'] target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
target_stock_id = get_stockId_fromdb(target_dept_name + '库房') target_stock_id = get_stockId_fromdb(target_dept_name + '库房')
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2) target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2)
PICK_id = get_PICK_id(branch_id, type) PICK_id = get_PICK_id(branch_id, type1)
source_id = PICK_id source_id = PICK_id
source_corp_id = get_hosid() source_corp_id = get_hosid()
source_branch_id = get_branch_id() source_branch_id = get_branch_id()
...@@ -329,17 +329,17 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -329,17 +329,17 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
source_stock_id = get_stockId_fromdb(source_dept_name + '库房') source_stock_id = get_stockId_fromdb(source_dept_name + '库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2) source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2)
buyBillId = get_buyBillId(branch_id, type) buyBillId = get_buyBillId(branch_id, type1)
pickOrderNo = get_PICK_order_no(branch_id, type) pickOrderNo = get_PICK_order_no(branch_id, type1)
buyOrderNo = get_buyOrderNo(branch_id, type) buyOrderNo = get_buyOrderNo(branch_id, type1)
pickBillId = get_PICK_id(branch_id, type) pickBillId = get_PICK_id(branch_id, type1)
psiDeptOutBillId = DR_ID psiDeptOutBillId = DR_ID
psiDeptOutOrderNo = order_no psiDeptOutOrderNo = order_no
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_dept where id='%s';" % DR_ID) create_time = get_create_time("select create_time from mcms_psi_dept where id='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID) last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID)
last_modified_user = create_user last_modified_user = create_user
if type == 16: if type1 == 16:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID,type,order_no) check_mcms_psi_dept_batch(DR_ID,type,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
...@@ -352,7 +352,7 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -352,7 +352,7 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
, create_user, create_time, last_modified, last_modified_user , create_user, create_time, last_modified, last_modified_user
) )
elif type == 20: elif type1 == 20:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID, type, order_no) check_mcms_psi_dept_batch(DR_ID, type, order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
...@@ -394,14 +394,14 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -394,14 +394,14 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b7流程十四退库业务_消耗退库.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b7流程十四退库业务_消耗退库.air')
from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_consume_Out_Stock,second_dept_consume_in_Stock
try: try:
pro_path = commonFuc().get_pro_path2() # updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
print('pro_path', pro_path) # sCan_grant(1) # 低值扫码发放
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b7流程十四退库业务_消耗退库.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b7流程十四退库业务_消耗退库.air')
from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_consume_Out_Stock,second_dept_consume_in_Stock
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
sCan_grant(1) # 低值扫码发放
check_mcms_psi_dept_out_and_in(16,10) check_mcms_psi_dept_out_and_in(16,10)
# check_mcms_psi_dept_in(10) # check_mcms_psi_dept_in(10)
sCan_grant(3) # 试剂扫码发放 sCan_grant(3) # 试剂扫码发放
...@@ -412,5 +412,7 @@ try: ...@@ -412,5 +412,7 @@ try:
second_dept_consume_Out_Stock(3) # 试剂消耗出库 second_dept_consume_Out_Stock(3) # 试剂消耗出库
second_dept_consume_in_Stock(3) # 试剂消耗退回入库 second_dept_consume_in_Stock(3) # 试剂消耗退回入库
commonFuc().check_text_exist_result_text('SUCCESS', 'SUCCESS') commonFuc().check_text_exist_result_text('SUCCESS', 'SUCCESS')
except: except Exception as e:
# 打印错误信息
print(f"发生错误: {e}")
commonFuc().check_text_exist_result_text('error', 'SUCCESS') commonFuc().check_text_exist_result_text('error', 'SUCCESS')
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