123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Data;
- using Bowin.Common.Utility;
- using EMIS.Utility;
- using EMIS.Web.Controls;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.GraduationManage.GraduateCardManage;
- namespace EMIS.Web.Controllers.GraduationManage.GraduateCardManage
- {
- [Authorization]
- public class GraduateCardListController : Controller
- {
- public IGraduateCardListServices GraduateCardListServices { 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 needCardResult = pararms.getExtraInt("DictionaryNeedCardResult") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryNeedCardResult");
-
- return base.Json(GraduateCardListServices.GetGraduateCardListViewGrid(configuretView, gradSchoolyearID, campusID, collegeID,
- yearID, standardID, educationID, learningformID, learnSystem, graduationTypeID, inSchoolStatus, needCardResult, (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();
- GraduateCardListServices.GraduateCardListDelete(list);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + ex.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 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 needCardResult = Request.Form["DictionaryNeedCardResult"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryNeedCardResult"].ParseStrTo<int>();
-
- var dt = GraduateCardListServices.GetGraduateCardListViewList(configuretView, gradSchoolyearID, campusID, collegeID, yearID,
- standardID, educationID, learningformID, learnSystem, graduationTypeID, inSchoolStatus, needCardResult)
- .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.NeedCardResultName,
- 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 = "导出成功。"
- });
- }
- }
- }
|