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.
 
 
 
 
 
 

172 lines
5.8 KiB

  1. using Learun.Application.TwoDevelopment.EducationalAdministration;
  2. using Learun.Util;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Web.Mvc;
  6. using static Learun.Application.TwoDevelopment.EducationalAdministration.StuInfoGraduateEntity;
  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. /// 日 期:2020-05-21 16:16
  14. /// 描 述:毕业学生信息
  15. /// </summary>
  16. public class StuInfoGraduateController : MvcControllerBase
  17. {
  18. private StuInfoGraduateIBLL stuInfoGraduateIBLL = new StuInfoGraduateBLL();
  19. private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
  20. private StuScoreIBLL stuScoreIBLL = new StuScoreBLL();
  21. private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
  22. private CdMajorIBLL cdMajorIBLL = new CdMajorBLL();
  23. #region 视图功能
  24. /// <summary>
  25. /// 主页面
  26. /// <summary>
  27. /// <returns></returns>
  28. [HttpGet]
  29. public ActionResult Index()
  30. {
  31. return View();
  32. }
  33. /// <summary>
  34. /// 表单页
  35. /// <summary>
  36. /// <returns></returns>
  37. [HttpGet]
  38. public ActionResult Form()
  39. {
  40. return View();
  41. }
  42. [HttpGet]
  43. public ActionResult PrintScore()
  44. {
  45. return View();
  46. }
  47. [HttpGet]
  48. [AjaxOnly]
  49. public ActionResult DataFilling(string keyValue)
  50. {
  51. //毕业表
  52. var StuInfoGraduateEntity = stuInfoGraduateIBLL.GetEntity(keyValue);
  53. if (StuInfoGraduateEntity == null)
  54. {
  55. return View(new StuInfoGraduateEntity());
  56. }
  57. var Score = stuScoreIBLL.GetScoreListStuNo(StuInfoGraduateEntity.StuNo).Where(x => x.AcademicYearNo != null && x.Semester != null);
  58. //学习成绩
  59. StuInfoGraduateEntity.StuScoreList = Score
  60. .GroupBy(x => new { x.AcademicYearNo, x.Semester })
  61. .Select(x => new StuScores()
  62. {
  63. AcademicYearNo = x.Key.AcademicYearNo,
  64. Semester = x.Key.Semester,
  65. StuScoreList = x.Select(y => new StuScoreEntity()
  66. {
  67. LessonNo = y.LessonNo,
  68. LessonName = y.LessonName,
  69. Score = y.Score,
  70. ScoreFormat = y.ScoreFormat
  71. }).OrderBy(xx => xx.LessonNo).ToList()
  72. }).OrderBy(xx => xx.AcademicYearNo).ThenBy(xx => xx.Semester).ToList();
  73. var result = new
  74. {
  75. StuNo = StuInfoGraduateEntity.StuNo,
  76. StuName = StuInfoGraduateEntity.StuName,
  77. Crowning = StuInfoGraduateEntity.Crowning,
  78. EduSystem = StuInfoGraduateEntity.EduSystem,
  79. Grade = StuInfoGraduateEntity.Grade,
  80. ClassName = classInfoIBLL.GetClassInfoEntityByClassNo(StuInfoGraduateEntity.ClassNo).ClassName,
  81. MajorName = cdMajorIBLL.GetCdMajorEntityByMajorNo(StuInfoGraduateEntity.MajorNo).MajorName,
  82. StuInfoGraduateEntity = StuInfoGraduateEntity,
  83. Counts = Score.GroupBy(x => x.LessonName).Select(x => x.Key).Count().ToString(),
  84. };
  85. return Success(result);
  86. }
  87. #endregion
  88. #region 获取数据
  89. /// <summary>
  90. /// 获取列表数据
  91. /// <summary>
  92. /// <returns></returns>
  93. [HttpGet]
  94. [AjaxOnly]
  95. public ActionResult GetList(string queryJson)
  96. {
  97. var data = stuInfoGraduateIBLL.GetList(queryJson);
  98. return Success(data);
  99. }
  100. /// <summary>
  101. /// 获取列表分页数据
  102. /// <param name="pagination">分页参数</param>
  103. /// <summary>
  104. /// <returns></returns>
  105. [HttpGet]
  106. [AjaxOnly]
  107. public ActionResult GetPageList(string pagination, string queryJson)
  108. {
  109. Pagination paginationobj = pagination.ToObject<Pagination>();
  110. var data = stuInfoGraduateIBLL.GetPageList(paginationobj, queryJson);
  111. var jsonData = new
  112. {
  113. rows = data,
  114. total = paginationobj.total,
  115. page = paginationobj.page,
  116. records = paginationobj.records
  117. };
  118. return Success(jsonData);
  119. }
  120. /// <summary>
  121. /// 获取表单数据
  122. /// <param name="keyValue">主键</param>
  123. /// <summary>
  124. /// <returns></returns>
  125. [HttpGet]
  126. [AjaxOnly]
  127. public ActionResult GetFormData(string keyValue)
  128. {
  129. var data = stuInfoGraduateIBLL.GetEntity(keyValue);
  130. return Success(data);
  131. }
  132. #endregion
  133. #region 提交数据
  134. /// <summary>
  135. /// 删除实体数据
  136. /// <param name="keyValue">主键</param>
  137. /// <summary>
  138. /// <returns></returns>
  139. [HttpPost]
  140. [AjaxOnly]
  141. public ActionResult DeleteForm(string keyValue)
  142. {
  143. stuInfoGraduateIBLL.DeleteEntity(keyValue);
  144. return Success("删除成功!");
  145. }
  146. /// <summary>
  147. /// 保存实体数据(新增、修改)
  148. /// <param name="keyValue">主键</param>
  149. /// <summary>
  150. /// <returns></returns>
  151. [HttpPost]
  152. [ValidateAntiForgeryToken]
  153. [AjaxOnly]
  154. public ActionResult SaveForm(string keyValue, StuInfoGraduateEntity entity)
  155. {
  156. stuInfoGraduateIBLL.SaveEntity(keyValue, entity);
  157. return Success("保存成功!");
  158. }
  159. #endregion
  160. }
  161. }