Commit 54e69d0d authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent 769f62d4
...@@ -1663,8 +1663,8 @@ def check_mcms_psi(type=1): ...@@ -1663,8 +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 = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
last_modified_user = create_user last_modified_user = create_user
if type == 1: if type == 1:
#检查子表 # 检查子表
check_mcms_psi_batch_in(id,bill_mode,order_no,source_id) check_mcms_psi_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1', 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, order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id target_dept_name, target_stock_id
...@@ -1905,10 +1905,10 @@ def check_mcms_psi_dept_in(type=16): ...@@ -1905,10 +1905,10 @@ def check_mcms_psi_dept_in(type=16):
checkOrderNo = get_checkOrderNo(branch_id, bill_mode) checkOrderNo = get_checkOrderNo(branch_id, bill_mode)
psiInBillId = get_psiInBillId(branch_id, bill_mode) psiInBillId = get_psiInBillId(branch_id, bill_mode)
psiInOrderNo = get_psiInOrderNo(branch_id, bill_mode) psiInOrderNo = get_psiInOrderNo(branch_id, bill_mode)
planOrderNo=get_planOrderNo(hos_goods_id) planOrderNo = get_planOrderNo(hos_goods_id)
if type == 16: if type == 16:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_in(id,type,order_no,source_id) check_mcms_psi_dept_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_in_4', id, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept_in_4', id, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -1924,7 +1924,7 @@ def check_mcms_psi_dept_in(type=16): ...@@ -1924,7 +1924,7 @@ def check_mcms_psi_dept_in(type=16):
elif type == 20: elif type == 20:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_in(id, type, order_no,source_id) check_mcms_psi_dept_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_in_5', id, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept_in_5', id, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -1940,7 +1940,7 @@ def check_mcms_psi_dept_in(type=16): ...@@ -1940,7 +1940,7 @@ def check_mcms_psi_dept_in(type=16):
else: else:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_in(id, type, order_no,source_id) check_mcms_psi_dept_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_in_6', id, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept_in_6', id, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -1953,7 +1953,6 @@ def check_mcms_psi_dept_in(type=16): ...@@ -1953,7 +1953,6 @@ def check_mcms_psi_dept_in(type=16):
psiDeptOutBillId, psiDeptOutOrderNo, psiDeptInBillId, psiDeptInOrderNo, psiDeptOutBillId, psiDeptOutOrderNo, psiDeptInBillId, psiDeptInOrderNo,
create_user, create_time, last_modified, last_modified_user) create_user, create_time, last_modified, last_modified_user)
print('expected', expected) print('expected', expected)
print('aaaaaaaaaaaaaaaaa') print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual) actual_value1 = get_process_list2(actual)
...@@ -1973,7 +1972,8 @@ def check_mcms_psi_dept_in(type=16): ...@@ -1973,7 +1972,8 @@ def check_mcms_psi_dept_in(type=16):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1):
def check_mcms_psi_dept_batch_in(DR_ID, type, order_no, source_id1):
branch_id = get_branch_id() branch_id = get_branch_id()
sql = " select * from mcms_psi_dept_batch where pid='%s';" % ( sql = " select * from mcms_psi_dept_batch where pid='%s';" % (
DR_ID) DR_ID)
...@@ -1982,8 +1982,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1): ...@@ -1982,8 +1982,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1):
batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID) batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
pid = DR_ID pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % 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' source_detail_id = source_id1 + '0001'
pick_detail_id=None pick_detail_id = None
if type == 16: if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20: elif type == 20:
...@@ -1995,47 +1995,53 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1): ...@@ -1995,47 +1995,53 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1):
pkg_def_id = get_pkg_def_id(hos_goods_id) pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1'] picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name) picker = get_login_user_uxid_bydb(picker_name)
source_batch_id=get_id("select source_batch_id from mcms_psi_dept_batch where pid='%s';" % DR_ID) source_batch_id = get_id("select source_batch_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
target_batch_id=source_batch_id target_batch_id = source_batch_id
if check_batch_id(source_batch_id)==True: if check_batch_id(source_batch_id) == True:
print('ok') print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id=get_id("select barcode_id from mcms_psi_dept_batch where pid='%s';" % DR_ID) barcode_id = get_id("select barcode_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id)==True: if check_barcode_id(barcode_id) == True:
print('ok') print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code= get_stockAreaId_new_fromDb(dept_name, 2) 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_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) 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 = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified_user = create_user last_modified_user = create_user
if type == 16: if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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 'mcms_psi_dept_batch_in4', batch_main_key, pid, order_no,
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id, source_detail_id
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified , 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: elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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 'mcms_psi_dept_batch_in5', batch_main_key, pid, order_no,
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id, source_detail_id
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified , 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: else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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 'mcms_psi_dept_batch_in6', batch_main_key, pid, order_no,
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id, source_detail_id
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified , 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
) )
...@@ -2058,7 +2064,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1): ...@@ -2058,7 +2064,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type,order_no,source_id1):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1):
def check_mcms_psi_batch_in(DR_ID, type, order_no, source_id1):
if type == 1: if type == 1:
bill_mode = 16 bill_mode = 16
elif type == 2: elif type == 2:
...@@ -2073,11 +2080,11 @@ def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1): ...@@ -2073,11 +2080,11 @@ def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1):
batch_main_key = get_id("select id from mcms_psi_batch where pid='%s';" % DR_ID) batch_main_key = get_id("select id from mcms_psi_batch where pid='%s';" % DR_ID)
pid = DR_ID pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % 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' source_detail_id = source_id1 + '0001'
pick_detail_id=None pick_detail_id = None
if type == 16: if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20: elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else: else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
...@@ -2086,48 +2093,49 @@ def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1): ...@@ -2086,48 +2093,49 @@ def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1):
pkg_def_id = get_pkg_def_id(hos_goods_id) pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1'] picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name) 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) source_batch_id = get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
distrBillId=get_distrBillId(branch_id,bill_mode) distrBillId = get_distrBillId(branch_id, bill_mode)
target_batch_id=get_id("select id from mcms_hos_batch where hos_goods_id='%s' order by create_time desc LIMIT 1;" % hos_goods_id) target_batch_id = get_id(
if check_batch_id(source_batch_id)==True: "select id from mcms_hos_batch where hos_goods_id='%s' order by create_time desc LIMIT 1;" % hos_goods_id)
if check_batch_id(source_batch_id) == True:
print('ok') print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id=get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID) barcode_id = get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id)==True: if check_barcode_id(barcode_id) == True:
print('ok') print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code= get_stockAreaId_new_fromDb(dept_name, 2) shelf_code = get_stockAreaId_new_fromDb(get_branch_name()+'中心库房', 1)
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_batch where pid='%s';" % DR_ID) create_time = get_create_time("select create_time from mcms_psi_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 = get_create_time("select last_modified from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified_user = create_user last_modified_user = create_user
if type == 16: if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in4', batch_main_key, pid, order_no,source_detail_id 'mcms_psi_batch_in1', batch_main_key, pid, order_no, source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_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 target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified,last_modified_user
) )
elif type == 20: elif type == 2:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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 'mcms_psi_batch_in2', batch_main_key, pid, order_no, source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_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 target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified,last_modified_user
) )
else: else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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 'mcms_psi_batch_in3', batch_main_key, pid, order_no, source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_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 target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified,last_modified_user
) )
...@@ -2149,6 +2157,8 @@ def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1): ...@@ -2149,6 +2157,8 @@ def check_mcms_psi_batch_in(DR_ID,type,order_no,source_id1):
else: else:
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
try: try:
pro_path = commonFuc().get_pro_path2() pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path) print('pro_path', pro_path)
......
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