123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.ChargeManage.ChargeSituation;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.ViewModel.ChargeManage.ChargeSituation;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.StudentSystem.Charge
- {
- [Authorization]
- public class StudentChargeDelayController : Controller
- {
- public IChargeDelayServices ChargeDelayServices { get; set; }
- /// <summary>
- /// 缓交申请页面(学生平台)
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 缓交申请列表查询(学生平台)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [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 chargeDelayStatus = pararms.getExtraInt("DictionaryChargeDelayStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryChargeDelayStatus");
- return base.Json(ChargeDelayServices.GetStudentChargeDelayViewGrid(configuretView, user.UserID, chargeYearID, chargeProjectID, chargeDelayStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 编辑(申请、修改)
- /// </summary>
- /// <param name="chargeDelayID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? chargeDelayID)
- {
- ChargeDelayView chargeDelayView = new ChargeDelayView();
- if (chargeDelayID.HasValue && chargeDelayID != Guid.Empty)
- {
- chargeDelayView = ChargeDelayServices.GetChargeDelayEditView(chargeDelayID);
- }
- else
- {
- //登录用户user
- var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- chargeDelayView.UserID = user.UserID;
- chargeDelayView.ChargeYear = BaseExtensions.GetCurrentYearID();
- }
- return View(chargeDelayView);
- }
- /// <summary>
- /// 编辑(申请、修改)
- /// </summary>
- /// <param name="chargeDelayView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(ChargeDelayView chargeDelayView)
- {
- try
- {
- ChargeDelayServices.ChaegeDelayEdit(chargeDelayView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message + "。"
- });
- }
- }
- /// <summary>
- /// 导出Excel
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- //登录用户user
- var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var chargeYearID = Request.Form["ChargeYearDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ChargeYearDropDown"].ParseStrTo<int>();
- var chargeProjectID = Request.Form["ChargeProjectComboGrid"].ParseStrTo<Guid>();
- //审批状态
- var chargeDelayStatus = Request.Form["DictionaryChargeDelayStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryChargeDelayStatus"].ParseStrTo<int>();
- var dt = ChargeDelayServices.GetStudentChargeDelayViewList(configuretView, user.UserID, chargeYearID, chargeProjectID, chargeDelayStatus)
- .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.PaidAmount,
- x.DelayAmount,
- x.InSchoolStatusName,
- x.Reason,
- x.RecordStatusName
- }).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 = "导出成功。"
- });
- }
- }
- }
|