EvaluationStudentSettingDetailController.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using Bowin.Common.Data;
  7. using Bowin.Common.Exceptions;
  8. using Bowin.Common.Utility;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.Web.Controls;
  11. using EMIS.Utility;
  12. using EMIS.ViewModel;
  13. using EMIS.ViewModel.EvaluationManage.StudentEvaluation;
  14. using EMIS.CommonLogic.EvaluationManage.StudentEvaluation;
  15. namespace EMIS.Web.Controllers.EvaluationManage.StudentEvaluation
  16. {
  17. [Authorization]
  18. public class EvaluationStudentSettingDetailController : Controller
  19. {
  20. public Lazy<IEvaluationStudentSettingDetailServices> EvaluationStudentSettingDetailServices { get; set; }
  21. /// <summary>
  22. /// 学评名单页面
  23. /// </summary>
  24. /// <returns></returns>
  25. public ActionResult List()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 学评名单列表查询
  31. /// </summary>
  32. /// <param name="pararms"></param>
  33. /// <returns></returns>
  34. [HttpPost]
  35. public ActionResult List(QueryParamsModel pararms)
  36. {
  37. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  38. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
  39. var campusID = pararms.getExtraGuid("CampusDropdown");
  40. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  41. var departmentID = pararms.getExtraGuid("DepartmentDropdown");
  42. var coursematerialID = pararms.getExtraGuid("CourseComboGrid");
  43. var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseType");
  44. var teachingModeID = pararms.getExtraInt("DictionaryTeachingMode") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryTeachingMode");
  45. var staffID = pararms.getExtraGuid("StaffComboGrid");
  46. var evaluationTableID = pararms.getExtraGuid("EvaluationTableDropdown");
  47. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  48. var openState = pararms.getExtraInt("OpenStateDropdown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("OpenStateDropdown");
  49. var isEvaluation = pararms.getExtraInt("IsEvaluationDropdown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsEvaluationDropdown");
  50. return base.Json(EvaluationStudentSettingDetailServices.Value.GetEvaluationStudentSettingDetailViewGrid(configuretView, schoolyearID, campusID, collegeID, departmentID,
  51. coursematerialID, courseTypeID, teachingModeID, staffID, evaluationTableID, inSchoolStatus, openState, isEvaluation, (int)pararms.page, (int)pararms.rows));
  52. }
  53. /// <summary>
  54. /// Excel导出
  55. /// </summary>
  56. /// <returns></returns>
  57. [HttpPost]
  58. public ActionResult Excel()
  59. {
  60. NpoiExcelHelper neh = new NpoiExcelHelper();
  61. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  62. var schoolyearID = Request.Form["SchoolyearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
  63. var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
  64. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  65. var departmentID = Request.Form["DepartmentDropdown"].ParseStrTo<Guid>();
  66. var coursematerialID = Request.Form["CourseComboGrid"].ParseStrTo<Guid>();
  67. var courseTypeID = Request.Form["DictionaryCourseType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryCourseType"].ParseStrTo<int>();
  68. var teachingModeID = Request.Form["DictionaryTeachingMode"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryTeachingMode"].ParseStrTo<int>();
  69. var staffID = Request.Form["StaffComboGrid"].ParseStrTo<Guid>();
  70. var evaluationTableID = Request.Form["EvaluationTableDropdown"].ParseStrTo<Guid>();
  71. var inschoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
  72. var openState = Request.Form["OpenStateDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["OpenStateDropdown"].ParseStrTo<int>();
  73. int? isEvaluation = Request["IsEvaluationDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["IsEvaluationDropdown"].ParseStrTo<int>();
  74. var dt = EvaluationStudentSettingDetailServices.Value.GetEvaluationStudentSettingDetailViewList(configuretView, schoolyearID, campusID, collegeID, departmentID,
  75. coursematerialID, courseTypeID, teachingModeID, staffID, evaluationTableID, inschoolStatus, openState, isEvaluation)
  76. .Select(x => new
  77. {
  78. x.StudentNo,
  79. x.Name,
  80. x.SexName,
  81. x.ClassmajorNo,
  82. x.ClassmajorName,
  83. x.CollegeNo,
  84. x.CollegeName,
  85. x.CampusNo,
  86. x.CampusName,
  87. x.InSchoolStatusName,
  88. x.SchoolyearCode,
  89. x.MissionName,
  90. x.MissionClassName,
  91. x.CourseCode,
  92. x.CourseName,
  93. x.CourseStructureName,
  94. x.CourseCategoryName,
  95. x.CourseTypeName,
  96. x.CourseQualityName,
  97. Credit = x.Credit.HasValue ? x.Credit.Value.ToString("#.#") : null,
  98. x.DepartmentNo,
  99. x.DepartmentName,
  100. x.HandleModeName,
  101. x.TeachingModeName,
  102. x.MissionClassStatusName,
  103. x.EvaluationTableCode,
  104. x.EvaluationTableName,
  105. x.ParticipateTypeName,
  106. x.EvaluationTypeCode,
  107. x.EvaluationTypeName,
  108. x.StaffCode,
  109. x.StaffName,
  110. x.TitleName,
  111. x.TeachingMethodName,
  112. x.OpenStateName,
  113. x.IsEvaluationName
  114. }).ToTable();
  115. string[] liststring = {
  116. "学号", "姓名", "性别", "班级编号", "班级名称", RSL.Get("CollegeCode"), RSL.Get("College"), RSL.Get("CampusCode"), RSL.Get("CampusName"),
  117. "在校状态", "学年学期", "任务名称", "任务班名称", "课程代码", "课程名称", "课程结构", "课程属性", "课程类型", "课程性质",
  118. "课程学分", "开课教研室代码", "开课教研室", "处理方式", "授课方式", "任务状态", "评价表编号", "评价表名", "参评类型", "评价类型编号",
  119. "评价类型", "教师工号", "任课教师", "职称", "任课方式", "开放状态", "评价状态"
  120. };
  121. var title = "学评名单信息";
  122. if (isEvaluation == (int)CF_GeneralPurpose.IsNo)
  123. {
  124. title = "学评名单信息(未评)";
  125. }
  126. if (isEvaluation == (int)CF_GeneralPurpose.IsYes)
  127. {
  128. title = "学评名单信息(已评)";
  129. }
  130. neh.Export(dt, liststring, title + DateTime.Now.ToString("yyyyMMdd"));
  131. return Json(new ReturnMessage()
  132. {
  133. IsSuccess = true,
  134. Message = "导出成功。"
  135. });
  136. }
  137. }
  138. }