123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Common.Utility;
- using EMIS.CommonLogic.RetakeManage;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Data;
- using EMIS.ViewModel.RetakeManage;
- using EMIS.CommonLogic.RetakeManage.General;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.RetakeManage.General
- {
- [Authorization]
- public class RetakePlanPrescanGeneralController : Controller
- {
- public IRetakePlanTaskServices RetakePlanServices { get; set; }
- /// <summary>
- /// 学生预查页面(网上报名版本)
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 学生预查(网上报名版本)列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- try
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolYearDropdown").ToString() == DropdownList.SELECT_ALL.ToString() ? null : pararms.getExtraGuid("SchoolYearDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- //开课教研室
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
- var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var classmajorID = pararms.getExtraGuid("ClassmajorDropdown");
- //在校状态
- var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- //考试性质
- var examsCategoryID = pararms.getExtraInt("DictionaryExamsCategory") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryExamsCategory");
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
- //课程类型List
- var courseTypeIDs = pararms.getExtraString("CourseTypeID");
- return Json(RetakePlanServices.GetRetakePreStudentView(configuretView, schoolyearID, collegeID, departmentID, yearID,
- standardID, educationID, learningformID, learnSystem, classmajorID, inSchoolStatus, examsCategoryID,
- coursematerialID, courseTypeIDs, (int)pararms.page, (int)pararms.rows));
- }
- catch (Exception ex)
- {
- //页面弹出消息框
- return base.Json("查询失败,原因:" + ex.Message);
- }
- }
- /// <summary>
- /// 重修任务生成页面
- /// </summary>
- /// <returns></returns>
- public ActionResult Generate()
- {
- RetakeStudentListView retakeStudentListView = new RetakeStudentListView();
- retakeStudentListView.RetakeTypeID = (int)ER_RetakeType.Retake; //重修类型默认为正常重修
- return View(retakeStudentListView);
- }
- /// <summary>
- /// 重修任务生成确定
- /// </summary>
- /// <param name="finallyScoreIDs"></param>
- /// <param name="retakeStudentListView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Generate(string finallyScoreIDs, RetakeStudentListView retakeStudentListView)
- {
- try
- {
- //最终成绩信息IDList
- var finallyScoreIDList = finallyScoreIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- string result = RetakePlanServices.Generate(finallyScoreIDList, retakeStudentListView.RetakeTypeID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "生成成功" + result + "。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "生成失败,原因:" + ex.Message + "。"
- });
- }
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- try
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolyearID = Request.Form["SchoolYearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- //开课教研室
- var departmentID = Request.Form["DepartmentDropdown"].ParseStrTo<Guid>();
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
- var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>();
- //在校状态
- var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- var examsCategoryID = Request.Form["DictionaryExamsCategory"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryExamsCategory"].ParseStrTo<int>();
- var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();
- var courseTypeIDs = Request.Form["CourseTypeID"].ToString();
- var dt = RetakePlanServices.GetRetakePreStudentViewList(configuretView, schoolyearID, collegeID, departmentID, yearID,
- standardID, educationID, learningformID, learnSystem, classmajorID, inSchoolStatus, examsCategoryID,
- coursematerialID, courseTypeIDs)
- .Select(x => new
- {
- x.LoginID,
- x.UserName,
- x.SexName,
- x.ClassmajorCode,
- x.ClassmajorName,
- x.GrademajorCode,
- x.GrademajorName,
- x.CollegeNo,
- x.CollegeName,
- x.Gradeyear,
- x.StandardID,
- x.StandardCode,
- x.StandardDesc,
- x.EducationName,
- x.LearningformName,
- x.LearnSystem,
- x.SchoolyearCode,
- x.CourseCode,
- x.CourseName,
- x.CourseTypeDesc,
- x.CourseCredit,
- x.ExamsCategoryDesc,
- x.ExamsStateDesc,
- x.SchoolyearNumDesc,
- x.StarttermDesc,
- x.TotalScore,
- x.DepartmentCode,
- x.DepartmentName,
- x.InSchoolStatusName,
- x.StudentStatusName
- }).ToTable();
- string[] liststring = {
- "学号", "姓名", "性别", "班级编号", "班级名称", "年级专业编号", "年级专业名称",
- RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "年级", "专业ID(Value)", "专业代码",
- "专业名称", RSL.Get("EducationID"), "学习形式", "学制", "学年学期", "课程代码",
- "课程名称", "课程类型", "课程学分", "考试性质", "考试状态", "开课学年", "开课学期",
- "总成绩", "开课教研室代码", "开课教研室", "在校状态", "学籍状态"
- };
- neh.Export(dt, liststring, "学生预查信息" + DateTime.Now.ToString("yyyyMMddhhmmss"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- catch (Exception ex)
- {
- //页面弹出消息框
- return base.Json("导出失败,原因:" + ex.Message);
- }
- }
- }
- }
|