您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

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