using Bowin.Common.Utility; using Bowin.Web.Controls.Mvc; using Bowin.Common.Data; using EMIS.CommonLogic.ChargeManage.ChargeSituation; using EMIS.ViewModel; using EMIS.Web.Controls; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.Utility; namespace EMIS.Web.Controllers.StudentSystem.Charge { [Authorization] public class PersonalPaymentController : Controller { public IStudentChargeServices StudentChargeServices { get; set; } /// /// 缴费信息(学生平台) /// /// public ActionResult List() { return View(); } /// /// 缴费信息列表查询(学生平台) /// /// /// [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); //登录用户user var user = EMIS.Utility.FormValidate.CustomPrincipal.Current; var chargeYearID = pararms.getExtraInt("ChargeYearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ChargeYearDropDown"); var chargeProjectID = pararms.getExtraGuid("ChargeProjectComboGrid"); var chargeTagID = pararms.getExtraInt("DictionaryChargeTag") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryChargeTag"); //欠费状态 var isArrear = pararms.getExtraInt("IsArrearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsArrearDropDown"); return base.Json(StudentChargeServices.GetPersonalPaymentViewGrid(configuretView, user.UserID, chargeYearID, chargeProjectID, chargeTagID, isArrear, (int)pararms.page, (int)pararms.rows)); } /// /// 导出Excel /// /// [HttpPost] public ActionResult Excel() { NpoiExcelHelper neh = new NpoiExcelHelper(); ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null); var user = EMIS.Utility.FormValidate.CustomPrincipal.Current; var chargeYearID = Request.Form["ChargeYearDropDown"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["ChargeYearDropDown"].ParseStrTo(); var chargeProjectID = Request.Form["ChargeProjectComboGrid"].ParseStrTo(); var chargeTagID = Request.Form["DictionaryChargeTag"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryChargeTag"].ParseStrTo(); //欠费状态 var isArrear = Request.Form["IsArrearDropDown"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["IsArrearDropDown"].ParseStrTo(); var dt = StudentChargeServices.GetPersonalPaymentViewList(configuretView, user.UserID, chargeYearID, chargeProjectID, chargeTagID, isArrear) .Select(x => new { x.StudentNo, x.UserName, x.SexName, x.ClassNo, x.ClassName, x.GradeMajorCode, x.GradeMajoyStr, x.CollegeCode, x.CollegeStr, x.ChargeYear, x.ChargeProjectStr, x.ActualAmount, x.ChargeTagName, x.PaidAmount, x.IsArrearName, x.InSchoolStatusName, x.Remark }).ToTable(); string[] liststring = { "学号", "姓名", "性别", "班级编号", "班级名称", "年级专业编号", "年级专业名称", RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "缴费学年", "收费项目", "实收金额", "缴费标记", "已缴金额", "欠费状态", "在校状态", "备注" }; neh.Export(dt, liststring, "缴费信息" + DateTime.Now.ToString("yyyyMMdd") + "(" + user.Name.ToString() + ")"); return Json(new ReturnMessage() { IsSuccess = true, Message = "导出成功。" }); } } }