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.
 
 
 
 
 
 

218 lines
6.8 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;
  7. using System.Linq;
  8. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  12. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-11-27 10:05
  15. /// 描 述:学生请假管理
  16. /// </summary>
  17. public class StuLeaveManagementController : MvcControllerBase
  18. {
  19. private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL();
  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 Form()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 表单页-查看
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult FormView()
  45. {
  46. return View();
  47. }
  48. /// <summary>
  49. /// 主页面【学工信息管理】【旧】
  50. /// <summary>
  51. /// <returns></returns>
  52. [HttpGet]
  53. public ActionResult CheckIndex()
  54. {
  55. ViewBag.IsDeptDirector = false; //登录用户是否是系主任标识
  56. var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId");
  57. var loginInfoRoleIds = LoginUserInfo.Get().roleIds;
  58. if (loginInfoRoleIds.IndexOf(',') == -1)
  59. {
  60. if (loginInfoRoleIds == deptDirectorRoleId)
  61. {
  62. ViewBag.IsDeptDirector = true;
  63. }
  64. }
  65. else
  66. {
  67. if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId))
  68. {
  69. ViewBag.IsDeptDirector = true;
  70. }
  71. }
  72. return View();
  73. }
  74. /// <summary>
  75. /// 表单页【学工信息管理】【旧】
  76. /// <summary>
  77. /// <returns></returns>
  78. [HttpGet]
  79. public ActionResult CheckForm()
  80. {
  81. return View();
  82. }
  83. #endregion
  84. #region 获取数据
  85. /// <summary>
  86. /// 获取页面显示列表数据
  87. /// </summary>
  88. /// <param name="pagination">分页参数</param>
  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 = stuLeaveManagementIBLL.GetPageList(paginationobj, queryJson);
  97. var jsonData = new
  98. {
  99. rows = data,
  100. total = paginationobj.total,
  101. page = paginationobj.page,
  102. records = paginationobj.records
  103. };
  104. return Success(jsonData);
  105. }
  106. /// <summary>
  107. /// 获取表单数据
  108. /// </summary>
  109. /// <param name="keyValue">主键</param>
  110. /// <returns></returns>
  111. [HttpGet]
  112. [AjaxOnly]
  113. public ActionResult GetFormData(string keyValue)
  114. {
  115. var StuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue);
  116. var jsonData = new
  117. {
  118. StuLeaveManagement = StuLeaveManagementData,
  119. };
  120. return Success(jsonData);
  121. }
  122. /// <summary>
  123. /// 获取表单数据
  124. /// </summary>
  125. /// <param name="processId">流程实例主键</param>
  126. /// <returns></returns>
  127. [HttpGet]
  128. [AjaxOnly]
  129. public ActionResult GetFormDataByProcessId(string processId)
  130. {
  131. var StuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(processId);
  132. var jsonData = new
  133. {
  134. StuLeaveManagement = StuLeaveManagementData,
  135. };
  136. return Success(jsonData);
  137. }
  138. #endregion
  139. #region 提交数据
  140. /// <summary>
  141. /// 删除实体数据
  142. /// </summary>
  143. /// <param name="keyValue">主键</param>
  144. /// <returns></returns>
  145. [HttpPost]
  146. [AjaxOnly]
  147. public ActionResult DeleteForm(string keyValue)
  148. {
  149. stuLeaveManagementIBLL.DeleteEntity(keyValue);
  150. return Success("删除成功!");
  151. }
  152. /// <summary>
  153. /// 保存实体数据(新增、修改)
  154. /// </summary>
  155. /// <param name="keyValue">主键</param>
  156. /// <param name="strEntity">实体</param>
  157. /// <returns></returns>
  158. [HttpPost]
  159. [ValidateAntiForgeryToken]
  160. [AjaxOnly]
  161. public ActionResult SaveForm(string keyValue, string strEntity)
  162. {
  163. var loginInfo = LoginUserInfo.Get();
  164. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  165. entity.CreateUserId = loginInfo.userId;
  166. entity.CreateUserNo = loginInfo.account;
  167. entity.CreateTime = DateTime.Now;
  168. entity.CheckStatus = "0";
  169. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  170. return Success("保存成功!");
  171. }
  172. /// <summary>
  173. /// 保存实体数据(新增、修改)
  174. /// </summary>
  175. /// <param name="keyValue">主键</param>
  176. /// <param name="strEntity">实体</param>
  177. /// <returns></returns>
  178. [HttpPost]
  179. [ValidateAntiForgeryToken]
  180. [AjaxOnly]
  181. public ActionResult SaveCheckForm(string keyValue, string strEntity)
  182. {
  183. var loginInfo = LoginUserInfo.Get();
  184. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  185. entity.CheckUserId = loginInfo.userId;
  186. entity.CheckUserNo = loginInfo.account;
  187. entity.CheckTime = DateTime.Now;
  188. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  189. return Success("保存成功!");
  190. }
  191. /// <summary>
  192. /// 提交实体数据
  193. /// </summary>
  194. /// <param name="keyValue">主键</param>
  195. /// <returns></returns>
  196. [HttpPost]
  197. [AjaxOnly]
  198. public ActionResult DoSubmit(string keyValue, string status, string processId)
  199. {
  200. stuLeaveManagementIBLL.DoSubmit(keyValue, status, processId);
  201. return Success("提交成功!");
  202. }
  203. #endregion
  204. }
  205. }