Commit ae28b640 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增科室产品分配脚本

parent ad84a28b
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,o8科室管理_科室产品分配_编辑产品状态_停用,id2263,id2263-175,sit,on
内网:o8科室管理_科室产品分配_编辑产品状态_停用
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o8科室管理_科室产品分配_编辑产品状态_停用
用例名称:o8科室管理_科室产品分配_编辑产品状态_停用
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#o8科室管理_科室产品分配_编辑产品状态_停用
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_updateById")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_8")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
if code==0 and data==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,o8科室管理_科室产品分配_编辑产品状态_启用,id2263,id2263-176,sit,on
内网:o8科室管理_科室产品分配_编辑产品状态_启用
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o8科室管理_科室产品分配_编辑产品状态_启用
用例名称:o8科室管理_科室产品分配_编辑产品状态_启用
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#o8科室管理_科室产品分配_编辑产品状态_启用
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_updateById")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_9")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
if code==0 and data==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,o9科室管理_科室产品分配_编辑产品,id2263,id2263-177,sit,on
内网:o9科室管理_科室产品分配_编辑产品
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o9科室管理_科室产品分配_编辑产品
用例名称:o9科室管理_科室产品分配_编辑产品
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#o9科室管理_科室产品分配_编辑产品
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_updateById")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_10")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
if code==0 and data==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,o9科室管理_科室产品分配_编辑产品_异常,id2263,id2263-178,sit,on
内网:o9科室管理_科室产品分配_编辑产品_异常
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o9科室管理_科室产品分配_编辑产品_异常
用例名称:o9科室管理_科室产品分配_编辑产品_异常
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#o9科室管理_科室产品分配_编辑产品_异常
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_updateById")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_11")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
if code==0 and data==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,p0科室管理_科室产品分配_编辑产品_恢复原样,id2263,id2263-179,sit,on
内网:p0科室管理_科室产品分配_编辑产品_恢复原样
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p0科室管理_科室产品分配_编辑产品_恢复原样
用例名称:p0科室管理_科室产品分配_编辑产品_恢复原样
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p0科室管理_科室产品分配_编辑产品_恢复原样
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_updateById")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_12")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
if code==0 and data==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,p1科室管理_科室产品分配_产品列表查询,id2263,id2263-180,sit,on
内网:p1科室管理_科室产品分配_产品列表查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p1科室管理_科室产品分配_产品列表查询
用例名称:p1科室管理_科室产品分配_产品列表查询
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p1科室管理_科室产品分配_产品列表查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_page_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_13")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
data1=commonFuc().analysis_json('data',data)
if code==0 and len(data1)>=1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,p1科室管理_科室产品分配_产品列表查询_条件查询,id2263,id2263-181,sit,on
内网:p1科室管理_科室产品分配_产品列表查询_条件查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p1科室管理_科室产品分配_产品列表查询_条件查询
用例名称:p1科室管理_科室产品分配_产品列表查询_条件查询
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_page_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
str = commonFuc().get_business_data(module, 'data10')
list2 = list(str.split(","))
print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_14",i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
data1=commonFuc().analysis_json('data',data)
hosGoodsCode =commonFuc().analysis_json('hosGoodsCode',data1)
if code==0 and len(data1)>=1 and hosGoodsCode=='00001977':
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#按规格型号查询
request_body = commonFuc().get_business_data(module, "payload58_15",'SSY-001')
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
data1=commonFuc().analysis_json('data',data)
hosGoodsCode =commonFuc().analysis_json('hosGoodsCode',data1)
if code==0 and len(data1)>=1 and hosGoodsCode=='00001977':
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#按耗材类型查询
str = commonFuc().get_business_data(module, 'data11')
list2 = list(str.split(","))
print(list2)
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_16",i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', '按耗材类型查询',result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
if code == 0 and len(data1) >= 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
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,p1科室管理_科室产品分配_产品列表查询_条件查询_异常,id2263,id2263-182,sit,on
内网:p1科室管理_科室产品分配_产品列表查询_条件查询_异常
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p1科室管理_科室产品分配_产品列表查询_条件查询
用例名称:p1科室管理_科室产品分配_产品列表查询_条件查询
输入:"abcxxedd,1234456,',!@#$%,select,where 1=1"
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_page_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(","))
print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_14",i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
data1=commonFuc().analysis_json('data',data)
if code==0 and len(data1)==0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#========
for i in list2:
# 按规格型号查询
request_body = commonFuc().get_business_data(module, "payload58_15", i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
if code == 0 and len(data1)==0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
# 按耗材类型查询
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_16", i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', '按耗材类型查询', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
if code == 0 and len(data1)==0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -70,6 +70,8 @@
"tree_h0347_url": "/api/platformService/sys/message/template/tree/h0347"
"basic_mcmsGoodsInfo_url": "/api/herpService/basic/mcmsGoodsInfo/list"
"basic_mcmsGoodsInfo_insert": "/api/herpService/basic/mcmsDeptGoodsInfo/insert"
"basic_mcmsDeptGoodsInfo_updateById": "/api/herpService/basic/mcmsDeptGoodsInfo/updateById"
"basic_mcmsDeptGoodsInfo_page_url": "/api/herpService/basic/mcmsDeptGoodsInfo/page"
"basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree"
......@@ -83,6 +85,8 @@ data6: "mcms,试剂性能,check_no,收单号,dept,单,_,NO,tock_no,期初单,per
data7: "20,50,100,200"
data8: "眼科,眼,科,001,jyk,1,j,k"
data9: "不存在的眼科,1眼,2科,111,jyk2"
data10: "00001977,手术衣,ssy"
data11: "10,20,60"
"username": "xhs1009"
"password": "1qaz!QAZ"
......@@ -373,7 +377,15 @@ json_headers2: {
"payload58_5": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"美敦力公司 Medtronic Inc.","goodsName":"指引导管","goodsSpec":"","purModes":["60"]},"pageNum":1,"pageSize":200}
"payload58_6": {"deptId":"%s","hosGoodsId":"h034700001743","grantRule":1,"purMode":10}
"payload58_7": {"deptId":"%s","hosGoodsId":"h034700001743222","grantRule":1,"purMode":10}
"payload58_8": {"consumeMode":null,"id":"2c127343e49947f5855021c790f4b08e","pkgDefId":"56b010aba2e04f978e3038c0f53d910c","stockLower":0,"stockUpper":0,"targetDeptId":"d69a68df361a4289b2262e4ef75b55a5","shelfCode":"area0354-2-01-02","codingType":1,"grantWay":1,"packetQty":33,"tbStatus":0}
"payload58_9": {"consumeMode":null,"id":"2c127343e49947f5855021c790f4b08e","pkgDefId":"56b010aba2e04f978e3038c0f53d910c","stockLower":0,"stockUpper":0,"targetDeptId":"d69a68df361a4289b2262e4ef75b55a5","shelfCode":"area0354-2-01-02","codingType":1,"grantWay":1,"packetQty":33,"tbStatus":1}
"payload58_10": {"consumeMode":null,"id":"2c127343e49947f5855021c790f4b08e","pkgDefId":"f8ad68aae4a5406ab04316e46bbf38bd","stockLower":100,"stockUpper":1000000,"targetDeptId":"d69a68df361a4289b2262e4ef75b55a5","shelfCode":"area0354-2-02-01","codingType":0,"grantWay":2,"packetQty":66,"tbStatus":1}
"payload58_11": {"consumeMode":null,"id":"2c127343e49947f5855021c790f4b08e","pkgDefId":"aaf8ad68aae4a5406ab04316e46bbf38bd","stockLower":100,"stockUpper":1000000,"targetDeptId":"d69a68df361a4289b2262e4ef75b55a5","shelfCode":"area0354-2-02-01","codingType":0,"grantWay":2,"packetQty":66,"tbStatus":1}
"payload58_12": {"consumeMode":null,"id":"2c127343e49947f5855021c790f4b08e","pkgDefId":"56b010aba2e04f978e3038c0f53d910c","stockLower":0,"stockUpper":0,"targetDeptId":"d69a68df361a4289b2262e4ef75b55a5","shelfCode":"area0354-2-02-01","codingType":1,"grantWay":1,"packetQty":33,"tbStatus":1}
"payload58_13": {"queryObject":{"goodsName":"","goodsSpec":"","purModes":[],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload58_14": {"queryObject":{"goodsName":"%s","goodsSpec":"SSY-001","purModes":["10"],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload58_15": {"queryObject":{"goodsName":"","goodsSpec":"%s","purModes":["10"],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload58_16": {"queryObject":{"goodsName":"","goodsSpec":"","purModes":["%s"],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload60": {"hosId":"h0347","stockCode":"%s"}
......
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分1</td>
<td class='details-col-elapsed'>1分32</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/新增库区/log.html' target='_blank'>新增库区</a></td>
<td class="details-col-elapsed"><a href='../log/p1科室管理_科室产品分配_产品列表查询_条件查询_异常/log.html' target='_blank'>p1科室管理_科室产品分配_产品列表查询_条件查询_异常</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.488</td>
<td class="details-col-elapsed">92.345</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment