EducationSchedulingReportController.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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.CalendarManage;
  7. using EMIS.ViewModel;
  8. using EMIS.Web.Controls;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.CommonLogic.EducationSchedule;
  11. using Bowin.Common.Utility;
  12. using Bowin.Common.Exceptions;
  13. using Bowin.Common.Data;
  14. using EMIS.CommonLogic.Report;
  15. namespace EMIS.Web.Controllers.EducationSchedule
  16. {
  17. [Authorization]
  18. public class EducationSchedulingReportController : Controller
  19. {
  20. public ISchoolYearServices SchoolYearServices { get; set; }
  21. public INewReportServices NewReportServices { get; set; }
  22. public IRealtimeServices IRealtimeServices { get; set; }
  23. //
  24. // GET: /EducationReport/
  25. public ActionResult ClassmajorReport()
  26. {
  27. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  28. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  29. return View();
  30. }
  31. public ActionResult GrademajorReport()
  32. {
  33. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  34. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  35. return View();
  36. }
  37. public ActionResult TeacherReport()
  38. {
  39. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  40. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  41. return View();
  42. }
  43. public ActionResult ClassroomReport()
  44. {
  45. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  46. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  47. return View();
  48. }
  49. public ActionResult DepartmentReport()
  50. {
  51. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  52. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  53. return View();
  54. }
  55. public ActionResult ClassmajorPrintingReport()
  56. {
  57. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  58. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  59. return View();
  60. }
  61. public ActionResult TeacherPrintingReport()
  62. {
  63. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  64. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  65. return View();
  66. }
  67. public ActionResult ClassroomPrintingReport()
  68. {
  69. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  70. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  71. return View();
  72. }
  73. public ActionResult BuildingReport()
  74. {
  75. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  76. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  77. return View();
  78. }
  79. public ActionResult CollegeClassmajorFullReport()
  80. {
  81. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  82. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  83. return View();
  84. }
  85. public ActionResult BuildingFullReport()
  86. {
  87. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  88. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  89. return View();
  90. }
  91. public ActionResult CollegeTeacherFullReport()
  92. {
  93. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  94. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  95. return View();
  96. }
  97. public ActionResult CollegeMissionClassTeacherFullReport()
  98. {
  99. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  100. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  101. return View();
  102. }
  103. public ActionResult TeacherCollegeReport()
  104. {
  105. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  106. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  107. return View();
  108. }
  109. public ActionResult StudentReport()
  110. {
  111. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  112. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  113. return View();
  114. }
  115. public ActionResult UserReport()
  116. {
  117. return View();
  118. }
  119. public ActionResult MyReport()
  120. {
  121. return View();
  122. }
  123. /// <summary>
  124. /// 实时课表查询
  125. /// </summary>
  126. /// <returns></returns>
  127. public ActionResult Realtime()
  128. {
  129. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  130. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  131. return View();
  132. }
  133. /// <summary>
  134. /// 实时课表列表查询
  135. /// </summary>
  136. /// <param name="pararms"></param>
  137. /// <returns></returns>
  138. [HttpPost]
  139. public ActionResult Realtime(QueryParamsModel pararms)
  140. {
  141. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  142. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdownList");
  143. var collegeID = pararms.getExtraGuid("ComboGridCollege");
  144. var openCollegeID = pararms.getExtraGuid("ComboGridOpenCollege");
  145. var WeekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum"); ;
  146. var WeekDay = pararms.getExtraInt("WeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekDay"); ;
  147. var Times = pararms.getExtraGuid("Times");
  148. var ClassroomID = pararms.getExtraGuid("ClassroomID");
  149. var result = IRealtimeServices.GetEducationMissionClassScheduleViewGrid(configuretView, collegeID, openCollegeID, schoolyearID, WeekNum, WeekDay, Times, ClassroomID, (int)pararms.page, (int)pararms.rows);
  150. return Json(result);
  151. }
  152. /// <summary>
  153. /// 实时课表查询广体
  154. /// </summary>
  155. /// <returns></returns>
  156. public ActionResult RealtimeGT()
  157. {
  158. var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
  159. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  160. return View();
  161. }
  162. /// <summary>
  163. /// 实时课表列表查询广体
  164. /// </summary>
  165. /// <param name="pararms"></param>
  166. /// <returns></returns>
  167. [HttpPost]
  168. public ActionResult RealtimeGT(QueryParamsModel pararms)
  169. {
  170. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  171. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdownList");
  172. var collegeID = pararms.getExtraGuid("ComboGridCollege");
  173. var openCollegeID = pararms.getExtraGuid("ComboGridOpenCollege");
  174. var WeekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum"); ;
  175. var WeekDay = pararms.getExtraInt("WeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekDay"); ;
  176. var Times = pararms.getExtraGuid("Times");
  177. var ClassroomID = pararms.getExtraGuid("ClassroomID");
  178. var result = IRealtimeServices.GetEducationMissionClassScheduleViewGridGT(configuretView, collegeID, openCollegeID, schoolyearID, WeekNum, WeekDay, Times, ClassroomID, (int)pararms.page, (int)pararms.rows);
  179. return Json(result);
  180. }
  181. /// <summary>
  182. /// Excel导出
  183. /// </summary>
  184. /// <returns></returns>
  185. [HttpPost]
  186. public ActionResult Excel()
  187. {
  188. NpoiExcelHelper neh = new NpoiExcelHelper();
  189. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  190. //var EducationMissionClassID = Request.Form["EducationMissionClassID"];
  191. var schoolyearID = Request.Form["SchoolyearDropdownList"].ParseStrTo<Guid>();
  192. var collegeID = Request.Form["ComboGridCollege"].ParseStrTo<Guid>();
  193. var openCollegeID = Request.Form["ComboGridOpenCollege"].ParseStrTo<Guid>();
  194. var WeekNum = Request.Form["ddlWeekNum"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlWeekNum"].ParseStrTo<int>();
  195. var WeekDay = Request.Form["WeekDay"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["WeekDay"].ParseStrTo<int>();
  196. var Times = Request.Form["Times"].ParseStrTo<Guid>();
  197. var ClassroomID = Request.Form["ClassroomID"].ParseStrTo<Guid>();
  198. List<Guid?> EducationMissionClassList = new List<Guid?>();
  199. var CoursesTimeID = Request.Form["TimeComboGrid"].ParseStrTo<Guid>();
  200. //if (EducationMissionClassID != "")
  201. //{
  202. // EducationMissionClassList = EducationMissionClassID.SplitIDString();
  203. //}
  204. //else
  205. //{
  206. // EducationMissionClassList = null;
  207. //}
  208. var dt = IRealtimeServices.GetEducationMissionClassScheduleViewGridForExcel(configuretView, collegeID, openCollegeID, schoolyearID, WeekNum, WeekDay, Times, ClassroomID).Select(x => new
  209. {
  210. x.ClassroomName,
  211. x.WeekNum,
  212. x.WeekdayName,
  213. x.Times,
  214. x.TimesHoure,
  215. x.TeacherName,
  216. x.Name,
  217. x.OpenCollegeName,
  218. x.CollegeName,
  219. x.ClassNum
  220. }).ToTable();
  221. string[] liststring = {
  222. "教室名称", "上课周次", "星期", "上课节次", "上课时间", "授课老师",
  223. "任务班名称", @EMIS.Utility.RSL.Get("CourseCollege"), @EMIS.Utility.RSL.Get("College"), "人数"
  224. };
  225. neh.Export(dt, liststring, "实时课表信息" + DateTime.Now.ToString("yyyyMMdd"));
  226. return Json(new ReturnMessage()
  227. {
  228. IsSuccess = true,
  229. Message = "导出成功。"
  230. });
  231. }
  232. public ActionResult TeacherselfSchedulingPDF(Guid SchoolyearID, Guid? UserID)
  233. {
  234. var pdf = NewReportServices.TeacherselfSchedulingPDF(SchoolyearID, UserID);
  235. return File(pdf.ToArray(), "application/pdf");
  236. }
  237. public ActionResult StudentForTeacherSchedulingPDF(Guid SchoolyearID, Guid StudentNo)
  238. {
  239. var pdf = NewReportServices.StudentForTeacherSchedulingPDF(SchoolyearID, StudentNo);
  240. return File(pdf.ToArray(), "application/pdf");
  241. }
  242. public ActionResult ClassmajorSchedulingPDF(Guid SchoolyearID, Guid? CollegeID, Guid? ClassmajorID, int? Years)
  243. {
  244. var pdf = NewReportServices.ClassmajorSchedulingPDF(SchoolyearID, CollegeID, ClassmajorID, Years);
  245. return File(pdf.ToArray(), "application/pdf");
  246. }
  247. public ActionResult ClassmajorPrintingSchedulingPDF(Guid SchoolyearID, Guid? CollegeID)
  248. {
  249. var pdf = NewReportServices.ClassmajorPrintingSchedulingPDF(SchoolyearID, CollegeID);
  250. return File(pdf.ToArray(), "application/pdf");
  251. }
  252. public ActionResult TeacherSchedulingPDF(Guid SchoolyearID, Guid? CollegeID, Guid? UserID)
  253. {
  254. var pdf = NewReportServices.TeacherSchedulingPDF(SchoolyearID, CollegeID, UserID);
  255. return File(pdf.ToArray(), "application/pdf");
  256. }
  257. public ActionResult TeacherPrintSchedulingPDF(Guid SchoolyearID, Guid? CollegeID)
  258. {
  259. var pdf = NewReportServices.TeacherPrintingSchedulingPDF(SchoolyearID, CollegeID);
  260. return File(pdf.ToArray(), "application/pdf");
  261. }
  262. public ActionResult ClassroomReportPDF(Guid SchoolyearID, Guid? BuildingsInfoID, Guid? ClassroomID)
  263. {
  264. var pdf = NewReportServices.ClassroomReportPDF(SchoolyearID, BuildingsInfoID, ClassroomID);
  265. return File(pdf.ToArray(), "application/pdf");
  266. }
  267. public ActionResult ClassroomPrintReportPDF(Guid SchoolyearID, Guid? BuildingsInfoID)
  268. {
  269. var pdf = NewReportServices.ClassroomPrintingReportPDF(SchoolyearID, BuildingsInfoID);
  270. return File(pdf.ToArray(), "application/pdf");
  271. }
  272. public ActionResult DepartmentSchedulingPDF(Guid SchoolyearID, Guid CollegeID, Guid DepartmentID, Guid? HandleModeID)
  273. {
  274. var pdf = NewReportServices.DepartmentSchedulingPDF(SchoolyearID, CollegeID, DepartmentID, HandleModeID);
  275. return File(pdf.ToArray(), "application/pdf");
  276. }
  277. public ActionResult CollegeSchedulingPDF(Guid SchoolyearID, Guid? CollegeID, int? Years)
  278. {
  279. var pdf = NewReportServices.CollegeSchedulingPDF(SchoolyearID, CollegeID, Years);
  280. return File(pdf.ToArray(), "application/pdf");
  281. }
  282. }
  283. }