Commit 1a0ad915 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程十七脚本提交

parent 6d5b40bb
......@@ -8,7 +8,7 @@ from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import check_mcms_pur_plan_sql, get_DRID, get_login_user_uxid_bydb, get_create_time, \
get_buyBillId, get_PICK_order_no, get_PICK_id, get_planBillId, get_buyOrderNo, get_purOrderNo, get_purBillId, \
get_purBillDate2, get_distrBillId, get_distrOrderNo, get_mdm_goods_code1, get_goods_code1, get_pkg_def_id, \
check_mcms_dept_buy_sql, check_batch_id, check_barcode_id, get_pick_detail_id
check_mcms_dept_buy_sql, check_batch_id, check_barcode_id, get_pick_detail_id, get_expdt_date
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
......@@ -239,8 +239,165 @@ def check_mcms_psi_batch_out(DR_ID, type, order_no, source_id1):
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_pick(type=16):
branch_id = get_branch_id()
print('拣货单验证')
sql = " select * from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
id = get_id(
"select id from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
order_no = get_id(
"select order_no from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
source_id = get_buyBillId(branch_id, type)
dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_id = get_stockId_fromdb(dept_name + '中心库房')
area_code = get_stockAreaId_new_fromDb(dept_name, 1)
target_dept_id = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_corpId']
target_dept_name = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username']
target_stock_id = target_dept_id
target_area_code = None
username = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
reviewer = get_login_user_uxid_bydb(username)
review_date = get_expdt_date(
"select review_date from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
buyBillId = get_buyBillId(branch_id, type)
pickOrderNo = order_no
buyOrderNo = get_buyOrderNo(branch_id, type)
pickBillId = id
create_user = reviewer
create_time = get_expdt_date(
"select create_time from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
last_modified = get_expdt_date(
"select last_modified from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
last_modified_user=create_user
picker = create_user
picker_name = username
if type == 16:
#检查拣货单子表
check_mcms_pick_detail(id,type,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick1', id, get_hosid(), get_branch_id(), order_no, source_id,
dept_id,
dept_name, stock_id, area_code, target_dept_id, target_dept_name,
target_stock_id, target_area_code, reviewer,
review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
create_user, create_time, last_modified, last_modified_user,picker, picker_name
)
elif type == 20:
# 检查拣货单子表
check_mcms_pick_detail(id,type,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick2', id, get_hosid(), get_branch_id(), order_no, source_id,
dept_id,
dept_name, stock_id, area_code, target_dept_id, target_dept_name,
target_stock_id, target_area_code, reviewer,
review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
create_user, create_time, last_modified, last_modified_user,picker, picker_name
)
else:
# 检查拣货单子表
check_mcms_pick_detail(id, type, order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick3', id, get_hosid(), get_branch_id(), order_no, source_id,
dept_id,
dept_name, stock_id, area_code, target_dept_id, target_dept_name,
target_stock_id, target_area_code, reviewer,
review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
create_user, create_time, last_modified, last_modified_user,picker, picker_name
)
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_pick_detail(pid,type,order_no):
branch_id = get_branch_id()
print('拣货单子表检查')
sql = " select * from mcms_pick_detail where pid='%s';" % (
pid)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
id=get_id("select id from mcms_pick_detail where pid='%s';" % ( pid))
source_id=get_buyBillId(branch_id,type)
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)
create_user=picker
create_time=get_create_time("select create_time from mcms_pick_detail where pid='%s';" % (pid))
last_modified=get_create_time("select last_modified from mcms_pick_detail where pid='%s';" % (pid))
last_modified_user=create_user
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_detail1', id,pid,order_no,source_id,hos_goods_id
,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
create_user,create_time,last_modified,last_modified_user
)
elif type == 20:
pkg_def_id=None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_detail2', id,pid,order_no,source_id,hos_goods_id
,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
create_user,create_time,last_modified,last_modified_user
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_detail3', id,pid,order_no,source_id,hos_goods_id
,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
create_user,create_time,last_modified,last_modified_user
)
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')
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_c0流程十七退货业务_中心库退供应商.air')
......@@ -251,7 +408,8 @@ try:
# updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) #设置登录账号默认权限是1级库
# center_Stock_return_Out(2) #高值耗材退货出库
# time.sleep(6)
check_mcms_psi_out(2)
check_mcms_psi_out(2)#检查出库单主表和子表
check_mcms_pick(20) #检查拣货单主表和子表
center_Stock_return_Out(1) #低值耗材退货出库
time.sleep(6)
check_mcms_psi_out(1)
......
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