123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.CommonLogic.Students;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- namespace EMIS.Web.Controllers.StudentManage.StudentChange
- {
- [Authorization]
- public class StudentBatchRepeatController : Controller
- {
- public IDifferentDynamicServices DifferentDynamicServices { get; set; }
- public IBatchRepeatServices BatchRepeatServices { 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 schoolYearID = pararms.getExtraGuid("ddlSchoolYear"); //学年学期
- var campusID = pararms.getExtraGuid("cbgCampus"); //校区
- var collegeID = pararms.getExtraGuid("cbgCollege"); //院系所
- var education = pararms.getExtraInt("ddlEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlEducation"); //培养层次
- var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear"); //年级
- var standard = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard"); //专业名称
- var learningform = pararms.getExtraInt("ddlLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlLearningform"); //学习形式
- var differentDynamicStatus = pararms.getExtraInt("ddlStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlStatus"); //审批状态
- var result = BatchRepeatServices.GetDifferentDynamicViewGrid(configuretView, schoolYearID, campusID, collegeID, year, standard, education,
- learningform, differentDynamicStatus, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult Delete(string differentDynamicIDs)
- {
- var idList = differentDynamicIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- try
- {
- DifferentDynamicServices.DeleteDifferentDynamic(idList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult BatchAdd(string studentIDs)
- {
- var studentIDList = studentIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- try
- {
- BatchRepeatServices.BatchAddStudents(studentIDList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
- }
- }
- /// <summary>
- /// 提交
- /// </summary>
- /// <param name="planApplicationIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Submit(string differentDynamicIDs)
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var idList = differentDynamicIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- DifferentDynamicServices.Submit(idList, user.UserID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "提交成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "提交失败:" + ex.Message });
- }
- }
- /// <summary>
- /// 处理
- /// </summary>
- /// <param name="planApplicationIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Process(string differentDynamicIDs)
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var idList = differentDynamicIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- BatchRepeatServices.Process(idList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "处理成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "处理失败:" + ex.Message });
- }
- }
- /// <summary>
- /// 审核
- /// </summary>
- /// <param name="planApplicationIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Approve(string differentDynamicIDs)
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var idList = differentDynamicIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- BatchRepeatServices.Approve(idList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "审核成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "审核失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolYearID = Request.Form["ddlSchoolYear"].ParseStrTo<Guid>(); //学年学期
- var campusID = Request.Form["cbgCampus"].ParseStrTo<Guid>(); //校区
- var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>(); //院系所
- var education = Request.Form["ddlEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlEducation"].ParseStrTo<int>(); //培养层次
- var year = Request.Form["ddlYear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>(); //年级
- var standard = Request.Form["cbgStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["cbgStandard"].ParseStrTo<int>(); //专业名称
- var learningform = Request.Form["ddlLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlLearningform"].ParseStrTo<int>(); //学习形式
- var differentDynamicStatus = Request.Form["ddlStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlStatus"].ParseStrTo<int>(); //审批状态
- var result = BatchRepeatServices.GetDifferentDynamicViewList(configuretView, schoolYearID, campusID, collegeID, year, standard, education,
- learningform, differentDynamicStatus);
- var dt = result.Select(s => new
- {
- s.LoginID,
- s.Name,
- s.SchoolyearCode,
- s.DifferentDynamicTypeName,
- s.ReasonName,
- s.ClassmajorName,
- s.AfterClassmajorName,
- s.ApprovalStatusName,
- s.Remark
- }).ToTable();
- string[] liststring = { "学号", "姓名", "学年学期", "异动类型", "异动原因", "异动前班级", "异动后班级", "状态", "备注" };
- neh.Export(dt, liststring, "批量留级申请");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Action("List").AddMenuParameter()
- });
- }
- }
- }
|