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.
 
 
 
 
 
 

253 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. 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-06-17 14:54
  14. /// 描 述:学生处分管理
  15. /// </summary>
  16. public class StuPunishmentController : MvcControllerBase
  17. {
  18. private StuPunishmentIBLL stuPunishmentIBLL = new StuPunishmentBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. return View();
  37. }
  38. /// <summary>
  39. /// 表页面
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult DeptIndex()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 表页面
  49. /// <summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult MajorIndex()
  53. {
  54. return View();
  55. }
  56. /// <summary>
  57. /// 表页面
  58. /// <summary>
  59. /// <returns></returns>
  60. [HttpGet]
  61. public ActionResult ClassIndex()
  62. {
  63. return View();
  64. }
  65. /// <summary>
  66. /// 主页面
  67. /// <summary>
  68. /// <returns></returns>
  69. [HttpGet]
  70. public ActionResult StuIndex()
  71. {
  72. return View();
  73. }
  74. #endregion
  75. #region 获取数据
  76. /// <summary>
  77. /// 获取页面显示列表数据
  78. /// <summary>
  79. /// <param name="queryJson">查询参数</param>
  80. /// <returns></returns>
  81. [HttpGet]
  82. [AjaxOnly]
  83. public ActionResult GetPageList(string pagination, string queryJson)
  84. {
  85. Pagination paginationobj = pagination.ToObject<Pagination>();
  86. var data = stuPunishmentIBLL.GetPageList(paginationobj, queryJson);
  87. var jsonData = new
  88. {
  89. rows = data,
  90. total = paginationobj.total,
  91. page = paginationobj.page,
  92. records = paginationobj.records
  93. };
  94. return Success(jsonData);
  95. }
  96. /// <summary>
  97. /// 获取表单数据
  98. /// <summary>
  99. /// <returns></returns>
  100. [HttpGet]
  101. [AjaxOnly]
  102. public ActionResult GetFormData(string keyValue)
  103. {
  104. var StuPunishmentData = stuPunishmentIBLL.GetStuPunishmentEntity(keyValue);
  105. var jsonData = new
  106. {
  107. StuPunishment = StuPunishmentData,
  108. };
  109. return Success(jsonData);
  110. }
  111. /// <summary>
  112. /// 获取页面显示列表数据
  113. /// <summary>
  114. /// <param name="queryJson">查询参数</param>
  115. /// <returns></returns>
  116. [HttpGet]
  117. [AjaxOnly]
  118. public ActionResult GetPageListOne(string queryJson)
  119. {
  120. var data = stuPunishmentIBLL.GetPageList(queryJson);
  121. var data1 = data.GroupBy(x => new { x.AcademicYearNo, x.Semester, x.DeptNo, x.Num }).Select(x => new
  122. {
  123. AcademicYearNo = x.Key.AcademicYearNo,
  124. Semester = x.Key.Semester,
  125. DeptNo = x.Key.DeptNo,
  126. Num = x.Count(),
  127. });
  128. return Success(data1);
  129. }
  130. /// <summary>
  131. /// 获取页面显示列表数据
  132. /// <summary>
  133. /// <param name="queryJson">查询参数</param>
  134. /// <returns></returns>
  135. [HttpGet]
  136. [AjaxOnly]
  137. public ActionResult GetPageListTwo(string queryJson)
  138. {
  139. var data = stuPunishmentIBLL.GetPageList(queryJson);
  140. var data1 = data.GroupBy(x => new { x.AcademicYearNo, x.Semester, x.DeptNo, x.Grade, x.Num }).Select(x => new
  141. {
  142. AcademicYearNo = x.Key.AcademicYearNo,
  143. Semester = x.Key.Semester,
  144. DeptNo = x.Key.DeptNo,
  145. Grade = x.Key.Grade,
  146. Num = x.Count(),
  147. });
  148. return Success(data1);
  149. }
  150. /// <summary>
  151. /// 获取页面显示列表数据
  152. /// <summary>
  153. /// <param name="queryJson">查询参数</param>
  154. /// <returns></returns>
  155. [HttpGet]
  156. [AjaxOnly]
  157. public ActionResult GetPageListThree(string queryJson)
  158. {
  159. var data = stuPunishmentIBLL.GetPageList(queryJson);
  160. var data1 = data.GroupBy(x => new
  161. {
  162. x.AcademicYearNo,
  163. x.Semester,
  164. x.DeptNo,
  165. x.MajorNo,
  166. x.ClassNo,
  167. x.Grade,
  168. x.Num
  169. }).Select(x => new
  170. {
  171. AcademicYearNo = x.Key.AcademicYearNo,
  172. Semester = x.Key.Semester,
  173. DeptNo = x.Key.DeptNo,
  174. MajorNo = x.Key.MajorNo,
  175. ClassNo = x.Key.ClassNo,
  176. Grade = x.Key.Grade,
  177. Num = x.Count(),
  178. });
  179. return Success(data1);
  180. }
  181. /// <summary>
  182. /// 获取页面显示列表数据
  183. /// <summary>
  184. /// <param name="queryJson">查询参数</param>
  185. /// <returns></returns>
  186. [HttpGet]
  187. [AjaxOnly]
  188. public ActionResult GetPageListStu(string queryJson)
  189. {
  190. var data = stuPunishmentIBLL.GetPageList(queryJson);
  191. var data1 = data.GroupBy(x => new { x.AcademicYearNo, x.Semester, x.StuNo, x.StuName, x.Num }).Select(x => new
  192. {
  193. AcademicYearNo = x.Key.AcademicYearNo,
  194. Semester = x.Key.Semester,
  195. StuNo = x.Key.StuNo,
  196. StuName = x.Key.StuName,
  197. Num = x.Count(),
  198. });
  199. return Success(data1);
  200. }
  201. #endregion
  202. #region 提交数据
  203. /// <summary>
  204. /// 删除实体数据
  205. /// <param name="keyValue">主键</param>
  206. /// <summary>
  207. /// <returns></returns>
  208. [HttpPost]
  209. [AjaxOnly]
  210. public ActionResult DeleteForm(string keyValue)
  211. {
  212. stuPunishmentIBLL.DeleteEntity(keyValue);
  213. return Success("删除成功!");
  214. }
  215. /// <summary>
  216. /// 保存实体数据(新增、修改)
  217. /// <param name="keyValue">主键</param>
  218. /// <summary>
  219. /// <returns></returns>
  220. [HttpPost]
  221. [ValidateAntiForgeryToken]
  222. [AjaxOnly]
  223. public ActionResult SaveForm(string keyValue, string strEntity)
  224. {
  225. StuPunishmentEntity entity = strEntity.ToObject<StuPunishmentEntity>();
  226. stuPunishmentIBLL.SaveEntity(keyValue, entity);
  227. return Success("保存成功!");
  228. }
  229. /// <summary>
  230. /// 解除处分
  231. /// <param name="keyValue">主键</param>
  232. /// <summary>
  233. /// <returns></returns>
  234. [HttpPost]
  235. [AjaxOnly]
  236. public ActionResult DoCancelPunish(string keyValue, bool status)
  237. {
  238. stuPunishmentIBLL.DoCancelPunish(keyValue, status);
  239. return Success("操作成功!");
  240. }
  241. #endregion
  242. }
  243. }