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.
 
 
 
 
 
 

268 lines
7.6 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 RoleForm()
  38. {
  39. return View();
  40. }
  41. /// <summary>
  42. /// 公文接收归档
  43. /// <summary>
  44. /// <returns></returns>
  45. [HttpGet]
  46. public ActionResult IndexFile()
  47. {
  48. return View();
  49. }
  50. /// <summary>
  51. /// 表单页
  52. /// <summary>
  53. /// <returns></returns>
  54. [HttpGet]
  55. public ActionResult Form()
  56. {
  57. return View();
  58. }
  59. /// <summary>
  60. /// 表单页
  61. /// <summary>
  62. /// <returns></returns>
  63. [HttpGet]
  64. public ActionResult FormView()
  65. {
  66. return View();
  67. }
  68. /// <summary>
  69. /// 指派人列表
  70. /// <summary>
  71. /// <returns></returns>
  72. [HttpGet]
  73. public ActionResult IssueForm()
  74. {
  75. return View();
  76. }
  77. /// <summary>
  78. /// 阅读详情
  79. /// <summary>
  80. /// <returns></returns>
  81. [HttpGet]
  82. public ActionResult ReadList()
  83. {
  84. return View();
  85. }
  86. /// <summary>
  87. /// 打印页面
  88. /// <summary>
  89. /// <returns></returns>
  90. [HttpGet]
  91. public ActionResult PrintView()
  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 GetRoleData()
  134. {
  135. var data = roleIBLL.GetListForSelect();
  136. //var jsonData = new
  137. //{
  138. // data = data
  139. //};
  140. return Success(data);
  141. }
  142. /// <summary>
  143. /// 获取表单数据
  144. /// <summary>
  145. /// <returns></returns>
  146. [HttpGet]
  147. [AjaxOnly]
  148. public ActionResult GetFormData(string keyValue)
  149. {
  150. var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
  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 GetFormDataByProcessId(string processId)
  164. {
  165. var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetEntityByProcessId(processId);
  166. var jsonData = new
  167. {
  168. Sys_ReceiveDocument = Sys_ReceiveDocumentData,
  169. };
  170. return Success(jsonData);
  171. }
  172. public ActionResult PrintInfo(string keyValue)
  173. {
  174. var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
  175. var entityItem = receiveFileIbll.GetPageListBySendId(keyValue).ToList().Where(a=>a.ReadTime!=null).OrderBy(a=>a.ReadTime);
  176. object data = new
  177. {
  178. entity,
  179. entityItem
  180. };
  181. return Success(data);
  182. }
  183. #endregion
  184. #region 提交数据
  185. /// <summary>
  186. /// 删除实体数据
  187. /// <param name="keyValue">主键</param>
  188. /// <summary>
  189. /// <returns></returns>
  190. [HttpPost]
  191. [AjaxOnly]
  192. public ActionResult DeleteForm(string keyValue)
  193. {
  194. sYS_ReceiveDocumentIBLL.DeleteEntity(keyValue);
  195. return Success("删除成功!");
  196. }
  197. /// <summary>
  198. /// 结束下发
  199. /// <param name="keyValue">主键</param>
  200. /// <summary>
  201. /// <returns></returns>
  202. [HttpPost]
  203. [AjaxOnly]
  204. public ActionResult OverIssue(string keyValue)
  205. {
  206. var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
  207. if (null != entity)
  208. {
  209. entity.RSendFlag = "4";
  210. sYS_ReceiveDocumentIBLL.SaveEntity(keyValue, entity);
  211. }
  212. return Success("操作成功!");
  213. }
  214. /// <summary>
  215. /// 保存实体数据(新增、修改)
  216. /// <param name="keyValue">主键</param>
  217. /// <summary>
  218. /// <returns></returns>
  219. [HttpPost]
  220. [ValidateAntiForgeryToken]
  221. [AjaxOnly]
  222. [ValidateInput(false)]
  223. public ActionResult SaveForm(string keyValue, string strEntity)
  224. {
  225. Sys_ReceiveDocumentEntity entity = strEntity.ToObject<Sys_ReceiveDocumentEntity>();
  226. sYS_ReceiveDocumentIBLL.SaveEntity(keyValue, entity);
  227. return Success("保存成功!");
  228. }
  229. /// <summary>
  230. /// 提交申请
  231. /// </summary>
  232. /// <param name="keyValue"></param>
  233. /// <returns></returns>
  234. [HttpPost]
  235. [AjaxOnly]
  236. public ActionResult ChangeStatusById(string keyValue, string processId)
  237. {
  238. sYS_ReceiveDocumentIBLL.ChangeStatusById(keyValue, 1, processId);
  239. return Success("操作成功!");
  240. }
  241. #endregion
  242. }
  243. }