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.
 
 
 
 
 
 

220 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;
  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. StuLeaveManagementData.num = stuLeaveManagementIBLL.Num(StuLeaveManagementData.CreateUserNo);
  117. var jsonData = new
  118. {
  119. StuLeaveManagement = StuLeaveManagementData,
  120. };
  121. return Success(jsonData);
  122. }
  123. /// <summary>
  124. /// 获取表单数据
  125. /// </summary>
  126. /// <param name="processId">流程实例主键</param>
  127. /// <returns></returns>
  128. [HttpGet]
  129. [AjaxOnly]
  130. public ActionResult GetFormDataByProcessId(string processId)
  131. {
  132. var StuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(processId);
  133. StuLeaveManagementData.num = stuLeaveManagementIBLL.Num(StuLeaveManagementData.CreateUserNo);
  134. var jsonData = new
  135. {
  136. StuLeaveManagement = StuLeaveManagementData,
  137. };
  138. return Success(jsonData);
  139. }
  140. #endregion
  141. #region 提交数据
  142. /// <summary>
  143. /// 删除实体数据
  144. /// </summary>
  145. /// <param name="keyValue">主键</param>
  146. /// <returns></returns>
  147. [HttpPost]
  148. [AjaxOnly]
  149. public ActionResult DeleteForm(string keyValue)
  150. {
  151. stuLeaveManagementIBLL.DeleteEntity(keyValue);
  152. return Success("删除成功!");
  153. }
  154. /// <summary>
  155. /// 保存实体数据(新增、修改)
  156. /// </summary>
  157. /// <param name="keyValue">主键</param>
  158. /// <param name="strEntity">实体</param>
  159. /// <returns></returns>
  160. [HttpPost]
  161. [ValidateAntiForgeryToken]
  162. [AjaxOnly]
  163. public ActionResult SaveForm(string keyValue, string strEntity)
  164. {
  165. var loginInfo = LoginUserInfo.Get();
  166. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  167. entity.CreateUserId = loginInfo.userId;
  168. entity.CreateUserNo = loginInfo.account;
  169. entity.CreateTime = DateTime.Now;
  170. entity.CheckStatus = "0";
  171. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  172. return Success("保存成功!");
  173. }
  174. /// <summary>
  175. /// 保存实体数据(新增、修改)
  176. /// </summary>
  177. /// <param name="keyValue">主键</param>
  178. /// <param name="strEntity">实体</param>
  179. /// <returns></returns>
  180. [HttpPost]
  181. [ValidateAntiForgeryToken]
  182. [AjaxOnly]
  183. public ActionResult SaveCheckForm(string keyValue, string strEntity)
  184. {
  185. var loginInfo = LoginUserInfo.Get();
  186. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  187. entity.CheckUserId = loginInfo.userId;
  188. entity.CheckUserNo = loginInfo.account;
  189. entity.CheckTime = DateTime.Now;
  190. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  191. return Success("保存成功!");
  192. }
  193. /// <summary>
  194. /// 提交实体数据
  195. /// </summary>
  196. /// <param name="keyValue">主键</param>
  197. /// <returns></returns>
  198. [HttpPost]
  199. [AjaxOnly]
  200. public ActionResult DoSubmit(string keyValue, string status, string processId)
  201. {
  202. stuLeaveManagementIBLL.DoSubmit(keyValue, status, processId);
  203. return Success("提交成功!");
  204. }
  205. #endregion
  206. }
  207. }