Commit 0e43388b authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent 591a349d
...@@ -142,8 +142,7 @@ def check_mcms_psi_dept_batch_in(DR_ID,type): ...@@ -142,8 +142,7 @@ def check_mcms_psi_dept_batch_in(DR_ID,type):
batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID) batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
pid = DR_ID pid = DR_ID
order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_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,16)
pick_detail_id=source_detail_id
if type == 16 or type==10: if type == 16 or type==10:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20: elif type == 20:
...@@ -185,6 +184,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type): ...@@ -185,6 +184,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type):
) )
elif type == 20: 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', 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 '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, ,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
...@@ -193,6 +194,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type): ...@@ -193,6 +194,8 @@ def check_mcms_psi_dept_batch_in(DR_ID,type):
) )
else: 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', 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 '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, ,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
...@@ -357,7 +360,7 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -357,7 +360,7 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
) )
elif type1 == 20: elif type1 == 20:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID, type, order_no) check_mcms_psi_dept_batch(DR_ID,type1,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept5', DR_ID, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept5', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -368,16 +371,16 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -368,16 +371,16 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
, create_user, create_time, last_modified, last_modified_user) , create_user, create_time, last_modified, last_modified_user)
else: else:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID, type, order_no) check_mcms_psi_dept_batch(DR_ID,type1,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept6', DR_ID, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept6', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_corp_id, source_branch_id, , target_area_code, source_id, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id, source_area_code, source_dept_id, source_dept_name, source_stock_id, source_area_code,accounter,account_date,
buyBillId, pickOrderNo, buyOrderNo, pickBillId, psiDeptOutBillId, pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
psiDeptOutOrderNo , create_user, create_time, last_modified, last_modified_user
, create_user, create_time, last_modified, last_modified_user)
)
print('expected', expected) print('expected', expected)
print('aaaaaaaaaaaaaaaaa') print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual) actual_value1 = get_process_list2(actual)
...@@ -406,7 +409,7 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -406,7 +409,7 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_CB' order by CREATE_TIME desc LIMIT 1;" % ( " select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_CB' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type2)) branch_id, type2))
sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID1 sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID1
order_no = get_id(sql) order_no1 = get_id(sql)
target_corp_id = get_hosid() target_corp_id = get_hosid()
target_branch_id = get_branch_id() target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
...@@ -427,28 +430,35 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -427,28 +430,35 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
pickBillId = get_PICK_id(branch_id, type1) pickBillId = get_PICK_id(branch_id, type1)
psiDeptOutBillId = DR_ID psiDeptOutBillId = DR_ID
psiDeptOutOrderNo = order_no psiDeptOutOrderNo = order_no
psiDeptInBillId=DR_ID1
psiDeptInOrderNo=order_no1
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) 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 where id='%s';" % DR_ID1) create_time = get_create_time("select create_time from mcms_psi_dept where id='%s';" % DR_ID1)
last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID1) last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID1)
last_modified_user = create_user last_modified_user = create_user
accounter = create_user accounter = create_user
account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID)) source_no=order_no
last_auditor=create_user
last_audit_time= get_create_time("select last_audit_time from mcms_psi_dept where id='%s';" % DR_ID1)
account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID1))
if type2 == 10: if type2 == 10:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_in(DR_ID, type2) check_mcms_psi_dept_batch_in(DR_ID, type2)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept7', DR_ID, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept7', DR_ID1, order_no1, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_corp_id, source_branch_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, source_dept_id, source_dept_name, source_stock_id, source_area_code,
accounter, account_date, accounter, account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
, create_user, create_time, last_modified, last_modified_user , psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user,
last_auditor,last_audit_time
) )
elif type1 == 20: elif type1 == 20:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID, type, order_no) check_mcms_psi_dept_batch_in(DR_ID, type2)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept8', DR_ID, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept8', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -459,15 +469,16 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10): ...@@ -459,15 +469,16 @@ def check_mcms_psi_dept_out_and_in(type1=16,type2=10):
, create_user, create_time, last_modified, last_modified_user) , create_user, create_time, last_modified, last_modified_user)
else: else:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID, type, order_no) check_mcms_psi_dept_batch_in(DR_ID, type2)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept9', DR_ID, order_no, target_corp_id, target_branch_id, 'mcms_psi_dept9', DR_ID1, order_no1, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_corp_id, source_branch_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, source_dept_id, source_dept_name, source_stock_id, source_area_code,
buyBillId, pickOrderNo, buyOrderNo, pickBillId, psiDeptOutBillId, accounter, account_date,
psiDeptOutOrderNo pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
, create_user, create_time, last_modified, last_modified_user) , psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user,
last_auditor,last_audit_time)
print('expected', expected) print('expected', expected)
print('aaaaaaaaaaaaaaaaa') print('aaaaaaaaaaaaaaaaa')
...@@ -497,9 +508,9 @@ from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_con ...@@ -497,9 +508,9 @@ from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_con
try: try:
# updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库 # updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
# sCan_grant(1) # 低值扫码发放 # sCan_grant(1) # 低值扫码发放
check_mcms_psi_dept_out_and_in(16,10) # check_mcms_psi_dept_out_and_in(16,10)
# check_mcms_psi_dept_in(10) # sCan_grant(3) # 试剂扫码发放
sCan_grant(3) # 试剂扫码发放 check_mcms_psi_dept_out_and_in(66,67)
second_dept_consume_Out_Stock(2) # 高值消耗出库 second_dept_consume_Out_Stock(2) # 高值消耗出库
second_dept_consume_in_Stock(2) # 高值消耗退货入库 second_dept_consume_in_Stock(2) # 高值消耗退货入库
second_dept_consume_Out_Stock(1) # 低值消耗出库 second_dept_consume_Out_Stock(1) # 低值消耗出库
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
#拆包入库单主表 #拆包入库单主表
"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_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":"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_dept9": '{"id":"%s","order_no":"%s","bill_mode":"66","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_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}'
#拆包人库单子表 #拆包人库单子表
......
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