ChargeAggregateController.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.ViewModel;
  7. using Bowin.Web.Controls.Mvc;
  8. using EMIS.CommonLogic.ChargeManage.ChargeSituation;
  9. using EMIS.Web.Controls;
  10. using EMIS.ViewModel.ChargeManage.ChargeSituation;
  11. using Bowin.Common.Utility;
  12. using Bowin.Common.Data;
  13. using EMIS.CommonLogic.CalendarManage;
  14. using EMIS.Utility;
  15. namespace EMIS.Web.Controllers.ChargeManage.ChargeSituation
  16. {
  17. [Authorization]
  18. public class ChargeAggregateController : Controller
  19. {
  20. public IChargeAggregateServices chargeAggregateServices { get; set; }
  21. /// <summary>
  22. /// 费用明细
  23. /// </summary>
  24. /// <returns></returns>
  25. public ActionResult List()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 费用明细列表查询
  31. /// </summary>
  32. /// <param name="pararms"></param>
  33. /// <returns></returns>
  34. [HttpPost]
  35. public ActionResult List(QueryParamsModel pararms)
  36. {
  37. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  38. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  39. var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
  40. var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
  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 chargeYearID = pararms.getExtraInt("ChargeYearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ChargeYearDropDown");
  45. var chargeProjectID = pararms.getExtraGuid("ChargeProjectComboGrid");
  46. //在校状态
  47. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  48. return base.Json(chargeAggregateServices.GetChargeAggregateViewGrid(configuretView, collegeID, yearID, standardID, educationID,
  49. learningformID, learnSystem, chargeYearID, chargeProjectID, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
  50. }
  51. /// <summary>
  52. /// Excel导出
  53. /// </summary>
  54. /// <returns></returns>
  55. [HttpPost]
  56. public ActionResult Excel()
  57. {
  58. NpoiExcelHelper neh = new NpoiExcelHelper();
  59. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  60. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  61. var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
  62. var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
  63. var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
  64. var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
  65. var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
  66. var chargeYearID = Request.Form["ChargeYearDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ChargeYearDropDown"].ParseStrTo<int>();
  67. var chargeProjectID = Request.Form["ChargeProjectComboGrid"].ParseStrTo<Guid>();
  68. //在校状态
  69. var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
  70. var dt = chargeAggregateServices.GetChargeAggregateViewList(configuretView, collegeID, yearID, standardID, educationID,
  71. learningformID, learnSystem, chargeYearID, chargeProjectID, inSchoolStatus)
  72. .Select(x => new
  73. {
  74. x.StudentNo,
  75. x.ExamineeNum,
  76. x.UserName,
  77. x.SexName,
  78. x.ClassNo,
  79. x.ClassName,
  80. x.GradeMajorCode,
  81. x.GrademajorStr,
  82. x.CollegeCode,
  83. x.CollegeStr,
  84. x.ChargeYear,
  85. x.ChargeProjectName,
  86. x.Amount,
  87. x.ChargeAmount,
  88. x.ActualAmount,
  89. x.ChargeTagName,
  90. x.DelayAmount,
  91. x.PaidAmount,
  92. x.AmountSum,
  93. x.GradeStr,
  94. x.StandardID,
  95. x.StandardCode,
  96. x.MajorStr,
  97. x.EducationName,
  98. x.LearningformName,
  99. x.LearnSystem,
  100. x.IsDreamProject,
  101. x.InSchoolStatusName,
  102. x.StudentStatusName,
  103. x.TeacherNo,
  104. x.TeacherName
  105. }).ToTable();
  106. string[] liststring = {
  107. "学号", "考生号", "姓名", "性别", "班级编号", "班级名称", "年级专业编号", "年级专业名称",
  108. RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "缴费学年", "收费项目", "应收金额",
  109. "调整金额", "实收金额", "缴费标记", "缓交金额", "已缴金额", "欠费金额",
  110. "年级", "专业ID(Value)", "专业代码", "专业名称", RSL.Get("EducationID"), "学习形式",
  111. "学制", "是否圆梦计划", "在校状态", "学籍状态", "班主任编号", "班主任"
  112. };
  113. neh.Export(dt, liststring, "应收名单信息" + DateTime.Now.ToString("yyyyMMdd"));
  114. return Json(new ReturnMessage()
  115. {
  116. IsSuccess = true,
  117. Message = "导出成功。"
  118. });
  119. }
  120. }
  121. }