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.
 
 
 
 
 
 

241 lines
6.9 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. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-10-22 16:58
  14. /// 描 述:文件接收
  15. /// </summary>
  16. public class SYS_ReceiveDocumentController : MvcControllerBase
  17. {
  18. private SYS_ReceiveDocumentIBLL sYS_ReceiveDocumentIBLL = new SYS_ReceiveDocumentBLL();
  19. private Sys_ReceiveFileIBLL receiveFileIbll = new Sys_ReceiveFileBLL();
  20. #region 视图功能
  21. /// <summary>
  22. /// 主页面
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Index()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 公文接收归档
  32. /// <summary>
  33. /// <returns></returns>
  34. [HttpGet]
  35. public ActionResult IndexFile()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 表单页
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult Form()
  45. {
  46. return View();
  47. }
  48. /// <summary>
  49. /// 表单页
  50. /// <summary>
  51. /// <returns></returns>
  52. [HttpGet]
  53. public ActionResult FormView()
  54. {
  55. return View();
  56. }
  57. /// <summary>
  58. /// 指派人列表
  59. /// <summary>
  60. /// <returns></returns>
  61. [HttpGet]
  62. public ActionResult IssueForm()
  63. {
  64. return View();
  65. }
  66. /// <summary>
  67. /// 阅读详情
  68. /// <summary>
  69. /// <returns></returns>
  70. [HttpGet]
  71. public ActionResult ReadList()
  72. {
  73. return View();
  74. }
  75. /// <summary>
  76. /// 打印页面
  77. /// <summary>
  78. /// <returns></returns>
  79. [HttpGet]
  80. public ActionResult PrintView()
  81. {
  82. return View();
  83. }
  84. #endregion
  85. #region 获取数据
  86. /// <summary>
  87. /// 获取页面显示列表数据
  88. /// <summary>
  89. /// <param name="queryJson">查询参数</param>
  90. /// <returns></returns>
  91. [HttpGet]
  92. [AjaxOnly]
  93. public ActionResult GetPageList(string pagination, string queryJson)
  94. {
  95. Pagination paginationobj = pagination.ToObject<Pagination>();
  96. var data = sYS_ReceiveDocumentIBLL.GetPageList(paginationobj, queryJson);
  97. foreach (var item in data)
  98. {
  99. var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.RID}'";
  100. var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.RID}'";
  101. var readdt = sYS_ReceiveDocumentIBLL.Execute(sql);
  102. var senddt = sYS_ReceiveDocumentIBLL.Execute(sendSql);
  103. var readcount = readdt.Rows[0][0];
  104. var sendcount = senddt.Rows[0][0];
  105. item.NumberPeople = $"{readcount}/{sendcount}";
  106. }
  107. var jsonData = new
  108. {
  109. rows = data,
  110. total = paginationobj.total,
  111. page = paginationobj.page,
  112. records = paginationobj.records
  113. };
  114. return Success(jsonData);
  115. }
  116. /// <summary>
  117. /// 获取表单数据
  118. /// <summary>
  119. /// <returns></returns>
  120. [HttpGet]
  121. [AjaxOnly]
  122. public ActionResult GetFormData(string keyValue)
  123. {
  124. var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
  125. var jsonData = new
  126. {
  127. Sys_ReceiveDocument = Sys_ReceiveDocumentData,
  128. };
  129. return Success(jsonData);
  130. }
  131. /// <summary>
  132. /// 获取表单数据
  133. /// <summary>
  134. /// <returns></returns>
  135. [HttpGet]
  136. [AjaxOnly]
  137. public ActionResult GetFormDataByProcessId(string processId)
  138. {
  139. var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetEntityByProcessId(processId);
  140. var jsonData = new
  141. {
  142. Sys_ReceiveDocument = Sys_ReceiveDocumentData,
  143. };
  144. return Success(jsonData);
  145. }
  146. public ActionResult PrintInfo(string keyValue)
  147. {
  148. var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
  149. var entityItem = receiveFileIbll.GetPageListBySendId(keyValue).ToList().Where(a => a.ReadTime != null).OrderBy(a => a.ReadTime);
  150. object data = new
  151. {
  152. entity,
  153. entityItem
  154. };
  155. return Success(data);
  156. }
  157. #endregion
  158. #region 提交数据
  159. /// <summary>
  160. /// 删除实体数据
  161. /// <param name="keyValue">主键</param>
  162. /// <summary>
  163. /// <returns></returns>
  164. [HttpPost]
  165. [AjaxOnly]
  166. public ActionResult DeleteForm(string keyValue)
  167. {
  168. sYS_ReceiveDocumentIBLL.DeleteEntity(keyValue);
  169. return Success("删除成功!");
  170. }
  171. /// <summary>
  172. /// 结束下发
  173. /// <param name="keyValue">主键</param>
  174. /// <summary>
  175. /// <returns></returns>
  176. [HttpPost]
  177. [AjaxOnly]
  178. public ActionResult OverIssue(string keyValue)
  179. {
  180. var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
  181. if (null != entity)
  182. {
  183. entity.RSendFlag = "4";
  184. sYS_ReceiveDocumentIBLL.SaveEntity(keyValue, entity);
  185. }
  186. return Success("操作成功!");
  187. }
  188. /// <summary>
  189. /// 保存实体数据(新增、修改)
  190. /// <param name="keyValue">主键</param>
  191. /// <summary>
  192. /// <returns></returns>
  193. [HttpPost]
  194. [ValidateAntiForgeryToken]
  195. [AjaxOnly]
  196. [ValidateInput(false)]
  197. public ActionResult SaveForm(string keyValue, string strEntity)
  198. {
  199. Sys_ReceiveDocumentEntity entity = strEntity.ToObject<Sys_ReceiveDocumentEntity>();
  200. sYS_ReceiveDocumentIBLL.SaveEntity(keyValue, entity);
  201. return Success("保存成功!");
  202. }
  203. /// <summary>
  204. /// 提交申请
  205. /// </summary>
  206. /// <param name="keyValue"></param>
  207. /// <returns></returns>
  208. [HttpPost]
  209. [AjaxOnly]
  210. public ActionResult ChangeStatusById(string keyValue, string processId)
  211. {
  212. sYS_ReceiveDocumentIBLL.ChangeStatusById(keyValue, 1, processId);
  213. return Success("操作成功!");
  214. }
  215. #endregion
  216. }
  217. }