diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\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_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index 0ebc0fef501b45f08e50db56e44c9df56d6fec3b..d5b1bd69aab34a1fc84921f691a9ff3a70642a71 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\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_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a7\346\265\201\347\250\213\344\272\224_\344\270\255\345\277\203\345\272\223\345\205\245\345\272\223\347\273\223\347\256\227_\346\255\243\347\273\223\347\256\2273_\345\206\205\347\275\221\351\252\214\346\224\266\345\205\245\345\272\223\347\273\223\347\256\227_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -3,6 +3,7 @@ import traceback from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.public1.public1.public1 import * +from common.dateUtils import dateUtils from common.fileUtls import FileUtils from common.run_cmd_script import execute_command from common.timeUtils import timeUtils @@ -535,6 +536,592 @@ def check_mcms_psi_batch_in(DR_ID, type, order_no, source_id1): print('error') commonFuc().check_text_exist_result_text('error', 'succees') +def check_mcms_out_balance(type=1, OBh_ID=""): + print('===检查结算数据======') + if type == 1: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 2: + 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"] + branch_id = get_branch_id() + sql = "select * from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id) + # 获取实际值 + actual = check_mcms_pur_plan_sql(sql) + print('actual', actual) + sql = "select id from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id) + id = get_id(sql) + if id == OBh_ID: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + + order_no = get_id( + "select order_no from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id)) + hos_id = get_hosid() + prov_id = get_prov_id() + prov_name = get_prov_name() + sub_prov_id = prov_id + settle_dept_id = None + distr_detail_id = get_id("select distr_detail_id from mcms_out_un_balance where id='%s';" % id) + if check_distr_detail_id(distr_detail_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + hos_batch_id = get_id("select hos_batch_id from mcms_out_un_balance where id='%s';" % id) + if check_batch_id(hos_batch_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + # 从文件中获取条码信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18') + list_a = info['list_a'] + bar_id = commonFuc().analysis_json('id', list_a) + bar_code = commonFuc().analysis_json('pkgCodeSee', list_a) + from_id = get_id( + "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id)) + from_order_no = get_id( + "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + hos_goods_id)) + settle_start_time = get_account_date1("select settle_start_time from mcms_out_balance where id='%s';" % id) + settle_end_time = get_account_date1("select settle_end_time from mcms_out_balance where id='%s';" % id) + account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + create_user = account_user_id + create_time = get_create_time("select create_time from mcms_out_balance where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_out_balance where id='%s';" % id) + last_modified_user = create_user + goods_code = get_goods_code1(hos_goods_id) + charge_dept_id = settle_dept_id + settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id) + year, month = dateUtils().get_year_month(dateUtils().get_current_time()) + if month < 10: + month = "0" + str(month) + year_month = str(year) + str(month) + if year_month == settle_month: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_out_balance_0918', id, + order_no, branch_id, hos_id, prov_id, prov_name, settle_month, + settle_start_time, settle_end_time, create_user, create_time, + last_modified, last_modified_user + ) + + # 对比预期值和实际值是否一致 + 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) + result = (compare_text_index(actual_value2, expected_value2)) + print('result', result) + 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') + + # 检查结算表子表数据 + check_mcms_out_balance_detail(type, id) + check_mcms_out_balance_detail2(type, id) + + +def check_mcms_out_balance_detail(type=1, pid=""): + print('===检查结算数据子表======') + if type == 1: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 2: + 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"] + branch_id = get_branch_id() + sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;;" % ( + pid) + # 获取实际值 + actual = check_mcms_pur_plan_sql(sql) + print('actual', actual) + sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % ( + pid) + id = get_id(sql) + sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % ( + pid) + id2 = get_id(sql) + hos_id = get_hosid() + prov_id = get_prov_id() + prov_name = get_prov_name() + sub_prov_id = prov_id + settle_dept_id = None + distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id) + if check_distr_detail_id(distr_detail_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id) + if check_batch_id(hos_batch_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + # 从文件中获取条码信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18') + list_a = info['list_a'] + bar_id = commonFuc().analysis_json('id', list_a) + bar_code = commonFuc().analysis_json('pkgCodeSee', list_a) + from_id = get_id( + "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id)) + from_order_no = get_id( + "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + hos_goods_id)) + + account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + create_user = account_user_id + create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id) + last_modified_user = create_user + # goods_code = get_goods_code1(hos_goods_id) + # charge_dept_id = settle_dept_id + # settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id) + # year, month = dateUtils().get_year_month(dateUtils().get_current_time()) + + out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] + out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + sub_prov_name = prov_name + account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id) + un_settle_id = get_id( + "select id from mcms_out_un_balance where branch_id='%s' and from_kind='CK_TH' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, hos_goods_id)) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_out_balance_detail_0918_1', id, + pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id, + out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id, + bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user, + create_time, last_modified, last_modified_user, hos_id + ) + + # 对比预期值和实际值是否一致 + 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) + result = (compare_text_index(actual_value2, expected_value2)) + print('result', result) + 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_out_balance_detail2(type=1, pid=""): + print('===检查结算数据子表======') + if type == 1: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 2: + 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"] + branch_id = get_branch_id() + sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % ( + pid) + # 获取实际值 + actual = check_mcms_pur_plan_sql(sql) + print('actual', actual) + # sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % ( + # pid) + # id = get_id(sql) + sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % ( + pid) + id = get_id(sql) + hos_id = get_hosid() + prov_id = get_prov_id() + prov_name = get_prov_name() + sub_prov_id = prov_id + settle_dept_id = None + distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id) + if check_distr_detail_id(distr_detail_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id) + if check_batch_id(hos_batch_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + # 从文件中获取条码信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18') + list_a = info['list_a'] + bar_id = get_id("select bar_id from mcms_out_balance_detail where id='%s';" % (id)) + bar_code = get_id("select bar_code from mcms_out_balance_detail where id='%s';" % (id)) + from_id = get_id( + "select from_id from mcms_out_balance_detail where id='%s';" % (id)) + if check_batch_id(from_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + from_order_no = get_id( + "select order_no from mcms_psi_batch where id='%s';" % (from_id)) + + account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + create_user = account_user_id + create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id) + last_modified_user = create_user + + out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] + out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + sub_prov_name = prov_name + account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id) + un_settle_id = get_id( + "select un_settle_id from mcms_out_balance_detail where id='%s';" % id) + if check_un_balance_id(un_settle_id): + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_out_balance_detail_0918_2', id, + pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id, + out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id, + bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user, + create_time, last_modified, last_modified_user, hos_id + ) + + # 对比预期值和实际值是否一致 + 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) + result = (compare_text_index(actual_value2, expected_value2)) + print('result', result) + 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_out_balance_approve_after(type=1, OBh_ID=""): + print('===检查结算数据======') + if type == 1: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 2: + 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"] + branch_id = get_branch_id() + sql = "select * from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id) + # 获取实际值 + actual = check_mcms_pur_plan_sql(sql) + print('actual', actual) + sql = "select id from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id) + id = get_id(sql) + if id == OBh_ID: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + + order_no = get_id( + "select order_no from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id)) + hos_id = get_hosid() + prov_id = get_prov_id() + prov_name = get_prov_name() + sub_prov_id = prov_id + settle_dept_id = None + distr_detail_id = get_id("select distr_detail_id from mcms_out_un_balance where id='%s';" % id) + if check_distr_detail_id(distr_detail_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + hos_batch_id = get_id("select hos_batch_id from mcms_out_un_balance where id='%s';" % id) + if check_batch_id(hos_batch_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + # 从文件中获取条码信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18') + list_a = info['list_a'] + bar_id = commonFuc().analysis_json('id', list_a) + bar_code = commonFuc().analysis_json('pkgCodeSee', list_a) + from_id = get_id( + "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id)) + from_order_no = get_id( + "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + hos_goods_id)) + settle_start_time = get_account_date1("select settle_start_time from mcms_out_balance where id='%s';" % id) + settle_end_time = get_account_date1("select settle_end_time from mcms_out_balance where id='%s';" % id) + account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + create_user = account_user_id + create_time = get_create_time("select create_time from mcms_out_balance where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_out_balance where id='%s';" % id) + last_modified_user = create_user + goods_code = get_goods_code1(hos_goods_id) + charge_dept_id = settle_dept_id + settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id) + year, month = dateUtils().get_year_month(dateUtils().get_current_time()) + if month < 10: + month = "0" + str(month) + year_month = str(year) + str(month) + if year_month == settle_month: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + check_user = create_user + check_time = get_create_time("select check_time from mcms_out_balance where id='%s';" % id) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_out_balance_0919', id, + order_no, branch_id, hos_id, prov_id, prov_name, settle_month, + settle_start_time, settle_end_time, create_user, create_time, + last_modified, last_modified_user, check_user, check_time + ) + + # 对比预期值和实际值是否一致 + 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) + result = (compare_text_index(actual_value2, expected_value2)) + print('result', result) + 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') + + # 检查结算表子表数据 + check_mcms_out_balance_detail_approve_after(type, id) + check_mcms_out_balance_detail_approve_after2(type, id) + + +def check_mcms_out_balance_detail_approve_after(type=1, pid=""): + print('===检查结算数据子表======') + if type == 1: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 2: + 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"] + branch_id = get_branch_id() + sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;;" % ( + pid) + # 获取实际值 + actual = check_mcms_pur_plan_sql(sql) + print('actual', actual) + sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % ( + pid) + id = get_id(sql) + sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % ( + pid) + id2 = get_id(sql) + hos_id = get_hosid() + prov_id = get_prov_id() + prov_name = get_prov_name() + sub_prov_id = prov_id + settle_dept_id = None + distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id) + if check_distr_detail_id(distr_detail_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id) + if check_batch_id(hos_batch_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + # 从文件中获取条码信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18') + list_a = info['list_a'] + bar_id = commonFuc().analysis_json('id', list_a) + bar_code = commonFuc().analysis_json('pkgCodeSee', list_a) + from_id = get_id( + "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id)) + from_order_no = get_id( + "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + hos_goods_id)) + + account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + create_user = account_user_id + create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id) + last_modified_user = create_user + # goods_code = get_goods_code1(hos_goods_id) + # charge_dept_id = settle_dept_id + # settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id) + # year, month = dateUtils().get_year_month(dateUtils().get_current_time()) + + out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] + out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + sub_prov_name = prov_name + account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id) + un_settle_id = get_id( + "select id from mcms_out_un_balance where branch_id='%s' and from_kind='CK_TH' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, hos_goods_id)) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_out_balance_detail_0919_1', id, + pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id, + out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id, + bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user, + create_time, last_modified, last_modified_user, hos_id + ) + + # 对比预期值和实际值是否一致 + 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) + result = (compare_text_index(actual_value2, expected_value2)) + print('result', result) + 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_out_balance_detail_approve_after2(type=1, pid=""): + print('===检查结算数据子表======') + if type == 1: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 2: + 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"] + branch_id = get_branch_id() + sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % ( + pid) + # 获取实际值 + actual = check_mcms_pur_plan_sql(sql) + print('actual', actual) + # sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % ( + # pid) + # id = get_id(sql) + sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % ( + pid) + id = get_id(sql) + hos_id = get_hosid() + prov_id = get_prov_id() + prov_name = get_prov_name() + sub_prov_id = prov_id + settle_dept_id = None + distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id) + if check_distr_detail_id(distr_detail_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id) + if check_batch_id(hos_batch_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + # 从文件中获取条码信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18') + list_a = info['list_a'] + bar_id = get_id("select bar_id from mcms_out_balance_detail where id='%s';" % (id)) + bar_code = get_id("select bar_code from mcms_out_balance_detail where id='%s';" % (id)) + from_id = get_id( + "select from_id from mcms_out_balance_detail where id='%s';" % (id)) + if check_batch_id(from_id) == True: + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + from_order_no = get_id( + "select order_no from mcms_psi_batch where id='%s';" % (from_id)) + + account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + create_user = account_user_id + create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id) + last_modified_user = create_user + + out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1'] + out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'] + sub_prov_name = prov_name + account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id) + un_settle_id = get_id( + "select un_settle_id from mcms_out_balance_detail where id='%s';" % id) + if check_un_balance_id(un_settle_id): + print('ok') + commonFuc().check_text_exist_result_text('success', 'success') + else: + commonFuc().check_text_exist_result_text('error', 'success') + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_out_balance_detail_0919_2', id, + pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id, + out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id, + bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user, + create_time, last_modified, last_modified_user, hos_id + ) + + # 对比预期值和实际值是否一致 + 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) + result = (compare_text_index(actual_value2, expected_value2)) + print('result', result) + 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') pro_path = commonFuc().get_pro_path2() print('pro_path', pro_path) @@ -542,32 +1129,39 @@ sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a7流程五_ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.air') from a_a7流程五_中心库入库结算_正结算3_内网验收入库结算 import check_accept_order,putaway try: - # # 验收 + # # # 验收 # check_accept_order(3) # 试剂 # time.sleep(6) - check_mcms_check(3) - time.sleep(3) - check_accept_order(2) # 高值 - time.sleep(6) - check_mcms_check(2) - time.sleep(3) - check_accept_order(1) # 低值 - time.sleep(6) - check_mcms_check(1) - # 入库上架 - putaway() - time.sleep(6) - check_mcms_psi(3) - putaway() - time.sleep(6) - check_mcms_psi(2) - putaway() - time.sleep(6) - check_mcms_psi(1) - time.sleep(3) + # check_mcms_check(3) + # time.sleep(3) + # check_accept_order(2) # 高值 + # time.sleep(6) + # check_mcms_check(2) + # time.sleep(3) + # check_accept_order(1) # 低值 + # time.sleep(6) + # check_mcms_check(1) + # # 入库上架 + # putaway() + # time.sleep(6) + # check_mcms_psi(1) + # putaway() + # time.sleep(6) + # check_mcms_psi(2) + # putaway() + # time.sleep(6) + # check_mcms_psi(3) + # time.sleep(3) OBD_ID = settle()# 生成结算单 + print(OBD_ID) + time.sleep(6) + check_mcms_out_balance(1, OBD_ID) # 检查审批前的结算数据 # 调用审批结算单 approval_center(OBD_ID) + time.sleep(6) + check_mcms_out_balance_approve_after(1, OBD_ID) # 检查审批后的结算数据 + commonFuc().check_text_exist_result_text('succees', 'succees') + except Exception as e: print('脚本出现异常,请检查脚本或者数据') print("发生异常:", str(e)) diff --git a/data/b6_spd3_core_business_flow_database_check/data b/data/b6_spd3_core_business_flow_database_check/data index 240b6f8f414ee354975bcae282ef7f10637fad0d..793f1eac3c9f0752071a50912f9f477fb80cccd5 100644 --- a/data/b6_spd3_core_business_flow_database_check/data +++ b/data/b6_spd3_core_business_flow_database_check/data @@ -446,3 +446,12 @@ "check_mcms_psi1_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "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": %s, "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}' "check_mcms_psi2_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "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": %s, "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}' "check_mcms_psi3_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "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": %s, "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}' + + +#手工采购计划入库_结算数据主表 +"check_mcms_out_balance_1008": '{"id": "%s", "order_no": "%s", "branch_id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "settle_dept_id": None, "tb_status": 0, "sum_row": 2, "settle_amount": Decimal("0.000000"), "settle_way": 0, "settle_month": "%s", "settle_start_time": %s, "settle_end_time": %s, "remark": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "check_msg": None, "settle_qty": Decimal("0.0000"), "check_user": None, "check_time": None}' +#手工采购计划入库_结算数据子表 + +"check_mcms_out_balance_detail_1008_1": '{"id": "%s", "pid": "%s", "prov_id": "%s", "prov_name": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "out_dept_id": "%s", "out_dept_name": "%s", "account_date": %s, "pur_mode": 10, "from_table": "mcms_psi_batch", "from_id": "%s", "from_order_no": "%s", "hos_goods_id": "%s", "bar_id": "%s", "bar_code": "%s", "distr_detail_id": "%s", "hos_batch_id": "%s", "tb_status": 10, "price": Decimal("99.999900"), "settle_qty": Decimal("-100.00"), "invoice_qty": Decimal("0.00"), "settle_amount": Decimal("-9999.9900"), "un_settle_id": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "settle_type": 1, "contract_id": None, "normal_contract_id": None, "temp_purchase": 0, "hos_id": "%s", "fcat_id": None, "invoice_price": Decimal("99.999900"), "online_kind": "10"}' + +"check_mcms_out_balance_detail_1008_2": '{"id": "%s", "pid": "%s", "prov_id": "%s", "prov_name": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "out_dept_id": "%s", "out_dept_name": "%s", "account_date": %s, "pur_mode": 10, "from_table": "mcms_psi_batch", "from_id": "%s", "from_order_no": "%s", "hos_goods_id": "%s", "bar_id": "%s", "bar_code": "%s", "distr_detail_id": "%s", "hos_batch_id": "%s", "tb_status": 10, "price": Decimal("99.999900"), "settle_qty": Decimal("100.00"), "invoice_qty": Decimal("0.00"), "settle_amount": Decimal("9999.9900"), "un_settle_id": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "settle_type": 1, "contract_id": None, "normal_contract_id": None, "temp_purchase": 0, "hos_id": "%s", "fcat_id": None, "invoice_price": Decimal("99.999900"), "online_kind": "10"}' \ No newline at end of file