StudentReentryController.cs 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.CommonLogic.Students;
  7. using EMIS.ViewModel;
  8. using EMIS.Web.Controls;
  9. using Bowin.Web.Controls.Mvc;
  10. using Bowin.Common.Data;
  11. using Bowin.Common.Utility;
  12. namespace EMIS.Web.Controllers.StudentManage.StudentChange
  13. {
  14. [Authorization]
  15. public class StudentReentryController : Controller
  16. {
  17. public IReentryServices ReentryServices { get; set; }
  18. /// <summary>
  19. ///
  20. /// </summary>
  21. /// <returns></returns>
  22. public ActionResult List()
  23. {
  24. return View();
  25. }
  26. /// <summary>
  27. /// 列表查询
  28. /// </summary>
  29. /// <param name="pararms"></param>
  30. /// <returns></returns>
  31. [HttpPost]
  32. public ActionResult List(QueryParamsModel pararms)
  33. {
  34. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  35. var schoolYearID = pararms.getExtraGuid("ddlSchoolYear"); //学年学期
  36. var campusID = pararms.getExtraGuid("cbgCampus"); //校区
  37. var collegeID = pararms.getExtraGuid("cbgCollege"); //院系所
  38. var education = pararms.getExtraInt("ddlEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlEducation"); //培养层次
  39. var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear"); //年级
  40. var standard = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard"); //专业名称
  41. var learningform = pararms.getExtraInt("ddlLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlLearningform"); //学习形式
  42. var differentDynamicStatus = pararms.getExtraInt("ddlStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlStatus"); //审批状态
  43. var result = ReentryServices.GetStudentReentryViewGrid(configuretView, schoolYearID, campusID, collegeID, education, year, standard,
  44. learningform, (int)pararms.page, (int)pararms.rows);
  45. return Json(result);
  46. }
  47. [HttpPost]
  48. public ActionResult Excel()
  49. {
  50. NpoiExcelHelper neh = new NpoiExcelHelper();
  51. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  52. var schoolYearID = Request.Form["ddlSchoolYear"].ParseStrTo<Guid>(); //学年学期
  53. var campusID = Request.Form["cbgCampus"].ParseStrTo<Guid>(); //校区
  54. var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>(); //院系所
  55. var education = Request.Form["ddlEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlEducation"].ParseStrTo<int>(); //培养层次
  56. var year = Request.Form["ddlYear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>(); //年级
  57. var standard = Request.Form["cbgStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["cbgStandard"].ParseStrTo<int>(); //专业名称
  58. var learningform = Request.Form["ddlLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlLearningform"].ParseStrTo<int>(); //学习形式
  59. var differentDynamicStatus = Request.Form["ddlStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlStatus"].ParseStrTo<int>(); //审批状态
  60. var result = ReentryServices.GetStudentReentryViewList(configuretView, schoolYearID, campusID, collegeID, education, year, standard,
  61. learningform);
  62. var dt = result.Select(s => new
  63. {
  64. s.LoginID,
  65. s.UserName,
  66. EndDateString = (s.EndDate.HasValue ? s.EndDate.Value.ToString("yyyy-MM-dd") : ""),
  67. s.DifferentDynamicTypeDesc,
  68. s.ClassmajorName,
  69. s.StudentStatusDesc,
  70. s.AfterClassmajorName,
  71. s.AfterStudentStatusDesc,
  72. s.ReasonDesc,
  73. IsReturnedDesc = s.IsReentriedDesc,
  74. s.CollegeName,
  75. s.CampusName
  76. }).ToTable();
  77. string[] liststring = { "学号", "姓名", "结束日期", "异动类型", "异动前班级", "异动前学籍状态", "异动后班级", "异动后学籍状态", "异动原因", "是否已复学处理", "所属学院", "所属校区" };
  78. neh.Export(dt, liststring, "复学名单");
  79. return RedirectToAction("MsgShow", "Common", new
  80. {
  81. msg = "导出成功!",
  82. url = Url.Action("List").AddMenuParameter()
  83. });
  84. }
  85. }
  86. }