EducationMissionClassStudentController.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using Bowin.Web.Controls.Mvc;
  7. using Bowin.Common.Utility;
  8. using Bowin.Common.Data;
  9. using EMIS.Web.Controls;
  10. using EMIS.Utility;
  11. using EMIS.ViewModel;
  12. using EMIS.ViewModel.EducationManage.EducationArrange;
  13. using EMIS.CommonLogic.EducationManage.EducationArrange;
  14. namespace EMIS.Web.Controllers.EducationManage.EducationArrange
  15. {
  16. [Authorization]
  17. public class EducationMissionClassStudentController : Controller
  18. {
  19. public IEducationMissionClassStudentServices EducationMissionClassStudentServices { get; set; }
  20. /// <summary>
  21. /// 任务名单(教学任务班)页面
  22. /// </summary>
  23. /// <returns></returns>
  24. public ActionResult List()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 任务名单(教学任务班)列表查询
  30. /// </summary>
  31. /// <param name="pararms"></param>
  32. /// <returns></returns>
  33. [HttpPost]
  34. public ActionResult List(QueryParamsModel pararms)
  35. {
  36. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  37. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
  38. var campusID = pararms.getExtraGuid("CampusDropdown");
  39. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  40. var yearID = pararms.getExtraInt("DictionarySchoolyear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionarySchoolyear");
  41. var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
  42. var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
  43. var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
  44. var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
  45. var classmajorID = pararms.getExtraGuid("ClassmajorComboGrid");
  46. var coursematerialID = pararms.getExtraGuid("CourseComboGrid");
  47. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  48. var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
  49. return base.Json(EducationMissionClassStudentServices.GetEducationMissionClassStudentViewGrid(configuretView, schoolyearID, campusID, collegeID,
  50. yearID, standardID, educationID, learningformID, learnSystem, classmajorID, coursematerialID, inSchoolStatus, approvalStatus, (int)pararms.page, (int)pararms.rows));
  51. }
  52. /// <summary>
  53. /// Excel导出
  54. /// </summary>
  55. /// <returns></returns>
  56. [HttpPost]
  57. public ActionResult Excel()
  58. {
  59. NpoiExcelHelper neh = new NpoiExcelHelper();
  60. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  61. var schoolyearID = Request.Form["SchoolyearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
  62. var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
  63. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  64. var yearID = Request.Form["DictionarySchoolyear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionarySchoolyear"].ParseStrTo<int>();
  65. var standardID = Request.Form["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryStandard"].ParseStrTo<int>();
  66. var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
  67. var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
  68. var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
  69. var classmajorID = Request.Form["ClassmajorComboGrid"].ParseStrTo<Guid>();
  70. var coursematerialID = Request.Form["CourseComboGrid"].ParseStrTo<Guid>();
  71. var inschoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
  72. var approvalStatus = Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>();
  73. var dt = EducationMissionClassStudentServices.GetEducationMissionClassStudentViewList(configuretView, schoolyearID, campusID, collegeID, yearID,
  74. standardID, educationID, learningformID, learnSystem, classmajorID, coursematerialID, inschoolStatus, approvalStatus)
  75. .Select(x => new
  76. {
  77. x.StudentNo,
  78. x.Name,
  79. x.SexName,
  80. x.InSchoolStatusName,
  81. x.StudentStatusName,
  82. x.StandardID,
  83. x.StandardCode,
  84. x.StandardName,
  85. x.EducationName,
  86. x.LearningformName,
  87. x.LearnSystem,
  88. x.ClassmajorNo,
  89. x.ClassmajorName,
  90. x.ClassNum,
  91. x.GradeID,
  92. x.GrademajorCode,
  93. x.GrademajorName,
  94. x.CollegeCode,
  95. x.CollegeName,
  96. x.CampusNo,
  97. x.CampusName,
  98. x.SchoolyearCode,
  99. x.MissionName,
  100. x.MissionClassName,
  101. x.SchedulingClassName,
  102. x.MainScheduleClassNo,
  103. x.MainScheduleClassName,
  104. x.MissionSourceName,
  105. x.MissionTypeName,
  106. x.OrderNo,
  107. x.CourseCode,
  108. x.CourseName,
  109. x.DepartmentName,
  110. x.CourseCollegeName,
  111. x.CourseStructureName,
  112. x.CourseCategoryName,
  113. x.CourseTypeName,
  114. x.CourseQualityName,
  115. Credit = x.Credit.HasValue ? x.Credit.Value.ToString("#.#") : null,
  116. x.TheoryCourse,
  117. x.Practicehours,
  118. x.Trialhours,
  119. x.Totalhours,
  120. x.ExecHours,
  121. x.TheoryWeeklyNum,
  122. x.PracticeWeeklyNum,
  123. x.TrialWeeklyNum,
  124. x.SchoolweeksNum,
  125. x.WeeklyHours,
  126. x.WeeklyNum,
  127. x.StartWeeklyNum,
  128. x.EndWeeklyNum,
  129. x.StartEndWeeklyNum,
  130. x.ExecWeeklyNum,
  131. x.ClassroomTypeName,
  132. x.ClassroomCode,
  133. x.ClassroomName,
  134. x.IsNeedMaterialName,
  135. x.TeachinglanguageName,
  136. x.ExaminationModeName,
  137. x.ResultTypeName,
  138. x.HandleModeName,
  139. x.TeachingModeName,
  140. x.ApprovalStatusName,
  141. x.Remark
  142. }).ToTable();
  143. string[] liststring = {
  144. "学号", "姓名", "性别", "在校状态", "学籍状态", "专业ID(Value)", "专业代码", "专业名称", RSL.Get("EducationID"), "学习形式",
  145. "学制", "班级编号", "班级名称", "班序", "年级", "年级专业编号", "年级专业名称", RSL.Get("CollegeCode"), RSL.Get("CollegeName"),
  146. RSL.Get("CampusCode"), RSL.Get("Campus"), "学年学期", "任务名称", "任务班名称", "排课班名称", "主排课班级编号", "主排课班级名称",
  147. "任务来源", "任务类型", "任务班序", "课程代码", "课程名称", "开课教研室", "开课院系", "课程结构", "课程属性", "课程类型",
  148. "课程性质", "课程学分", "理论学时", "实践学时", "实验学时", "总学时", "执行学时", "理论周次", "实践周次", "实验周次", "总周次",
  149. "周学时", "每周次数", "开始周次", "结束周次", "起止周次", "执行周次", "教室类型", "教室编号", "教室名称", "是否需要教材",
  150. "授课语言", "考试方式", "成绩类型", "处理方式", "授课方式", "状态", "备注"
  151. };
  152. neh.Export(dt, liststring, "任务名单信息" + DateTime.Now.ToString("yyyyMMdd"));
  153. return Json(new ReturnMessage()
  154. {
  155. IsSuccess = true,
  156. Message = "导出成功。"
  157. });
  158. }
  159. }
  160. }