From 38faf2fc409b162490d19dc5f62be1f8c92d7998 Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Tue, 23 Jul 2024 17:18:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8D=81=E4=BA=8C=E8=84=9A=E6=9C=AC=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...56\345\272\223\351\252\214\350\257\201.py" | 23 +++++++++++++++---- common/db/sql/sql_tools.py | 7 +++++- .../data | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" "b/air_case/b6_spd3_core_business_flow_database_check/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index cbfef6b4..e2e0fb4b 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" +++ "b/air_case/b6_spd3_core_business_flow_database_check/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b5\346\265\201\347\250\213\345\215\201\344\272\214\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\344\272\214\347\272\247\345\272\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -305,12 +305,14 @@ def check_mcms_psi_dept(type=16): DR_ID = info['DR_NO3'] else: 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_branch_id=get_branch_id() 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_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) PICK_id=get_PICK_id(branch_id,type) source_id=PICK_id @@ -318,14 +320,25 @@ def check_mcms_psi_dept(type=16): source_branch_id=get_branch_id() 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_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) + 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: 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 ,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: diff --git a/common/db/sql/sql_tools.py b/common/db/sql/sql_tools.py index 4506ea77..325358c3 100644 --- a/common/db/sql/sql_tools.py +++ b/common/db/sql/sql_tools.py @@ -260,7 +260,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_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): 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) diff --git a/data/b6_spd3_core_business_flow_database_check/data b/data/b6_spd3_core_business_flow_database_check/data index 2d524f02..4244d165 100644 --- a/data/b6_spd3_core_business_flow_database_check/data +++ b/data/b6_spd3_core_business_flow_database_check/data @@ -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_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}' \ No newline at end of file +"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 -- GitLab