You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

182 lines
4.7 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Learun.Application.Base.SystemModule
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创建人:陈彬彬
  10. /// 日 期:2017.03.21
  11. /// 描 述:系统日志
  12. /// </summary>
  13. public static class LogBLL
  14. {
  15. private static LogService service = new LogService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 日志列表
  19. /// </summary>
  20. /// <param name="pagination">分页</param>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. public static IEnumerable<LogEntity> GetPageList(Pagination pagination, string queryJson, string userId)
  24. {
  25. try
  26. {
  27. return service.GetPageList(pagination, queryJson, userId);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowBusinessException(ex);
  38. }
  39. }
  40. }
  41. /// <summary>
  42. /// 日志列表
  43. /// </summary>
  44. /// <param name="queryJson">查询参数</param>
  45. /// <returns></returns>
  46. public static IEnumerable<LogEntity> GetList(string queryJson, bool isYear)
  47. {
  48. try
  49. {
  50. return service.GetList(queryJson, isYear);
  51. }
  52. catch (Exception ex)
  53. {
  54. if (ex is ExceptionEx)
  55. {
  56. throw;
  57. }
  58. else
  59. {
  60. throw ExceptionEx.ThrowBusinessException(ex);
  61. }
  62. }
  63. }
  64. public static IEnumerable<LogEntity> GetGroupLog(string userid)
  65. {
  66. try
  67. {
  68. return service.GetGroupLog(userid);
  69. }
  70. catch (Exception ex)
  71. {
  72. if (ex is ExceptionEx)
  73. {
  74. throw;
  75. }
  76. else
  77. {
  78. throw ExceptionEx.ThrowBusinessException(ex);
  79. }
  80. }
  81. }
  82. #endregion
  83. #region 提交数据
  84. /// <summary>
  85. /// 清空日志
  86. /// </summary>
  87. /// <param name="categoryId">日志分类Id</param>
  88. /// <param name="keepTime">保留时间段内</param>
  89. public static void RemoveLog(int categoryId, string keepTime)
  90. {
  91. try
  92. {
  93. service.RemoveLog(categoryId, keepTime);
  94. }
  95. catch (Exception ex)
  96. {
  97. if (ex is ExceptionEx)
  98. {
  99. throw;
  100. }
  101. else
  102. {
  103. throw ExceptionEx.ThrowBusinessException(ex);
  104. }
  105. }
  106. }
  107. /// <summary>
  108. /// 写日志
  109. /// </summary>
  110. /// <param name="logEntity">对象</param>
  111. public static void WriteLog(this LogEntity logEntity)
  112. {
  113. try
  114. {
  115. service.WriteLog(logEntity);
  116. }
  117. catch (Exception ex)
  118. {
  119. if (ex is ExceptionEx)
  120. {
  121. throw;
  122. }
  123. else
  124. {
  125. throw ExceptionEx.ThrowBusinessException(ex);
  126. }
  127. }
  128. }
  129. #endregion
  130. #region 扩展数据
  131. /// <summary>
  132. /// 获取在线用户人数【登录页面】
  133. /// <summary>
  134. /// <returns></returns>
  135. public static IEnumerable<LogEntity> GetOnlineUserList()
  136. {
  137. try
  138. {
  139. return service.GetOnlineUserList();
  140. }
  141. catch (Exception ex)
  142. {
  143. if (ex is ExceptionEx)
  144. {
  145. throw;
  146. }
  147. else
  148. {
  149. throw ExceptionEx.ThrowBusinessException(ex);
  150. }
  151. }
  152. }
  153. #endregion
  154. public static LogEntity GetUserLogList(string userId)
  155. {
  156. try
  157. {
  158. return service.GetUserLogList(userId);
  159. }
  160. catch (Exception ex)
  161. {
  162. if (ex is ExceptionEx)
  163. {
  164. throw;
  165. }
  166. else
  167. {
  168. throw ExceptionEx.ThrowBusinessException(ex);
  169. }
  170. }
  171. }
  172. }
  173. }