|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- using Learun.Util;
- using System;
- using System.Collections.Generic;
-
- namespace Learun.Application.Base.SystemModule
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创建人:陈彬彬
- /// 日 期:2017.03.21
- /// 描 述:系统日志
- /// </summary>
- public static class LogBLL
- {
- private static LogService service = new LogService();
-
- #region 获取数据
- /// <summary>
- /// 日志列表
- /// </summary>
- /// <param name="pagination">分页</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- public static IEnumerable<LogEntity> GetPageList(Pagination pagination, string queryJson, string userId)
- {
- try
- {
- return service.GetPageList(pagination, queryJson, userId);
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
-
- /// <summary>
- /// 日志列表
- /// </summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- public static IEnumerable<LogEntity> GetList(string queryJson, bool isYear)
- {
- try
- {
- return service.GetList(queryJson, isYear);
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- public static IEnumerable<LogEntity> GetGroupLog(string userid)
- {
- try
- {
- return service.GetGroupLog(userid);
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- #endregion
-
- #region 提交数据
- /// <summary>
- /// 清空日志
- /// </summary>
- /// <param name="categoryId">日志分类Id</param>
- /// <param name="keepTime">保留时间段内</param>
- public static void RemoveLog(int categoryId, string keepTime)
- {
- try
- {
- service.RemoveLog(categoryId, keepTime);
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- /// <summary>
- /// 写日志
- /// </summary>
- /// <param name="logEntity">对象</param>
- public static void WriteLog(this LogEntity logEntity)
- {
- try
- {
- service.WriteLog(logEntity);
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- #endregion
-
- #region 扩展数据
-
- /// <summary>
- /// 获取在线用户人数【登录页面】
- /// <summary>
- /// <returns></returns>
- public static IEnumerable<LogEntity> GetOnlineUserList()
- {
- try
- {
- return service.GetOnlineUserList();
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
-
- #endregion
-
- public static LogEntity GetUserLogList(string userId)
- {
- try
- {
- return service.GetUserLogList(userId);
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- }
- }
|