DifferentDynamicResultController.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.ViewModel;
  7. using EMIS.Web.Controls;
  8. using EMIS.CommonLogic.Students;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.ViewModel.DifferentDynamic;
  11. using Bowin.Common.Linq.Entity;
  12. using Bowin.Common.Utility;
  13. using Bowin.Common.Linq;
  14. using Bowin.Common.Mvc;
  15. using EMIS.CommonLogic.CalendarManage;
  16. namespace EMIS.Web.Controllers.DifferentDynamic
  17. {
  18. /// <summary>
  19. /// 异动结果
  20. /// </summary>
  21. [Authorization]
  22. public class DifferentDynamicResultController : DifferentDynamicController
  23. {
  24. public ISchoolYearServices SchoolYearServices { get; set; }
  25. //[StaticFileWriteFilter]
  26. public ActionResult List()
  27. {
  28. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  29. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  30. return View();
  31. }
  32. /// <summary>
  33. /// 列表查询
  34. /// </summary>
  35. /// <param name="pararms"></param>
  36. /// <returns></returns>
  37. [HttpPost]
  38. public ActionResult List(QueryParamsModel pararms)
  39. {
  40. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  41. var campusID = pararms.getExtraGuid("CampusDropdown"); //校区
  42. var collegeID = pararms.getExtraGuid("CollegeDropdown"); //院系所
  43. var year = CheckIsSelectAll(pararms.getExtraInt("SchoolyearDictionaryDropDown")); //年级
  44. var standard = CheckIsSelectAll(pararms.getExtraInt("StandardDictionaryDropDown")); //专业名称
  45. var education = CheckIsSelectAll(pararms.getExtraInt("DictionaryEducation")); //培养层次
  46. var learningform = CheckIsSelectAll(pararms.getExtraInt("DictionaryLearningform")); //学习形式
  47. var classmajorID = pararms.getExtraGuid("ClassmajorDropdown"); //班级名称
  48. var schoolYearID = pararms.getExtraGuid("SchoolYearDropdown"); //异动学期
  49. var differentDynamicType = CheckIsSelectAll(pararms.getExtraInt("DictionaryDifferentDynamicType")); //异动类型
  50. var differentDynamicStatus = DifferentDynamicServices.GetCorrectEndStatus();// CheckIsSelectAll(pararms.getExtraInt("DictionaryDifferentDynamicStatus")); //审批状态
  51. var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
  52. var result = DifferentDynamicServices.GetDifferentDynamicViewGrid(configuretView, campusID, collegeID, year, standard, education, learningform, classmajorID, schoolYearID, differentDynamicType, differentDynamicStatus, LearnSystem, (int)pararms.page, (int)pararms.rows, 0);
  53. return Json(result);
  54. }
  55. public ActionResult Edit(Guid? id)
  56. {
  57. var vm = new DifferentDynamicView();
  58. if (id != null && id != Guid.Empty)
  59. vm = DifferentDynamicServices.GetDifferentDynamicView(id);
  60. return View(vm);
  61. }
  62. [HttpPost]
  63. public ActionResult Excel()
  64. {
  65. NpoiExcelHelper neh = new NpoiExcelHelper();
  66. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  67. //避开全选值
  68. //var roleID = Request.Form["Role"].ParseStrTo<Guid>();
  69. var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>(); //校区
  70. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>(); //院系所
  71. var year = CheckIsSelectAll(Request.Form["DictionarySchoolyear"].ParseStrTo<int>()); //年级
  72. var standard = CheckIsSelectAll(Request.Form["DictionaryStandard"].ParseStrTo<int>()); //专业名称
  73. var education = CheckIsSelectAll(Request.Form["DictionaryEducation"].ParseStrTo<int>()); //培养层次
  74. var learningform = CheckIsSelectAll(Request.Form["DictionaryLearningform"].ParseStrTo<int>()); //学习形式
  75. var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>(); //班级名称
  76. var schoolYearID = Request.Form["SchoolYearDropdown"].ParseStrTo<Guid>(); //异动学期
  77. var differentDynamicType = CheckIsSelectAll(Request.Form["DictionaryDifferentDynamicType"].ParseStrTo<int>()); //异动类型
  78. var differentDynamicStatus = DifferentDynamicServices.GetCorrectEndStatus(); //审批状态
  79. var LearnSystem = Request.Form["DictionaryLearnSystem"].ToString();
  80. var result = DifferentDynamicServices.GetDifferentDynamicViewList(configuretView, campusID, collegeID, year, standard, education, learningform, classmajorID, schoolYearID, differentDynamicType, differentDynamicStatus, LearnSystem, 0);
  81. var dt = result.OrderBy(x => x.EntityCreateTime).Select(s => new
  82. {
  83. s.SchoolyearCode,
  84. s.LoginID,
  85. s.Name,
  86. s.DifferentDynamicTypeName,
  87. s.ReasonName,
  88. s.InSchoolStatusName,
  89. s.StudentStatusName,
  90. s.StandardName,
  91. s.ClassmajorName,
  92. s.AfterStandardName,
  93. s.AfterClassmajorName,
  94. s.AfterInSchoolStatusName,
  95. s.AfterStudentStatusName,
  96. s.EntityCreateTimeStr,
  97. s.ReportStatusName,
  98. }).ToTable();
  99. string[] liststring = { "异动学期", "学号", "姓名", "异动类型", "异动原因", "在校状态", "学籍状态",
  100. "异动前专业", "异动前班级", "异动后专业", "异动后班级", "异动后在校状态", "异动后学籍状态",
  101. "异动日期", "注册状态" };
  102. neh.Export(dt, liststring, "异动结果");
  103. return RedirectToAction("MsgShow", "Common", new
  104. {
  105. msg = "导出成功!",
  106. url = Url.Action("List").AddMenuParameter()
  107. });
  108. }
  109. [HttpPost]
  110. public ActionResult StudentDifferentDynamicApplyInfo(Guid? Userid)
  111. {
  112. var view = DifferentDynamicServices.GetStudentDifferentInfoViewGrid(Userid);
  113. return Json(view);
  114. }
  115. }
  116. }