123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.EducationSchedule;
- using Bowin.Common.Utility;
- using Bowin.Common.Exceptions;
- using Bowin.Common.Data;
- using EMIS.CommonLogic.Report;
- namespace EMIS.Web.Controllers.EducationSchedule
- {
- [Authorization]
- public class EducationSchedulingReportController : Controller
- {
- public ISchoolYearServices SchoolYearServices { get; set; }
- public INewReportServices NewReportServices { get; set; }
- public IRealtimeServices IRealtimeServices { get; set; }
- //
- // GET: /EducationReport/
- public ActionResult ClassmajorReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult GrademajorReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult TeacherReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult ClassroomReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult DepartmentReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult ClassmajorPrintingReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult TeacherPrintingReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult ClassroomPrintingReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult BuildingReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult CollegeClassmajorFullReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult BuildingFullReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult CollegeTeacherFullReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult CollegeMissionClassTeacherFullReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult TeacherCollegeReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult StudentReport()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult UserReport()
- {
- return View();
- }
- public ActionResult MyReport()
- {
- return View();
- }
- /// <summary>
- /// 实时课表查询
- /// </summary>
- /// <returns></returns>
- public ActionResult Realtime()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- /// <summary>
- /// 实时课表列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Realtime(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolyearDropdownList");
- var collegeID = pararms.getExtraGuid("ComboGridCollege");
- var openCollegeID = pararms.getExtraGuid("ComboGridOpenCollege");
- var WeekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum"); ;
- var WeekDay = pararms.getExtraInt("WeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekDay"); ;
- var Times = pararms.getExtraGuid("Times");
- var ClassroomID = pararms.getExtraGuid("ClassroomID");
- var result = IRealtimeServices.GetEducationMissionClassScheduleViewGrid(configuretView, collegeID, openCollegeID, schoolyearID, WeekNum, WeekDay, Times, ClassroomID, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- /// <summary>
- /// 实时课表查询广体
- /// </summary>
- /// <returns></returns>
- public ActionResult RealtimeGT()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- /// <summary>
- /// 实时课表列表查询广体
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult RealtimeGT(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolyearDropdownList");
- var collegeID = pararms.getExtraGuid("ComboGridCollege");
- var openCollegeID = pararms.getExtraGuid("ComboGridOpenCollege");
- var WeekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum"); ;
- var WeekDay = pararms.getExtraInt("WeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekDay"); ;
- var Times = pararms.getExtraGuid("Times");
- var ClassroomID = pararms.getExtraGuid("ClassroomID");
- var result = IRealtimeServices.GetEducationMissionClassScheduleViewGridGT(configuretView, collegeID, openCollegeID, schoolyearID, WeekNum, WeekDay, Times, ClassroomID, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- //var EducationMissionClassID = Request.Form["EducationMissionClassID"];
- var schoolyearID = Request.Form["SchoolyearDropdownList"].ParseStrTo<Guid>();
- var collegeID = Request.Form["ComboGridCollege"].ParseStrTo<Guid>();
- var openCollegeID = Request.Form["ComboGridOpenCollege"].ParseStrTo<Guid>();
- var WeekNum = Request.Form["ddlWeekNum"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlWeekNum"].ParseStrTo<int>();
- var WeekDay = Request.Form["WeekDay"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["WeekDay"].ParseStrTo<int>();
- var Times = Request.Form["Times"].ParseStrTo<Guid>();
- var ClassroomID = Request.Form["ClassroomID"].ParseStrTo<Guid>();
- List<Guid?> EducationMissionClassList = new List<Guid?>();
- var CoursesTimeID = Request.Form["TimeComboGrid"].ParseStrTo<Guid>();
- //if (EducationMissionClassID != "")
- //{
- // EducationMissionClassList = EducationMissionClassID.SplitIDString();
- //}
- //else
- //{
- // EducationMissionClassList = null;
- //}
- var dt = IRealtimeServices.GetEducationMissionClassScheduleViewGridForExcel(configuretView, collegeID, openCollegeID, schoolyearID, WeekNum, WeekDay, Times, ClassroomID).Select(x => new
- {
- x.ClassroomName,
- x.WeekNum,
- x.WeekdayName,
- x.Times,
- x.TimesHoure,
- x.TeacherName,
- x.Name,
- x.OpenCollegeName,
- x.CollegeName,
- x.ClassNum
- }).ToTable();
- string[] liststring = {
- "教室名称", "上课周次", "星期", "上课节次", "上课时间", "授课老师",
- "任务班名称", @EMIS.Utility.RSL.Get("CourseCollege"), @EMIS.Utility.RSL.Get("College"), "人数"
- };
- neh.Export(dt, liststring, "实时课表信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- public ActionResult TeacherselfSchedulingPDF(Guid SchoolyearID, Guid? UserID)
- {
- var pdf = NewReportServices.TeacherselfSchedulingPDF(SchoolyearID, UserID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult StudentForTeacherSchedulingPDF(Guid SchoolyearID, Guid StudentNo)
- {
- var pdf = NewReportServices.StudentForTeacherSchedulingPDF(SchoolyearID, StudentNo);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult ClassmajorSchedulingPDF(Guid SchoolyearID, Guid? CollegeID, Guid? ClassmajorID, int? Years)
- {
- var pdf = NewReportServices.ClassmajorSchedulingPDF(SchoolyearID, CollegeID, ClassmajorID, Years);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult ClassmajorPrintingSchedulingPDF(Guid SchoolyearID, Guid? CollegeID)
- {
- var pdf = NewReportServices.ClassmajorPrintingSchedulingPDF(SchoolyearID, CollegeID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult TeacherSchedulingPDF(Guid SchoolyearID, Guid? CollegeID, Guid? UserID)
- {
- var pdf = NewReportServices.TeacherSchedulingPDF(SchoolyearID, CollegeID, UserID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult TeacherPrintSchedulingPDF(Guid SchoolyearID, Guid? CollegeID)
- {
- var pdf = NewReportServices.TeacherPrintingSchedulingPDF(SchoolyearID, CollegeID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult ClassroomReportPDF(Guid SchoolyearID, Guid? BuildingsInfoID, Guid? ClassroomID)
- {
- var pdf = NewReportServices.ClassroomReportPDF(SchoolyearID, BuildingsInfoID, ClassroomID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult ClassroomPrintReportPDF(Guid SchoolyearID, Guid? BuildingsInfoID)
- {
- var pdf = NewReportServices.ClassroomPrintingReportPDF(SchoolyearID, BuildingsInfoID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult DepartmentSchedulingPDF(Guid SchoolyearID, Guid CollegeID, Guid DepartmentID, Guid? HandleModeID)
- {
- var pdf = NewReportServices.DepartmentSchedulingPDF(SchoolyearID, CollegeID, DepartmentID, HandleModeID);
- return File(pdf.ToArray(), "application/pdf");
- }
- public ActionResult CollegeSchedulingPDF(Guid SchoolyearID, Guid? CollegeID, int? Years)
- {
- var pdf = NewReportServices.CollegeSchedulingPDF(SchoolyearID, CollegeID, Years);
- return File(pdf.ToArray(), "application/pdf");
- }
- }
- }
|