123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.GraduationManage.GraduationSetting;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using Bowin.Common.JSON;
- using EMIS.ViewModel.GraduationManage.GraduationSetting;
- using EMIS.Utility;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.Web.Controllers.GraduationManage.GraduationSetting
- {
- [Authorization]
- public class GraduationStandardController : Controller
- {
- public IGraduationStandardServices GraduationStandardServices { 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)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var gradSchoolyearID = pararms.getExtraGuid("GradSchoolyearDropdown");
- var campusID = pararms.getExtraGuid("CampusDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var yearID = pararms.getExtraInt("DictionarySchoolyear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionarySchoolyear");
- var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
- 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 inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- return base.Json(GraduationStandardServices.GetGraduationStandardViewGrid(configuretView, gradSchoolyearID, campusID, collegeID, yearID,
- standardID, educationID, learningformID, learnSystem, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 标准生成
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Generate()
- {
- return View();
- }
- /// <summary>
- /// 标准生成(只生成年级专业对应的学生人数大于0的信息)
- /// </summary>
- /// <param name="graduationStandardView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Generate(GraduationStandardView graduationStandardView)
- {
- try
- {
- string result = GraduationStandardServices
- .GraduationStandardGenerate(graduationStandardView.GraduatingSemesterID, graduationStandardView.CollegeID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "生成成功" + result + "。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "生成失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduationStandardID"></param>
- /// <returns></returns>
- public ActionResult CopyAdd(Guid graduationStandardID)
- {
- GraduationStandardView graduationStandardView = new GraduationStandardView();
- graduationStandardView = GraduationStandardServices.GetGraduationStandardView(graduationStandardID);
- return View("Edit", graduationStandardView);
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduationStandardView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyAdd(GraduationStandardView graduationStandardView)
- {
- graduationStandardView.GraduationStandardID = Guid.Empty;
- return this.Edit(graduationStandardView);
- }
- /// <summary>
- /// 编辑(新增、修改)
- /// </summary>
- /// <param name="GraduationStandardID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? GraduationStandardID)
- {
- GraduationStandardView graduationStandardView = new GraduationStandardView();
- if (GraduationStandardID.HasValue && GraduationStandardID != Guid.Empty)
- {
- graduationStandardView = GraduationStandardServices.GetGraduationStandardView(GraduationStandardID);
- }
- return View(graduationStandardView);
- }
- /// <summary>
- /// 编辑(新增、修改)
- /// </summary>
- /// <param name="graduationStandardView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(GraduationStandardView graduationStandardView)
- {
- try
- {
- GraduationStandardServices.GraduationStandardEdit(graduationStandardView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 毕业标准批量新增(业务主键:年级专业ID)
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult GraduationStandardBatchAdd()
- {
- GraduationStandardView graduationStandardView = new GraduationStandardView();
- return View(graduationStandardView);
- }
- /// <summary>
- /// 毕业标准批量新增(业务主键:年级专业ID)
- /// </summary>
- /// <param name="graduationStandardView"></param>
- /// <returns></returns>
- public ActionResult GraduationStandardBatchAdd(GraduationStandardView graduationStandardView)
- {
- try
- {
- var grademajorIDList = Request["grademajorIDList"].JsonToObject<List<Guid?>>();
- string result = GraduationStandardServices.GraduationStandardBatchAdd(grademajorIDList, graduationStandardView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "新增成功" + result + "。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "新增失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 查询未新增的毕业标准对应的年级专业信息
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GraduationStandardNoAddList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var campusID = pararms.getExtraGuid("CampusDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var schoolyearID = pararms.getExtraInt("DictionarySchoolyear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionarySchoolyear");
- var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
- 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 inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- //毕业学期(年级专业对应的毕业学期)
- var gradSchoolyearID = pararms.getExtraGuid("GradSchoolyearDropdown");
- return base.Json(GraduationStandardServices.GetGraduationStandardNoAddViewGrid(configuretView, campusID, collegeID,
- schoolyearID, standardID, educationID, learningformID, learnSystem, inSchoolStatus, gradSchoolyearID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="graduationStandardIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string graduationStandardIDs)
- {
- try
- {
- List<Guid?> list = graduationStandardIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- GraduationStandardServices.GraduationStandardDelete(list);
- return base.Json("删除成功。");
- }
- catch (Exception ex)
- {
- return base.Json("删除失败,原因:" + ex.Message);
- }
- }
- /// <summary>
- /// 根据毕业标准查看对应的专业计划信息
- /// </summary>
- /// <returns></returns>
- public ActionResult SpecialtyPlanList()
- {
- return View();
- }
- /// <summary>
- /// 根据毕业标准查看对应的专业计划信息
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SpecialtyPlanList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var graduationStandardID = Request["graduationStandardID"].ParseStrTo<Guid>();
- var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
- var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseType");
- var starttermID = pararms.getExtraInt("DictionaryStartterm") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStartterm");
- var isMainCourse = pararms.getExtraInt("DictionaryIsMainCourse") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsMainCourse");
- var handleModeID = pararms.getExtraInt("DictionaryHandleMode") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryHandleMode");
- return Json(GraduationStandardServices.GetSpecialtyPlanViewGrid(configuretView, graduationStandardID,
- schoolyearID, courseTypeID, starttermID, isMainCourse, handleModeID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 专业计划明细Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SpecialtyPlanListExcel()
- {
- return null;
- }
- /// <summary>
- /// 根据毕业标准查看对应的执行计划信息
- /// </summary>
- /// <returns></returns>
- public ActionResult ExecutablePlanList()
- {
- return View();
- }
- /// <summary>
- /// 根据毕业标准查看对应的执行计划信息
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult ExecutablePlanList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var graduationStandardID = Request["graduationStandardID"].ParseStrTo<Guid>();
- var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
- var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseType");
- var starttermID = pararms.getExtraInt("DictionaryStartterm") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStartterm");
- var isMainCourse = pararms.getExtraInt("DictionaryIsMainCourse") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsMainCourse");
- var handleModeID = pararms.getExtraInt("DictionaryHandleMode") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryHandleMode");
- //计划状态(执行计划)
- var executablePlanStatus = pararms.getExtraInt("DictionaryExecutablePlanStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryExecutablePlanStatus");
- return Json(GraduationStandardServices.GetExecutablePlanViewGrid(configuretView, graduationStandardID,
- schoolyearID, courseTypeID, starttermID, isMainCourse, handleModeID, executablePlanStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 执行计划明细Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult ExecutablePlanListExcel()
- {
- return null;
- }
- /// <summary>
- /// 查询年级专业下各班级学生名单
- /// </summary>
- /// <returns></returns>
- public ActionResult Detail()
- {
- return View();
- }
- /// <summary>
- /// 查询年级专业下各班级学生名单
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Detail(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var grademajorID = Request["grademajorID"].ParseStrTo<Guid>();
- int? inschoolStatus = Request["inschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["inschoolStatus"].ParseStrTo<int>();
- return Json(GraduationStandardServices.GetGradeMajorStudentViewGrid(configuretView, grademajorID, inschoolStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 学生信息明细Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GrademajorStudentExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var grademajorID = Request["grademajorID"].ParseStrTo<Guid>();
- int? inSchoolStatus = Request["inschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["inschoolStatus"].ParseStrTo<int>();
- var dt = GraduationStandardServices.GetGradeMajorStudentViewGrid(configuretView, grademajorID, inSchoolStatus)
- .Select(x => new
- {
- x.LoginID,
- x.UserName,
- x.SexName,
- x.ClassmajorName,
- x.InSchoolStatusName,
- x.StudentStatusName
- }).ToTable();
- string[] liststring = { "学号", "姓名", "性别", "班级名称 ", "在校状态", "学籍状态" };
- var title = "毕业标准学生信息";
- if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.No)
- {
- title = "毕业标准学生信息(非在校)";
- }
- if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.Yes)
- {
- title = "毕业标准学生信息(在校)";
- }
- neh.Export(dt, liststring, title + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var gradSchoolyearID = Request.Form["GradSchoolyearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["GradSchoolyearDropdown"].ParseStrTo<Guid>();
- var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var yearID = Request.Form["DictionarySchoolyear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionarySchoolyear"].ParseStrTo<int>();
- var standardID = Request.Form["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryStandard"].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 inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- var dt = GraduationStandardServices.GetGraduationStandardViewList(configuretView, gradSchoolyearID, campusID, collegeID, yearID,
- standardID, educationID, learningformID, learnSystem, inSchoolStatus)
- .Select(x => new
- {
- x.GraduatingSemesterCode,
- x.GrademajorCode,
- x.GrademajorName,
- x.FacultymajorNo,
- x.FacultymajorName,
- x.CollegeNo,
- x.CollegeName,
- x.SchoolyearID,
- x.SchoolcodeName,
- x.EnteringSchoolYearCode,
- x.StandardID,
- x.StandardCode,
- x.StandardName,
- x.EducationName,
- x.LearningformName,
- x.LearnSystem,
- x.PlanCourseCount,
- x.SpecialtyCreditTotal,
- x.SpecialtyRequireCreditTotal,
- x.OptionalCreditTotal,
- x.FreeSelectionCreditTotal,
- x.ExecCourseCount,
- x.ExecutableCreditTotal,
- x.RequireCourseCount,
- x.GraduationCredit,
- x.StudentCount
- }).ToTable();
- string[] liststring = {
- "毕业学期", "年级专业编号", "年级专业名称", "院系专业编号", "院系专业名称",
- RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "年级", "学期", "入学学年学期",
- "专业ID(Value)", "专业代码", "专业名称", RSL.Get("EducationID"), "学习形式",
- "学制", "计划门数", "计划学分", "必修学分", "限选学分", "任选学分",
- "执行门数", "执行学分", "毕业门数", "毕业学分", "人数"
- };
- var title = "毕业标准信息";
- if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.No)
- {
- title = "毕业标准信息(非在校)";
- }
- if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.Yes)
- {
- title = "毕业标准信息(在校)";
- }
- neh.Export(dt, liststring, title + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|