CheckingCollectController.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using Bowin.Common.Utility;
  7. using Bowin.Common.Data;
  8. using Bowin.Web.Controls.Mvc;
  9. using EMIS.Utility;
  10. using EMIS.Web.Controls;
  11. using EMIS.ViewModel;
  12. using EMIS.ViewModel.StudentManage.OnlineChecking;
  13. using EMIS.CommonLogic.StudentManage.OnlineChecking;
  14. namespace EMIS.Web.Controllers.StudentManage.OnlineChecking
  15. {
  16. [Authorization]
  17. public class CheckingCollectController : Controller
  18. {
  19. public Lazy<ICheckingCollectServices> CheckingCollectServices { get; set; }
  20. /// <summary>
  21. /// 校对汇总页面
  22. /// </summary>
  23. /// <returns></returns>
  24. public ActionResult List()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 校对汇总页面列表查询
  30. /// </summary>
  31. /// <param name="pararms"></param>
  32. /// <returns></returns>
  33. [HttpPost]
  34. public ActionResult List(QueryParamsModel pararms)
  35. {
  36. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  37. var campusID = pararms.getExtraGuid("CampusDropdown");
  38. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  39. var gradeID = pararms.getExtraInt("DictionaryGrade") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGrade");
  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. var grademajorID = pararms.getExtraGuid("GrademajorComboGrid");
  45. var classmajorID = pararms.getExtraGuid("ClassmajorComboGrid");
  46. var checkingTypeID = pararms.getExtraInt("DictionaryCheckingType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCheckingType");
  47. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  48. var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
  49. return base.Json(CheckingCollectServices.Value.GetCheckingCollectViewGrid(configuretView, campusID, collegeID, gradeID, standardID,
  50. educationID, learningformID, learnSystem, grademajorID, classmajorID, checkingTypeID, inSchoolStatus, approvalStatus, (int)pararms.page, (int)pararms.rows));
  51. }
  52. /// <summary>
  53. /// 编辑
  54. /// </summary>
  55. /// <param name="studentRecordChangeHistoryID"></param>
  56. /// <returns></returns>
  57. [HttpGet]
  58. public ActionResult Edit(Guid? studentRecordChangeHistoryID)
  59. {
  60. CheckingHistoryView checkingHistoryView = new CheckingHistoryView();
  61. if (studentRecordChangeHistoryID.HasValue && studentRecordChangeHistoryID != Guid.Empty)
  62. {
  63. checkingHistoryView = CheckingCollectServices.Value.GetStudentRecordChangeHistoryView(studentRecordChangeHistoryID);
  64. }
  65. return View(checkingHistoryView);
  66. }
  67. /// <summary>
  68. /// 编辑
  69. /// </summary>
  70. /// <param name="checkingHistoryView"></param>
  71. /// <returns></returns>
  72. [HttpPost]
  73. public ActionResult Edit(CheckingHistoryView checkingHistoryView)
  74. {
  75. try
  76. {
  77. //CheckingCollectServices.Value.StudentRecordChangeHistoryEdit(checkingHistoryView);
  78. return Json(new ReturnMessage()
  79. {
  80. IsSuccess = true,
  81. Message = "保存成功。"
  82. });
  83. }
  84. catch (Exception ex)
  85. {
  86. return Json(new ReturnMessage()
  87. {
  88. IsSuccess = false,
  89. Message = "保存失败,原因:" + ex.Message
  90. });
  91. }
  92. }
  93. /// <summary>
  94. /// 删除
  95. /// </summary>
  96. /// <param name="studentRecordChangeHistoryIDs"></param>
  97. /// <returns></returns>
  98. [HttpPost]
  99. public ActionResult Delete(string studentRecordChangeHistoryIDs)
  100. {
  101. try
  102. {
  103. List<Guid?> list = studentRecordChangeHistoryIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  104. CheckingCollectServices.Value.StudentRecordChangeHistoryDelete(list);
  105. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
  106. }
  107. catch (Exception ex)
  108. {
  109. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + ex.Message });
  110. }
  111. }
  112. /// <summary>
  113. /// Excel导出
  114. /// </summary>
  115. /// <returns></returns>
  116. [HttpPost]
  117. public ActionResult Excel()
  118. {
  119. NpoiExcelHelper neh = new NpoiExcelHelper();
  120. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  121. var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
  122. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  123. var gradeID = Request.Form["DictionaryGrade"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGrade"].ParseStrTo<int>();
  124. var standardID = Request.Form["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryStandard"].ParseStrTo<int>();
  125. var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
  126. var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
  127. var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
  128. var grademajorID = Request.Form["GrademajorComboGrid"].ParseStrTo<Guid>();
  129. var classmajorID = Request.Form["ClassmajorComboGrid"].ParseStrTo<Guid>();
  130. var checkingTypeID = Request.Form["DictionaryCheckingType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryCheckingType"].ParseStrTo<int>();
  131. var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
  132. var approvalStatus = Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>();
  133. var dt = CheckingCollectServices.Value.GetCheckingCollectViewList(configuretView, campusID, collegeID, gradeID, standardID,
  134. educationID, learningformID, learnSystem, grademajorID, classmajorID, checkingTypeID, inSchoolStatus, approvalStatus)
  135. .Select(x => new
  136. {
  137. x.StudentNo,
  138. x.Name,
  139. x.SexName,
  140. BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyyMMdd") : ""),
  141. x.NationName,
  142. x.PoliticsName,
  143. x.CertificatesTypeName,
  144. x.IDNumber,
  145. x.StandardCode,
  146. x.StandardID,
  147. x.StandardName,
  148. x.EducationName,
  149. x.LearningformName,
  150. LearnSystem = x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("#.#") : "",
  151. x.FacultymajorCode,
  152. x.FacultymajorName,
  153. x.GradeID,
  154. x.GrademajorCode,
  155. x.GrademajorName,
  156. x.ClassmajorNo,
  157. x.ClassmajorName,
  158. x.ClassNum,
  159. x.StudentTypeName,
  160. x.InSchoolStatusName,
  161. x.StudentStatusName,
  162. x.CollegeNo,
  163. x.CollegeName,
  164. x.CampusCode,
  165. x.CampusName,
  166. x.SemesterName,
  167. x.UsedName,
  168. x.Country,
  169. x.Place,
  170. x.BornPlace,
  171. x.ExamineeType,
  172. EntranceDate = (x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyyMMdd") : ""),
  173. x.LiteracyLevelName,
  174. x.CultureModelName,
  175. x.IsDreamProjectName,
  176. x.Email,
  177. x.Telephone,
  178. x.Mobile,
  179. x.ZIPCode,
  180. x.WeChatNum,
  181. x.QQ,
  182. x.HealthStateName,
  183. x.BloodGroupName,
  184. x.Specialty,
  185. x.Height,
  186. x.Weight,
  187. x.DirectorName,
  188. x.Score,
  189. x.EntranceWayName,
  190. x.FeaturesName,
  191. x.TerritorialName,
  192. x.Area,
  193. x.HomeAddress,
  194. x.WorkUnit,
  195. x.Address,
  196. x.Recipient,
  197. x.Dormitory,
  198. x.BankName,
  199. x.CardNo,
  200. x.Career,
  201. x.IsProofreadName,
  202. x.Remark,
  203. x.TableName,
  204. x.ColumnName,
  205. x.DisplayPropertyName,
  206. x.Description,
  207. x.CheckingTypeName,
  208. x.CheckingBeforeContent,
  209. x.CheckingAfterContent,
  210. x.IP,
  211. x.ApprovalStatusName,
  212. x.Comment,
  213. ApprovalTime = (x.ApprovalTime.HasValue ? x.ApprovalTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
  214. }).ToTable();
  215. string[] liststring = {
  216. "学号", "姓名", "性别", "出生日期", "民族", "政治面貌", "证件类型", "证件号码", "专业代码",
  217. "专业ID(Value)", "专业名称", RSL.Get("EducationID"), "学习形式", "学制", "院系专业编号",
  218. "院系专业名称", "年级", "年级专业编号", "年级专业名称", "班级编号", "班级名称", "班序", "学生类别",
  219. "在校状态", "学籍状态", RSL.Get("CollegeCode"), RSL.Get("College"), RSL.Get("CampusCode"),
  220. RSL.Get("Campus"), "入学学期", "曾用名", "国籍", "籍贯", "出生地", "考生类别", "入学日期",
  221. "文化程度", "培养方式", "圆梦计划", "电子邮箱", "家庭电话", "移动电话", "邮政编码", "微信号", "QQ",
  222. "健康状况", "血型", "特长", "身高(cm)", "体重(kg)", "导师姓名", "总分", "入学方式", "考生特征",
  223. "生源所属地", "来源地区", "家庭住址", "工作单位", "通信地址", "收件人" , "宿舍地址", "开户银行",
  224. "银行卡号", "在校经历", "是否核对", "备注", "校对表名", "校对列名", "显示属性", "校对名称",
  225. "校对类型", "校对前内容", "校对后内容", "IP地址", "状态", "处理意见", "审核时间"
  226. };
  227. neh.Export(dt, liststring, "校对汇总信息" + DateTime.Now.ToString("yyyyMMdd"));
  228. return Json(new ReturnMessage()
  229. {
  230. IsSuccess = true,
  231. Message = "导出成功。"
  232. });
  233. }
  234. }
  235. }