From 37555d336fb1f8ec8dccab611477a656399dcfb5 Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Thu, 11 Jul 2024 17:41:29 +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=E8=84=9A=E6=9C=AC=E7=BC=96=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" | 124 ++++++++++-------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\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_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index 129922f8..518f8537 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\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_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\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\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -114,9 +114,9 @@ def mcms_dept_buy_detail(type=16): # 从数据库中获取实际值 actual = check_mcms_dept_buy_sql(sql1) print('actual', actual) - if type==16: + if type == 16: hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] - elif type==20: + elif type == 20: 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"] @@ -128,24 +128,28 @@ def mcms_dept_buy_detail(type=16): print('detail_id', detail_id) info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') list_a = info['list_a'] - mdm_goods_code =process_tuple(get_mdm_goods_code("select mdm_goods_code from mcms_goods_info where id='%s';"%hos_goods_id)) - goods_code = process_tuple(get_mdm_goods_code("select hos_goods_code from mcms_goods_info where id='%s';"%hos_goods_id)) - pkg_def_id = process_tuple(get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;"%hos_goods_id)) - if pkg_def_id=='None': + mdm_goods_code = process_tuple( + get_mdm_goods_code("select mdm_goods_code from mcms_goods_info where id='%s';" % hos_goods_id)) + goods_code = process_tuple( + get_mdm_goods_code("select hos_goods_code from mcms_goods_info where id='%s';" % hos_goods_id)) + pkg_def_id = process_tuple( + get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id)) + if pkg_def_id == 'None': print(pkg_def_id) - pkg_def_id=pkg_def_id.replace("'","") + pkg_def_id = pkg_def_id.replace("'", "") print(pkg_def_id) - pkg_def_name = process_tuple(get_id("select pkg_def_name from mcms_pkg where hos_goods_id='%s' LIMIT 1;"%hos_goods_id)) - create_user=get_login_user_uxid() - create_time= get_create_time("select create_time from mcms_dept_buy_detail where pid='%s';" % id1) - last_modified=create_time - last_modified_user=create_user - if type==16: + pkg_def_name = process_tuple( + get_id("select pkg_def_name from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id)) + create_user = get_login_user_uxid() + create_time = get_create_time("select create_time from mcms_dept_buy_detail where pid='%s';" % id1) + last_modified = create_time + last_modified_user = create_user + if type == 16: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_dept_buy_detail', detail_id, id1, order_no1, hos_goods_id, mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user, create_time, last_modified, last_modified_user) - elif type==20: + elif type == 20: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_dept_buy_detail1', detail_id, id1, order_no1, hos_goods_id, mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user, @@ -165,8 +169,8 @@ def mcms_dept_buy_detail(type=16): print(expected_value2) print('actual_value2') print(actual_value2) - result=(compare_text_index(actual_value2,expected_value2)) - print('result',result) + 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') @@ -183,11 +187,11 @@ def check_mcms_dept_buy(type=16): print(actual) # 获取主键id sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type) + branch_id, type) id1 = get_dept_buy_id(sql) # 获取order_no sql1 = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type) + branch_id, type) order_no1 = get_dept_buy_id(sql1) print(process_tuple(id1), process_tuple(order_no1)) id1 = process_tuple(id1) @@ -214,21 +218,21 @@ def check_mcms_dept_buy(type=16): target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';" % branch_id) bill_expdt_date = get_expdt_date( "select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) rec_user = get_login_user_uxid() # rec_addr='二级检验科002' create_user = rec_user create_time = get_create_time( "select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) last_modified = get_create_time( "select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) last_modified_user = rec_user last_auditor = rec_user last_audit_time = get_create_time( "select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) target_stock_name = '自动化测试12345' rec_addr = deptname2 if type == 16: @@ -281,11 +285,11 @@ def check_mcms_dept_buy_approval_after(type=16): print(actual) # 获取主键id sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type) + branch_id, type) id1 = get_dept_buy_id(sql) # 获取order_no sql1 = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type) + branch_id, type) order_no1 = get_dept_buy_id(sql1) print(process_tuple(id1), process_tuple(order_no1)) id1 = process_tuple(id1) @@ -312,44 +316,47 @@ def check_mcms_dept_buy_approval_after(type=16): target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';" % branch_id) bill_expdt_date = get_expdt_date( "select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) rec_user = get_login_user_uxid() # rec_addr='二级检验科002' create_user = rec_user create_time = get_create_time( "select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) last_modified = get_create_time( "select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) last_modified_user = rec_user last_auditor = rec_user last_audit_time = get_create_time( "select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( - branch_id, type)) + branch_id, type)) target_stock_name = '自动化测试12345' rec_addr = deptname2 if type == 16: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'mcms_dept_buy_approval_after', id1, order_no1, get_hosid(), branch_id, deptid2, + 'mcms_dept_buy_approval_after', id1, order_no1, get_hosid(), branch_id, + deptid2, deptname2, area_code, area_name, target_dept_id, target_dept_name, target_stock_id, target_stock_name, bill_expdt_date, rec_user, rec_addr, create_user, create_time, - last_modified, last_modified_user,last_auditor,last_audit_time) + last_modified, last_modified_user, last_auditor, last_audit_time) elif type == 20: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'mcms_dept_buy_approval_after2', id1, order_no1, get_hosid(), branch_id, deptid2, + 'mcms_dept_buy_approval_after2', id1, order_no1, get_hosid(), + branch_id, deptid2, deptname2, area_code, area_name, target_dept_id, target_dept_name, target_stock_id, target_stock_name, bill_expdt_date, rec_user, rec_addr, create_user, create_time, - last_modified, last_modified_user,last_auditor,last_audit_time) + last_modified, last_modified_user, last_auditor, last_audit_time) else: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'mcms_dept_buy_approval_after3', id1, order_no1, get_hosid(), branch_id, deptid2, + 'mcms_dept_buy_approval_after3', id1, order_no1, get_hosid(), + branch_id, deptid2, deptname2, area_code, area_name, target_dept_id, target_dept_name, target_stock_id, target_stock_name, bill_expdt_date, rec_user, rec_addr, create_user, create_time, - last_modified, last_modified_user,last_auditor,last_audit_time) + last_modified, last_modified_user, last_auditor, last_audit_time) print('expected', expected) print('aaaaaaaaaaaaaaaaa') @@ -387,9 +394,9 @@ def mcms_dept_buy_detail_approval_after(type=16): # 从数据库中获取实际值 actual = check_mcms_dept_buy_sql(sql1) print('actual', actual) - if type==16: + if type == 16: hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] - elif type==20: + elif type == 20: 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"] @@ -401,31 +408,38 @@ def mcms_dept_buy_detail_approval_after(type=16): print('detail_id', detail_id) info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') list_a = info['list_a'] - mdm_goods_code =process_tuple(get_mdm_goods_code("select mdm_goods_code from mcms_goods_info where id='%s';"%hos_goods_id)) - goods_code = process_tuple(get_mdm_goods_code("select hos_goods_code from mcms_goods_info where id='%s';"%hos_goods_id)) - pkg_def_id = process_tuple(get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;"%hos_goods_id)) - if pkg_def_id=='None': + mdm_goods_code = process_tuple( + get_mdm_goods_code("select mdm_goods_code from mcms_goods_info where id='%s';" % hos_goods_id)) + goods_code = process_tuple( + get_mdm_goods_code("select hos_goods_code from mcms_goods_info where id='%s';" % hos_goods_id)) + pkg_def_id = process_tuple( + get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id)) + if pkg_def_id == 'None': print(pkg_def_id) - pkg_def_id=pkg_def_id.replace("'","") + pkg_def_id = pkg_def_id.replace("'", "") print(pkg_def_id) - pkg_def_name = process_tuple(get_id("select pkg_def_name from mcms_pkg where hos_goods_id='%s' LIMIT 1;"%hos_goods_id)) - create_user=get_login_user_uxid() - create_time= get_create_time("select create_time from mcms_dept_buy_detail where pid='%s';" % id1) - last_modified=get_create_time("select last_modified from mcms_dept_buy_detail where pid='%s';" % id1) - last_modified_user=create_user - if type==16: + pkg_def_name = process_tuple( + get_id("select pkg_def_name from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id)) + create_user = get_login_user_uxid() + create_time = get_create_time("select create_time from mcms_dept_buy_detail where pid='%s';" % id1) + last_modified = get_create_time("select last_modified from mcms_dept_buy_detail where pid='%s';" % id1) + last_modified_user = create_user + if type == 16: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'mcms_dept_buy_detail_approval_after', detail_id, id1, order_no1, hos_goods_id, + 'mcms_dept_buy_detail_approval_after', detail_id, id1, order_no1, + hos_goods_id, mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user, create_time, last_modified, last_modified_user) - elif type==20: + elif type == 20: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'mcms_dept_buy_detail_approval_after1', detail_id, id1, order_no1, hos_goods_id, + 'mcms_dept_buy_detail_approval_after1', detail_id, id1, order_no1, + hos_goods_id, mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user, create_time, last_modified, last_modified_user) else: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'mcms_dept_buy_detail_approval_after2', detail_id, id1, order_no1, hos_goods_id, + 'mcms_dept_buy_detail_approval_after2', detail_id, id1, order_no1, + hos_goods_id, mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user, create_time, last_modified, last_modified_user) @@ -438,14 +452,16 @@ def mcms_dept_buy_detail_approval_after(type=16): print(expected_value2) print('actual_value2') print(actual_value2) - result=(compare_text_index(actual_value2,expected_value2)) - print('result',result) + 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') + + try: # ==================暂时注释=================================== # set_dept_lead() # 设置二级科室负责人 @@ -483,7 +499,7 @@ try: # mcms_dept_buy_detail(int(i)) # for i in range(6): # 三个单据共审批6次 # approval_center() - #==================上面暂时注释=================================== + # ==================上面暂时注释=================================== list_data = ['16', '20', '66'] for i in list_data: check_mcms_dept_buy_approval_after(int(i)) -- GitLab