diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\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_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index cfe72ece6e5e08af2f1764c69f852626958b6efd..c5436eee3e823355dbbb47ffe27dc4b04c70c344 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\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_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_a4_\346\265\201\347\250\213\345\233\233_\345\237\272\347\241\200\346\250\241\345\235\227\350\256\276\347\275\256_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -21,28 +21,111 @@ import time module = "b6_spd3_core_business_flow_database_check" +def check_test1_info(): + print('检查院区数据,科室数据,库房库区数据') + # 获取实际值 + # 要验证的数据sql + sql1 = "select * from mcms_branch_info order by create_time desc LIMIT 1;" + actual = check_mcms_pur_sql(sql1) + print('actual', actual) + id = get_id("select id from mcms_branch_info order by create_time desc LIMIT 1;") + branch_id = get_branch_id() + if branch_id == id: + print('ok') + commonFuc().check_text_exist_result_text('succees', 'succees') + else: + commonFuc().check_text_exist_result_text('error', 'succees') + hos_id = get_hosid() + name = get_id("select name from mcms_branch_info order by create_time desc LIMIT 1;") + address = name + create_time = get_create_time("select create_time from mcms_branch_info where id='%s';" % id) + last_modified = get_create_time("select last_modified from mcms_branch_info where id='%s';" % id) + username=commonFuc().get_business_data('b2_herp3_bs', "username") + create_user=get_login_user_uxid_bydb(username) + last_modified_user = create_user + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_branch_info', id, hos_id, name, address, create_time,create_user + , 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') + # 验证科室数据 + # 要验证的数据sql + for i in range(4): + sql1 = "select * from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"%(branch_id,i) + actual = check_mcms_pur_sql(sql1) + print('actual', actual) + id = get_id("select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"%(branch_id,i)) + pid =get_id("select pid from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"%(branch_id,i)) + code = get_id("select code from sys_org where branch_id='%s' and id='%s';"%(branch_id,id)) + corp_id = get_hosid() + last_update_datetime = get_create_time("select last_update_datetime from sys_org where id='%s';" % id) + create_time = get_create_time("select create_time from sys_org where id='%s';" % id) + last_modified = get_create_time("select last_modified from sys_org where id='%s';" % id) + if i<3: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_dept_info'+str(i), id, pid, code, corp_id,branch_id, last_update_datetime + , create_time, create_user,last_modified_user,last_modified) + else: + user_leader_id=get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_dept_info' + str(i), id, pid, code, corp_id, branch_id, + last_update_datetime + , create_time, create_user, last_modified_user, last_modified,user_leader_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) sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air') using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air') -from a_a4_流程四_基础模块设置 import test1,test2, grants_user, add_StockArea - +from a_a4_流程四_基础模块设置 import test1, test2, grants_user, add_StockArea try: + # ==============删除业务数据和报表数据 - # delData().Delete_business_Data()#删除业务数据 - # delData().Del_reporter_data() # 删除报表数据 - #==============删除业务数据和报表数据 - test1()#参数2是新增院区后缀为6位数的参数1是老模式 - test2()# 科室添加产品信息(产品是从外网同步过来的) - dept_query_all()# 科室查询,将科室id写入文件中 - grants_user()#给用户授权 - set_dept_lead1() #设置一级科室负责人 - add_StockArea()#添加库区 + # test1()#参数2是新增院区后缀为6位数的参数1是老模式 + # 检查院区数据,科室数据,库房库区数据 + check_test1_info() + + test2() # 科室添加产品信息(产品是从外网同步过来的) + dept_query_all() # 科室查询,将科室id写入文件中 + grants_user() # 给用户授权 + set_dept_lead1() # 设置一级科室负责人 + add_StockArea() # 添加库区 commonFuc().check_text_exist_result_text('succees', 'succees') print('=================流程四结束=================') except Exception as e: - commonFuc().check_text_exist_result_text('succees','error') - print("发生异常:", str(e)) \ No newline at end of file + commonFuc().check_text_exist_result_text('succees', 'error') + 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 3dafe987f99c438ebaef24806dad20e95f1620da..00dd77b587beebdeff0b091371733408f80bcb90 100644 --- a/data/b6_spd3_core_business_flow_database_check/data +++ b/data/b6_spd3_core_business_flow_database_check/data @@ -475,3 +475,11 @@ "check_mcms_invoice_detail_1009_2": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("100.00"), "invoice_amount": Decimal("9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}' #中心库入库结算_正结算_付款单主表 "check_mcms_invoice_ext_1009": '{"id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "payment_status": 20, "pay_channel": "YGPT", "pay_amount": Decimal("9999.9900"), "remain_pay_amount": Decimal("0.0000"), "remark": None, "pay_date": %s, "pay_count": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "pay_user": "%s"}' + +#院区数据 +"check_mcms_branch_info": '{"id": "%s", "hos_id": "%s", "name": "%s", "yb_flag": "0", "main_branch": 0, "address": "%s", "province": "11", "city": "1101", "area": "110101", "tb_status": 1, "remark": None, "version": 0, "short_name": None, "create_time": %s, "create_user": "%s", "last_modified": %s, "last_modified_user": "%s"}' +#科室数据 +"check_dept_info0": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "科室004", "cname": "科室004", "dept_level": 4, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 5, "ordinal": None, "short_pinyin": "ks004", "address": "三级科室004", "contact_way": "三级科室004", "scm_code": None, "erp_code": "004", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}' +"check_dept_info1": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "三级检测组003", "cname": "三级检测组003", "dept_level": 3, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 7, "ordinal": None, "short_pinyin": "sjjcz003", "address": "三级检测组003", "contact_way": "12401003250", "scm_code": None, "erp_code": "003", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}' +"check_dept_info2": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "二级检验科002", "cname": "二级检验科002", "dept_level": 2, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 7, "ordinal": None, "short_pinyin": "ejjyk002", "address": "二级检验科002", "contact_way": "13401003250", "scm_code": None, "erp_code": "002", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}' +"check_dept_info3": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "设备科001", "cname": "设备科001", "dept_level": 1, "dept_type": "1", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 1, "ordinal": None, "short_pinyin": "sbk001", "address": "设备科001", "contact_way": "13401003250", "scm_code": None, "erp_code": "001", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 1, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": "%s"}' \ No newline at end of file