Commit 38faf2fc authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent 112d52a7
...@@ -305,12 +305,14 @@ def check_mcms_psi_dept(type=16): ...@@ -305,12 +305,14 @@ def check_mcms_psi_dept(type=16):
DR_ID = info['DR_NO3'] DR_ID = info['DR_NO3']
else: else:
DR_ID = info['DR_NO1'] DR_ID = info['DR_NO1']
order_no = get_id("select order_no from mcms_psi_dept where id='%s';" % DR_ID) DR_ID = ''.join(DR_ID)
sql="select order_no from mcms_psi_dept where id='%s';"% DR_ID
order_no = 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')['deptid5'] target_dept_id=FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid5']
target_dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5'] target_dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid5']
target_stock_id=get_stockId_fromdb(target_dept_name) target_stock_id=get_stockId_fromdb(target_dept_name+'库房')
target_area_code=get_stockAreaId_new_fromDb(target_dept_name,2) target_area_code=get_stockAreaId_new_fromDb(target_dept_name,2)
PICK_id=get_PICK_id(branch_id,type) PICK_id=get_PICK_id(branch_id,type)
source_id=PICK_id source_id=PICK_id
...@@ -318,14 +320,25 @@ def check_mcms_psi_dept(type=16): ...@@ -318,14 +320,25 @@ def check_mcms_psi_dept(type=16):
source_branch_id=get_branch_id() source_branch_id=get_branch_id()
source_dept_id=FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] source_dept_id=FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
source_dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] source_dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
source_stock_id=get_stockId_fromdb(source_dept_name) source_stock_id=get_stockId_fromdb(source_dept_name+'库房')
source_area_code=get_stockAreaId_new_fromDb(source_dept_name,2) source_area_code=get_stockAreaId_new_fromDb(source_dept_name,2)
buyBillId =get_buyBillId(branch_id,type)
pickOrderNo=get_PICK_order_no(branch_id,type)
buyOrderNo=get_buyOrderNo(branch_id,type)
pickBillId=get_PICK_id(branch_id,type)
psiDeptOutBillId=DR_ID
psiDeptOutOrderNo=order_no
create_user=get_login_user_uxid()
create_time=get_create_time("select create_time from mcms_psi_dept where id='%s';" % DR_ID)
last_modified=get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID)
last_modified_user=create_user
if type == 16: if type == 16:
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_dept1',DR_ID,order_no,target_corp_id,target_branch_id,target_dept_id,target_dept_name,target_stock_id 'mcms_psi_dept1',DR_ID,order_no,target_corp_id,target_branch_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,
buyBillId,pickOrderNo,buyOrderNo,pickBillId,psiDeptOutBillId,psiDeptOutOrderNo
,create_user,create_time,last_modified,last_modified_user
) )
elif type == 20: elif type == 20:
......
...@@ -260,7 +260,12 @@ def get_PICK_id(branch_id,bill_mode): ...@@ -260,7 +260,12 @@ def get_PICK_id(branch_id,bill_mode):
branch_id, bill_mode) branch_id, bill_mode)
print(sql) print(sql)
return process_tuple(get_dept_buy_id(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;" % (
PICK_id)
print(sql)
return process_tuple(get_dept_buy_id(sql))
def get_buyBillId(branch_id,bill_mode): def get_buyBillId(branch_id,bill_mode):
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;" % ( 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, bill_mode) branch_id, bill_mode)
......
...@@ -73,4 +73,4 @@ ...@@ -73,4 +73,4 @@
"mcms_dept_buy5_2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "xhs0301", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}' "mcms_dept_buy5_2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "xhs0301", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}'
"mcms_dept_buy5_3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "xhs0301", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}' "mcms_dept_buy5_3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": null, "create_type": "SG", "buy_kind": "LY", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "xhs0301", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None}'
"mcms_psi_dept1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "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": 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": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"Bh03472024072300096","pickOrderNo":"JH202407230037","buyOrderNo":"BUY2024072309790","pickBillId":"PICKh03472407230037","psiDeptOutBillId":"DRh034720240723000050","psiDeptOutOrderNo":"DN20240723000050"}", "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 23, 15, 22, 5), "last_modified": datetime.datetime(2024, 7, 23, 15, 22, 5), "last_modified_user": "h0347_UID-051420", "version": 0, "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_dept1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": -1, "psi_kind": "204", "stock_kind": "CK_SL", "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": 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": "%s", "source_area_name": "默认库区", "consume_type": 0, "patient_id": "", "patient_name": "", "machine_id": None, "machine_name": None, "his_charge_no": None, "remark": "", "tb_status": 20, "accounter": None, "account_date": None, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s","psiDeptOutBillId":"%s","psiDeptOutOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "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}'
\ No newline at end of file \ 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