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 b07cde4121671549213e4651f9638f74d17e8a87..984ff0122fbf4465b68478de4cf617b17c3a5f30 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,6 +1,8 @@ # -*- encoding=utf8 -*- +import time + 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 + get_login_user_uxid_bydb, get_process_list2, compare_text_index, get_prov_name from common.db.sql.sql_get_info import sql_get_info from common.fileUtls import FileUtils from common.run_cmd_script import execute_command @@ -23,28 +25,28 @@ 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;" + sql1 = "select * from spd_ybtest_hdi.company_regist_bill order by last_modified desc limit 1;" actual = check_mcms_pur_sql(sql1) print('actual', actual) - id = get_id("select id from spd_ybtest_hdi.company_regist_bill order by create_time desc limit 1;") - hos_id = get_id("select hos_id from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - prov_id = get_prov_id() - sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - contact_way = get_id("select contact_way from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - contact_user = get_id("select contact_user from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - create_time = get_create_time("select create_time from spd_ybtest_hdi.company_regist_bill 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") + id = get_id("select id from spd_ybtest_hdi.company_regist_bill order by last_modified desc limit 1;") + user_login_code=get_id("select user_login_code from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + user_login_psw=get_id("select user_login_psw from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + user_name=user_login_code + email=user_name + erp_code=user_name + cname=user_login_code + # audit_end_time = get_create_time("select audit_end_time from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + audit_end_time=None + regist_source_project=user_name + create_time= get_create_time("select create_time from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + last_modified= get_create_time("select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) 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) + supply_relation_id=get_id("select supply_relation_id from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + comp_function=get_id("select comp_function from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'company_regist_bill', id, hos_id, prov_id, sub_prov_id, contact_way - , contact_user, auditor, audit_time, create_user, create_time, - last_modified_user, last_modified) + 'company_regist_bill', id, user_login_code, user_login_psw, user_name, cname,comp_function + , email, erp_code, audit_end_time, regist_source_project, create_time, + last_modified, supply_relation_id) actual_value1 = get_process_list2(actual) expected_value1 = get_process_list2(expected) @@ -70,24 +72,27 @@ def check_company_regist_bill(type=1): actual = check_mcms_pur_sql(sql1) print('actual', actual) id = get_id("select id from spd_ybtest_hdi.company_regist_bill order by create_time desc limit 1;") - hos_id = get_id("select hos_id from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - prov_id = get_prov_id() - sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - contact_way = get_id("select contact_way from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) - contact_user = get_id("select contact_user from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + user_login_code = get_id("select user_login_code from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + user_login_psw = get_id("select user_login_psw from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + user_name = user_login_code + email = user_name + erp_code = user_name + cname = user_login_code + # audit_end_time = get_create_time("select audit_end_time from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + audit_end_time = None + regist_source_project = user_name create_time = get_create_time("select create_time from spd_ybtest_hdi.company_regist_bill 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.company_regist_bill 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.company_regist_bill where id='%s';" % id) + last_modified = get_create_time( + "select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + auditor = get_id("select auditor from spd_ybtest_hdi.supply_relation where id='%s';" % id) + supply_relation_id = get_id( + "select supply_relation_id from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + comp_function = get_id("select comp_function from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'company_regist_bill2', id, hos_id, prov_id, sub_prov_id, contact_way - , contact_user, auditor, audit_time, create_user, create_time, - last_modified_user, last_modified) + 'company_regist_bill', id, user_login_code, user_login_psw, user_name, + cname, comp_function + , email, erp_code, audit_end_time, regist_source_project, create_time, + last_modified, supply_relation_id) actual_value1 = get_process_list2(actual) expected_value1 = get_process_list2(expected) @@ -109,28 +114,23 @@ def check_company_regist_bill(type=1): def check_bas_company_info(): print('检查bas_company_info数据') branch_id = get_branch_id() - sql1 = "select * from spd_ybtest_hdi.bas_company_info order by create_time desc limit 1;" + sql1 = "select * from spd_ybtest_hdi.bas_company_info order by last_modified desc limit 1;" actual = check_mcms_pur_sql(sql1) print('actual', actual) - id = get_id("select id from spd_ybtest_hdi.bas_company_info order by create_time desc limit 1;") - hos_id = get_id("select hos_id from spd_ybtest_hdi.bas_company_info where id='%s';" % id) - prov_id = get_prov_id() - sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.bas_company_info where id='%s';" % id) - contact_way = get_id("select contact_way from spd_ybtest_hdi.bas_company_info where id='%s';" % id) - contact_user = get_id("select contact_user from spd_ybtest_hdi.bas_company_info where id='%s';" % id) - create_time = get_create_time("select create_time from spd_ybtest_hdi.bas_company_info 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.bas_company_info 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.company_regist_bill where id='%s';" % id) + id =FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] + code=id + cname=FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"] + short_pinyin=get_id("select short_pinyin from spd_ybtest_hdi.bas_company_info where id='%s';" % id) + email=cname + erp_code=cname + fill_date=get_create_time("select fill_date from spd_ybtest_hdi.bas_company_info where id='%s';" % id) + last_update_datetime=get_create_time("select last_update_datetime from spd_ybtest_hdi.bas_company_info where id='%s';" % id) + last_modified =get_create_time("select last_modified from spd_ybtest_hdi.bas_company_info where id='%s';" % id) + last_modified_user=get_id("select last_modified_user from spd_ybtest_hdi.bas_company_info where id='%s';" % id) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'bas_company_info2', id, hos_id, prov_id, sub_prov_id, contact_way - , contact_user, auditor, audit_time, create_user, create_time, - last_modified_user, last_modified) + 'check_bas_company_info', id, code, cname, short_pinyin, email + , erp_code, fill_date, last_update_datetime, last_modified, last_modified_user + ) actual_value1 = get_process_list2(actual) expected_value1 = get_process_list2(expected) @@ -152,28 +152,21 @@ def check_bas_company_info(): def check_sys_org(): print('检查sys_org数据') branch_id = get_branch_id() - sql1 = "select * from spd_ybtest_hdi.sys_org order by create_time desc limit 1;" + sql1 = "select * from spd_ybtest_hdi.sys_org where corp_id='%s';"% FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] actual = check_mcms_pur_sql(sql1) print('actual', actual) - id = get_id("select id from spd_ybtest_hdi.sys_org order by create_time desc limit 1;") - hos_id = get_id("select hos_id from spd_ybtest_hdi.sys_org where id='%s';" % id) - prov_id = get_prov_id() - sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.sys_org where id='%s';" % id) - contact_way = get_id("select contact_way from spd_ybtest_hdi.sys_org where id='%s';" % id) - contact_user = get_id("select contact_user from spd_ybtest_hdi.sys_org where id='%s';" % id) - create_time = get_create_time("select create_time from spd_ybtest_hdi.sys_org 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.sys_org 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.sys_org where id='%s';" % id) - last_modified = get_create_time("select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + id = get_id("select id from spd_ybtest_hdi.sys_org where corp_id='%s';"% FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]) + code=FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] + corp_id=FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] + last_update_datetime = get_create_time("select last_update_datetime from spd_ybtest_hdi.sys_org where id='%s';" % id) + create_time= get_create_time("select create_time from spd_ybtest_hdi.sys_org where id='%s';" % id) + create_user= get_id("select create_user from spd_ybtest_hdi.sys_org where id='%s';" % id) + last_modified_user= get_id("select last_modified_user from spd_ybtest_hdi.sys_org where id='%s';" % id) + + last_modified = get_create_time("select last_modified from spd_ybtest_hdi.sys_org where id='%s';" % id) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'sys_org2', id, hos_id, prov_id, sub_prov_id, contact_way - , contact_user, auditor, audit_time, create_user, create_time, - last_modified_user, last_modified) + 'check_sys_org', id, code, corp_id, last_update_datetime,create_time, create_user + , last_modified_user, last_modified) actual_value1 = get_process_list2(actual) expected_value1 = get_process_list2(expected) @@ -199,24 +192,19 @@ def check_sys_user(): actual = check_mcms_pur_sql(sql1) print('actual', actual) id = get_id("select id from spd_ybtest_hdi.sys_user order by create_time desc limit 1;") - hos_id = get_id("select hos_id from spd_ybtest_hdi.sys_user where id='%s';" % id) - prov_id = get_prov_id() - sub_prov_id = get_id("select sub_prov_id from spd_ybtest_hdi.sys_user where id='%s';" % id) - contact_way = get_id("select contact_way from spd_ybtest_hdi.sys_user where id='%s';" % id) - contact_user = get_id("select contact_user from spd_ybtest_hdi.sys_user where id='%s';" % id) + user_code = get_id("select user_code from spd_ybtest_hdi.sys_user where id='%s';" % id) + corp_id = get_id("select corp_id from spd_ybtest_hdi.sys_user where id='%s';" % id) + last_update_datetime = get_create_time( + "select last_update_datetime from spd_ybtest_hdi.sys_user where id='%s';" % id) create_time = get_create_time("select create_time from spd_ybtest_hdi.sys_user 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.sys_user 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.sys_user where id='%s';" % id) - last_modified = get_create_time("select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';" % id) + create_user = get_id("select create_user from spd_ybtest_hdi.sys_user where id='%s';" % id) + last_modified_user = get_id("select last_modified_user from spd_ybtest_hdi.sys_user where id='%s';" % id) + + last_modified = get_create_time("select last_modified from spd_ybtest_hdi.sys_user where id='%s';" % id) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'sys_user2', id, hos_id, prov_id, sub_prov_id, contact_way - , contact_user, auditor, audit_time, create_user, create_time, - last_modified_user, last_modified) + 'check_sys_user', id, user_code, last_update_datetime, create_time, + create_user + , last_modified, last_modified_user,corp_id) actual_value1 = get_process_list2(actual) expected_value1 = get_process_list2(expected) @@ -374,14 +362,20 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a1_流程一外网企 from a_a1_流程一外网企业注册审批 import test1,test2,test3 def main(): - test1() + test1()#企业注册 + time.sleep(6) check_company_regist_bill(1) check_bas_company_info() - test2() + test2()#企业审核 + time.sleep(6) + check_sys_org() + check_sys_user() check_company_regist_bill(2) test3() try: main() commonFuc().check_text_exist_result_text('succees','succees') -except: +except Exception as e: + # 打印错误信息 + print(f"发生错误: {e}") commonFuc().check_text_exist_result_text('error','succees') \ No newline at end of file diff --git a/data/b6_spd3_core_business_flow_database_check/data b/data/b6_spd3_core_business_flow_database_check/data index f7c91fb4c038b391d981c7c484ce8b95a3cdcbae..6a3f8c683dac097fcc756c571865f51701c1c110 100644 --- a/data/b6_spd3_core_business_flow_database_check/data +++ b/data/b6_spd3_core_business_flow_database_check/data @@ -532,4 +532,10 @@ #检查供应关系表 "check_supply_relation": '{"id": "%s", "hos_id": "%s", "prov_id": "%s", "sub_prov_id": "%s", "client_type": "1", "invitation_code": None, "contact_way": "%s", "contact_user": "%s", "tb_status": 20, "active_flag": "1", "auditor": "%s", "audit_time": %s, "audit_comment": None, "version": 1, "create_user": "GYQX-SPD:user-19669", "create_time": %s, "last_modified_user": "h0347:UID-042066", "last_modified": %s}' -"check_supply_relation2": '{"id":"%s","hos_id":"%s","prov_id":"%s","sub_prov_id":"%s","client_type":"2","invitation_code":"","contact_way":"%s","contact_user":"%s","tb_status":20,"active_flag":"1","auditor":"%s","audit_time":%s,"audit_comment":null,"version":1,"create_user":"%s","create_time":%s,"last_modified_user":"%s","last_modified":%s}' \ No newline at end of file +"check_supply_relation2": '{"id":"%s","hos_id":"%s","prov_id":"%s","sub_prov_id":"%s","client_type":"2","invitation_code":"","contact_way":"%s","contact_user":"%s","tb_status":20,"active_flag":"1","auditor":"%s","audit_time":%s,"audit_comment":null,"version":1,"create_user":"%s","create_time":%s,"last_modified_user":"%s","last_modified":%s}' + +# +"company_regist_bill": '{"id": "%s", "user_login_code": "%s", "user_login_psw": "%s", "user_name": "%s", "cname": "%s", "short_name": "", "up_company_id": "", "comp_kind": 0, "comp_function": "%s", "province": None, "city": None, "area": "", "area_code": None, "legal": "", "address": "", "is_abroad": 1, "nation": None, "regist_contact_user": "", "regist_contact_way": "", "email": "%s@sina.com", "hos_property": None, "hos_level": None, "erp_code": "%s", "reg_code": None, "jyxk_code": None, "jyxkba_code": None, "scxkz_code": None, "scbapz_code": None, "is_locked": 0, "audit_status": 10, "audit_start_time": None, "audit_end_time": %s, "auditor": None, "audit_comment": None, "regist_source_project": "%s", "data_entrance": "注册", "import_task_mfrs_id": None, "version": 0, "create_user_corp_id": None, "create_user": None, "create_time": %s, "last_modified_user": null, "last_modified": %s, "hos_spd_type": None, "organization_code": None, "spd_project_code": null, "admin_role": null, "client_type": null, "prov_id": None, "is_drug_prov": None, "is_drug_lic": None, "is_apparatus_prov": None, "is_apparatus_register": None, "user_role": null, "supply_relation_id": %s}' +"check_bas_company_info": '{"id": "%s", "code": "%s", "cname": "%s", "another_name": "", "short_pinyin": "%s", "reg_code": None, "jyxk_code": None, "nsrsb_code": None, "kind": "4", "legal": "", "address": "", "linkman": "", "contact_way": "", "contact_fax": None, "logo": None, "post_code": None, "email": "%s@sina.com", "remark": None, "erp_code": "%s", "is_supply": None, "is_three_in_one": None, "master_code": None, "flag": "1", "nation": None, "province": None, "city": None, "area": "", "area_code": None, "mfrs_kind": None, "uxid": None, "fill_date": %s, "last_update_datetime": %s, "version": 2, "ygcode": None, "agent_name": None, "record_card": None, "product_code": None, "business_scope": None, "new_business_scope": None, "two_business_scope": None, "new_two_business_scope": None, "three_business_scope": None, "new_three_business_scope": None, "audit_remark": None, "changed_remark": None, "status": None, "create_user": None, "create_time": None, "last_modified": %s, "last_modified_user": "%s"}' +"check_sys_org": '{"id":"%s","pid":"/","code":"%s:001","self_code":null,"corp_id":"%s","corp_kind":"4","ename":"配送机构","cname":"配送机构","ordinal":1,"short_pinyin":"psjg","address":null,"contact_way":null,"scm_code":null,"erp_code":null,"remark":null,"node_kind":null,"flag":"1","last_update_datetime":%s,"version":0,"branch_id":null,"dept_kind":null,"create_time":%s,"create_user":"%s","last_modified_user":"%s","last_modified":%s,"dept_cate":null,"user_leader_id":null,"dept_level":null,"dept_type":null,"ext1":null,"ext2":null,"ext3":null,"ext4":null,"ext5":null}' +"check_sys_user": '{"id":"%s","user_code":"%s","kind":"0","enable_flag":1,"create_datetime":null,"create_user_id":null,"last_update_datetime":%s,"version":0,"create_time":%s,"create_user":"%s","last_modified":%s,"last_modified_user":"%s","corp_id":"%s"}' \ No newline at end of file