GraduateCardApproveController.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using Bowin.Web.Controls.Mvc;
  7. using Bowin.Common.Data;
  8. using Bowin.Common.Utility;
  9. using EMIS.Utility;
  10. using EMIS.Web.Controls;
  11. using EMIS.ViewModel;
  12. using EMIS.CommonLogic.GraduationManage.GraduateCardManage;
  13. namespace EMIS.Web.Controllers.GraduationManage.GraduateCardManage
  14. {
  15. [Authorization]
  16. public class GraduateCardApproveController : Controller
  17. {
  18. public IGraduateCardApproveServices GraduateCardApproveServices { get; set; }
  19. /// <summary>
  20. /// 去向审核页面
  21. /// </summary>
  22. /// <returns></returns>
  23. public ActionResult List()
  24. {
  25. return View();
  26. }
  27. /// <summary>
  28. /// 去向审核列表查询
  29. /// </summary>
  30. /// <param name="pararms"></param>
  31. /// <returns></returns>
  32. [HttpPost]
  33. public ActionResult List(QueryParamsModel pararms)
  34. {
  35. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  36. var gradSchoolyearID = pararms.getExtraGuid("GradSchoolyearDropdown");
  37. var campusID = pararms.getExtraGuid("CampusDropdown");
  38. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  39. var yearID = pararms.getExtraInt("DictionarySchoolyear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionarySchoolyear");
  40. var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
  41. var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
  42. var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
  43. var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
  44. //毕业类型
  45. var graduationTypeID = pararms.getExtraInt("DictionaryGraduationType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGraduationType");
  46. //在校状态
  47. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  48. //去向结论
  49. var needCardResult = pararms.getExtraInt("DictionaryNeedCardResult") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryNeedCardResult");
  50. //审核状态
  51. var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
  52. return base.Json(GraduateCardApproveServices.GetGraduateCardApproveViewGrid(configuretView, gradSchoolyearID, campusID, collegeID,
  53. yearID, standardID, educationID, learningformID, learnSystem, graduationTypeID, inSchoolStatus, needCardResult,
  54. approvalStatus, (int)pararms.page, (int)pararms.rows));
  55. }
  56. /// <summary>
  57. /// 删除
  58. /// </summary>
  59. /// <param name="graduateCardApplyIDs"></param>
  60. /// <returns></returns>
  61. [HttpPost]
  62. public ActionResult Delete(string graduateCardApplyIDs)
  63. {
  64. try
  65. {
  66. List<Guid?> list = graduateCardApplyIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
  67. .Select(x => (Guid?)new Guid(x)).ToList();
  68. GraduateCardApproveServices.GraduateCardApproveDelete(list);
  69. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
  70. }
  71. catch (Exception ex)
  72. {
  73. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + ex.Message });
  74. }
  75. }
  76. /// <summary>
  77. /// Excel导出
  78. /// </summary>
  79. /// <returns></returns>
  80. [HttpPost]
  81. public ActionResult Excel()
  82. {
  83. NpoiExcelHelper neh = new NpoiExcelHelper();
  84. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  85. var gradSchoolyearID = Request.Form["GradSchoolyearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["GradSchoolyearDropdown"].ParseStrTo<Guid>();
  86. var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
  87. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  88. var yearID = Request.Form["DictionarySchoolyear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionarySchoolyear"].ParseStrTo<int>();
  89. var standardID = Request.Form["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryStandard"].ParseStrTo<int>();
  90. var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
  91. var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
  92. var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
  93. //毕业类型
  94. var graduationTypeID = Request.Form["DictionaryGraduationType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGraduationType"].ParseStrTo<int>();
  95. //在校状态
  96. var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
  97. //去向结论
  98. var needCardResult = Request.Form["DictionaryNeedCardResult"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryNeedCardResult"].ParseStrTo<int>();
  99. //审核状态
  100. var approvalStatus = Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>();
  101. var dt = GraduateCardApproveServices.GetGraduateCardApproveViewList(configuretView, gradSchoolyearID, campusID, collegeID, yearID,
  102. standardID, educationID, learningformID, learnSystem, graduationTypeID, inSchoolStatus, needCardResult, approvalStatus)
  103. .Select(x => new
  104. {
  105. x.GraduatingSemesterCode,
  106. x.StudentNo,
  107. x.UserName,
  108. x.SexName,
  109. x.GraduationTypeName,
  110. BirthDate = x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyyMMdd") : "",
  111. x.StandardID,
  112. x.StandardCode,
  113. x.StandardName,
  114. x.SchoolyearID,
  115. x.CampusName,
  116. x.CollegeNo,
  117. x.CollegeName,
  118. x.GrademajorCode,
  119. x.GrademajorName,
  120. x.ClassNo,
  121. x.ClassName,
  122. x.EducationName,
  123. x.LearningformName,
  124. LearnSystem = x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("#.#") : null,
  125. x.ExamineeNum,
  126. x.NationName,
  127. x.PoliticsName,
  128. x.IDNumber,
  129. EntranceDate = x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyyMMdd") : "",
  130. x.ZIPCode,
  131. x.Telephone,
  132. x.Address,
  133. x.InSchoolStatusName,
  134. x.StudentStatusName,
  135. x.FinallyScoreCount,
  136. x.NeedCardResultName,
  137. x.ApprovalStatusName,
  138. x.Remark
  139. }).ToTable();
  140. string[] liststring = {
  141. "毕业学期", "学号", "姓名", "性别", "毕业类型", "出生日期", "专业ID(Value)", "专业代码", "专业名称",
  142. "年级", RSL.Get("CampusName"), RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "年级专业编号",
  143. "年级专业名称", "班级编号", "班级名称", RSL.Get("EducationID"), "学习形式", "学制",
  144. "考生号", "民族", "政治面貌", "身份证号", "入学日期", "邮政编码", "联系电话", "通讯地址",
  145. "在校状态", "学籍状态", "已修门数", "去向结论", "审核状态", "备注"
  146. };
  147. neh.Export(dt, liststring, "去向审核信息" + DateTime.Now.ToString("yyyyMMdd"));
  148. return Json(new ReturnMessage()
  149. {
  150. IsSuccess = true,
  151. Message = "导出成功。"
  152. });
  153. }
  154. }
  155. }