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.
 
 
 
 
 
 

245 lines
6.3 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Learun.Application.OA
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创建人:陈彬彬
  10. /// 日 期:2017.04.17
  11. /// 描 述:公告管理
  12. /// </summary>
  13. public class NoticeBLL : NoticeIBLL
  14. {
  15. private NoticeService noticeService = new NoticeService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 公告列表
  19. /// </summary>
  20. /// <param name="pagination">分页参数</param>
  21. /// <param name="keyword">关键词</param>
  22. /// <returns></returns>
  23. public IEnumerable<NewsEntity> GetPageList(Pagination pagination, string keyword)
  24. {
  25. try
  26. {
  27. return noticeService.GetPageList(pagination, keyword);
  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. public IEnumerable<NewsEntity> GetPageListForStatistics(Pagination pagination, string queryJson)
  42. {
  43. try
  44. {
  45. return noticeService.GetPageListForStatistics(pagination, queryJson);
  46. }
  47. catch (Exception ex)
  48. {
  49. if (ex is ExceptionEx)
  50. {
  51. throw;
  52. }
  53. else
  54. {
  55. throw ExceptionEx.ThrowBusinessException(ex);
  56. }
  57. }
  58. }
  59. public void SaveNewsShouldRead()
  60. {
  61. try
  62. {
  63. noticeService.SaveNewsShouldRead();
  64. }
  65. catch (Exception ex)
  66. {
  67. if (ex is ExceptionEx)
  68. {
  69. throw;
  70. }
  71. else
  72. {
  73. throw ExceptionEx.ThrowBusinessException(ex);
  74. }
  75. }
  76. }
  77. /// <summary>
  78. /// 公告实体
  79. /// </summary>
  80. /// <param name="keyValue">主键值</param>
  81. /// <returns></returns>
  82. public NewsEntity GetEntity(string keyValue)
  83. {
  84. try
  85. {
  86. return noticeService.GetEntity(keyValue);
  87. }
  88. catch (Exception ex)
  89. {
  90. if (ex is ExceptionEx)
  91. {
  92. throw;
  93. }
  94. else
  95. {
  96. throw ExceptionEx.ThrowBusinessException(ex);
  97. }
  98. }
  99. }
  100. #endregion
  101. #region 提交数据
  102. /// <summary>
  103. /// 删除
  104. /// </summary>
  105. /// <param name="keyValue">主键</param>
  106. public void DeleteEntity(string keyValue)
  107. {
  108. try
  109. {
  110. noticeService.DeleteEntity(keyValue);
  111. }
  112. catch (Exception ex)
  113. {
  114. if (ex is ExceptionEx)
  115. {
  116. throw;
  117. }
  118. else
  119. {
  120. throw ExceptionEx.ThrowBusinessException(ex);
  121. }
  122. }
  123. }
  124. /// <summary>
  125. /// 保存(新增、修改)
  126. /// </summary>
  127. /// <param name="keyValue">主键值</param>
  128. /// <param name="newsEntity">公告实体</param>
  129. /// <returns></returns>
  130. public void SaveEntity(string keyValue, NewsEntity newsEntity)
  131. {
  132. try
  133. {
  134. noticeService.SaveEntity(keyValue, newsEntity);
  135. }
  136. catch (Exception ex)
  137. {
  138. if (ex is ExceptionEx)
  139. {
  140. throw;
  141. }
  142. else
  143. {
  144. throw ExceptionEx.ThrowBusinessException(ex);
  145. }
  146. }
  147. }
  148. #endregion
  149. #region 扩展数据
  150. /// <summary>
  151. /// 公告列表
  152. /// </summary>
  153. /// <param name="keyword">关键词</param>
  154. /// <returns></returns>
  155. public IEnumerable<NewsEntity> GetList(string keyword, string categoryId = null)
  156. {
  157. try
  158. {
  159. return noticeService.GetList(keyword, categoryId);
  160. }
  161. catch (Exception ex)
  162. {
  163. if (ex is ExceptionEx)
  164. {
  165. throw;
  166. }
  167. else
  168. {
  169. throw ExceptionEx.ThrowBusinessException(ex);
  170. }
  171. }
  172. }
  173. #endregion
  174. #region 流程
  175. public void ChangeStatusById(string keyValue, int status, string processId)
  176. {
  177. try
  178. {
  179. noticeService.ChangeStatusById(keyValue, status, processId);
  180. }
  181. catch (Exception ex)
  182. {
  183. if (ex is ExceptionEx)
  184. {
  185. throw;
  186. }
  187. else
  188. {
  189. throw ExceptionEx.ThrowBusinessException(ex);
  190. }
  191. }
  192. }
  193. public NewsEntity GetEntityByProcessId(string processId)
  194. {
  195. try
  196. {
  197. return noticeService.GetEntityByProcessId(processId);
  198. }
  199. catch (Exception ex)
  200. {
  201. if (ex is ExceptionEx)
  202. {
  203. throw;
  204. }
  205. else
  206. {
  207. throw ExceptionEx.ThrowBusinessException(ex);
  208. }
  209. }
  210. }
  211. public void SaveFormAndSubmit(string keyValue, NewsEntity entity)
  212. {
  213. try
  214. {
  215. noticeService.SaveFormAndSubmit(keyValue, entity);
  216. }
  217. catch (Exception ex)
  218. {
  219. if (ex is ExceptionEx)
  220. {
  221. throw;
  222. }
  223. else
  224. {
  225. throw ExceptionEx.ThrowBusinessException(ex);
  226. }
  227. }
  228. }
  229. #endregion
  230. }
  231. }