PersonalPaymentController.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using Bowin.Common.Utility;
  2. using Bowin.Web.Controls.Mvc;
  3. using Bowin.Common.Data;
  4. using EMIS.CommonLogic.ChargeManage.ChargeSituation;
  5. using EMIS.ViewModel;
  6. using EMIS.Web.Controls;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Web;
  11. using System.Web.Mvc;
  12. using EMIS.Utility;
  13. namespace EMIS.Web.Controllers.StudentSystem.Charge
  14. {
  15. [Authorization]
  16. public class PersonalPaymentController : Controller
  17. {
  18. public IStudentChargeServices StudentChargeServices { 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. //登录用户user
  37. var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
  38. var chargeYearID = pararms.getExtraInt("ChargeYearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ChargeYearDropDown");
  39. var chargeProjectID = pararms.getExtraGuid("ChargeProjectComboGrid");
  40. var chargeTagID = pararms.getExtraInt("DictionaryChargeTag") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryChargeTag");
  41. //欠费状态
  42. var isArrear = pararms.getExtraInt("IsArrearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsArrearDropDown");
  43. return base.Json(StudentChargeServices.GetPersonalPaymentViewGrid(configuretView, user.UserID, chargeYearID,
  44. chargeProjectID, chargeTagID, isArrear, (int)pararms.page, (int)pararms.rows));
  45. }
  46. /// <summary>
  47. /// 导出Excel
  48. /// </summary>
  49. /// <returns></returns>
  50. [HttpPost]
  51. public ActionResult Excel()
  52. {
  53. NpoiExcelHelper neh = new NpoiExcelHelper();
  54. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  55. var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
  56. var chargeYearID = Request.Form["ChargeYearDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ChargeYearDropDown"].ParseStrTo<int>();
  57. var chargeProjectID = Request.Form["ChargeProjectComboGrid"].ParseStrTo<Guid>();
  58. var chargeTagID = Request.Form["DictionaryChargeTag"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryChargeTag"].ParseStrTo<int>();
  59. //欠费状态
  60. var isArrear = Request.Form["IsArrearDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["IsArrearDropDown"].ParseStrTo<int>();
  61. var dt = StudentChargeServices.GetPersonalPaymentViewList(configuretView, user.UserID, chargeYearID, chargeProjectID,
  62. chargeTagID, isArrear)
  63. .Select(x => new
  64. {
  65. x.StudentNo,
  66. x.UserName,
  67. x.SexName,
  68. x.ClassNo,
  69. x.ClassName,
  70. x.GradeMajorCode,
  71. x.GradeMajoyStr,
  72. x.CollegeCode,
  73. x.CollegeStr,
  74. x.ChargeYear,
  75. x.ChargeProjectStr,
  76. x.ActualAmount,
  77. x.ChargeTagName,
  78. x.PaidAmount,
  79. x.IsArrearName,
  80. x.InSchoolStatusName,
  81. x.Remark
  82. }).ToTable();
  83. string[] liststring = { "学号", "姓名", "性别", "班级编号", "班级名称", "年级专业编号", "年级专业名称",
  84. RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "缴费学年", "收费项目",
  85. "实收金额", "缴费标记", "已缴金额", "欠费状态", "在校状态", "备注"
  86. };
  87. neh.Export(dt, liststring, "缴费信息" + DateTime.Now.ToString("yyyyMMdd") + "(" + user.Name.ToString() + ")");
  88. return Json(new ReturnMessage()
  89. {
  90. IsSuccess = true,
  91. Message = "导出成功。"
  92. });
  93. }
  94. }
  95. }