123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.ChargeManage.ArrearsSituation;
- using EMIS.ViewModel.ChargeManage.ArrearsSituation;
- using Bowin.Common.Linq.Entity;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.ChargeManage.ArrearsSituation
- {
- [Authorization]
- public class ArrearsListController : Controller
- {
- public IArrearsListServices ArrearsListServices { get; set; }
- /// <summary>
- /// 欠费名单页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 欠费名单列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [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 isArrear = pararms.getExtraInt("IsArrearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsArrearDropDown");
- //登录控制
- var isControl = pararms.getExtraInt("DictionaryIsControl") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsControl");
- //在校状态
- var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- return base.Json(ArrearsListServices.GetArrearListViewGrid(configuretView, collegeID, yearID, standardID, educationID,
- learningformID, learnSystem, isArrear, isControl, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
- }
- public ActionResult AdultList()
- {
- return View();
- }
- /// <summary>
- /// 欠费名单列表查询(成教)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult AdultList(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 isArrear = pararms.getExtraInt("IsArrearDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsArrearDropDown");
- //登录控制
- var isControl = pararms.getExtraInt("DictionaryIsControl") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsControl");
- //在校状态
- var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- return base.Json(ArrearsListServices.GetArrearListViewGridForAdult(configuretView, collegeID, yearID, standardID, educationID,
- learningformID, learnSystem, isArrear, isControl, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 放行(个性化控制登录)
- /// </summary>
- /// <param name="userIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Pass(string userIDs)
- {
- try
- {
- List<Guid?> list = userIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- ArrearsListServices.Pass(list);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "放行成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "放行失败,原因:" + ex.Message + "。"
- });
- }
- }
- /// <summary>
- /// 控制(个性化控制登录)
- /// </summary>
- /// <param name="userIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Control(string userIDs)
- {
- try
- {
- List<Guid?> list = userIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- ArrearsListServices.Control(list);
- 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);
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
- var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- //欠费状态
- var isArrear = Request.Form["IsArrearDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["IsArrearDropDown"].ParseStrTo<int>();
- //登录控制
- var isControl = Request.Form["DictionaryIsControl"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryIsControl"].ParseStrTo<int>();
- //在校状态
- var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- var dt = ArrearsListServices.GetArrearsListViewList(configuretView, collegeID, yearID, standardID, educationID,
- learningformID, learnSystem, isArrear, isControl, inSchoolStatus)
- .Select(x => new
- {
- x.StudentNo,
- x.UserName,
- x.SexName,
- x.ClassNo,
- x.ClassName,
- x.GradeMajorCode,
- x.GrademajorStr,
- x.CollegeCode,
- x.CollegeStr,
- x.Amount,
- x.ChargeAmount,
- x.ActualAmount,
- x.DelayAmount,
- x.PaidAmount,
- x.AmountSum,
- x.IsArrearName,
- x.IsControlName,
- x.GradeStr,
- x.StandardID,
- x.StandardCode,
- x.MajorStr,
- x.EducationName,
- x.LearningformName,
- x.LearnSystem,
- x.InSchoolStatusName,
- x.StudentStatusName
- }).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 = "导出成功。"
- });
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult AdultExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
- var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- //欠费状态
- var isArrear = Request.Form["IsArrearDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["IsArrearDropDown"].ParseStrTo<int>();
- //登录控制
- var isControl = Request.Form["DictionaryIsControl"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryIsControl"].ParseStrTo<int>();
- //在校状态
- var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- var dt = ArrearsListServices.GetArrearsListViewList(configuretView, collegeID, yearID, standardID, educationID,
- learningformID, learnSystem, isArrear, isControl, inSchoolStatus).Where(x=>x.AmountSum>0)
- .Select(x => new
- {
- x.StudentNo,
- x.UserName,
- x.SexName,
- x.ClassNo,
- x.ClassName,
- x.GradeMajorCode,
- x.GrademajorStr,
- x.CollegeCode,
- x.CollegeStr,
- x.Amount,
- x.ChargeAmount,
- x.ActualAmount,
- x.DelayAmount,
- x.PaidAmount,
- x.AmountSum,
- x.IsArrearName,
- x.IsControlName,
- x.GradeStr,
- x.StandardID,
- x.StandardCode,
- x.MajorStr,
- x.EducationName,
- x.LearningformName,
- x.LearnSystem,
- x.InSchoolStatusName,
- x.StudentStatusName
- }).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 = "导出成功。"
- });
- }
- }
- }
|