Commit 7cab8e9c authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程八脚本提交

parent 91ce5ae0
......@@ -376,10 +376,6 @@ def check_hdi_distr(type=25):
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
hos_id = get_hosid()
# 获取采购订单id
purchase_id = get_id(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
# 查询配送单主键
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;" % (
......@@ -388,30 +384,16 @@ def check_hdi_distr(type=25):
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
source_id = get_id(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
"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']
sql = "select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyBillId = process_tuple(get_dept_buy_id(sql))
bill_relation_json = get_id(
"select bill_relation_json from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
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_uxid_bydb(FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1'])
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(
......@@ -420,37 +402,14 @@ def check_hdi_distr(type=25):
last_modified_user = distrUser
# 验证子表数据
check_hdi_distr_detail(distr_main_key, type, purchase_id)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
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)))
check_hdi_distr_detail(distr_main_key, type)
planOrderNo = process_tuple(
get_id(
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyOrderNo = process_tuple(get_dept_buy_id(sql))
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, type, id1)
print(sql)
purOrderNo = process_tuple(get_dept_buy_id(sql))
purBillId = id1
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')['deptid1']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
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'])))
......@@ -458,16 +417,22 @@ def check_hdi_distr(type=25):
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))
confirmUser = distrUser
ext_info = get_ext_info(branch_id, type)
confirmTime = reGetString(ext_info, r'"confirmTime":"', r'""confirmUser')
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)
bill_relation_json = get_id(
"select bill_relation_json from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, type))
print(bill_relation_json)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
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, rec_user, buyBillId, planBillId, planOrderNo, buyOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
confirmTime, confirmUser, distrUser, create_user, create_user_name,
rec_org_name, operationApplyOrderNo, operationNoticeBillId, distrBillId, operationNoticeOrderNo,
distrOrderNo, operationApplyBillId,distrUser, create_user, create_user_name,
create_time, last_modified,
last_modified_user
)
......@@ -492,7 +457,7 @@ def check_hdi_distr(type=25):
commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_detail(distr_main_key, type, purchase_id):
def check_hdi_distr_detail(distr_main_key, type):
branch_id=get_branch_id()
sql = "select * from hdi_distr_detail where pid = '%s';" % distr_main_key
# 获取实际值
......
......@@ -313,4 +313,4 @@
"hdi_distr_detail_0911": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "20", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "2222", "expdt_date": %s, "product_date": %s, "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("1.00"), "settlement": 3, "certificate_code": null, "product_cert_code": None, "detail_relation_json": "{"operationNoticeBillId":"%s","distrDetailId":"%s","distrBillId":"%s","transCond":"","erpCode":"","storageCond":"","operationNoticeBillDetailId":"%s","operationApplyBillDetailId":"%s","ygptCode":""}","ext_info": "{"ygptCode":"","transCond":"","storageCond":"","erpCode":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
#高值跟台配送单主表
"hdi_distr_0911": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "None", "rec_addr": "自动化测试", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"purMode":20,"confirmTime":"%s","confirmUser":"%s","epidemicFlag":0,"distrUser":"%s"}", "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}'
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