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

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

parent 666b2c38
......@@ -197,6 +197,7 @@ def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type):
elif type == 20:
source_detail_id = DR_ID + "0001"
pick_detail_id = None
last_modified_user=None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in8', batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
......@@ -234,95 +235,7 @@ def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type):
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_dept_batch_in2(DR_ID,DR_ID1,type):
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)
if type == 16 or type==10:
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)
source_batch_id=get_id("select source_batch_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
target_batch_id=source_batch_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_dept_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(dept_name, 2)
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_dept_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified_user = create_user
if type == 16 or type==10:
source_detail_id = get_pick_detail_id(branch_id, 16)
pick_detail_id=source_detail_id
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in7', batch_main_key, pid, order_no,source_detail_id
,pick_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 == 20:
source_detail_id = get_pick_detail_id(branch_id, 16)
pick_detail_id = source_detail_id
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in8', batch_main_key, pid, order_no,source_detail_id
,pick_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:
source_detail_id = get_pick_detail_id(branch_id, 66)
pick_detail_id = source_detail_id
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch_in9',batch_main_key, pid, order_no,source_detail_id
,pick_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_dept_batch(DR_ID,type,order_no):
branch_id = get_branch_id()
......@@ -584,12 +497,11 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept8', DR_ID1, order_no1, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id,source_no, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id, source_area_code,
, target_area_code, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id,
his_charge_no,accounter, account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
, psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user,
last_auditor,last_audit_time)
create_user, create_time, last_modified, last_modified_user
)
else:
# 子表检查
check_mcms_psi_dept_batch_in(DR_ID1, DR_ID, type2)
......
......@@ -156,13 +156,13 @@
#拆包入库单主表
"mcms_psi_dept7": '{"id": "%s", "order_no": "%s", "bill_mode": "10", "rec_type": "YND", "psi_flag": 1, "psi_kind": "106", "stock_kind": "RK_CB", "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": None, "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": "默认库区", "consume_type": 0, "patient_id": None, "patient_name": None, "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": "%s", "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s","psiDeptInBillId":"%s","psiDeptInOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": "%s", "last_audit_time": %s, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept8": '{"id":"%s","order_no":"%s","bill_mode":"20","rec_type":"YND","psi_flag":-1,"psi_kind":"206","stock_kind":"CK_CB","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":null,"source_repl_id":null,"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":"默认库区","consume_type":0,"patient_id":null,"patient_name":null,"machine_id":null,"machine_name":null,"his_charge_no":null,"remark":null,"tb_status":40,"accounter":"%s","account_date":"%s","bill_relation_json":"{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}","create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":2,"last_auditor":null,"last_audit_time":null,"reject_reason":null,"reject_user":null,"reject_time":null,"initial_order":null,"source_type":"SG","target_coding_type":null}'
"mcms_psi_dept8": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "psi_flag": 1, "psi_kind": "108", "stock_kind": "RK_XH", "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": "-", "source_no": None, "source_repl_id": None, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "consume_type": 1, "patient_id": None, "patient_name": None, "machine_id": None, "machine_name": None, "his_charge_no": "%s", "remark": None, "tb_status": 30, "accounter": "%s", "account_date": "%s", "bill_relation_json": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
"mcms_psi_dept9": '{"id": "%s", "order_no": "%s", "bill_mode": "67", "rec_type": "YND", "psi_flag": 1, "psi_kind": "106", "stock_kind": "RK_CB", "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": None, "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": "默认库区", "consume_type": 0, "patient_id": None, "patient_name": None, "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": "%s", "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s","psiDeptInBillId":"%s","psiDeptInOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": "%s", "last_audit_time": %s, "reject_reason": None, "reject_user": None, "reject_time": None, "initial_order": None, "source_type": "SG", "target_coding_type": None}'
#拆包入库单子表
"mcms_psi_dept_batch_in7": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": %s, "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "source_batch_id": "%s", "target_batch_id": "%s", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("100.00"), "unit_name": "1支", "barcode_id": %s, "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": null, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
"mcms_psi_dept_batch_in8": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": %s, "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "source_batch_id": "%s", "target_batch_id": "%s", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("1.00"), "unit_name": "1支", "barcode_id": %s, "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": null, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
"mcms_psi_dept_batch_in8": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": %s, "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "source_batch_id": "%s", "target_batch_id": "%s", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("1.00"), "unit_name": "1支", "barcode_id": "%s", "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": %s, "version": 0}'
"mcms_psi_dept_batch_in9": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "pick_detail_id": %s, "pur_mode": 60, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "source_batch_id": "%s", "target_batch_id": "%s", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("1.00"), "unit_name": "1支", "barcode_id": "%s", "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": null, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
#拆包出库单子表试剂
......
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