Commit 16370cad authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent bc465df8
......@@ -294,18 +294,21 @@ def check_mcms_dept_buy(type=16):
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_dept_batch(type, DR_ID):
def check_mcms_psi_dept_batch(DR_ID,type,order_no):
branch_id = get_branch_id()
sql = " select * from mcms_psi_dept_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_dept_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_detail_id'
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
source_detail_id = get_pick_detail_id(branch_id,type)
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch1', batch_main_key, pid, order_no
'mcms_psi_dept_batch1', batch_main_key, pid, order_no,source_detail_id
,
)
elif type == 20:
......@@ -379,7 +382,7 @@ def check_mcms_psi_dept(type=16):
last_modified_user = create_user
if type == 16:
# 子表检查
check_mcms_psi_dept_batch(type, DR_ID)
check_mcms_psi_dept_batch(DR_ID,type,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept1', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id
......@@ -461,6 +464,7 @@ def check_mcms_pick_detail(pid,type,order_no):
)
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,
......@@ -535,6 +539,7 @@ def check_mcms_pick(type=16):
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,
......@@ -545,6 +550,8 @@ def check_mcms_pick(type=16):
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,
......@@ -554,6 +561,8 @@ def check_mcms_pick(type=16):
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,
......@@ -644,11 +653,11 @@ try:
# # # 二级科室领用出库
# # # 低值拣货执行
# pick_execute()
# # 检查拣货单
# list_data = ['16', '20', '66']
# for i in list_data:
# check_mcms_pick(int(i))
# 上面暂时注释========================
# 检查拣货单
list_data = ['16', '20', '66']
for i in list_data:
check_mcms_pick(int(i))
# 检查出库单
check_mcms_psi_dept(16)
check_mcms_psi_dept(20)
......
......@@ -272,6 +272,12 @@ def get_PICK_id(branch_id,bill_mode):
branch_id, bill_mode)
print(sql)
return process_tuple(get_dept_buy_id(sql))
def get_pick_detail_id(branch_id,bill_mode):
main_id=get_PICK_id(branch_id,bill_mode)
sql = "select id from mcms_pick_detail where pid='%s';" % (
main_id)
print(sql)
return process_tuple(get_dept_buy_id(sql))
def get_PICK_order_no(branch_id,bill_mode):
PICK_id=get_PICK_id(branch_id,bill_mode)
sql = "select order_no from mcms_pick where id='%s' order by CREATE_TIME desc LIMIT 1;" % (
......
......@@ -83,9 +83,9 @@
"mcms_pick2": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "20", "create_type": "ZD", "pick_type": "KS_SL", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "默认库区", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 0, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 4, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
"mcms_pick3": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "66", "create_type": "ZD", "pick_type": "KS_SL", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "默认库区", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 4, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
#拣货单子表
"mcms_pick_detail1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": %s, "pkg_def_name": None, "pkg_def_qty": Decimal("1.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 60, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
#出库单
"mcms_psi_dept_batch1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "5ec2e516d7b4420ca2557eb44b7b03ca", "pick_detail_id": "5ec2e516d7b4420ca2557eb44b7b03ca", "pur_mode": 10, "hos_goods_id": "h034700004601", "mdm_goods_code": "11661563", "goods_code": "00004601", "source_batch_id": "Ph034724071800020", "target_batch_id": "Ph034724071800020", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("100.00"), "unit_name": "100支/100", "barcode_id": "100000142024071800000628", "sub_barcode_id": None, "shelf_code": "areah03472781-A-01-01", "tb_status": 0, "charge_flag": 1, "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 23, 15, 58, 32), "last_modified": datetime.datetime(2024, 7, 23, 15, 58, 32), "last_modified_user": "h0347_UID-051420", "version": 0}'
\ No newline at end of file
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