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

基础设置模块-运维管理-操作日志脚本编写

parent 128b2c38
# -*- 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,m9运维管理_操作日志_列表查询,id2263,id2263-151,sit,on
内网:m9运维管理_操作日志_列表查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:m9运维管理_操作日志_列表查询
用例名称:m9运维管理_操作日志_列表查询
输入:无
输出:"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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#m9运维管理_操作日志_列表查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "auditLog_sync_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"]
#
# #请求体
request_body = commonFuc().get_business_data(module, "payload56")
# # # 发送请求
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 len(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,n0运维管理_操作日志_列表查询_条件查询,id2263,id2263-152,sit,on
内网:n0运维管理_操作日志_列表查询_条件查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:n0运维管理_操作日志_列表查询_条件查询_精确查询
用例名称:n0运维管理_操作日志_列表查询_条件查询_精确查询
输入:无
输出:"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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#n0运维管理_操作日志_列表查询_条件查询_精确查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "auditLog_sync_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"]
#获取日期
date1=timeUtils().get_time_hms(2)
date2=timeUtils().get_time_hms(2)
# #请求体
request_body = commonFuc().get_business_data(module, "payload56_1",date1,date2)
# # # 发送请求
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 len(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,n1运维管理_操作日志_列表查询_条件查询_模糊查询,id2263,id2263-153,sit,on
内网:n1运维管理_操作日志_列表查询_条件查询_模糊查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:n1运维管理_操作日志_列表查询_条件查询_模糊查询
用例名称:n1运维管理_操作日志_列表查询_条件查询_模糊查询
输入:无
输出:"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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#n1运维管理_操作日志_列表查询_条件查询_模糊查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "auditLog_sync_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"]
#获取日期
date1=timeUtils().get_time_hms(2)
date2=timeUtils().get_time_hms(2)
# #请求体
request_body = commonFuc().get_business_data(module, "payload56_2",date1,date2)
# # # 发送请求
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 len(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,n2运维管理_操作日志_列表查询_条件查询_异常查询,id2263,id2263-154,sit,on
内网:n2运维管理_操作日志_列表查询_条件查询_异常查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:n2运维管理_操作日志_列表查询_条件查询_异常查询
用例名称:n2运维管理_操作日志_列表查询_条件查询_异常查询
输入:无
输出:"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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#n2运维管理_操作日志_列表查询_条件查询_异常查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "auditLog_sync_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:
# #请求体
request_body = commonFuc().get_business_data(module, "payload56_3",i,date1,date2)
# # # 发送请求
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, "payload56_4",i,date1,date2)
# # # 发送请求
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, "payload56_5",i,date1,date2)
# # # 发送请求
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)
test1()
...@@ -5,11 +5,15 @@ from datetime import timedelta, date ...@@ -5,11 +5,15 @@ from datetime import timedelta, date
# 数据读入和写入文件 # 数据读入和写入文件
class timeUtils(object): class timeUtils(object):
def get_time_hms(self): def get_time_hms(self,type=1):
'''2023-05-06 09:39:30''' '''2023-05-06 09:39:30'''
import time import time
t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) if type==1:
return t t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
return t
elif type==2:
t = time.strftime("%Y-%m-%d 00:00:00", time.localtime())
return t
def get_time_add(self,days_aa): def get_time_add(self,days_aa):
import time import time
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
"sysrPdaDevice_deleteById_url": "/hospitaltest2api/platformService/sysrPdaDevice/deleteById/" "sysrPdaDevice_deleteById_url": "/hospitaltest2api/platformService/sysrPdaDevice/deleteById/"
"cacheMonitor_getStatistics_url": "/hospitaltest2api/herpService/cacheMonitor/getStatistics" "cacheMonitor_getStatistics_url": "/hospitaltest2api/herpService/cacheMonitor/getStatistics"
"cacheMonitor_getCacheKeys_url": "/hospitaltest2api/platformService/cacheMonitor/getCacheKeys" "cacheMonitor_getCacheKeys_url": "/hospitaltest2api/platformService/cacheMonitor/getCacheKeys"
"auditLog_sync_url": "/hospitaltest2api/herpService/auditLog/listPage/sync"
data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印' data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印'
data2: 'code,医院标识,code1,code1,erpCode,JDE编码修改,GOODS_CHANGE_STATUS,产品信息变更状态,GOODS_CHARGE_COST,是否计入成本,GOODS_KIND_TYPE,产品分类类型,MFRS_KIND,企业职能,miCode,医保编码修改,NOTICE_RANGE_KIND,公告通知范围,PUR_MODE,耗材类型,YWMS,业务模式,CORP_TYPE,主体类别,PROGRAM_TYPE,程序端,GRAIN,参数粒度,ENV,发布环境,PROJECT_GROUP,系统分组,RETURN_REASON_TYPE,退货原因,NEWCPFL,新产品分类,ZZLX,企业证照类型,68FL,68器械分类,18FL,18器械分类,GOODS_START_STOP,产品启停,YYDJ,医院等级,GOODS_TEMP,产品临采,GLJB,耗材管理级别,GOODS_PURCHASE,产品是否采购,HIS_CODE_CHANGE,HIS编码修改,MI_CODE_CHANGE,医保型号修改,MI_GOODS_GG_CHANGE,医保产品规格,MI_GOODS_XH_CHANGE,医保型号修改,GOODS_CHARGE,产品是否计费,GOODS_BAR_CODE,产品管理模式,GOODS_PUR_MODE,耗材类型,GOODS_CHANGE_PRICE,产品调价类型,GOODS_BAR_CODE_STRATEGY,UDI管理策略,FOCUS_CONTROL_TYPE,重点管控分类,MANUAL_PICK_REASON,手工出库原因,RFID_LABEL_CHANGE,RFID标签管理,ALLOT_PICK_REASON,调拨出库原因,MAGRE_PICK_REASON,移库出库原因' data2: 'code,医院标识,code1,code1,erpCode,JDE编码修改,GOODS_CHANGE_STATUS,产品信息变更状态,GOODS_CHARGE_COST,是否计入成本,GOODS_KIND_TYPE,产品分类类型,MFRS_KIND,企业职能,miCode,医保编码修改,NOTICE_RANGE_KIND,公告通知范围,PUR_MODE,耗材类型,YWMS,业务模式,CORP_TYPE,主体类别,PROGRAM_TYPE,程序端,GRAIN,参数粒度,ENV,发布环境,PROJECT_GROUP,系统分组,RETURN_REASON_TYPE,退货原因,NEWCPFL,新产品分类,ZZLX,企业证照类型,68FL,68器械分类,18FL,18器械分类,GOODS_START_STOP,产品启停,YYDJ,医院等级,GOODS_TEMP,产品临采,GLJB,耗材管理级别,GOODS_PURCHASE,产品是否采购,HIS_CODE_CHANGE,HIS编码修改,MI_CODE_CHANGE,医保型号修改,MI_GOODS_GG_CHANGE,医保产品规格,MI_GOODS_XH_CHANGE,医保型号修改,GOODS_CHARGE,产品是否计费,GOODS_BAR_CODE,产品管理模式,GOODS_PUR_MODE,耗材类型,GOODS_CHANGE_PRICE,产品调价类型,GOODS_BAR_CODE_STRATEGY,UDI管理策略,FOCUS_CONTROL_TYPE,重点管控分类,MANUAL_PICK_REASON,手工出库原因,RFID_LABEL_CHANGE,RFID标签管理,ALLOT_PICK_REASON,调拨出库原因,MAGRE_PICK_REASON,移库出库原因'
...@@ -337,7 +337,12 @@ json_headers2: { ...@@ -337,7 +337,12 @@ json_headers2: {
"payload55_2": {"cacheNameInfo":"SYS_ORG","meta":"herpService"} "payload55_2": {"cacheNameInfo":"SYS_ORG","meta":"herpService"}
"payload55_3": {"cacheNameInfo":"SYS_ORG-组织科室","meta":"herpService"} "payload55_3": {"cacheNameInfo":"SYS_ORG-组织科室","meta":"herpService"}
"payload55_4": {"cacheKey":"","cacheKeyQueryInfo":"fc9c56b92e094365af713f892bd24286","cacheManagerList":["cacheManager","l2CacheManager"],"cacheName":"SYS_ORG","meta":"herpService"} "payload55_4": {"cacheKey":"","cacheKeyQueryInfo":"fc9c56b92e094365af713f892bd24286","cacheManagerList":["cacheManager","l2CacheManager"],"cacheName":"SYS_ORG","meta":"herpService"}
"payload56": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"branchId":"h0347-2011","date1":null,"date2":null}}
"payload56_1": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"projectCode":"herp.pc","operObjectName":"系统配置信息表接口","operType":"更新参数信息","branchId":"h0347-2011","date1":"%s","date2":"%s"}}
"payload56_2": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"projectCode":"herp.","operObjectName":"系统配置信息表","operType":"更新参数","branchId":"h0347-2011","date1":"%s","date2":"%s"}}
"payload56_3": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"projectCode":"%s","operObjectName":"系统配置信息表","operType":"更新参数","branchId":"h0347-2011","date1":"%s","date2":"%s"}}
"payload56_4": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"projectCode":"herp.","operObjectName":"%s","operType":"更新参数","branchId":"h0347-2011","date1":"%s","date2":"%s"}}
"payload56_5": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"projectCode":"herp.","operObjectName":"系统配置信息表","operType":"%s","branchId":"h0347-2011","date1":"%s","date2":"%s"}}
checkDict: {"code": 0,'msg': None,'data': True} checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: { checkDict1: {
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<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'>0分4</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/m8运维管理_缓存监控_key查询_条件查询_精确查询_内网服务/log.html' target='_blank'>m8运维管理_缓存监控_key查询_条件查询_精确查询_内网服务</a></td> <td class="details-col-elapsed"><a href='../log/n2运维管理_操作日志_列表查询_条件查询_异常查询/log.html' target='_blank'>n2运维管理_操作日志_列表查询_条件查询_异常查询</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">1.327</td> <td class="details-col-elapsed">4.37</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </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