From 4adb91e4db79e2d203cbc4a773e74c56dd09c146 Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Fri, 8 Nov 2024 09:30:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=B8=80=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50\345\206\214\345\256\241\346\211\271.py" | 4 + ...56\345\272\223\351\252\214\350\257\201.py" | 96 ++++++++++++++++++- common/db/sql/sql_tools.py | 4 +- data/a2_mdm3_ea/message | 4 +- data/a3_mdm3_hs/message | 4 +- report/summary.html | 38 +++++++- 6 files changed, 137 insertions(+), 13 deletions(-) diff --git "a/air_case/b5_spd3_core_business_flow/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.py" "b/air_case/b5_spd3_core_business_flow/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.py" index 90de4256..2e2750fa 100644 --- "a/air_case/b5_spd3_core_business_flow/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.py" +++ "b/air_case/b5_spd3_core_business_flow/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271.py" @@ -21,13 +21,17 @@ import sys def test1(): #企业注册 execute_command("python runner_test.py tag id2232 debug mdm3") +def test2(): #企业审核 execute_command("python runner_test.py tag id2248 debug mdm3") +def test3(): #医院注册审核 execute_command("python runner_test.py tag id2249 debug mdm3") def main(): try: test1() + test2() + test3() commonFuc().check_text_exist_result_text('succees', 'succees') print('=================流程一结束=================') except: diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\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_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index 975e8a7e..9eb8bced 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\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_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a1_\346\265\201\347\250\213\344\270\200\345\244\226\347\275\221\344\274\201\344\270\232\346\263\250\345\206\214\345\256\241\346\211\271_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -1,4 +1,6 @@ # -*- encoding=utf8 -*- +from air_case.public1.public1.public1 import get_branch_id, check_mcms_pur_sql, get_id, get_prov_id, get_create_time, \ + get_login_user_uxid_bydb, get_process_list2, compare_text_index from common.db.sql.sql_get_info import sql_get_info from common.fileUtls import FileUtils from common.run_cmd_script import execute_command @@ -17,15 +19,105 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_ from airtest.core.api import using import sys +def check_company_regist_bill(type=1): + if type==1: + print('检查企业注册信息数据') + branch_id = get_branch_id() + sql1 = "select * from spd_ybtest_hdi.company_regist_bill order by create_time desc limit 1;" + actual = check_mcms_pur_sql(sql1) + print('actual', actual) + id = get_id("select id from spd_ybtest_hdi.supply_relation order by create_time desc limit 1;") + hos_id = get_id("select hos_id from spd_ybtest_hdi.supply_relation where id='%s';" % id) + prov_id = get_prov_id() + sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.supply_relation where id='%s';" % id) + contact_way = get_id("select contact_way from spd_ybtest_hdi.supply_relation where id='%s';" % id) + contact_user = get_id("select contact_user from spd_ybtest_hdi.supply_relation where id='%s';" % id) + create_time = get_create_time("select create_time from spd_ybtest_hdi.supply_relation where id='%s';" % id) + # last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id) + # username = commonFuc().get_business_data('b2_herp3_bs', "username") + auditor = get_id("select auditor from spd_ybtest_hdi.supply_relation where id='%s';" % id) + create_user = get_login_user_uxid_bydb( + FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]) + last_modified_user = get_id("select id from spd_ybtest_hdi.sys_user where user_code='test_1';") + audit_time = get_create_time("select audit_time from spd_ybtest_hdi.supply_relation where id='%s';" % id) + last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_supply_relation2', id, hos_id, prov_id, sub_prov_id, contact_way + , contact_user, auditor, audit_time, create_user, create_time, + last_modified_user, last_modified) + + 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') + else: + print('检查医院注册信息数据') + branch_id = get_branch_id() + sql1 = "select * from spd_ybtest_hdi.company_regist_bill order by create_time desc limit 1;" + actual = check_mcms_pur_sql(sql1) + print('actual', actual) + id = get_id("select id from spd_ybtest_hdi.supply_relation order by create_time desc limit 1;") + hos_id = get_id("select hos_id from spd_ybtest_hdi.supply_relation where id='%s';" % id) + prov_id = get_prov_id() + sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.supply_relation where id='%s';" % id) + contact_way = get_id("select contact_way from spd_ybtest_hdi.supply_relation where id='%s';" % id) + contact_user = get_id("select contact_user from spd_ybtest_hdi.supply_relation where id='%s';" % id) + create_time = get_create_time("select create_time from spd_ybtest_hdi.supply_relation where id='%s';" % id) + # last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id) + # username = commonFuc().get_business_data('b2_herp3_bs', "username") + auditor = get_id("select auditor from spd_ybtest_hdi.supply_relation where id='%s';" % id) + create_user = get_login_user_uxid_bydb( + FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]) + last_modified_user = get_id("select id from spd_ybtest_hdi.sys_user where user_code='test_1';") + audit_time = get_create_time("select audit_time from spd_ybtest_hdi.supply_relation where id='%s';" % id) + last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_supply_relation2', id, hos_id, prov_id, sub_prov_id, contact_way + , contact_user, auditor, audit_time, create_user, create_time, + last_modified_user, last_modified) + + 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) sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a1_流程一外网企业注册审批.air') using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a1_流程一外网企业注册审批.air') -from a_a1_流程一外网企业注册审批 import test1 +from a_a1_流程一外网企业注册审批 import test1,test2,test3 def main(): test1() - + check_company_regist_bill(1) + test2() + check_company_regist_bill(2) + test3() try: main() commonFuc().check_text_exist_result_text('succees','succees') diff --git a/common/db/sql/sql_tools.py b/common/db/sql/sql_tools.py index a3de50fa..072f47db 100644 --- a/common/db/sql/sql_tools.py +++ b/common/db/sql/sql_tools.py @@ -101,7 +101,7 @@ def main2(hos_goods_id): sterilize_flag, multi_charge_flag, use_frequency, - charge_unit FROM mcms_goods_info WHERE id ='%s';""" % hos_goods_id + charge_unit FROM mcms_goods_info WHERE id ='%s';""" % hos_goods_id res_dict = get_dict_data_sql(cursor, sql) print('res_dict', res_dict) return res_dict @@ -248,7 +248,7 @@ def get_id(sql): def get_DRId(branch_id, type): db, cursor = get_sql_conn() cursor.execute( - "select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_LYTK' order by CREATE_TIME desc LIMIT 1;"%(branch_id,type)) + "select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_LYTK' order by CREATE_TIME desc LIMIT 1;"%(branch_id,type)) results = cursor.fetchone() str1 = str(results) new_str1 = str1.replace(',)', '') diff --git a/data/a2_mdm3_ea/message b/data/a2_mdm3_ea/message index dbd86494..42724a5f 100644 --- a/data/a2_mdm3_ea/message +++ b/data/a2_mdm3_ea/message @@ -1,3 +1,3 @@ 企业信息: - e_id: CR202411070074 - cname: 国药集团公司NHDet + e_id: CR202411080066 + cname: 国药集团公司Qaglp diff --git a/data/a3_mdm3_hs/message b/data/a3_mdm3_hs/message index c030bf48..695647fe 100644 --- a/data/a3_mdm3_hs/message +++ b/data/a3_mdm3_hs/message @@ -1,3 +1,3 @@ 医院信息: - h_id: 湖南省人民医院fwl2B - h_name: 湖南省人民医院fwl2B + h_id: 湖南省人民医院pFgNk + h_name: 湖南省人民医院pFgNk diff --git a/report/summary.html b/report/summary.html index 5485dcdd..8e7636d2 100644 --- a/report/summary.html +++ b/report/summary.html @@ -75,9 +75,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间 - 1 - 1 - 0分2秒 + 5 + 5 + 0分4秒 100.0% @@ -93,9 +93,37 @@ setInterval(updateTime, 1000); // 每秒更新一次时间 - r_b6科室管理_科室人员查询_按科室查询人员_设置科室负责人 + 医院注册_正常注册_私立医院 成功 - 2.254 + 0.354 + xiaohesheng + + + + 医院注册_注册时医院已存在 + 成功 + 0.462 + xiaohesheng + + + + 医院注册正常注册公立医院 + 成功 + 0.343 + xiaohesheng + + + + 注册医院审核通过 + 成功 + 1.548 + xiaohesheng + + + + 注册医院审核驳回 + 成功 + 1.132 xiaohesheng -- GitLab