Commit 4f4adc1c authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent b8536fc4
......@@ -1663,6 +1663,8 @@ def check_mcms_psi(type=1):
last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
last_modified_user = create_user
if type == 1:
#检查子表
check_mcms_psi_batch_in(id,bill_mode,order_no,source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
......@@ -2035,6 +2037,91 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1):
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1):
branch_id = get_branch_id()
sql = " select * from mcms_psi_batch where pid='%s';" % (
DR_ID)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
batch_main_key = get_id("select id from mcms_psi_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_id1+'0001'
pick_detail_id=None
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id=get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
target_batch_id=source_batch_id
if check_batch_id(source_batch_id)==True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id=get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id)==True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code= get_stockAreaId_new_fromDb(dept_name, 2)
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_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified_user = create_user
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in4', batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified
)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in5', batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in6',batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified
)
print('expected', expected)
......
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