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.
 
 
 
 
 
 

230 lines
7.0 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Web;
  8. using Learun.Application.Base.SystemModule;
  9. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  13. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  14. /// 创 建:超级管理员
  15. /// 日 期:2019-04-11 10:08
  16. /// 描 述:公文收发
  17. /// </summary>
  18. public class Sys_ReceiveFileController : MvcControllerBase
  19. {
  20. private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL();
  21. private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL();
  22. #region 视图功能
  23. /// <summary>
  24. /// 主页面
  25. /// <summary>
  26. /// <returns></returns>
  27. [HttpGet]
  28. public ActionResult Index()
  29. {
  30. return View();
  31. }
  32. [HttpGet]
  33. public ActionResult FormReadDocument()
  34. {
  35. return View();
  36. }
  37. [HttpGet]
  38. public ActionResult IndexDocument()
  39. {
  40. return View();
  41. }
  42. /// <summary>
  43. /// 主页面【党政公文查阅】
  44. /// </summary>
  45. /// <returns></returns>
  46. [HttpGet]
  47. public ActionResult IndexParty()
  48. {
  49. return View();
  50. }
  51. /// <summary>
  52. /// 表单页
  53. /// <summary>
  54. /// <returns></returns>
  55. [HttpGet]
  56. public ActionResult Form()
  57. {
  58. return View();
  59. }
  60. [HttpGet]
  61. public ActionResult FormDocument()
  62. {
  63. return View();
  64. }
  65. /// <summary>
  66. /// 表单页【党政公文查阅】
  67. /// <summary>
  68. /// <returns></returns>
  69. [HttpGet]
  70. public ActionResult FormParty()
  71. {
  72. return View();
  73. }
  74. #endregion
  75. #region 获取数据
  76. /// <summary>
  77. /// 获取页面显示列表数据
  78. /// <summary>
  79. /// <param name="queryJson">查询参数</param>
  80. /// <returns></returns>
  81. [HttpGet]
  82. [AjaxOnly]
  83. public ActionResult GetPageList(string pagination, string queryJson)
  84. {
  85. Pagination paginationobj = pagination.ToObject<Pagination>();
  86. var data = sys_ReceiveFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 1);
  87. var jsonData = new
  88. {
  89. rows = data,
  90. total = paginationobj.total,
  91. page = paginationobj.page,
  92. records = paginationobj.records
  93. };
  94. return Success(jsonData);
  95. }
  96. [HttpGet]
  97. [AjaxOnly]
  98. public ActionResult GetPageListDocument(string pagination, string queryJson)
  99. {
  100. Pagination paginationobj = pagination.ToObject<Pagination>();
  101. var data = sys_ReceiveFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 2);
  102. var jsonData = new
  103. {
  104. rows = data,
  105. total = paginationobj.total,
  106. page = paginationobj.page,
  107. records = paginationobj.records
  108. };
  109. return Success(jsonData);
  110. }
  111. [HttpGet]
  112. [AjaxOnly]
  113. public ActionResult GetPageListParty(string pagination, string queryJson)
  114. {
  115. Pagination paginationobj = pagination.ToObject<Pagination>();
  116. var data = sys_ReceiveFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 3);
  117. var jsonData = new
  118. {
  119. rows = data,
  120. total = paginationobj.total,
  121. page = paginationobj.page,
  122. records = paginationobj.records
  123. };
  124. return Success(jsonData);
  125. }
  126. /// <summary>
  127. /// 获取页面显示列表数据
  128. /// <summary>
  129. /// <param name="queryJson">查询参数</param>
  130. /// <returns></returns>
  131. [HttpGet]
  132. [AjaxOnly]
  133. public ActionResult GetPageListByUserId(string pagination, string queryJson)
  134. {
  135. var UserInfoEntity = LoginUserInfo.Get();
  136. Pagination paginationobj = pagination.ToObject<Pagination>();
  137. var data = sys_ReceiveFileIBLL.GetPageListByUserId(paginationobj, queryJson, UserInfoEntity.userId);
  138. var jsonData = new
  139. {
  140. rows = data,
  141. total = paginationobj.total,
  142. page = paginationobj.page,
  143. records = paginationobj.records
  144. };
  145. return Success(jsonData);
  146. }
  147. /// <summary>
  148. /// 获取表单数据
  149. /// <summary>
  150. /// <returns></returns>
  151. [HttpGet]
  152. [AjaxOnly]
  153. public ActionResult GetFormData(string keyValue)
  154. {
  155. var Sys_ReceiveFileData = sys_ReceiveFileIBLL.GetSys_ReceiveFileEntity(keyValue);
  156. Sys_ReceiveFileData.Contents = HttpUtility.HtmlDecode(Sys_ReceiveFileData.Contents);
  157. var jsonData = new
  158. {
  159. Sys_ReceiveFile = Sys_ReceiveFileData,
  160. };
  161. return Success(jsonData);
  162. }
  163. [HttpGet]
  164. [AjaxOnly]
  165. public ActionResult CheckRUrl(string keyValue)
  166. {
  167. var fileEntity = annexesFileIbll.GetList(keyValue);
  168. if (fileEntity != null && fileEntity.Count() > 0)
  169. {
  170. return Json(true, JsonRequestBehavior.AllowGet);
  171. }
  172. return Json(false, JsonRequestBehavior.AllowGet);
  173. }
  174. #endregion
  175. #region 提交数据
  176. /// <summary>
  177. /// 删除实体数据
  178. /// <param name="keyValue">主键</param>
  179. /// <summary>
  180. /// <returns></returns>
  181. [HttpPost]
  182. [AjaxOnly]
  183. public ActionResult DeleteForm(string keyValue)
  184. {
  185. sys_ReceiveFileIBLL.VirtualDeleteEntity(keyValue);
  186. return Success("删除成功!");
  187. }
  188. /// <summary>
  189. /// 保存实体数据(新增、修改)
  190. /// <param name="keyValue">主键</param>
  191. /// <summary>
  192. /// <returns></returns>
  193. [HttpPost]
  194. [ValidateAntiForgeryToken]
  195. [AjaxOnly]
  196. public ActionResult SaveForm(string keyValue, string strEntity)
  197. {
  198. Sys_ReceiveFileEntity entity = strEntity.ToObject<Sys_ReceiveFileEntity>();
  199. sys_ReceiveFileIBLL.SaveEntity(keyValue, entity);
  200. return Success("保存成功!");
  201. }
  202. /// <summary>
  203. /// 查看实体数据
  204. /// <param name="keyValue">主键</param>
  205. /// <summary>
  206. /// <returns></returns>
  207. [HttpPost]
  208. [AjaxOnly]
  209. public ActionResult Read(string keyValue)
  210. {
  211. sys_ReceiveFileIBLL.ReadEntity(keyValue);
  212. return Success("保存成功!");
  213. }
  214. #endregion
  215. }
  216. }