PaymentController.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.CommonLogic.PaymentManage;
  7. using EMIS.ViewModel;
  8. using EMIS.Web.Controls;
  9. using Bowin.Common.Data;
  10. using Bowin.Web.Controls.Mvc;
  11. using Bowin.Common.Utility;
  12. using EMIS.Utility;
  13. namespace EMIS.Web.Controllers.PaymentManage
  14. {
  15. [Authorization]
  16. public class PaymentController : Controller
  17. {
  18. public IPaymentServices PaymentServices { get; set; }
  19. public ActionResult List()
  20. {
  21. return View();
  22. }
  23. public ActionResult CollegeTeacherReport()
  24. {
  25. return View();
  26. }
  27. public ActionResult CollegeTeacherMonthReport()
  28. {
  29. return View();
  30. }
  31. public ActionResult MonthlyReport()
  32. {
  33. return View();
  34. }
  35. public ActionResult GradeyearReport()
  36. {
  37. return View();
  38. }
  39. public ActionResult WorktimeTotalReport()
  40. {
  41. return View();
  42. }
  43. [HttpPost]
  44. public ActionResult List(QueryParamsModel pararms)
  45. {
  46. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  47. var schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
  48. var collegeID = pararms.getExtraGuid("cbgCollege");
  49. var titleID = pararms.getExtraInt("ddlTitle") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlTitle");
  50. var list = PaymentServices.GetPaymentDetailViewList(configuretView, schoolyearID, collegeID, titleID, pararms.page.Value, pararms.rows.Value);
  51. return Json(list);
  52. }
  53. /// <summary>
  54. /// 导出Excel
  55. /// </summary>
  56. /// <returns></returns>
  57. [HttpPost]
  58. public ActionResult Excel()
  59. {
  60. NpoiExcelHelper neh = new NpoiExcelHelper();
  61. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  62. var schoolyearID = Request.Form["ddlSchoolYear"].ParseStrTo<Guid>();
  63. var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>();
  64. var titleID = Request.Form["ddlTitle"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlTitle"].ParseStrTo<int>();
  65. var dt = PaymentServices.GetPaymentDetailViewList(configuretView, schoolyearID, collegeID, titleID).Select(x => new
  66. {
  67. x.SchoolyearCode,
  68. x.CollegeName,
  69. x.UserName,
  70. x.TeacherTypeDesc,
  71. x.TitleDesc,
  72. PaymentStandard = string.Format("{0:#0.00}", x.PaymentStandard),
  73. x.EducationDesc,
  74. x.LearningformDesc,
  75. x.LearningformRate,
  76. StudentCount = (x.StudentCount ?? 0).ToString(),
  77. ExemptionCount = (x.ExemptionCount ?? 0).ToString(),
  78. ActualStudentCount = (x.ActualStudentCount ?? 0).ToString(),
  79. StudentCountRate = (x.StudentCountRate ?? 0).ToString(),
  80. RetakeStudentCount = (x.RetakeStudentCount ?? 0).ToString(),
  81. ScheduleDayCount = (x.ScheduleDayCount ?? 0).ToString(),
  82. ActualScheduleHours = (x.ActualScheduleHours ?? 0).ToString(),
  83. HoursPayment = string.Format("{0:#0.00}", x.HoursPayment),
  84. PracticeHours = (x.PracticeHours ?? 0).ToString(),
  85. PracticeRate = string.Format("{0:#0.00}", x.PracticeRate),
  86. PracticePayment = string.Format("{0:#0.00}", x.PracticePayment),
  87. TotalPayment = string.Format("{0:#0.00}", x.TotalPayment),
  88. x.ClasamajorName,
  89. x.CoursematerialName,
  90. PlanTotalHours = (x.PlanTotalHours ?? 0).ToString(),
  91. x.TimeSegmentDesc,
  92. x.ExaminationModeDesc
  93. }).ToTable();
  94. string[] liststring = { "学年学期", RSL.Get("College"), "任课老师", "教师类型", "职称", "标准课酬", RSL.Get("EducationID"), "学习形式", "形式系数", "班级人数",
  95. "免考人数", "实际人数", "人数系数", "重修人数", "排课天数", "实际学时", "课时课酬", "实践学时", "实践系数", "实践课酬",
  96. "总课酬", "班级名称", "课程名称", "计划学时", "课时类别", "考核方式" };
  97. neh.Export(dt, liststring, "教师课酬列表");
  98. return RedirectToAction("MsgShow", "Common", new
  99. {
  100. msg = "导出成功!",
  101. url = Url.Action("List").AddMenuParameter()
  102. });
  103. }
  104. /// <summary>
  105. /// 导出Excel
  106. /// </summary>
  107. /// <returns></returns>
  108. [HttpPost]
  109. public ActionResult ExcelTotal()
  110. {
  111. NpoiExcelHelper neh = new NpoiExcelHelper();
  112. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  113. var schoolyearID = Request.Form["ddlSchoolYear"].ParseStrTo<Guid>();
  114. var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>();
  115. var titleID = Request.Form["ddlTitle"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlTitle"].ParseStrTo<int>();
  116. var dt = PaymentServices.GetPaymentTotalViewList(configuretView, schoolyearID, collegeID, titleID).Select(x => new
  117. {
  118. x.CollegeName,
  119. x.UserName,
  120. x.Account,
  121. TotalPayment = string.Format("{0:#0.00}", x.TotalPayment ?? 0)
  122. }).ToTable();
  123. string[] liststring = { RSL.Get("College"), "任课老师", "工商银行账号", "总课酬(元)" };
  124. neh.Export(dt, liststring, "教师课酬汇总表");
  125. return RedirectToAction("MsgShow", "Common", new
  126. {
  127. msg = "导出成功!",
  128. url = Url.Action("List").AddMenuParameter()
  129. });
  130. }
  131. }
  132. }