From 9a3d4dbaf0f2c35d6c4bd70c4e775ccb4bbcf05d Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Thu, 19 Oct 2023 14:56:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=91=E5=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\225\206\346\237\245\350\257\242byName.py" | 57 +++++++++++++++++ ...21\345\256\244\346\237\245\350\257\242.py" | 52 +++++++++++++++ ...55\345\277\203\345\272\223\346\210\277.py" | 53 +++++++++++++++ ...44\345\267\262\345\255\230\345\234\250.py" | 53 +++++++++++++++ ...45\350\257\242\347\247\221\345\256\244.py" | 56 ++++++++++++++++ ...14\347\272\247\345\272\223\346\210\277.py" | 53 +++++++++++++++ ...\350\257\242\347\247\221\345\256\244ID.py" | 64 +++++++++++++++++++ common/db/sql/sql_del_branch_info.py | 2 +- common/db/sql/sql_del_notices_info.py | 2 +- common/fileUtls.py | 49 +++++++++++++- data/a2_herp3_bs/data | 32 ++++++++++ data/a2_herp3_bs/message | 7 +- report/summary.html | 4 +- 13 files changed, 477 insertions(+), 7 deletions(-) create mode 100644 "air_case/a2_herp3_bs/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.air/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.py" create mode 100644 "air_case/a2_herp3_bs/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.air/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.py" create mode 100644 "air_case/a2_herp3_bs/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.air/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.py" create mode 100644 "air_case/a2_herp3_bs/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.air/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.py" create mode 100644 "air_case/a2_herp3_bs/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.air/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.py" create mode 100644 "air_case/a2_herp3_bs/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.air/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.py" create mode 100644 "air_case/a2_herp3_bs/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.air/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.py" diff --git "a/air_case/a2_herp3_bs/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.air/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.py" "b/air_case/a2_herp3_bs/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.air/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.py" new file mode 100644 index 00000000..065456d3 --- /dev/null +++ "b/air_case/a2_herp3_bs/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.air/b8_\345\216\202\345\225\206\347\256\241\347\220\206_\345\216\202\345\225\206\346\237\245\350\257\242byName.py" @@ -0,0 +1,57 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,b8_厂商管理_厂商查询byName,id2263,id2263-18,sit,on +主数据平台:b8_厂商管理_厂商查询byName +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def facturer_query_byID(): + """ + 场景:b8_厂商管理_厂商查询byName + 用例名称:b8_厂商管理_厂商查询byName + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #b8_厂商管理_厂商查询byName + notices_id = FileUtils().r_info3(module, '公告新增')["notices_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "firmpage_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + # # print(notices_id,notices_title) + # expireDate=timeUtils().get_time_add(30) + # # print(expireDate) + # #请求体 + request_body=commonFuc().get_business_data(module, "payload12") + # print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # checkDict=commonFuc().get_business_data(module,'checkDict2') + # #断言 + # id=commonFuc().analysis_json('id',commonFuc().analysis_json('data',commonFuc().analysis_json('data',result))) + # print(id) + commonFuc().check_text_exist('国药集团浙江医疗器材有限公司',result) +facturer_query_byID() + diff --git "a/air_case/a2_herp3_bs/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.air/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.py" "b/air_case/a2_herp3_bs/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.air/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.py" new file mode 100644 index 00000000..6f1066e2 --- /dev/null +++ "b/air_case/a2_herp3_bs/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.air/b9_\347\247\221\345\256\244\347\256\241\347\220\206_\347\247\221\345\256\244\347\231\273\350\256\260_\347\247\221\345\256\244\346\237\245\350\257\242.py" @@ -0,0 +1,52 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,b9_科室管理_科室登记_科室查询,id2263,id2263-19,sit,on +主数据平台:b9_科室管理_科室登记_科室查询 +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def dept_query_byID(): + """ + 场景:b9_科室管理_科室登记_科室查询 + 用例名称:b9_科室管理_科室登记_科室查询 + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #b9_科室管理_科室登记_科室查询 + branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "deptPage_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + + # #请求体 + request_body=commonFuc().get_business_data(module, "payload13",branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # #断言 + commonFuc().check_text_exist('[]',result) +dept_query_byID() + diff --git "a/air_case/a2_herp3_bs/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.air/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.py" "b/air_case/a2_herp3_bs/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.air/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.py" new file mode 100644 index 00000000..a621d457 --- /dev/null +++ "b/air_case/a2_herp3_bs/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.air/c0_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\350\256\276\345\244\207\347\247\221_\344\270\255\345\277\203\345\272\223\346\210\277.py" @@ -0,0 +1,53 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,c0_新增科室_特殊科室_设备科_中心库房,id2263,id2263-20,sit,on +主数据平台:c0_新增科室_特殊科室_设备科_中心库房 +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def add_center_dept(): + """ + 场景:c0_新增科室_特殊科室_设备科_中心库房 + 用例名称:c0_新增科室_特殊科室_设备科_中心库房 + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #c0_新增科室_特殊科室_设备科_中心库房 + branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "dept_insert_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + + # #请求体 + request_body=commonFuc().get_business_data(module, "payload14",branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # #断言 + checkDict=commonFuc().get_business_data(module,'checkDict2') + commonFuc().check_result(checkDict,result) +add_center_dept() + diff --git "a/air_case/a2_herp3_bs/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.air/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.py" "b/air_case/a2_herp3_bs/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.air/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.py" new file mode 100644 index 00000000..63385a26 --- /dev/null +++ "b/air_case/a2_herp3_bs/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.air/c1_\346\226\260\345\242\236\347\247\221\345\256\244_\347\247\221\345\256\244\345\267\262\345\255\230\345\234\250.py" @@ -0,0 +1,53 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,c1_新增科室_科室已存在,id2263,id2263-21,sit,on +主数据平台:c1_新增科室_科室已存在 +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def add_center_dept(): + """ + 场景:c1_新增科室_科室已存在 + 用例名称:c1_新增科室_科室已存在 + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #c1_新增科室_科室已存在 + branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "dept_insert_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + + # #请求体 + request_body=commonFuc().get_business_data(module, "payload14",branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # #断言 + checkDict=commonFuc().get_business_data(module,'checkDict7') + commonFuc().check_result(checkDict,result) +add_center_dept() + diff --git "a/air_case/a2_herp3_bs/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.air/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.py" "b/air_case/a2_herp3_bs/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.air/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.py" new file mode 100644 index 00000000..92a0370f --- /dev/null +++ "b/air_case/a2_herp3_bs/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.air/c2_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244.py" @@ -0,0 +1,56 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,c2_新增科室后查询科室,id2263,id2263-22,sit,on +主数据平台:c2_新增科室后查询科室 +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def add_select_dept(): + """ + 场景:c2_新增科室后查询科室 + 用例名称:c2_新增科室后查询科室 + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #c2_新增科室后查询科室 + branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "deptPage_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + + # #请求体 + request_body=commonFuc().get_business_data(module, "payload13",branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # #断言 + total=commonFuc().analysis_json('total',commonFuc().analysis_json('data',result)) + if total>=1: + commonFuc().check_text_exist('0',result) + else: + commonFuc().check_text_exist('500', result) +add_select_dept() + diff --git "a/air_case/a2_herp3_bs/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.air/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.py" "b/air_case/a2_herp3_bs/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.air/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.py" new file mode 100644 index 00000000..63b2ce95 --- /dev/null +++ "b/air_case/a2_herp3_bs/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.air/c3_\346\226\260\345\242\236\347\247\221\345\256\244_\347\211\271\346\256\212\347\247\221\345\256\244_\344\272\214\347\272\247\345\272\223\346\210\277.py" @@ -0,0 +1,53 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,c0_新增科室_特殊科室_设备科_中心库房,id2263,id2263-23,sit,on +主数据平台:c0_新增科室_特殊科室_设备科_中心库房 +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def add_center_dept(): + """ + 场景:c0_新增科室_特殊科室_设备科_中心库房 + 用例名称:c0_新增科室_特殊科室_设备科_中心库房 + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #c0_新增科室_特殊科室_设备科_中心库房 + branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "dept_insert_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + + # #请求体 + request_body=commonFuc().get_business_data(module, "payload15",branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # #断言 + checkDict=commonFuc().get_business_data(module,'checkDict2') + commonFuc().check_result(checkDict,result) +add_center_dept() + diff --git "a/air_case/a2_herp3_bs/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.air/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.py" "b/air_case/a2_herp3_bs/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.air/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.py" new file mode 100644 index 00000000..28510fae --- /dev/null +++ "b/air_case/a2_herp3_bs/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.air/c4_\346\226\260\345\242\236\347\247\221\345\256\244\345\220\216\346\237\245\350\257\242\347\247\221\345\256\244ID.py" @@ -0,0 +1,64 @@ +# -*- encoding=utf8 -*- +from common.db.sql.sql_del_branch_info import delByBranchId +from common.db.sql.sql_del_notices_info import delByNoticeName +from common.fileUtls import FileUtils +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,c4_新增科室后查询科室ID,id2263,id2263-24,sit,on +主数据平台:c4_新增科室后查询科室ID +""" + +from common.common_func import commonFuc +from air_case.a1_herp3_login.登录内网系统.登录内网系统 import login_system + +module = "a2_herp3_bs" +def add_select_dept(): + """ + 场景:c4_新增科室后查询科室ID + 用例名称:c4_新增科室后查询科室ID + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} + """ + #内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token,projectCode,uxid,corpId,info= login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #c4_新增科室后查询科室ID + branch_id = FileUtils().r_info(module, '院区新增')["branch_id"] + url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "deptPage_url") + + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + + + # #请求体 + request_body=commonFuc().get_business_data(module, "payload13",branch_id) + print(request_body) + # # # 发送请求 + result = commonFuc().http_post(url,request_body,headers) + print('result', result) + # #断言 + total=commonFuc().analysis_json('total',commonFuc().analysis_json('data',result)) + if total>=2: + commonFuc().check_text_exist('0',result) + data=commonFuc().analysis_json('data',commonFuc().analysis_json('data',result)) + deptid2=commonFuc().analysis_json('id',data[1]) + ename2=commonFuc().analysis_json('ename',data[1]) + print('deptid2',deptid2,ename2) + info=(deptid2,ename2) + titlename=('科室id','科室名称') + #将二级科室id写入文件中 + FileUtils().w_info4(info,module,'科室信息',titlename) + else: + commonFuc().check_text_exist('500', result) +add_select_dept() + diff --git a/common/db/sql/sql_del_branch_info.py b/common/db/sql/sql_del_branch_info.py index b11a6337..b413f63d 100644 --- a/common/db/sql/sql_del_branch_info.py +++ b/common/db/sql/sql_del_branch_info.py @@ -6,7 +6,7 @@ import pymysql class delByBranchId(object): def Delete_branch_by_id(self,id): - connection = pymysql.connect(host="10.17.65.108", user="root", password="Gyxc.2023", database="spd3_herp_test2", + connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2", charset="utf8") cursor = connection.cursor() # 删除新增的院区数据,减少垃圾数据的产生,保证脚本下次还可以正常运行,接口脚本每次都使用新增数据 diff --git a/common/db/sql/sql_del_notices_info.py b/common/db/sql/sql_del_notices_info.py index ad34431c..7571d1d4 100644 --- a/common/db/sql/sql_del_notices_info.py +++ b/common/db/sql/sql_del_notices_info.py @@ -6,7 +6,7 @@ import pymysql class delByNoticeName(object): def delete_ByNoticeName(self): - connection = pymysql.connect(host="10.17.65.108", user="root", password="Gyxc.2023", database="spd3_herp_test2", + connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2", charset="utf8") cursor = connection.cursor() # 删除新增的院区数据,减少垃圾数据的产生,保证脚本下次还可以正常运行,接口脚本每次都使用新增数据 diff --git a/common/fileUtls.py b/common/fileUtls.py index bf0858a0..72cf984e 100644 --- a/common/fileUtls.py +++ b/common/fileUtls.py @@ -52,7 +52,32 @@ class FileUtils(object): # 写入到yaml文件 with open(yamlpath, "w", encoding="utf-8") as f: yaml.dump(dict, f, Dumper=yaml.RoundTripDumper,allow_unicode=True) - + #写入院区数据,新函数,存在已有内容,替换掉旧内容 + def w_info2_new(self, newinfo, module, keyname, oldinfo): + module = module + dict = {} + value = {} + value['branch_id'] = newinfo[0] + value['branch_name'] = newinfo[1] + key = keyname + dict[key] = value + w_path = rootPath + os.sep + 'data' + os.sep + module + # print(w_path) + yamlpath = os.path.join(w_path, "message") + if (self.r_info(module, keyname) != None): + # 替换文件内容 + file = open(yamlpath, "r+", encoding="utf-8") + content = file.read() + for i in range(len(newinfo)): + new_content = content.replace(oldinfo[i], newinfo[i]) + file.seek(0) + file.write(new_content) + file.close() + else: + # 写入到yaml文件 + with open(yamlpath, "a", encoding="utf-8") as f: + yaml.dump(dict, f, Dumper=yaml.RoundTripDumper, allow_unicode=True) + #写入院区数据 def w_info2(self, info,module,keyname): module=module dict = {} @@ -101,6 +126,28 @@ class FileUtils(object): return None else: return None + #写入科室信息 + def w_info4(self, info,module,keyname,titlename): + module=module + dict = {} + value = {} + value[titlename[0]] = info[0] + value[titlename[1]] = info[1] + key=keyname + dict[key] = value + w_path=rootPath+os.sep+'data'+os.sep+module + # print(w_path) + yamlpath = os.path.join(w_path, "message") + if (self.r_info(module,keyname)!=None): + print('已有相同信息,不写入') + # 写入到yaml文件 + # with open(yamlpath, "w", encoding="utf-8") as f: + # yaml.dump(dict, f, Dumper=yaml.RoundTripDumper,allow_unicode=True) + else: + # 写入到yaml文件 + with open(yamlpath, "a", encoding="utf-8") as f: + yaml.dump(dict, f, Dumper=yaml.RoundTripDumper, allow_unicode=True) + if __name__ == '__main__': # info=("aaaa","bbbbbb","mdm3-pim") # FileUtils().w_info(info,"产品新增") diff --git a/data/a2_herp3_bs/data b/data/a2_herp3_bs/data index d584b28d..87b676c4 100644 --- a/data/a2_herp3_bs/data +++ b/data/a2_herp3_bs/data @@ -9,6 +9,8 @@ "update_url": "/hospitaltest2api/platformService/basic/notice/update" "del_url": "/hospitaltest2api/platformService/basic/notice/del/" "firmpage_url": "/hospitaltest2api/herpService/basic/firm/page/" +"deptPage_url": "/hospitaltest2api/platformService/sys/org/v2/deptPage/" +"dept_insert_url": "/hospitaltest2api/platformService/sys/org/v2/insert/" "username": "xhs1009" "password": "1qaz!QAZ" "X-APP-CODE": "herp.pc" @@ -75,6 +77,34 @@ json_headers2: { "payload9": {"pageNum": 1,"pageSize": 50,"queryObject": {"title": "不存在的公告","mgrRangeKind": "","publishDateBegin": "", "publishDateEnd": "", "corpId": "h0347"}} "payload10": {"content": "%s","expireDate": "%s","mgrRangeId": "","title": "%supdate","id": "%s","topFlag": "0","mgrRangeKind": "1","corpId": "h0347","noticeType": 1} "payload11": {"pageNum": 1,"pageSize": 50,"queryObject": {"hosId": "h0347","searchText": "p56a4","firmType": 1}} +"payload12": {"pageNum": 1,"pageSize": 50,"queryObject": {"hosId": "h0347","searchText": "国药集团浙江医疗器材有限公司","firmType": 1}} +"payload13": {"pageNum": 1,"pageSize": 50,"orderBy": "code asc","queryObject": {"ename": "","branchId": "院区id", "branchId": "%s", "hosId": "医院id", "hosId": "h0347" }} +"payload14": { + "branchId": "%s", + "cname": "", + "ename": "设备科室001", + "code": "001", + "address": "设备科室001001", + "contactWay": "设备科室001001", + "deptKind": 1, + "deptCate": 1, + "deptLevel": "1", + "flag": "1", + "corpId": "h0347" +} +"payload15": { + "branchId": "%s", + "cname": "", + "ename": "二级科室002", + "code": "002", + "address": "二级科室002", + "contactWay": "二级科室002", + "deptKind": 2, + "deptCate": 1, + "deptLevel": "2", + "flag": "1", + "corpId": "h0347" +} checkDict: {"code": 0,'msg': None,'data': True} checkDict1: { @@ -140,3 +170,5 @@ checkDict3: {"code": 400,'msg': '供销关系已存在!请勿重复添加','da checkDict4: {"code": 400,'msg': None,'data':None} checkDict5: {'code': 400, 'msg': '数据更新不成功,可能数据的版本不一致!请刷新页面重试', 'data': None} checkDict6: {'code': 0, 'msg': None, 'data': []} +checkDict7: {'code': 1100000, 'msg':'暂时没有定义异码,中文描述为:同一院区下科室编码不可重复','data':'/platformService:gyqx.spd.platform.sys.service.impl.SysOrgServiceImpl:156'} + diff --git a/data/a2_herp3_bs/message b/data/a2_herp3_bs/message index 20e96114..0969fe8b 100644 --- a/data/a2_herp3_bs/message +++ b/data/a2_herp3_bs/message @@ -1,3 +1,6 @@ 院区新增: - branch_id: h0347-2011 - branch_name: 东土城路院区 \ No newline at end of file + branch_id: h0347-2658 + branch_name: 东土城路院区pOryX +科室信息: + 科室id: 8f3aed0a165c486a92721cccb4298abc + 科室名称: 二级科室002 diff --git a/report/summary.html b/report/summary.html index fec322cb..6c57b76e 100644 --- a/report/summary.html +++ b/report/summary.html @@ -72,9 +72,9 @@ - b4_查询公告_精确查询_不存在 + c4_新增科室后查询科室ID 成功 - 0.604 + 0.69 xiaohesheng -- GitLab