12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Common;
- using Bowin.Common.Data;
- using Bowin.Common.Exceptions;
- using Bowin.Common.Utility;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.CommonLogic.Students;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.Entities;
- using EMIS.Utility;
- using EMIS.ViewModel;
- using EMIS.ViewModel.Students;
- using EMIS.Web.Controls;
- using System.Net;
- using System.Globalization;
- using Newtonsoft.Json;
- using EMIS.CommonLogic.DataCenterSynch;
- using Bowin.Common.Log;
- namespace EMIS.Web.Controllers.Students
- {
- [Authorization]
- public class StudentsController : Controller
- {
- public Lazy<IStudentsServices> StudentfileServices { get; set; }
- public Lazy<IUserServices> userServices { get; set; }
- public Lazy<ISchoolYearServices> schoolYearServices { get; set; }
- public IStudentSynchServices StudentSynchServices { get; set; }
- /// <summary>
- /// 学生信息页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- public ActionResult InfoExport(string selectedIDs)
- {
- ViewBag.selectedID = selectedIDs;
- return View();
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <param name="inSchoolStatus">在校状态</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- //避开全选值
- //var campusID = pararms.getExtraGuid("CampusDropdown");
- var campusID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var classmajorID = pararms.getExtraGuid("ClassmajorDropdown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var inSchoolStatusID = pararms.getExtraInt("InSchoolStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("InSchoolStatusDictionaryDropDown");
- var generalPurposeID = pararms.getExtraInt("GeneralPurposeDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("GeneralPurposeDictionaryDropDown");
- var isPhotos = pararms.getExtraInt("YesOrNoStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatusDictionaryDropDown");//是否有照片
- var isDream = pararms.getExtraInt("YesOrNoStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatus");//是否圆梦计划
- var planningGraduateDate = pararms.getExtraString("PlanningGraduateDropDown");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var reportStatusID = pararms.getExtraInt("ReportStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ReportStatusDictionaryDropDown");
- //DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();
- //dtFormat.ShortDatePattern = "yyyyMMdd";
- //var planningGraduateDate;
- //if (str != "" && !str.Equals(""))
- //{
- // planningGraduateDate = Convert.ToDateTime(str, dtFormat); //== DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatus");
- //}
- return base.Json(StudentfileServices.Value.GetStudentUserViewList(configuretView, campusID, collegeID, yearID, standardID,
- learningformID, classmajorID, generalPurposeID, inSchoolStatusID, isPhotos, isDream, planningGraduateDate, LearnSystem, education, reportStatusID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 学生信息页面
- /// </summary>
- /// <returns></returns>
- public ActionResult GdssList()
- {
- return View();
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <param name="inSchoolStatus">在校状态</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GdssList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- //避开全选值
- var campusID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var classmajorID = pararms.getExtraGuid("ClassmajorDropdown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var inSchoolStatusID = pararms.getExtraInt("InSchoolStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("InSchoolStatusDictionaryDropDown");
- var generalPurposeID = pararms.getExtraInt("GeneralPurposeDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("GeneralPurposeDictionaryDropDown");
- var isPhotos = pararms.getExtraInt("YesOrNoStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatusDictionaryDropDown");//是否有照片
- var isDream = pararms.getExtraInt("YesOrNoStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatus");//是否圆梦计划
- var planningGraduateDate = pararms.getExtraString("PlanningGraduateDropDown");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var reportStatusID = pararms.getExtraInt("ReportStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ReportStatusDictionaryDropDown");
- //DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();
- //dtFormat.ShortDatePattern = "yyyyMMdd";
- //var planningGraduateDate;
- //if (str != "" && !str.Equals(""))
- //{
- // planningGraduateDate = Convert.ToDateTime(str, dtFormat); //== DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatus");
- //}
- return base.Json(StudentfileServices.Value.GetStudentUserViewList(configuretView, campusID, collegeID, yearID, standardID,
- learningformID, classmajorID, generalPurposeID, inSchoolStatusID, isPhotos, isDream, planningGraduateDate, LearnSystem, education, reportStatusID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 查询学生信息
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult BaseStudentViewList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var collegeID = pararms.getExtraGuid("CollegeComboGrid");
- var grademajorID = pararms.getExtraGuid("GrademajorComboGrid");
- var classmajorID = pararms.getExtraGuid("ClassmajorComboGrid");
- var userID = pararms.getExtraGuid("StudentComboGrid");
- //var inSchool = Request.Form["InSchool"];
- return Json(StudentfileServices.Value.GetBaseStudentView(configuretView, collegeID, grademajorID, classmajorID, userID, (int)pararms.page, (int)pararms.rows));
- }
- //<summary>
- //编辑页面
- //</summary>
- //<returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? Userids,string type)
- {
- StudentsView StudentfileServicesr = new StudentsView();
- StudentfileServicesr.StudentType = (int)CF_STUDENTTYPE.DefaultType;
- if (Userids != null && Userids != Guid.Empty)
- StudentfileServicesr = StudentfileServices.Value.GetStudentfileView((Guid)Userids);
- //设置预计毕业学期 方案二
- if (StudentfileServicesr.GradeMajorID.HasValue)
- {
- //string GetPlanningGraduate = StudentfileServices.Value.GetPlanningGraduate((Guid)StudentfileServicesr.GradeMajorID);
- //if (GetPlanningGraduate != "")
- //{
- // StudentfileServicesr.PlanningGraduateDate = Convert.ToDateTime(GetPlanningGraduate);
- // StudentfileServicesr.PlanningGraduateDateStr = Convert.ToDateTime(GetPlanningGraduate);
- //}
- }
- if (type == "copyAdd" && Userids!=null)
- {
- StudentfileServicesr.UserID = Guid.Empty;
- StudentfileServicesr.LoginID = null;
- StudentfileServicesr.IDNumber = null;
- StudentfileServicesr.UserName = null;
- StudentfileServicesr.PhotoUrl = null;
- StudentfileServicesr.StudentType = (int)CF_STUDENTTYPE.DefaultType;
- }
- return View(StudentfileServicesr);
- }
- /// <summary>
- /// 编辑页面
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(StudentsView studentfileView)
- {
- try
- {
- //获取用户
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var accepts = new List<string> { ".jpg" };
- var postedFile = Request.Files["PhotoUrl"];
- if (!string.IsNullOrEmpty(postedFile.FileName) && !accepts.Contains(Path.GetExtension(postedFile.FileName).ToLower()))
- {
- throw new Exception("只允许上传.jpg格式的文件。");
- }
- if (!string.IsNullOrEmpty(postedFile.FileName) && (postedFile.ContentLength > (200 * 1024) || postedFile.ContentLength < (50 * 1024)))
- {
- throw new Exception("只允许上传50-200k大小的照片。");
- }
- string photoUrl = FileUploadHelper.UploadFile(postedFile);
- if (photoUrl != null)
- {
- studentfileView.PhotoUrl = photoUrl;
- }
- this.StudentfileServices.Value.Save(studentfileView);
- string UrlStr = Url.Action("Edit").AddMenuParameter() + "&Userids=" + studentfileView.UserID;
- if (studentfileView.UserID != null && studentfileView.UserID != Guid.Empty)
- {
- UrlStr = Url.Action("Edit").AddMenuParameter() + "&Userids=" + studentfileView.UserID + "&type=copyEdit";
- }
- return RedirectToAction("MsgShowAndOpenAddUrl", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "保存成功!",
- url = UrlStr,
- title = "学生信息修改"
- });
- }
- catch (Exception ex)
- {
- string UrlStr = Url.Action("Edit").AddMenuParameter();
- if (studentfileView.UserID != null && studentfileView.UserID != Guid.Empty)
- {
- UrlStr += "&Userids=" + studentfileView.UserID + "&type=copyEdit";
- }
- return RedirectToAction("MsgShowAndOpenAddUrl", "Common", new
- {
- title = "学生信息修改",
- WindowID = Request["WindowID"],
- msg = "保存失败!" + ex.Message,
- url = UrlStr
- });
- }
- }
- public ActionResult StudentExperience()
- {
- return View();
- }
- //<summary>
- //导出数据
- //</summary>
- //<returns></returns> Excel字段调整 2016年9月29日11:09:43 zhanghl
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var UserIDs = Request.Form["UserIDs"];
- var campusID = Request.Form["ddlSchoolArea"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlSchoolArea"].ParseStrTo<int>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- var learningformID = Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>();
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var inSchoolStatusID = Request.Form["InSchoolStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["InSchoolStatusDictionaryDropDown"].ParseStrTo<int>();
- var generalPurposeID = Request.Form["GeneralPurposeDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["GeneralPurposeDictionaryDropDown"].ParseStrTo<int>();
- var isPhotos = Request.Form["YesOrNoStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["YesOrNoStatusDictionaryDropDown"].ParseStrTo<int>();//是否有照片
- var isDream = Request.Form["YesOrNoStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["YesOrNoStatus"].ParseStrTo<int>();//是否圆梦计划
- var planningGraduateDate = "";
- //Request.Form["PlanningGraduateDropDown"].ToString();
- var LearnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var education = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var reportStatusID = Request.Form["ReportStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ReportStatusDictionaryDropDown"].ParseStrTo<int>();
- List<Guid?> UserIDsIDList = new List<Guid?>();
- if (UserIDs != "")
- {
- UserIDsIDList = UserIDs.SplitIDString();
- }
- else
- {
- UserIDsIDList = null;
- }
- var dt = StudentfileServices.Value.GetStudentViewList(configuretView, campusID, collegeID, yearID, standardID,
- learningformID, classmajorID, generalPurposeID, inSchoolStatusID, isPhotos, isDream, planningGraduateDate, LearnSystem, education, reportStatusID, UserIDsIDList)
- .Select(x => new
- {
- x.ExamineeNum,
- x.StudentNo,
- x.UserName,
- x.SexName,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyy-MM-dd") : ""),
- x.CertificatesTypeName,
- x.IDNumber,
- x.PoliticsName,
- x.NationName,
- x.StandardCode,
- x.StandardName,
- x.FacultymajorName,
- x.SchoolAreaName,
- x.CampusName,
- x.CollegeName,
- x.ClassMajorCode,
- x.EducationName,
- x.LearningformName,
- LearnSystem = (x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("#.#") : ""),
- EntranceDate = (x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyy-MM-dd") : ""),
- PlanningGraduateDate = (x.PlanningGraduateDate.HasValue ? x.PlanningGraduateDate.Value.ToString("yyyy-MM-dd") : ""),
- x.CardNo,
- x.InSchoolStatusName,
- x.StudentStatusName,
- x.ClassMajorName,
- x.Dormitory,
- x.GraduateCardNo,
- x.StudentCardNo,
- x.EntranceWayName,
- x.SchoolTypeName,
- x.CultureModelName,
- x.ExamineeTypeName,
- x.FeaturesName,
- x.TerritorialName,
- x.Area,
- x.Place,
- x.StudentTypeName,
- PhotoUrlNO = x.LoginID,
- x.Score,
- x.HealthyName,
- x.Email,
- x.QQ,
- x.Mobile,
- x.Telephone,
- x.ZipCode,
- x.HomeAddress,
- x.Recipient,
- x.Placebirth,
- x.UsedName,
- x.Specialty,
- x.Height,
- x.Weight,
- x.WorkUnit,
- x.IsDreamProjectName,
- x.Career,
- x.Remarks
- }).ToTable();
- string[] liststring = {
- "教育部考生号","学号","姓名","性别","出生日期","证件类型","证件号码","政治面貌","民族"
- ,"专业代码","专业名称",RSL.Get("College")+"专业","校区","分院(校)","系所函授站","班号","层次"
- ,"学习形式","学制","入学日期","预计毕业日期","银行卡号","在校状态","学籍状态"
- ,"班级名称","宿舍","毕结业证书编号","学籍卡编号","入学方式","办学类型","培养方式"
- ,"考生类别","考生特征","生源所属地","来源地区","籍贯","学生类别","相片编号","高考总分"
- ,"健康状态","电子邮箱","QQ","移动电话","固定电话","邮编","家庭地址","收件人","出生地","曾用名"
- ,"特长","身高(CM)","体重(KG)","工作单位","是否圆梦计划","在校经历","备注"};
- neh.Export(dt, liststring, "学生信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/Students/List").AddMenuParameter()
- });
- }
- //<summary>
- //学籍信息导出Excel dbf
- //</summary>
- //<returns></returns> Excel字段调整 2016年9月29日11:09:43 zhanghl
- [HttpPost]
- public ActionResult InfoExcel(QueryParamsModel pararms, string selectedIDs, string colnames, string showname)
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- string WindowStr = Request.UrlReferrer.ToString();
- int IndexofID = WindowStr.LastIndexOf("=");
- WindowStr = WindowStr.Remove(0, IndexofID + 1);
- var campusID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var classmajorID = pararms.getExtraGuid("ClassmajorDropdown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var inSchoolStatusID = pararms.getExtraInt("InSchoolStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("InSchoolStatusDictionaryDropDown");
- var generalPurposeID = pararms.getExtraInt("GeneralPurposeDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("GeneralPurposeDictionaryDropDown");
- var isPhotos = pararms.getExtraInt("YesOrNoStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatusDictionaryDropDown");//是否有照片
- var isDream = pararms.getExtraInt("YesOrNoStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatus");//是否圆梦计划
- var planningGraduateDate = pararms.getExtraString("PlanningGraduateDropDown");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var reportStatusID = pararms.getExtraInt("ReportStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ReportStatusDictionaryDropDown");
- List<string> namelist = new List<string>();
- for (int i = 0; i < showname.Split(',').Length; i++)
- {
- string col = showname.Split(',')[i];
- if (!string.IsNullOrEmpty(col))
- {
- namelist.Add(col);
- }
- }
- List<string> idlist = new List<string>();
- for (int i = 0; i < colnames.Split(',').Length; i++)
- {
- string col = colnames.Split(',')[i];
- if (!string.IsNullOrEmpty(col))
- {
- idlist.Add(col);
- }
- }
- var dt = StudentfileServices.Value.GetStudentExportList(configuretView, campusID, collegeID, yearID, standardID,
- learningformID, classmajorID, generalPurposeID, inSchoolStatusID, isPhotos, isDream, planningGraduateDate, LearnSystem, education, reportStatusID)
- .Select(x => new
- {
- x.ExamineeNum,
- x.UserName,
- x.SexName,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyyMMdd") : ""),
- x.IDNumber,
- x.SchoolCode,
- x.SchoolName,
- x.StandardCode,
- x.StandardName,
- LearnSystem = (x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("0.0") : ""),
- x.LearningformName,
- x.EducationName,
- EntranceDate = (x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyyMMdd") : ""),
- PlanningGraduateDate = (x.PlanningGraduateDate.HasValue ? x.PlanningGraduateDate.Value.ToString("yyyyMMdd") : ""),
- x.GraduationResultName,
- x.GraduateCardNo,
- x.HeadMasterName,
- x.TerritorialName,
- x.LoginID,
- x.PoliticsName,
- x.NationName,
- x.CampusName,
- x.CollegeName,
- x.ClassNumStr,
- x.ClassMajorCode,
- x.ClassMajorName,
- x.Remarks
- }).ToTable(namelist);
- string[] liststring = idlist.ToArray();
- neh.Export(dt, liststring, "学籍信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/Students/List").AddMenuParameter()
- });
- }
- //<summary>
- //学籍信息导出Excel dbf
- //</summary>
- //<returns></returns> Excel字段调整 2016年9月29日11:09:43 zhanghl
- [HttpPost]
- public ActionResult DbfExport(QueryParamsModel pararms, string selectedIDs, string colnames, string showname)
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- string WindowStr = Request.UrlReferrer.ToString();
- int IndexofID = WindowStr.LastIndexOf("=");
- WindowStr = WindowStr.Remove(0, IndexofID + 1);
- var campusID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var classmajorID = pararms.getExtraGuid("ClassmajorDropdown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var inSchoolStatusID = pararms.getExtraInt("InSchoolStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("InSchoolStatusDictionaryDropDown");
- var generalPurposeID = pararms.getExtraInt("GeneralPurposeDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("GeneralPurposeDictionaryDropDown");
- var isPhotos = pararms.getExtraInt("YesOrNoStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatusDictionaryDropDown");//是否有照片
- var isDream = pararms.getExtraInt("YesOrNoStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("YesOrNoStatus");//是否圆梦计划
- var planningGraduateDate = pararms.getExtraString("PlanningGraduateDropDown");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var reportStatusID = pararms.getExtraInt("ReportStatusDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ReportStatusDictionaryDropDown");
- List<string> namelist = new List<string>();
- for (int i = 0; i < showname.Split(',').Length; i++)
- {
- string col = showname.Split(',')[i];
- if (!string.IsNullOrEmpty(col))
- {
- namelist.Add(col);
- }
- }
- List<string> idlist = new List<string>();
- for (int i = 0; i < colnames.Split(',').Length; i++)
- {
- string col = colnames.Split(',')[i];
- if (!string.IsNullOrEmpty(col))
- {
- idlist.Add(col);
- }
- }
- var dt = StudentfileServices.Value.GetStudentExportList(configuretView, campusID, collegeID, yearID, standardID,
- learningformID, classmajorID, generalPurposeID, inSchoolStatusID, isPhotos, isDream, planningGraduateDate, LearnSystem, education, reportStatusID)
- .Select(x => new
- {
- x.ExamineeNum,
- x.UserName,
- x.SexName,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyyMMdd") : ""),
- x.IDNumber,
- x.SchoolCode,
- x.SchoolName,
- x.StandardCode,
- x.StandardName,
- LearnSystem = (x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("0.0") : ""),
- x.LearningformName,
- x.EducationName,
- EntranceDate = (x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyyMMdd") : ""),
- PlanningGraduateDate = (x.PlanningGraduateDate.HasValue ? x.PlanningGraduateDate.Value.ToString("yyyyMMdd") : ""),
- x.GraduationResultName,
- x.GraduateCardNo,
- x.HeadMasterName,
- x.TerritorialName,
- x.LoginID,
- x.PoliticsName,
- x.NationName,
- x.CampusName,
- x.CollegeName,
- x.ClassNumStr,
- x.ClassMajorCode,
- x.ClassMajorName,
- x.Remarks,
- }).ToTable(namelist);
- string[] liststring = idlist.ToArray();
- StudentfileServices.Value.WriteToDbf(dt, idlist);
- var physicalPath = System.IO.Directory.GetCurrentDirectory() + "\\" + dt.TableName + ".dbf";
- return File(physicalPath, "application/x-dbf", "学籍信息.dbf");
- }
- [HttpPost]
- public ActionResult Delete(string userIDs)
- {
- try
- {
- List<Guid> list = new List<Guid>();
- for (int i = 0; i < userIDs.Split(',').Length; i++)
- {
- string id = userIDs.Split(',')[i];
- if (!string.IsNullOrEmpty(id))
- {
- Guid userID = new Guid(id);
- list.Add(userID);
- }
- }
- StudentfileServices.Value.StudentDelete(list);
- return base.Json("删除成功!");
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- System.Data.SqlClient.SqlException num = ExceptionHelper.GetSqlException(ex);
- if (num != null)
- {
- if (num.Number == 547)
- mge = "请先删除所有关联的数据,学期注册,任务管理,学生成绩等";
- }
- return base.Json("删除失败,原因:" + mge + "!");
- }
- }
- [HttpGet]
- public ActionResult Import(string errorFile)
- {
- ViewBag.ErrorFile = errorFile;
- return View();
- }
- [HttpPost]
- public ActionResult Import(HttpPostedFileBase file)
- {
- try
- {
- var accept = new[] { ".xls" };
- var p = Path.GetExtension(file.FileName);
- if (!accept.Contains(p))
- {
- throw new Exception("只允许上传xls格式的Excel文件!");
- }
- string sourceWebPath = FileUploadHelper.UploadFile(file);
- var sourcePhysicalPath = Server.MapPath(sourceWebPath);
- var excel = new NpoiExcelHelper();
- var dataSource = excel.ImpotColumns(sourcePhysicalPath);
- System.IO.File.Delete(sourcePhysicalPath);
- var errorSource = StudentfileServices.Value.Import(dataSource);
- var errorCount = errorSource.Rows.Count;
- if (errorCount > 0)
- {
- var errorPhysicalPath = sourcePhysicalPath;
- excel.SaveInServer(errorSource, errorPhysicalPath);
- var errorWebPath = sourceWebPath;
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = "none",
- msg = "导入失败!",
- url = Url.Action("Import").AddMenuParameter() + "&errorFile=" + errorWebPath + "&WindowID=" + Request["WindowID"]
- });
- }
- else
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "导入成功!",
- url = Url.Action("List").AddMenuParameter()
- });
- }
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "导入发生错误!" + ex.Message,
- url = Url.Action("List").AddMenuParameter()
- });
- }
- }
- [HttpGet]
- public ActionResult PicImport(string errorFile)
- {
- ViewBag.ErrorFile = errorFile;
- return View();
- }
- [HttpPost]
- public ActionResult PicImport(HttpPostedFileBase file)
- {
- try
- {
- if (file.ContentLength <= 0)
- {
- throw new Exception("请选择上传文件!");
- }
- var acceptFileExtensions = new[] { ".zip", ".rar" };
- var p = Path.GetExtension(file.FileName);
- if (!acceptFileExtensions.Contains(p))
- {
- throw new Exception("只允许上传zip或rar格式的压缩包!");
- }
- var photoPaths = FileUploadHelper.UploadFileAndExtractFile(file);
- if (photoPaths.Count <= 0)
- {
- throw new Exception("压缩包中没有文件!");
- }
- List<string> listphotoPaths = new List<string>();
- var acceptPicExtensions = new[] { ".jpg" };
- foreach (var path in photoPaths)
- {
- string pathxiao = Path.GetExtension(path).ToLower();
- if (acceptPicExtensions.Contains(pathxiao))
- {
- listphotoPaths.Add(path);
- }
- }
- var errorDatatable = StudentfileServices.Value.PicImport(listphotoPaths);
- if (errorDatatable.Rows.Count > 0)
- {
- string filePath = Const.LOCAL_SETTING_UPLOAD_FILEPATH;
- var webFileName = filePath + "/" + Path.GetFileName("照片导入错误数据.xls");
- var sourcePhysicalPath = Server.MapPath(webFileName);
- var excel = new NpoiExcelHelper();
- excel.SaveInServer(errorDatatable, sourcePhysicalPath);
- var errorWebPath = webFileName.Substring(1,webFileName.Length - 1);
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = "none",
- msg = "导入失败!",
- url = Url.Action("PicImport").AddMenuParameter() + "&errorFile=" + errorWebPath + "&WindowID=" + Request["WindowID"]
- });
- }
- else
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "导入照片成功!",
- url = Url.Action("List").AddMenuParameter()
- });
- }
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = "none",
- msg = "导入照片失败!" + ex.Message,
- url = Url.Action("PicImport").AddMenuParameter() + "&WindowID=" + Request["WindowID"]
- });
- }
- }
- [HttpGet]
- public ActionResult GraduatePicImport()
- {
- return View();
- }
- [HttpPost]
- public ActionResult GraduationPicImport(HttpPostedFileBase file)
- {
- try
- {
- if (file.ContentLength <= 0)
- {
- throw new Exception("请选择上传文件!");
- }
- var acceptFileExtensions = new[] { ".zip", ".rar" };
- var p = Path.GetExtension(file.FileName);
- if (!acceptFileExtensions.Contains(p))
- {
- throw new Exception("只允许上传zip或rar格式的压缩包!");
- }
- var photoPaths = FileUploadHelper.UploadFileAndExtractFile(file);
- if (photoPaths.Count <= 0)
- {
- throw new Exception("压缩包中没有文件!");
- }
- List<string> listphotoPaths = new List<string>();
- var acceptPicExtensions = new[] { ".jpg" };
- foreach (var path in photoPaths)
- {
- string pathxiao = Path.GetExtension(path).ToLower();
- if (acceptPicExtensions.Contains(pathxiao))
- {
- listphotoPaths.Add(path);
- }
- }
- StudentfileServices.Value.GraduationPicImport(listphotoPaths);
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "导入毕业相片成功!",
- url = Url.Action("List").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = "none",
- msg = "导入毕业相片失败!" + ex.Message,
- url = Url.Action("GraduatePicImport").AddMenuParameter() + "&WindowID=" + Request["WindowID"]
- });
- }
- }
- /// <summary>
- /// 添加更新前验证
- /// </summary>
- /// <param name="universityID"></param>
- /// <param name="code"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Verification(Guid? Userid, string Code, string ReplaceGraduateNo)
- {
- Sys_User userNo = null;
- Sys_User userInfo = null;
- if (!string.IsNullOrEmpty(Code))
- {
- userNo = userServices.Value.GetUserByLoginID(Code.Trim());
- if (!string.IsNullOrEmpty(Code) && Userid != Guid.Empty)
- {
- if (!string.IsNullOrEmpty(ReplaceGraduateNo))
- {
- var isexistReplaceGraduateNo = StudentfileServices.Value.GetReplaceGraduateNo(ReplaceGraduateNo,Userid);
- if (isexistReplaceGraduateNo != null)
- {
- return base.Json("保存失败,补证号已经存在,请重新输入。");
- }
- }
- userInfo = StudentfileServices.Value.GetStudenter(Userid).Sys_User;
- if (userNo == userInfo)
- {
- return base.Json("成功");
- }
- else
- {
- if (userNo != null)
- {
- return base.Json("保存失败,学生号已经存在,请重新输入!");
- }
- }
- }
- else
- {
- if (userNo != null)
- {
- return base.Json("保存失败,学生号已经存在,请重新输入!");
- }
- }
- }
-
- if (Userid.HasValue && Userid != Guid.Empty)
- {
- userInfo = StudentfileServices.Value.GetStudenter(Userid).Sys_User;
- if (userInfo == null)
- {
- return base.Json("保存失败,未能找到相对应的数据!");
- }
- }
- return base.Json("成功");
- }
- /// <summary>
- /// 计算毕业日期
- /// </summary>
- /// <returns></returns>
- public ActionResult GetPlanningGraduateDate(Guid? GradeMajorID)
- {
- string planningGraduateDate = string.Empty;
- //var schoolyear = schoolYearServices.Value.GetSchoolYear(schoolYearID);
- //if (schoolyear != null)
- //{
- // DateTime dtime = PlanningGraduateDateHelper.GetPlanningGraduateDate(schoolyear);
- // planningGraduateDate = dtime.ToString("yyyy-MM-dd");
- //}
- //if (GradeMajorID.HasValue)
- //{
- // planningGraduateDate = StudentfileServices.Value.ReckonPlanningGraduateDate((Guid)GradeMajorID).Value.ToString("yyyy-MM-dd") + "";
- //}
- if (GradeMajorID.HasValue)
- {
- string PlanningGraduate = StudentfileServices.Value.GetPlanningGraduate((Guid)GradeMajorID);
- //planningGraduateDate = StudentfileServices.Value.GetPlanningGraduate((Guid)GradeMajorID).Value.ToString("yyyy-MM-dd") + "";
- }
- return base.Json(planningGraduateDate);
- }
- public ActionResult StudentProofReport(string LoginID)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var dataRange = StudentfileServices.Value.GetDataRange();
- ViewBag.DataRange = dataRange;
- ViewBag.UserID = curUser.UserID.ToString();
- return View();
- }
- [HttpGet]
- public ActionResult ExportPictures(string selectedIDs)
- {
- ViewBag.selectedID = selectedIDs;
- return View();
- }
- [HttpPost]
- public ActionResult ExportPictures(QueryParamsModel pararms, string ExportPictureType, string windowsssss)
- {
- try
- {
- string WindowStr = Request.UrlReferrer.ToString();
- int IndexofID = WindowStr.LastIndexOf("=");
- WindowStr = WindowStr.Remove(0,IndexofID+1);
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var campusID = Request.Form["ddlSchoolArea"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlSchoolArea"].ParseStrTo<int>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- var learningformID = Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>();
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var inSchoolStatusID = Request.Form["InSchoolStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["InSchoolStatusDictionaryDropDown"].ParseStrTo<int>();
- var generalPurposeID = Request.Form["GeneralPurposeDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["GeneralPurposeDictionaryDropDown"].ParseStrTo<int>();
- var isPhotos = Request.Form["YesOrNoStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["YesOrNoStatusDictionaryDropDown"].ParseStrTo<int>();//是否有照片
- var isDream = Request.Form["YesOrNoStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["YesOrNoStatus"].ParseStrTo<int>();//是否圆梦计划
- var planningGraduateDate = "";
- //Request.Form["PlanningGraduateDropDown"].ToString();
- var LearnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var education = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var reportStatusID = Request.Form["ReportStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ReportStatusDictionaryDropDown"].ParseStrTo<int>();
- var selectedIDs = Request.Form["SelectedIDs"];
- //WebClient conn = new WebClient();
- ExportPictureType = "IDNumberToPicture";
- List<StudentsView> studentList = new List<StudentsView>();
- if (!string.IsNullOrEmpty(selectedIDs))
- {
- var selectedIDList = selectedIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- studentList = this.StudentfileServices.Value.GetStudentViewListByIDList(selectedIDList).ToList();
- }
- else
- {
- studentList = this.StudentfileServices.Value.GetStudentViewList(configuretView, campusID, collegeID, yearID, standardID,
- learningformID, classmajorID, generalPurposeID, inSchoolStatusID, isPhotos, isDream, planningGraduateDate, LearnSystem, education, reportStatusID,null).ToList();
- }
- var remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- {
- FileName = x.LoginID + Path.GetExtension(x.PhotoUrl.Trim()),
- RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- }).ToList();
- if (ExportPictureType == "IDNumberToPicture")
- {
- remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- {
- FileName = x.IDNumber + Path.GetExtension(x.PhotoUrl.Trim()),
- RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- }).ToList();
- }
- if (ExportPictureType == "ExamineeNumToPicture")
- {
- remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- {
- FileName = x.ExamineeNum + Path.GetExtension(x.PhotoUrl.Trim()),
- RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- }).ToList();
- }
- if (ExportPictureType == "LoginIDandUserNameToPicture")
- {
- remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- {
- FileName = x.LoginID + x.UserName + x.MicroMsgNo + x.Mobile + Path.GetExtension(x.PhotoUrl.Trim()),
- RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- }).ToList();
- }
- if (remoteFileList.Count > 0)
- {
- var zipFileStream = FileUploadHelper.DownLoadFiles(Guid.NewGuid().ToString(), "学生相片", remoteFileList);
- return File(zipFileStream, System.Net.Mime.MediaTypeNames.Application.Zip, "学生相片.zip");
- }
-
- else
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "没有相片可导出!",
- url = Url.Content("~/Students/List").AddMenuParameter()
- });
- }
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = ex.Message,
- url = Url.Content("~/Students/List").AddMenuParameter()
- });
- //string mge = ex.Message;
- //return base.Json("导出失败,原因:" + mge + "!");
- }
- }
- [HttpPost]
- public ActionResult GetDataRange()
- {
- return Json(StudentfileServices.Value.GetDataRange());
- }
- [HttpPost]
- public ActionResult StudentOnlyInSchool(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- return base.Json(StudentfileServices.Value.GetStudentOnlyInSchool(configuretView, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <param name="inSchoolStatus">在校状态</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult BatchSelectList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- //避开全选值
- var campusID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("cbgCollege");
- var education = pararms.getExtraInt("ddlEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlEducation");
- var yearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var standardID = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard");
- var learningformID = pararms.getExtraInt("ddlLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlLearningform");
- var classNum = pararms.getExtraInt("ddlClassNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlClassNum");
- var studentStatusID = pararms.getExtraInt("ddlStudentStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlStudentStatus");
- var isPhotos = pararms.getExtraInt("ddlHasPhoto") == DropdownList.SELECT_ALL ? null : (bool?)(pararms.getExtraInt("ddlHasPhoto") == (int)CF_YesOrNoStatus.Yes);//是否有照片
- var isOnlyGraduation = pararms.getExtraBool("chkOnlyGraduation");
- var isPreviousNotGraduated = pararms.getExtraBool("chkPreviousNotGraduated");
- return base.Json(StudentfileServices.Value.GetStudentUserViewList(configuretView, campusID, collegeID, education, yearID, standardID,
- learningformID, classNum, studentStatusID, isPhotos, isOnlyGraduation, isPreviousNotGraduated, (int)pararms.page, (int)pararms.rows));
- }
- public ActionResult Synchr()
- {
- return View();
- }
- [HttpPost]
- public ActionResult Synchr(Guid? collegeID, int? year, int? schoolAreaID, string selectedColumns)
- {
- List<string> selectedColumnList = selectedColumns.Split(',').Where(x => !string.IsNullOrEmpty(x)).ToList();
- try
- {
- StudentSynchServices.SynchrByCondition(collegeID, year, schoolAreaID, selectedColumnList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "同步成功。" });
- }
- catch (Exception ex)
- {
- string errorMessage = ex.Message;
- if (ex.InnerException != null)
- {
- errorMessage += ex.InnerException.Message;
- }
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "同步失败:" + errorMessage
- });
- }
- }
- }
- }
|