123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375 |
- 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 Bowin.Common.JSON;
- using EMIS.Utility;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using EMIS.CommonLogic.GraduationManage.GraduateCardManage;
- using EMIS.ViewModel.GraduationManage.GraduateCardManage;
- namespace EMIS.Web.Controllers.GraduationManage.GraduateCardManage
- {
- [Authorization]
- public class GraduateCardApplyController : Controller
- {
- public IGraduateCardApplyServices GraduateCardApplyServices { 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 graduationTypeID = pararms.getExtraInt("DictionaryGraduationType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGraduationType");
- //在校状态
- var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- //审核状态
- var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
- return base.Json(GraduateCardApplyServices.GetGraduateCardApplyViewGrid(configuretView, gradSchoolyearID, campusID, collegeID,
- yearID, standardID, educationID, learningformID, learnSystem, graduationTypeID, inSchoolStatus, approvalStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 名单生成(新增、修改)
- /// 新增包括:毕业学期小于等于当前启用的毕业学期、学籍信息为在校(排除在校状态为结业、毕业的信息)、在毕业申请允许最大年限(年)范围内
- /// 修改:未提交
- /// 业务主键:学生信息ID、毕业学期ID(实际的毕业学期)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- public ActionResult GraduateCardApplyCreate(QueryParamsModel pararms)
- {
- try
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- string result = GraduateCardApplyServices.GraduateCardApplyEdit();
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "生成成功" + result + "。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "生成失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduateCardApplyID"></param>
- /// <returns></returns>
- public ActionResult CopyAdd(Guid graduateCardApplyID)
- {
- GraduateCardApplyView graduateCardApplyView = new GraduateCardApplyView();
- graduateCardApplyView = GraduateCardApplyServices.GetGraduateCardApplyView(graduateCardApplyID);
- return View("Edit", graduateCardApplyView);
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduateCardApplyView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyAdd(GraduateCardApplyView graduateCardApplyView)
- {
- graduateCardApplyView.GraduateCardApplyID = Guid.Empty;
- return this.Edit(graduateCardApplyView);
- }
- /// <summary>
- /// 编辑(新增、修改,业务主键:学生信息ID、毕业学期ID(实际的毕业学期))
- /// </summary>
- /// <param name="graduateCardApplyID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? graduateCardApplyID)
- {
- GraduateCardApplyView graduateCardApplyView = new GraduateCardApplyView();
- if (graduateCardApplyID.HasValue && graduateCardApplyID != Guid.Empty)
- {
- graduateCardApplyView = GraduateCardApplyServices.GetGraduateCardApplyView(graduateCardApplyID);
- }
- else
- {
- graduateCardApplyView.GraduatingSemesterID = BaseExtensions.GetGradSchoolYearID();
- }
- return View(graduateCardApplyView);
- }
- /// <summary>
- /// 编辑(新增、修改,业务主键:学生信息ID、毕业学期ID(实际的毕业学期))
- /// </summary>
- /// <param name="graduateCardApplyView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(GraduateCardApplyView graduateCardApplyView)
- {
- try
- {
- var sessionName = FileUploadHelper.GetFileUploadSessionName(graduateCardApplyView.GraduateCardApplyID);
- var fileList = (List<FileUploadView>)Session[sessionName];
- GraduateCardApplyServices.GraduateCardApplyEdit(graduateCardApplyView, fileList);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 去向申请批量新增(业务主键:学生信息ID、毕业学期ID(实际的毕业学期))
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult GraduateCardApplyBatchAdd()
- {
- GraduateCardApplyView graduateCardApplyView = new GraduateCardApplyView();
- return View(graduateCardApplyView);
- }
- /// <summary>
- /// 去向申请批量新增(业务主键:学生信息ID、毕业学期ID(实际的毕业学期))
- /// </summary>
- /// <param name="graduateCardApplyView"></param>
- /// <returns></returns>
- public ActionResult GraduateCardApplyBatchAdd(GraduateCardApplyView graduateCardApplyView)
- {
- try
- {
- var graduationStudentViewList = Request["graduationStudentViewList"].JsonToObject<List<GraduateCardApplyView>>();
- string result = GraduateCardApplyServices.GraduateCardApplyBatchAdd(graduationStudentViewList, graduateCardApplyView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "新增成功" + result + "。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "新增失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 查询未新增毕业学生信息GraduateCardApplyView
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GraduationStudentList(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(GraduateCardApplyServices.GetGraduationStudentNoAddViewGrid(configuretView, campusID, collegeID, schoolyearID,
- standardID, educationID, learningformID, learnSystem, inSchoolStatus, gradSchoolyearID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="graduateCardApplyIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string graduateCardApplyIDs)
- {
- try
- {
- List<Guid?> list = graduateCardApplyIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- GraduateCardApplyServices.GraduateCardApplyDelete(list);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + ex.Message });
- }
- }
- /// <summary>
- /// 根据去向申请查看对应的最终成绩信息
- /// </summary>
- /// <returns></returns>
- public ActionResult FinallyScoreList()
- {
- return View();
- }
- /// <summary>
- /// 根据去向申请查看对应的最终成绩信息
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult FinallyScoreList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var graduateCardApplyID = Request["graduateCardApplyID"].ParseStrTo<Guid>();
- var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
- var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseType");
- var courseSelectTypeID = pararms.getExtraInt("DictionaryCourseSelectType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseSelectType");
- var examsCategoryID = pararms.getExtraInt("DictionaryExamsCategory") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryExamsCategory");
- 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 isExecutablePlan = pararms.getExtraInt("DictionaryIsExecutablePlan") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsExecutablePlan");
- //计划状态(执行计划)
- var executablePlanStatus = pararms.getExtraInt("DictionaryExecutablePlanStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryExecutablePlanStatus");
- return Json(GraduateCardApplyServices.GetFinallyScoreViewGrid(configuretView, graduateCardApplyID, schoolyearID, courseTypeID,
- courseSelectTypeID, examsCategoryID, starttermID, isMainCourse, handleModeID, isExecutablePlan, executablePlanStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 最终成绩明细Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult FinallyScoreListExcel()
- {
- return null;
- }
- /// <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 graduationTypeID = Request.Form["DictionaryGraduationType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGraduationType"].ParseStrTo<int>();
- //在校状态
- var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- //审核状态
- var approvalStatus = Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>();
- var dt = GraduateCardApplyServices.GetGraduateCardApplyViewList(configuretView, gradSchoolyearID, campusID, collegeID, yearID,
- standardID, educationID, learningformID, learnSystem, graduationTypeID, inSchoolStatus, approvalStatus)
- .Select(x => new
- {
- x.GraduatingSemesterCode,
- x.StudentNo,
- x.UserName,
- x.SexName,
- x.GraduationTypeName,
- BirthDate = x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyyMMdd") : "",
- x.StandardID,
- x.StandardCode,
- x.StandardName,
- x.SchoolyearID,
- x.CampusName,
- x.CollegeNo,
- x.CollegeName,
- x.GrademajorCode,
- x.GrademajorName,
- x.ClassNo,
- x.ClassName,
- x.EducationName,
- x.LearningformName,
- LearnSystem = x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("#.#") : null,
- x.ExamineeNum,
- x.NationName,
- x.PoliticsName,
- x.IDNumber,
- EntranceDate = x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyyMMdd") : "",
- x.ZIPCode,
- x.Telephone,
- x.Address,
- x.InSchoolStatusName,
- x.StudentStatusName,
- x.FinallyScoreCount,
- x.ApprovalStatusName,
- x.Remark
- }).ToTable();
- string[] liststring = {
- "毕业学期", "学号", "姓名", "性别", "毕业类型", "出生日期", "专业ID(Value)", "专业代码", "专业名称",
- "年级", RSL.Get("CampusName"), RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "年级专业编号",
- "年级专业名称", "班级编号", "班级名称", RSL.Get("EducationID"), "学习形式", "学制",
- "考生号", "民族", "政治面貌", "身份证号", "入学日期", "邮政编码", "联系电话", "通讯地址",
- "在校状态", "学籍状态", "已修门数", "审核状态", "备注"
- };
- neh.Export(dt, liststring, "去向申请信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|