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

流程八脚本提交

parent b3788760
...@@ -331,17 +331,17 @@ def out_return_gt(): ...@@ -331,17 +331,17 @@ def out_return_gt():
def dept2_set(): def dept2_set():
#设置部门用户 #设置库管人员路径 库房管理-库区设置-编辑库房-人员管理-添加人员
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'], set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2) FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
# 设置部门负责人 # 设置科室负责人
set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]) # 设置二级科室负责人 set_dept_lead_new(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]) # 设置二级科室负责人
get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'], get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2) FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
deptName2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] deptName2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
# 设置库区联系人
set_stockShelf_Linkman(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"], set_stockShelf_Linkman(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"],
get_stockAreaId2_new_fromDb(deptName2, 2)) # 设置库区联系人 get_stockAreaId2_new_fromDb(deptName2, 2))
# 跟台退货出库确认======================== # 跟台退货出库确认========================
def main(): def main():
......
...@@ -464,6 +464,8 @@ def check_hdi_distr(type=25): ...@@ -464,6 +464,8 @@ def check_hdi_distr(type=25):
else: else:
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_in(type=25): def check_hdi_distr_in(type=25):
branch_id = get_branch_id() branch_id = get_branch_id()
# 验证配送单主表 # 验证配送单主表
...@@ -553,6 +555,7 @@ def check_hdi_distr_in(type=25): ...@@ -553,6 +555,7 @@ def check_hdi_distr_in(type=25):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_detail(distr_main_key, type): def check_hdi_distr_detail(distr_main_key, type):
from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id
branch_id = get_branch_id() branch_id = get_branch_id()
...@@ -612,7 +615,9 @@ def check_hdi_distr_detail(distr_main_key, type): ...@@ -612,7 +615,9 @@ def check_hdi_distr_detail(distr_main_key, type):
last_modified_user = create_user last_modified_user = create_user
operationNoticeBillId = source_id operationNoticeBillId = source_id
operationNoticeBillDetailId = source_detail_id operationNoticeBillDetailId = source_detail_id
operationApplyBillDetailId = source_detail_id operationApplyBillDetailId = get_id(
"select id from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % branch_id)
operationApplyBillDetailId = operationApplyBillDetailId.replace("O", "")
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail_0911', distr_detail_main_key, distr_main_key, source_id, 'hdi_distr_detail_0911', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id source_detail_id, pur_detail_id
...@@ -643,6 +648,7 @@ def check_hdi_distr_detail(distr_main_key, type): ...@@ -643,6 +648,7 @@ def check_hdi_distr_detail(distr_main_key, type):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_detail_in(distr_main_key, type): def check_hdi_distr_detail_in(distr_main_key, type):
branch_id = get_branch_id() branch_id = get_branch_id()
sql = "select * from hdi_distr_detail where pid = '%s';" % distr_main_key sql = "select * from hdi_distr_detail where pid = '%s';" % distr_main_key
...@@ -732,11 +738,13 @@ def check_hdi_distr_detail_in(distr_main_key, type): ...@@ -732,11 +738,13 @@ def check_hdi_distr_detail_in(distr_main_key, type):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_check(type=1): def check_mcms_check(type=1):
branch_id = get_branch_id()
if type == 1: if type == 1:
bill_mode = 16 bill_mode = 16
elif type == 2: elif type == 2:
bill_mode = 20 bill_mode = 25
else: else:
bill_mode = 66 bill_mode = 66
print('检查验收单数据库写值') print('检查验收单数据库写值')
...@@ -746,12 +754,8 @@ def check_mcms_check(type=1): ...@@ -746,12 +754,8 @@ def check_mcms_check(type=1):
# 获取实际值 # 获取实际值
actual = check_mcms_pur_plan_sql(sql) actual = check_mcms_pur_plan_sql(sql)
print('actual', actual) print('actual', actual)
if type == 1:
source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '低值配送单号', 'message10')['distrBillId1'] source_id = get_id("select id from hdi_distr where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % branch_id)
elif type == 2:
source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '高值配送单号', 'message10')['distrBillId1']
else:
source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '试剂配送单号', 'message10')['distrBillId1']
source_no = source_id source_no = source_id
prov_id = get_prov_id() prov_id = get_prov_id()
prov_name = get_prov_name() prov_name = get_prov_name()
...@@ -784,36 +788,26 @@ def check_mcms_check(type=1): ...@@ -784,36 +788,26 @@ def check_mcms_check(type=1):
sql = "select last_modified from mcms_check where id='%s';" % check_no sql = "select last_modified from mcms_check where id='%s';" % check_no
last_modified = get_create_time(sql) last_modified = get_create_time(sql)
last_modified_user = create_user last_modified_user = create_user
if type == 1: operationApplyOrderNo = get_id(
check_mcms_check_batch(type, check_no, order_no, hos_goods_id) "select order_no from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check', check_no, operationNoticeBillId = get_id(
order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id, "select id from spd3_herp_test2.mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
prov_name, rec_org_id, rec_org_name, dept_id, dept_name, buyBillId, operationNoticeOrderNo = get_id(
planBillId, planOrderNo, buyOrderNo, purOrderNo, purBillId, "select order_no from spd3_herp_test2.mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
purBillDate, operationApplyBillId = get_id(
distrBillId, distrOrderNo, checkBillId, checkOrderNo, create_user, "select id from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
create_time, last_modified, check_mcms_check_batch(type, check_no, order_no, hos_goods_id) # 子表检查
last_modified_user) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_0912', check_no,
elif type == 2: order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id,
check_mcms_check_batch(type, check_no, order_no, hos_goods_id) prov_name, rec_org_id, rec_org_name, dept_id, dept_name,
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check1', check_no, operationApplyOrderNo,
order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id, operationNoticeBillId, distrBillId, operationNoticeOrderNo, distrOrderNo,
prov_name, rec_org_id, rec_org_name, dept_id, dept_name, buyBillId, operationApplyBillId,
planBillId, planOrderNo, buyOrderNo, purOrderNo, purBillId, checkBillId,
purBillDate, checkOrderNo, create_user,
distrBillId, distrOrderNo, checkBillId, checkOrderNo, create_user, create_time, last_modified,
create_time, last_modified, last_modified_user)
last_modified_user)
else:
check_mcms_check_batch(type, check_no, order_no, hos_goods_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check2', check_no,
order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id,
prov_name, rec_org_id, rec_org_name, dept_id, dept_name, buyBillId,
planBillId, planOrderNo, buyOrderNo, purOrderNo, purBillId,
purBillDate,
distrBillId, distrOrderNo, checkBillId, checkOrderNo, create_user,
create_time, last_modified,
last_modified_user)
# 对比预期值和实际值是否一致 # 对比预期值和实际值是否一致
# comparison_result(actual, expected) # comparison_result(actual, expected)
actual_value1 = get_process_list2(actual) actual_value1 = get_process_list2(actual)
...@@ -840,7 +834,7 @@ def check_mcms_check_batch(type, check_no, order_no, hos_goods_id): ...@@ -840,7 +834,7 @@ def check_mcms_check_batch(type, check_no, order_no, hos_goods_id):
if type == 1: if type == 1:
bill_mode = 16 bill_mode = 16
elif type == 2: elif type == 2:
bill_mode = 20 bill_mode = 25
else: else:
bill_mode = 66 bill_mode = 66
sql = "select * from mcms_check_batch where pid='%s'" % check_no sql = "select * from mcms_check_batch where pid='%s'" % check_no
...@@ -861,31 +855,210 @@ def check_mcms_check_batch(type, check_no, order_no, hos_goods_id): ...@@ -861,31 +855,210 @@ def check_mcms_check_batch(type, check_no, order_no, hos_goods_id):
create_time = get_create_time("select create_time from mcms_check_batch where pid='%s'" % check_no) create_time = get_create_time("select create_time from mcms_check_batch where pid='%s'" % check_no)
last_modified = get_create_time("select last_modified from mcms_check_batch where pid='%s'" % check_no) last_modified = get_create_time("select last_modified from mcms_check_batch where pid='%s'" % check_no)
last_modified_user = create_user last_modified_user = create_user
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch_0912', id,
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id,
mdm_goods_code,
goods_code, barcode_id, create_user, create_time, last_modified,
last_modified_user
)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
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)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
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(type=1):
print('检查中心库入库单和出库单')
if type == 1: if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch', id, bill_mode = 16
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id,
mdm_goods_code,
goods_code, barcode_id, create_user, create_time, last_modified,
last_modified_user
)
elif type == 2: elif type == 2:
bill_mode = 25
else:
bill_mode = 66
branch_id = get_branch_id()
sql = "select * from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
id = get_id(sql)
sql = "select order_no from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
target_stock_id = get_stockId_fromdb(stock_name)
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 1)
source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')['CHECK_NO1']
source_no = get_distrBillId(branch_id, bill_mode)
source_repl_id = source_no
source_corp_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
source_dept_id = source_corp_id
source_dept_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
source_stock_id = source_corp_id
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch1', id, buyBillId = get_buyBillId(branch_id, bill_mode)
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id, if type == 1:
mdm_goods_code, hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
goods_code, barcode_id, create_user, create_time, last_modified, elif type == 2:
last_modified_user 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"]
planBillId = get_planBillId(hos_goods_id)
planOrderNo = get_planOrderNo(hos_goods_id)
buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
purOrderNo = get_purOrderNo(branch_id, bill_mode)
purBillId = get_purBillId(branch_id, bill_mode)
bill_relation_json = get_purBillDate2(branch_id, bill_mode)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
distrBillId = get_distrBillId(branch_id, bill_mode)
distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
checkBillId = source_id
sql = "select order_no from mcms_check where id='%s';" % checkBillId
checkOrderNo = get_id(sql)
psiInBillId = id
psiInOrderNo = order_no
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 where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
last_modified_user = create_user
operationApplyOrderNo = get_id(
"select order_no from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
operationNoticeBillId = get_id(
"select id from spd3_herp_test2.mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
operationNoticeOrderNo = get_id(
"select order_no from spd3_herp_test2.mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % branch_id)
operationApplyBillId = get_id(
"select id from spd3_herp_test2.mcms_operation_apply where branch_id='%s' order by create_time desc LIMIT 1;" % branch_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_psi_0912', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_dept_id, source_dept_name
, source_stock_id, accounter, account_date, operationApplyOrderNo,
operationNoticeBillId, distrBillId, operationNoticeOrderNo, distrOrderNo,
operationApplyBillId, checkBillId, checkOrderNo, psiInBillId, psiInOrderNo,
create_user
, create_time, last_modified, last_modified_user)
# 对比预期值和实际值是否一致
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)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
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')
# 检查中心库出库单====================================================================
sql = "select * from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
id_out = get_id(sql)
sql = "select order_no from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no_out = get_id(sql)
target_corp_id = get_hosid()
target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
stock_name = target_dept_name + "库房"
target_stock_id = get_stockId_fromdb(stock_name)
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2)
source_id_out = id
source_no_out = order_no
source_repl_id = source_no
source_corp_id = get_hosid()
source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
source_stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id_out)
buyBillId = get_buyBillId(branch_id, bill_mode)
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
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"]
planBillId = get_planBillId(hos_goods_id)
planOrderNo = get_planOrderNo(hos_goods_id)
buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
purOrderNo = get_purOrderNo(branch_id, bill_mode)
purBillId = get_purBillId(branch_id, bill_mode)
bill_relation_json = get_purBillDate2(branch_id, bill_mode)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
distrBillId = get_distrBillId(branch_id, bill_mode)
distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
checkBillId = source_id
sql = "select order_no from mcms_check where id='%s';" % checkBillId
checkOrderNo = get_id(sql)
psiInBillId = id
psiInOrderNo = order_no
psiOutBillId = id_out
psiOutOrderNo = order_no_out
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 where id='%s';" % id_out)
last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id_out)
last_modified_user = create_user
source_branch_id = get_branch_id()
source_area_code = get_stockAreaId_new_fromDb(source_dept_name)
#出库单子表检查
check_mcms_psi_batch_out(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out_0912',
id_out,
order_no_out, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id_out, source_no_out, source_repl_id,
source_corp_id, source_branch_id, source_dept_id, source_dept_name
, source_stock_id, source_area_code, operationApplyOrderNo, operationNoticeBillId,
distrBillId, operationNoticeOrderNo, distrOrderNo, operationApplyBillId
, checkBillId, checkOrderNo, psiInBillId, psiInOrderNo, psiOutBillId,
psiOutOrderNo,create_user
, create_time, last_modified, last_modified_user)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch2', id,
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id,
mdm_goods_code,
goods_code, barcode_id, create_user, create_time, last_modified,
last_modified_user
)
# 对比预期值和实际值是否一致 # 对比预期值和实际值是否一致
# comparison_result(actual, expected)
actual_value1 = get_process_list2(actual) actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected) expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "") actual_value2 = actual_value1.replace(" ", "")
...@@ -904,6 +1077,182 @@ def check_mcms_check_batch(type, check_no, order_no, hos_goods_id): ...@@ -904,6 +1077,182 @@ def check_mcms_check_batch(type, check_no, order_no, hos_goods_id):
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):
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 25
else:
bill_mode = 66
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 == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
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)
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)
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(get_branch_name(), 1)
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_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
if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in1', batch_main_key, pid, order_no, source_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, last_modified_user
)
elif type == 2:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in_0912', batch_main_key, pid, order_no,
source_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, last_modified_user
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in3', batch_main_key, pid, order_no, source_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, 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')
def check_mcms_psi_batch_out(DR_ID, type, order_no, source_id1):
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 25
else:
bill_mode = 66
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 == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
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)
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)
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(get_branch_name(), 1)
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_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
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in_0912', batch_main_key, pid, order_no, source_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, 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() pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path) print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air') sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟台业务流程.air')
...@@ -911,32 +1260,34 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟 ...@@ -911,32 +1260,34 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b1流程八_高值跟
from a_b1流程八_高值跟台业务流程 import dept2_set, operationApply, second_dept_in_warehouse, out_return_gt from a_b1流程八_高值跟台业务流程 import dept2_set, operationApply, second_dept_in_warehouse, out_return_gt
try: try:
dept2_set() # dept2_set()
# # # # 设置默认科室,切换到二级科室,使用科室管理功能 # # # # # 设置默认科室,切换到二级科室,使用科室管理功能
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 # updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
herpService_mcmsDeptGoodsInfo_getByProvIdPage() # herpService_mcmsDeptGoodsInfo_getByProvIdPage()
time.sleep(6) # time.sleep(6)
operationApply() # 手术跟台申请单提交 # operationApply() # 手术跟台申请单提交
time.sleep(6) # time.sleep(6)
check_mcms_operation_apply()# 手术跟台申请单数据库检查 # check_mcms_operation_apply()# 手术跟台申请单数据库检查
approval_center() # 二级科室审批审批手术跟台申请单 # approval_center() # 二级科室审批审批手术跟台申请单
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库 # updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
approval_center1() # 中心库再次审批手术跟台申请单 # approval_center1() # 中心库再次审批手术跟台申请单
time.sleep(6) # time.sleep(6)
check_mcms_operation_apply_approval_after() # 手术跟台申请单审批后的数据库检查 # check_mcms_operation_apply_approval_after() # 手术跟台申请单审批后的数据库检查
# #内网查询手术通知单号 # # #内网查询手术通知单号
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库 # updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
time.sleep(6) # time.sleep(6)
check_mcms_operation_notice()# 手术通知单数据库检查 # check_mcms_operation_notice()# 手术通知单数据库检查
time.sleep(6) # time.sleep(6)
orderno = Search_OrderNO() # 手术通知单接口查询单号 # orderno = Search_OrderNO() # 手术通知单接口查询单号
height_value_order_dp(orderno) # 高值跟台外网配送 # height_value_order_dp(orderno) # 高值跟台外网配送
time.sleep(6) # time.sleep(6)
check_hdi_distr() # 外网配送单数据库检查 # check_hdi_distr() # 外网配送单数据库检查
time.sleep(6) # time.sleep(6)
check_accept_order() # 内网验收 # check_accept_order() # 内网验收
time.sleep(6) # time.sleep(6)
check_mcms_check(3)#高值跟台验收检查验收表数据 # check_mcms_check(2)#高值跟台验收检查验收表数据
# #这里验收后会自动生成出入库单,批次信息,需要同步验证入库单和批次信息
check_mcms_psi(2) # 调用函数检查中心库入库单和出库单数据库写值
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
second_dept_in_warehouse() # 二级科室入库 second_dept_in_warehouse() # 二级科室入库
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库 updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
......
...@@ -248,33 +248,36 @@ def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'): ...@@ -248,33 +248,36 @@ def approval_center_all(OBH_ID='OBhxxxxxxxxxxxxxxx'):
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
data = commonFuc().analysis_json('data', result) data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data) total = commonFuc().analysis_json('total', data)
data1 = commonFuc().analysis_json('data', data) if total==0:
for i in data1: return
# code = commonFuc().analysis_json('code', result) else:
# data = commonFuc().analysis_json('data', result) data1 = commonFuc().analysis_json('data', data)
# total = commonFuc().analysis_json('total', result) for i in data1:
# data1 = commonFuc().analysis_json('data', i) # code = commonFuc().analysis_json('code', result)
# data = commonFuc().analysis_json('data', result)
taskId = commonFuc().analysis_json('taskId', i) # total = commonFuc().analysis_json('total', result)
# data1 = commonFuc().analysis_json('data', i)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "approvalBatch_url")
taskId = commonFuc().analysis_json('taskId', i)
# 请求体
request_body = commonFuc().get_business_data(module, "payload50_7", taskId) url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "approvalBatch_url")
print(request_body)
# # # 发送请求 # 请求体
result = commonFuc().http_post(url, request_body, headers) request_body = commonFuc().get_business_data(module, "payload50_7", taskId)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) print(request_body)
# 断言 # # # 发送请求
# checkDict=commonFuc().get_business_data(module,'checkDict10') result = commonFuc().http_post(url, request_body, headers)
# commonFuc().check_result(checkDict,result) print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
code = commonFuc().analysis_json('code', result) # 断言
data = commonFuc().analysis_json('data', result) # checkDict=commonFuc().get_business_data(module,'checkDict10')
total = commonFuc().analysis_json('total', result) # commonFuc().check_result(checkDict,result)
if code >= 0: code = commonFuc().analysis_json('code', result)
commonFuc().check_text_exist(0, result) data = commonFuc().analysis_json('data', result)
else: total = commonFuc().analysis_json('total', result)
commonFuc().check_text_exist('error', result) if code >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def approval_center1(): def approval_center1():
......
...@@ -314,3 +314,16 @@ ...@@ -314,3 +314,16 @@
#高值跟台配送单主表 #高值跟台配送单主表
"hdi_distr_0911": '{"id": "%s", "order_no": "%s", "bill_mode": "25", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "SUR", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 30, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": 3, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": null, "rec_phone": None, "rec_addr": null, "bill_relation_json": "{"operationApplyOrderNo":"%s","operationNoticeBillId":"%s","distrBillId":"%s","operationNoticeOrderNo":"%s","distrOrderNo":"%s","operationApplyBillId":"%s"}", "ext_info": "{"distrUser":"%s","operUserPhone":"ttt","operUserName":"ttt","operationPriority":0,"operationPkg":0}", "barcode_flag": 1, "pkg_flag": 0, "remark": "自动化测试", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}' "hdi_distr_0911": '{"id": "%s", "order_no": "%s", "bill_mode": "25", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "SUR", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 30, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": 3, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": null, "rec_phone": None, "rec_addr": null, "bill_relation_json": "{"operationApplyOrderNo":"%s","operationNoticeBillId":"%s","distrBillId":"%s","operationNoticeOrderNo":"%s","distrOrderNo":"%s","operationApplyBillId":"%s"}", "ext_info": "{"distrUser":"%s","operUserPhone":"ttt","operUserName":"ttt","operationPriority":0,"operationPkg":0}", "barcode_flag": 1, "pkg_flag": 0, "remark": "自动化测试", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
#高值跟台验收单子表
"mcms_check_batch_0912": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("1.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 3, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
#高值跟台验收单主表
"mcms_check_0912": '{"id": "%s", "order_no": "%s", "bill_mode": "25", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 20, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"operationApplyOrderNo":"%s","operationNoticeBillId":"%s","distrBillId":"%s","operationNoticeOrderNo":"%s","distrOrderNo":"%s","operationApplyBillId":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "initial_order": None, "remark": ""}'
#高值跟台中心库入库单子表和主表
"mcms_psi_batch_in_0912": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":null,"pur_mode":20,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"1支","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":1}'
"check_mcms_psi_0912": '{"id": "%s", "order_no": "%s", "bill_mode": "25", "rec_type": null, "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "自动化测试", "source_id": "%s", "source_no": "%s", "source_repl_id": "%s", "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"operationApplyOrderNo":"%s","operationNoticeBillId":"%s","distrBillId":"%s","operationNoticeOrderNo":"%s","distrOrderNo":"%s","operationApplyBillId":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "BD", "reject_reason": None, "receipt_status": 0}'
##高值跟台中心库出库单主表
"check_mcms_psi_out_0912": '{"id": "%s", "order_no": "%s", "bill_mode": "25", "rec_type": null, "psi_flag": -1, "psi_kind": "202", "stock_kind": "CK_QL", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "source_id": "%s", "source_no": "%s", "source_repl_id": "%s", "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "自动化测试", "remark": None, "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json":"{"operationApplyOrderNo":"%s","operationNoticeBillId":"%s","distrBillId":"%s","operationNoticeOrderNo":"%s","distrOrderNo":"%s","operationApplyBillId":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s","psiOutBillId":"%s","psiOutOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "BD", "reject_reason": None, "receipt_status": 0}'
...@@ -229,10 +229,11 @@ def main_text(): ...@@ -229,10 +229,11 @@ def main_text():
def flow5_flow18(): def flow5_flow18():
# 脚本运行前清空所有待审批数据 # 脚本运行前清空所有待审批数据
approval_center_all() approval_center_all()
approval_center_all()
try: try:
flow5() flow5()
flow6() flow6()
time.sleep(20) time.sleep(6)
flow7() flow7()
flow8() flow8()
flow9() flow9()
......
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