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

流程八脚本提交

parent c994d095
......@@ -463,9 +463,97 @@ def check_hdi_distr(type=25):
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_in(type=25):
branch_id = get_branch_id()
# 验证配送单主表
sql = "select * from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
hos_id = get_hosid()
# 查询配送单主键
distr_main_key = get_id(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
# 查询配送单order_no
distr_order_no = get_id(
"select order_no from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, type))
# 从手术通知单获取source_id
source_id = get_id(
"select id from mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % (
branch_id))
pur_bill_id = source_id
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
rec_user = info['username1']
distrBillId = distr_main_key
distrOrderNo = distr_order_no
distrUser = get_login_user_uxid_bydb(
FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"])
create_user = distrUser
create_user_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
create_time = get_create_time(
"select create_time from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
last_modified_user = distrUser
# 验证子表数据
check_hdi_distr_detail_in(distr_main_key, type)
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name = prov_name
pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
rec_org_id = process_tuple(
get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'])))
rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
last_modified = get_create_time(
"select last_modified from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
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)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_0911', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, operationApplyOrderNo, operationNoticeBillId, distrBillId,
operationNoticeOrderNo,
distrOrderNo, operationApplyBillId, distrUser, create_user,
create_user_name,
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')
def check_hdi_distr_detail(distr_main_key, type):
from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id
branch_id = get_branch_id()
sql = "select * from hdi_distr_detail where pid = '%s';" % distr_main_key
# 获取实际值
......@@ -493,7 +581,7 @@ def check_hdi_distr_detail(distr_main_key, type):
"select product_date from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
get_id("select pkg_def_id from spd3_herp_test2.mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
supply_id = get_supply_id(hos_goods_id)
sub_prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
sub_prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
......@@ -554,7 +642,94 @@ def check_hdi_distr_detail(distr_main_key, type):
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_detail_in(distr_main_key, type):
branch_id = get_branch_id()
sql = "select * from hdi_distr_detail where pid = '%s';" % distr_main_key
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
# 获取子表主键
distr_detail_main_key = get_id(
"select id from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
source_id = get_id(
"select id from mcms_operation_notice where branch_id='%s' order by create_time desc LIMIT 1;" % (
branch_id))
source_detail_id = get_id("select id from mcms_operation_notice_list order by create_time desc LIMIT 1;")
pur_detail_id = source_detail_id
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
goods_name = get_goods_name(hos_goods_id)
goods_gg = get_goods_gg(hos_goods_id)
mfrs_id = get_goods_mfrs_id(hos_goods_id)
expdt_date = get_expdt_date(
"select expdt_date from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
product_date = get_expdt_date(
"select product_date from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
supply_id = get_supply_id(hos_goods_id)
sub_prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
sub_prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
planBillId = process_tuple(
get_id(
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
planDetailId = get_id(
"select id from spd3_herp_test2.mcms_pur_plan_detail where pid='%s';" % planBillId)
purDetailId = pur_detail_id
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
get_branch_id(), type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
purBillId = id1
distrDetailId = distr_detail_main_key
distrBillId = distr_main_key
erpCode = mdm_goods_code # 11661563
create_user = get_login_user_uxid2()
create_time = get_create_time(
"select create_time from hdi_distr_detail where id = '%s';" % (
distr_detail_main_key))
last_modified = get_create_time(
"select last_modified from hdi_distr_detail where id = '%s';" % (
distr_detail_main_key))
last_modified_user = create_user
operationNoticeBillId = source_id
operationNoticeBillDetailId = source_detail_id
operationApplyBillDetailId = source_detail_id
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,
source_detail_id, pur_detail_id
, hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, operationNoticeBillId,
distrDetailId, distrBillId, operationNoticeBillDetailId,
operationApplyBillDetailId,
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')
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_b1流程八_高值跟台业务流程.air')
......@@ -584,6 +759,9 @@ try:
# height_value_order_dp(orderno) # 高值跟台外网配送
# time.sleep(6)
check_hdi_distr() # 外网配送单数据库检查
time.sleep(6)
check_hdi_distr_in() # 内网配送单数据库检查
time.sleep(6)
check_accept_order() # 内网验收
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
second_dept_in_warehouse() # 二级科室入库
......
......@@ -1115,11 +1115,6 @@ def check_hdi_distr(type=16):
distr_main_key, type))
print(bill_relation_json)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
# purBillDate = get_expdt_date(
# "select create_time from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
# branch_id, type))
# process_date(purBillDate)
distrBillId = distr_main_key
distrOrderNo = distr_order_no
distrUser = get_login_user_uxid2()
......@@ -2389,11 +2384,6 @@ def main():
from a_b4流程十一请领业务流_二级库向直送 import goods_move2,second_dept_Request,BuyCarSubmit,purchase_module_process,order_dp,check_accept_order
# from a_b4流程十一请领业务流_二级库向直送 import second_dept_Request
# from a_b4流程十一请领业务流_二级库向直送 import BuyCarSubmit
# from a_b4流程十一请领业务流_二级库向直送 import purchase_module_process
# from a_b4流程十一请领业务流_二级库向直送 import order_dp
# from a_b4流程十一请领业务流_二级库向直送 import check_accept_order
for i in range(1):
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
......
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