using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EMIS.ViewModel;
using Bowin.Web.Controls.Mvc;
using EMIS.CommonLogic.ChargeManage.ChargeSituation;
using EMIS.Web.Controls;
using EMIS.ViewModel.ChargeManage.ChargeSituation;
using Bowin.Common.Utility;
using Bowin.Common.Data;
using EMIS.CommonLogic.CalendarManage;
using EMIS.Utility;
namespace EMIS.Web.Controllers.ChargeManage.ChargeSituation
{
[Authorization]
public class ChargeAggregateController : Controller
{
public IChargeAggregateServices chargeAggregateServices { get; set; }
///
/// 费用明细
///
///
public ActionResult List()
{
return View();
}
///
/// 费用明细列表查询
///
///
///
[HttpPost]
public ActionResult List(QueryParamsModel pararms)
{
ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
var collegeID = pararms.getExtraGuid("CollegeDropdown");
var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
var chargeYearID = pararms.getExtraInt("ChargeYearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ChargeYearDropDown");
var chargeProjectID = pararms.getExtraGuid("ChargeProjectComboGrid");
//在校状态
var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
return base.Json(chargeAggregateServices.GetChargeAggregateViewGrid(configuretView, collegeID, yearID, standardID, educationID,
learningformID, learnSystem, chargeYearID, chargeProjectID, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
}
///
/// Excel导出
///
///
[HttpPost]
public ActionResult Excel()
{
NpoiExcelHelper neh = new NpoiExcelHelper();
ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
var collegeID = Request.Form["CollegeDropdown"].ParseStrTo();
var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo();
var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo();
var educationID = Request.Form["DictionaryEducation"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo();
var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo();
var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
var chargeYearID = Request.Form["ChargeYearDropDown"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["ChargeYearDropDown"].ParseStrTo();
var chargeProjectID = Request.Form["ChargeProjectComboGrid"].ParseStrTo();
//在校状态
var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo();
var dt = chargeAggregateServices.GetChargeAggregateViewList(configuretView, collegeID, yearID, standardID, educationID,
learningformID, learnSystem, chargeYearID, chargeProjectID, inSchoolStatus)
.Select(x => new
{
x.StudentNo,
x.ExamineeNum,
x.UserName,
x.SexName,
x.ClassNo,
x.ClassName,
x.GradeMajorCode,
x.GrademajorStr,
x.CollegeCode,
x.CollegeStr,
x.ChargeYear,
x.ChargeProjectName,
x.Amount,
x.ChargeAmount,
x.ActualAmount,
x.ChargeTagName,
x.DelayAmount,
x.PaidAmount,
x.AmountSum,
x.GradeStr,
x.StandardID,
x.StandardCode,
x.MajorStr,
x.EducationName,
x.LearningformName,
x.LearnSystem,
x.IsDreamProject,
x.InSchoolStatusName,
x.StudentStatusName,
x.TeacherNo,
x.TeacherName
}).ToTable();
string[] liststring = {
"学号", "考生号", "姓名", "性别", "班级编号", "班级名称", "年级专业编号", "年级专业名称",
RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "缴费学年", "收费项目", "应收金额",
"调整金额", "实收金额", "缴费标记", "缓交金额", "已缴金额", "欠费金额",
"年级", "专业ID(Value)", "专业代码", "专业名称", RSL.Get("EducationID"), "学习形式",
"学制", "是否圆梦计划", "在校状态", "学籍状态", "班主任编号", "班主任"
};
neh.Export(dt, liststring, "应收名单信息" + DateTime.Now.ToString("yyyyMMdd"));
return Json(new ReturnMessage()
{
IsSuccess = true,
Message = "导出成功。"
});
}
}
}