123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.Data;
- using EMIS.CommonLogic.ScoreManage;
- using Bowin.Common.Utility;
- using Bowin.Web.Controls.Mvc;
- using EMIS.Web.Controls;
- using Bowin.Common.JSON;
- using System.Dynamic;
- using EMIS.Utility;
- using EMIS.ViewModel;
- using System.Text.RegularExpressions;
- using System.Web.Script.Serialization;
- using System.Text;
- using EMIS.CommonLogic.CalendarManage;
- namespace EMIS.Web.Controllers.ScoreManage
- {
- [Authorization]
- public class SpecialityScoreSumController : Controller
- {
- public Lazy<ISpecialityScoreSumServices> specialityScoreSumServices { get; set; }
- public Lazy<ISpecialityScoreByFinalScoreServices> specialityScoreByFinalScoreServices { get; set; }
- public Lazy<ISchoolYearServices> schoolYearServices { get; set; }
- /// <summary>
- /// 专业成绩汇总
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 个人成绩报表(适用于松山、工大、科大等)
- /// </summary>
- /// <returns></returns>
- public ActionResult StudentScoreReport()
- {
- return View();
- }
- /// <summary>
- /// 广体版本专业成绩汇总
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult NewList()
- {
- var schoolYear = schoolYearServices.Value.GetSchoolYearIsCurrent(true);
- ViewBag.Years = schoolYear == null ? "-1" : schoolYear.Years.ToString();//默认当前学年
- return View();
- }
- /// <summary>
- /// 学生个人成绩报表(适用于广体等)
- /// </summary>
- /// <returns></returns>
- public ActionResult StudentScoreNewReport()
- {
- return View();
- }
- [HttpPost]
- public ActionResult SpecialityScoreSumList()
- {
- var collegeID = Request["collegeID"].ParseStrTo<Guid>();
- var standardID = Request["standardID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["standardID"].ParseStrTo<int>();
- var classmajorID = Request["classmajorID"].ParseStrTo<Guid>();
- var yearID = Request["yearID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["yearID"].ParseStrTo<int>();
- var schoolyearNumID = Request["schoolyearNumID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["schoolyearNumID"].ParseStrTo<int>();
- var schoolcodeID = Request["schoolcodeID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["schoolcodeID"].ParseStrTo<int>();
- var inSchoolStatus = Request["InSchoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["InSchoolStatus"].ParseStrTo<int>();
- var specialtyScoreSummaryView = specialityScoreSumServices.Value.SpecialityScoreSumTable(collegeID, yearID, standardID, schoolyearNumID, schoolcodeID, classmajorID, inSchoolStatus);
- return Json(specialtyScoreSummaryView);
- }
- protected override JsonResult Json(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior behavior)
- {
- return new ConfigurableJsonResult { Data = data, ContentType = contentType, ContentEncoding = contentEncoding, JsonRequestBehavior = behavior };
- }
- [HttpPost]
- public ActionResult SpecialityScoreByScoreList(string CourseTypeID)
- {
- //var courseType = pararms.getExtraInt("CourseTypeID") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("CourseTypeID");
- var collegeID = Request["collegeID"].ParseStrTo<Guid>();
- var standardID = Request["standardID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["standardID"].ParseStrTo<int>();
- var classmajorID = Request["classmajorID"].ParseStrTo<Guid>();
- var yearID = Request["yearID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["yearID"].ParseStrTo<int>();
- var schoolyearNumID = Request["schoolyearNumID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["schoolyearNumID"].ParseStrTo<int>();
- var schoolcodeID = Request["schoolcodeID"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["schoolcodeID"].ParseStrTo<int>();
- var inSchoolStatus = Request["InSchoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["InSchoolStatus"].ParseStrTo<int>();
- int count = Regex.Matches(CourseTypeID, ",").Count;
- List<int> CourseTypeIDList = new List<int>();
- for (int i = 0; i < count; i++)
- {
- string courseType = CourseTypeID.Split(',')[i];
- CourseTypeIDList.Add(int.Parse(courseType));
- }
- var specialtyScoreSummaryView = specialityScoreByFinalScoreServices.Value.SpecialityScoreSumTable(collegeID, yearID, standardID, schoolyearNumID, schoolcodeID, classmajorID, CourseTypeIDList);
- return Json(specialtyScoreSummaryView, "text/json", Encoding.UTF8, JsonRequestBehavior.AllowGet);
- }
- /// <summary>
- /// 导出Excel
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- try
- {
- var collegeID = Request["CollegeDropdown"].ParseStrTo<Guid>();
- var standardID = Request["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionaryStandard"].ParseStrTo<int>();
- var classmajorID = Request["ClassmajorDropdown"].ParseStrTo<Guid>();
- var yearID = Request["DictionarySchoolyear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionarySchoolyear"].ParseStrTo<int>();
- var schoolyearNumID = Request["DictionarySchoolyearNum"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionarySchoolyearNum"].ParseStrTo<int>();
- var schoolcodeID = Request["DictionarySchoolcode"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionarySchoolcode"].ParseStrTo<int>();
- var inSchoolStatus = Request["InSchoolStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["InSchoolStatusDictionaryDropDown"].ParseStrTo<int>();
- specialityScoreSumServices.Value.ExportSpecialityScoreSumTable(collegeID, yearID, standardID, schoolyearNumID, schoolcodeID, classmajorID, inSchoolStatus);
- }
- catch (Exception)
- {
- throw;
- }
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功!"
- });
- }
- /// <summary>
- /// 广体导出Excel
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GTExcel(string CourseTypeIDs, bool IsCredit)
- {
- try
- {
- var collegeID = Request["CollegeDropdown"].ParseStrTo<Guid>();
- var standardID = Request["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionaryStandard"].ParseStrTo<int>();
- var classmajorID = Request["ClassmajorDropdown"].ParseStrTo<Guid>();
- var yearID = Request["DictionarySchoolyear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionarySchoolyear"].ParseStrTo<int>();
- var schoolyearNumID = Request["DictionarySchoolyearNum"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionarySchoolyearNum"].ParseStrTo<int>();
- var schoolcodeID = Request["DictionarySchoolcode"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionarySchoolcode"].ParseStrTo<int>();
- var courseTypeIDList = CourseTypeIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => int.Parse(x)).ToList();
- specialityScoreByFinalScoreServices.Value.ExportSpecialityScoreSumTable(collegeID, yearID, standardID, schoolyearNumID, schoolcodeID, classmajorID, courseTypeIDList, IsCredit);
- }
- catch (Exception)
- {
- throw;
- }
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功!"
- });
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetCourseType()
- {
- List<string> list = new List<string>();
- list = specialityScoreByFinalScoreServices.Value.GetCourseTypeID().Select(x => x.ToString()).ToList();
- return base.Json(list);
- }
- }
- }
|