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.
 
 
 
 
 
 

226 lines
6.5 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Learun.Application.OA.File.FileInfo
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2017
  9. /// 创建人:陈彬彬
  10. /// 日 期:2018.06.20
  11. /// 描 述:文件管理
  12. /// </summary>
  13. public class FileInfoBLL : FileInfoIBLL
  14. {
  15. private FileInfoService service = new FileInfoService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 所有文件(夹)列表
  19. /// </summary>
  20. /// <param name="folderId">文件夹Id</param>
  21. /// <param name="userId">用户Id</param>
  22. /// <returns></returns>
  23. public IEnumerable<FileInfoEntity> GetList(string folderId, string userId)
  24. {
  25. return service.GetList(folderId, userId);
  26. }
  27. /// <summary>
  28. /// 所有文件(夹)列表
  29. /// </summary>
  30. /// <param name="folderId">文件夹Id</param>
  31. /// <param name="userId">用户Id</param>
  32. /// <returns></returns>
  33. public IEnumerable<FileInfoEntity> GetList(string folderId, string userId, string queryJson)
  34. {
  35. return service.GetList(folderId, userId, queryJson);
  36. }
  37. public IEnumerable<FileInfoEntity> GetList(string userId)
  38. {
  39. return service.GetList(userId);
  40. }
  41. public IEnumerable<FileInfoEntity> GetList()
  42. {
  43. return service.GetList();
  44. }
  45. public IEnumerable<FileInfoEntity> GetListByJson(string queryJson)
  46. {
  47. return service.GetListByJson(queryJson);
  48. }
  49. /// <summary>
  50. /// 文档列表
  51. /// </summary>
  52. /// <param name="userId">用户Id</param>
  53. /// <returns></returns>
  54. public IEnumerable<FileInfoEntity> GetDocumentList(string userId,string queryJson)
  55. {
  56. return service.GetDocumentList(userId, queryJson);
  57. }
  58. /// <summary>
  59. /// 图片列表
  60. /// </summary>
  61. /// <param name="userId">用户Id</param>
  62. /// <returns></returns>
  63. public IEnumerable<FileInfoEntity> GetImageList(string userId,string queryJson)
  64. {
  65. return service.GetImageList(userId, queryJson);
  66. }
  67. /// <summary>
  68. /// 回收站文件(夹)列表
  69. /// </summary>
  70. /// <param name="userId">用户Id</param>
  71. /// <returns></returns>
  72. public IEnumerable<FileInfoEntity> GetRecycledList(string userId)
  73. {
  74. return service.GetRecycledList(userId);
  75. }
  76. /// <summary>
  77. /// 我的文件(夹)共享列表
  78. /// </summary>
  79. /// <param name="userId">用户Id</param>
  80. /// <returns></returns>
  81. public IEnumerable<FileInfoEntity> GetMyShareList(string userId, string queryJson)
  82. {
  83. return service.GetMyShareList(userId, queryJson);
  84. }
  85. /// <summary>
  86. /// 他人文件(夹)共享列表
  87. /// </summary>
  88. /// <param name="userId">用户Id</param>
  89. /// <returns></returns>
  90. public IEnumerable<FileInfoEntity> GetOthersShareList(string userId, string queryJson)
  91. {
  92. return service.GetOthersShareList(userId, queryJson);
  93. }
  94. /// <summary>
  95. /// 文件信息实体
  96. /// </summary>
  97. /// <param name="keyValue">主键值</param>
  98. /// <returns></returns>
  99. public FileInfoEntity GetEntity(string keyValue)
  100. {
  101. return service.GetEntity(keyValue);
  102. }
  103. #endregion
  104. #region 提交数据
  105. /// <summary>
  106. /// 还原文件
  107. /// </summary>
  108. /// <param name="keyValue">主键</param>
  109. public void RestoreFile(string keyValue)
  110. {
  111. try
  112. {
  113. service.RestoreFile(keyValue);
  114. }
  115. catch (Exception)
  116. {
  117. throw;
  118. }
  119. }
  120. /// <summary>
  121. /// 删除文件信息
  122. /// </summary>
  123. /// <param name="keyValue">主键</param>
  124. public void RemoveForm(string keyValue)
  125. {
  126. try
  127. {
  128. service.RemoveForm(keyValue);
  129. }
  130. catch (Exception)
  131. {
  132. throw;
  133. }
  134. }
  135. /// <summary>
  136. /// 彻底删除文件信息
  137. /// </summary>
  138. /// <param name="keyValue">主键</param>
  139. public void ThoroughRemoveForm(string keyValue)
  140. {
  141. try
  142. {
  143. service.ThoroughRemoveForm(keyValue);
  144. }
  145. catch (Exception)
  146. {
  147. throw;
  148. }
  149. }
  150. /// <summary>
  151. /// 保存文件信息表单(新增、修改)
  152. /// </summary>
  153. /// <param name="keyValue">主键值</param>
  154. /// <param name="fileInfoEntity">文件信息实体</param>
  155. /// <returns></returns>
  156. public void SaveForm(string keyValue, FileInfoEntity fileInfoEntity)
  157. {
  158. try
  159. {
  160. service.SaveForm(keyValue, fileInfoEntity);
  161. }
  162. catch (Exception)
  163. {
  164. throw;
  165. }
  166. }
  167. /// <summary>
  168. /// 共享文件
  169. /// </summary>
  170. /// <param name="keyValue">主键</param>
  171. /// <param name="IsShare">是否共享:1-共享 0取消共享</param>
  172. public void ShareFile(string keyValue, int IsShare = 1)
  173. {
  174. try
  175. {
  176. service.ShareFile(keyValue, IsShare);
  177. }
  178. catch (Exception)
  179. {
  180. throw;
  181. }
  182. }
  183. #endregion
  184. public int GetCount()
  185. {
  186. try
  187. {
  188. return service.GetCount();
  189. }
  190. catch (Exception ex)
  191. {
  192. if (ex is ExceptionEx)
  193. {
  194. throw;
  195. }
  196. else
  197. {
  198. throw ExceptionEx.ThrowBusinessException(ex);
  199. }
  200. }
  201. }
  202. public Dictionary<int, int> GetMonthCount()
  203. {
  204. try
  205. {
  206. return service.GetMonthCount();
  207. }
  208. catch (Exception ex)
  209. {
  210. if (ex is ExceptionEx)
  211. {
  212. throw;
  213. }
  214. else
  215. {
  216. throw ExceptionEx.ThrowBusinessException(ex);
  217. }
  218. }
  219. }
  220. }
  221. }