|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289 |
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using Learun.Util;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Web.Mvc;
- using Hangfire.Annotations;
- using Learun.Application.Base.SystemModule;
- using Newtonsoft.Json;
- using System.Data;
- using Learun.Application.WorkFlow;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创 建:超级管理员
- /// 日 期:2019-07-17 11:20
- /// 描 述:新生录取管理
- /// </summary>
- public class StuEnrollController : MvcControllerBase
- {
- private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL();
- private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
- private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult StudentStatus()
- {
- return View();
- }
- [HttpGet]
- public ActionResult AmountForm()
- {
- return View();
- }
- [HttpGet]
- public ActionResult CardPrint()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult Report()
- {
- return View();
- }
- [HttpGet]
- public ActionResult EnrollTypeForm()
- {
- return View();
- }
- [HttpGet]
- /// <summary>
- /// 是否饼状图
- /// </summary>
- /// <returns></returns>
- public ActionResult Peichart()
- {
- //是否报道
- string sql = $"SELECT COUNT(CASE WHEN IsReport=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsReport = 0 THEN 1 END) AS num2 FROM StuEnroll";
- var data = stuEnrollIBLL.Execute(sql);
- List<object> list2 = new List<object>();
- list2.Add(new
- {
- name = "报道人数",
- value = data.Rows[0]["num1"].ToString()
-
- });
- list2.Add(new
- {
- name = "未报道人数",
- value = data.Rows[0]["num2"].ToString()
-
- });
- var jsonData = new
- {
- rows = list2
- };
- //是否住宿
- string sql1 = $"SELECT COUNT(CASE WHEN IsCheckIn=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsCheckIn = 0 THEN 1 END) AS num2 FROM StuEnroll";
- var data1 = stuEnrollIBLL.Execute(sql);
- List<object> list3 = new List<object>();
- list3.Add(new
- {
- name = "住宿人数",
- value = data.Rows[0]["num1"].ToString()
-
- });
- list3.Add(new
- {
- name = "未住宿人数",
- value = data.Rows[0]["num2"].ToString()
-
- });
- var jsonData1 = new
- {
- rows = list3
- };
- ///是否资助
- string sql2 = $"SELECT COUNT(CASE WHEN IsSubsidize1=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsSubsidize1 = 0 THEN 1 END) AS num2 FROM StuEnroll";
- var data2 = stuEnrollIBLL.Execute(sql);
- List<object> list4 = new List<object>();
- list4.Add(new
- {
- name = "资助人数",
- value = data.Rows[0]["num1"].ToString()
-
- });
- list4.Add(new
- {
- name = "未资助人数",
- value = data.Rows[0]["num2"].ToString()
-
- });
- var jsonData2 = new
- {
- rows = list4
- };
- //是否军训
- string sql3 = $"SELECT COUNT(CASE WHEN IsMilitary=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsMilitary = 0 THEN 1 END) AS num2 FROM StuEnroll";
- var data3 = stuEnrollIBLL.Execute(sql);
- List<object> list5 = new List<object>();
- list5.Add(new
- {
- name = "军训人数",
- value = data.Rows[0]["num1"].ToString()
-
- });
- list5.Add(new
- {
- name = "未军训人数",
- value = data.Rows[0]["num2"].ToString()
-
- });
- var jsonData3 = new
- {
- rows = list5
- };
- //是否缴费
- string sql4 = $"SELECT COUNT(CASE WHEN IsPay=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsPay = 0 THEN 1 END) AS num2 FROM StuEnroll";
- var data4 = stuEnrollIBLL.Execute(sql);
- List<object> list6 = new List<object>();
- list6.Add(new
- {
- name = "缴费人数",
- value = data.Rows[0]["num1"].ToString()
-
- });
- list6.Add(new
- {
- name = "未缴费人数",
- value = data.Rows[0]["num2"].ToString()
-
- });
- var jsonData4 = new
- {
- rows = list6
- };
- return JsonResult(jsonData);
- }
-
-
-
- /// <summary>
- /// 是否住宿
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult CheckIn()
- {
- return View();
- }
-
- /// <summary>
- /// 是否住宿
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult PayAfter()
- {
- return View();
- }
- /// <summary>
- /// 是否资助
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IsHelp()
- {
- return View();
- }
- /// <summary>
- /// 完善资助信息
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IsHelpForm()
- {
- return View();
- }
-
- /// <summary>
- /// 资助变更
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult HelpChange()
- {
- return View();
- }
- /// <summary>
- /// 资助变更列表
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexHelpChange()
- {
- return View();
- }
- /// <summary>
- /// 新生学费管理
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult StuTuition()
- {
- return View();
- }
-
- /// <summary>
- /// 是否军训
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Military()
- {
- return View();
- }
-
- /// <summary>
- /// 是否军训
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IsPay()
- {
- return View();
- }
-
-
- [HttpGet]
- public ActionResult CheckInUrl()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult SubsidizeUrl()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult MilitaryUrl()
- {
- return View();
- }
-
- /// <summary>
- /// 是否拍照
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IsPhoto()
- {
- return View();
- }
-
- /// <summary>
- /// 是否领取军训服
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult GetCloth()
- {
- return View();
- }
-
- /// <summary>
- /// 是否量校服尺寸
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult GetClothSize()
- {
- return View();
- }
-
- /// <summary>
- /// 是否领取床上用品
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult GetArticles()
- {
- return View();
- }
-
-
-
-
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult FormView()
- {
- return View();
- }
-
- public ActionResult AllocationClass()
- {
- return View();
- }
-
- public ActionResult AllocationDormitory()
- {
- return View();
- }
-
- public ActionResult NewAllocationDormitory()
- {
- return View();
- }
-
- public ActionResult NewAllocationBed()
- {
- return View();
- }
- /// <summary>
- /// 招生统计
- /// </summary>
- /// <returns></returns>
- public ActionResult StatisticIndex()
- {
- return View();
- }
-
- #endregion
-
- #region 获取数据
-
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = stuEnrollIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="queryJson"></param>
- /// <param name="type">1:军训管理;2:学费管理</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetMilitaryStatistics(string queryJson,int type)
- {
- var result = stuEnrollIBLL.GetMilitaryStatistics(queryJson, type);
- return Success(result);
-
- }
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetDormitorys(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = stuEnrollIBLL.GetDormitorys(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
-
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetReportPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = stuEnrollIBLL.GetReportPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
-
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
- if (string.IsNullOrEmpty(StuEnrollData.CheckInUrl))
- {
- StuEnrollData.CheckInUrl = Guid.NewGuid().ToString();
-
- }
- if (string.IsNullOrEmpty(StuEnrollData.SubsidizeUrl))
- {
- StuEnrollData.SubsidizeUrl = Guid.NewGuid().ToString();
-
- }
- if (string.IsNullOrEmpty(StuEnrollData.MilitaryUrl))
- {
- StuEnrollData.MilitaryUrl = Guid.NewGuid().ToString();
-
- }
- var jsonData = new
- {
- StuEnroll = StuEnrollData,
- };
- return Success(jsonData);
- }
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult RealationPhoto()
- {
- var studentList = stuEnrollIBLL.AllStudent().ToList();
- foreach (var student in studentList)
- {
- if (string.IsNullOrEmpty(student.PhotoUrl))
- {
- student.PhotoUrl = Guid.NewGuid().ToString();
- stuEnrollIBLL.SaveEntity(student.StuId, student);
- }
-
- var annexEntity = annexesFileIBLL.GetEntityByFolderId(student.PhotoUrl);
- if (annexEntity == null)
- {
- annexEntity = new AnnexesFileEntity();
- annexEntity.Create();
- annexEntity.F_Id = Guid.NewGuid().ToString();
- }
-
-
- }
-
- return Success("");
- }
-
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetStuInfo(string stuId)
- {
- var result = stuEnrollIBLL.GetStuInfo(stuId);
- return Success(result);
- }
-
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetYearListByClass()
- {
- var classList = classInfoIBLL.GetAllClass().ToList();
- var result = classList.GroupBy(a => a.Grade).Select(m => m.Key).ToList();
- List<object> list = new List<object>();
- foreach (var item in result)
- {
- list.Add(new { year = item });
- }
-
- return Success(list);
- }
- /// <summary>
- /// 获取年级(最大)
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetYearListByMaxClass()
- {
- var classList = classInfoIBLL.GetAllClass().ToList();
- var grade = classList.OrderByDescending(x => x.Grade).Select(x => x.Grade).FirstOrDefault();
- return Success(grade);
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetStuDefaultInfo(string StuId)
- {
- var result = stuEnrollIBLL.GetStuDefaultInfo(StuId);
- return Success(result);
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetPaymentInfo()
- {
- var result = stuEnrollIBLL.GetPaymentInfo();
- return Success(result);
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetCheckInStatistics(string DeptNo, string MajorNo, string ClassNo)
- {
- var result = stuEnrollIBLL.GetCheckInStatistics(DeptNo, MajorNo, ClassNo);
- return Success(result);
-
- }
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetHelpStatistics(string DeptNo, string MajorNo, string ClassNo)
- {
- var result = stuEnrollIBLL.GetHelpStatistics(DeptNo, MajorNo, ClassNo);
- return Success(result);
-
- }
-
-
- /// <summary>
- /// 获取左侧树形数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetTreeNew()
- {
- var data = stuEnrollIBLL.GetTree();
- return Success(data);
- }
- /// <summary>
- /// 获取左侧树形数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetBedTree(string classNo, string gender)
- {
- var data = stuEnrollIBLL.GetBedTree(classNo, gender);
- return Success(data);
- }
-
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormDataByProcessId(string processId)
- {
- StuEnrollEntity data = stuEnrollIBLL.GetEntityByProcessId(processId);
- var jsonData = new
- {
- StuEnroll = data,
- };
- return Success(jsonData);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- stuEnrollIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string strEntity)
- {
- StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
- stuEnrollIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
- /// <summary>
- /// 保存实收金额
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveActualPayAmount(string keyValue, string strEntity)
- {
- StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
-
- var newEntity = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
- newEntity.ActualPayAmount = entity.ActualPayAmount;
- stuEnrollIBLL.SaveEntity(keyValue, newEntity);
- return Success("保存成功!");
- }
-
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult EditEnrollType(string stuIds, string enrollType)
- {
-
- if (!string.IsNullOrEmpty(stuIds))
- {
-
- stuEnrollIBLL.EditEnrollType(stuIds, enrollType);
-
- }
- return Success("保存成功!");
- }
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllocationClass(string classNo, string dataJson)
- {
- stuEnrollIBLL.AllocationClass(classNo, dataJson);
- return Success("分配成功!");
- }
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult NewAllocationDormitory(string classNo, string dataJson)
- {
- stuEnrollIBLL.NewAllocationDormitory(classNo, dataJson);
- return Success("分配成功!");
- }
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllocationDormitory(string dormitoryNo, string stuId, string dormitoryName)
- {
- stuEnrollIBLL.AllocationDormiotry(dormitoryNo, stuId, dormitoryName);
- return Success("分配成功!");
-
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult SyncDept()
- {
- stuEnrollIBLL.SyncDept();
- return Success("同步成功");
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult SyncMajor()
- {
- stuEnrollIBLL.SyncMajor();
- return Success("同步成功");
- }
-
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult Sign(string stuId, bool status)
- {
- var result = stuEnrollIBLL.Sign(stuId, status);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
-
- }
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllReport()
- {
- stuEnrollIBLL.AllReport();
- return Success("操作成功");
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllPhoto()
- {
- stuEnrollIBLL.AllPhoto();
- return Success("操作成功");
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllGetCloth()
- {
- stuEnrollIBLL.AllGetCloth();
- return Success("操作成功");
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllGetSize()
- {
- stuEnrollIBLL.AllGetSize();
- return Success("操作成功");
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllGetArticle()
- {
- stuEnrollIBLL.AllGetArticle();
- return Success("操作成功");
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult Report(string stuId, bool status)
- {
- var result = stuEnrollIBLL.Report(stuId, status);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
-
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult Stay(string stuId, bool status, bool payAfter = false)
- {
- var result = stuEnrollIBLL.Stay(stuId, status, payAfter);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
-
- /// <summary>
- /// 生成帐号
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult Generate()
- {
- stuEnrollIBLL.GenerateAccout();
- return Success("生成成功!");
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllStay()
- {
- stuEnrollIBLL.AllStay();
- return Success("操作成功");
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult Help(string stuId, bool status, bool payAfter = false)
- {
- var result = stuEnrollIBLL.Help(stuId, status, payAfter);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllHelp()
- {
- stuEnrollIBLL.AllHelp();
- return Success("操作成功");
- }
-
- /// <summary>
- /// 学生学费管理-确认资助
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult Support(string keyValue)
- {
- var stuIds = "";
- if (keyValue.Contains(","))
- {
- var keyValueArr = keyValue.Split(',');
- stuIds = string.Join("','", keyValueArr);
- }
- else
- {
- stuIds = keyValue;
- }
- stuEnrollIBLL.Support(stuIds);
- return Success("操作成功");
- }
-
- /// <summary>
- /// 学生资助管理-完善资助信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult SupplySupport(string keyValue, string strEntity)
- {
- StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
- stuEnrollIBLL.SupplySupport(keyValue, entity);
- return Success("保存成功!");
- }
-
- /// <summary>
- /// 提交资助变更
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult ChangeStatusById(string keyValue, string processId)
- {
- stuEnrollIBLL.ChangeStatusById(keyValue, 1, processId);
- return Success("操作成功!");
- }
-
- /// <summary>
- /// 学生资助管理-资助变更
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult SupportChange(string keyValue, string strEntity)
- {
- StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
- stuEnrollIBLL.SupportChange(keyValue, entity);
- return Success("保存成功!");
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult Military(string stuId, bool status, bool payAfter = false)
- {
- var result = stuEnrollIBLL.Military(stuId, status, payAfter);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult AllMilitary()
- {
- stuEnrollIBLL.AllMilitary();
- return Success("成功");
- }
-
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult IsPay(string stuId, bool status)
- {
- var result = stuEnrollIBLL.IsPay(stuId, status);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
-
-
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult IsPhoto(string stuId, string base64url)
- {
- var loginuser = LoginUserInfo.Get();
- //头像处理
- var folderId = Guid.NewGuid().ToString();
-
- string filePath = Config.GetValue("AnnexesFile");
- string uploadDate = DateTime.Now.ToString("yyyyMMdd");
- string FileEextension = ".png";
- string fileGuid = Guid.NewGuid().ToString();
-
- string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, loginuser.account, uploadDate, fileGuid, FileEextension);
-
- //创建文件夹
- string path = Path.GetDirectoryName(virtualPath);
- Directory.CreateDirectory(path);
- AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity();
- if (!System.IO.File.Exists(virtualPath))
- {
- byte[] bytes = Convert.FromBase64String(base64url.Replace("data:image/png;base64,", ""));
- FileInfo file = new FileInfo(virtualPath);
- FileStream fs = file.Create();
- fs.Write(bytes, 0, bytes.Length);
- fs.Close();
-
- //文件信息写入数据库
- fileAnnexesEntity.F_Id = fileGuid;
- fileAnnexesEntity.F_FileName = "userphoto.png";
- fileAnnexesEntity.F_FilePath = virtualPath;
- fileAnnexesEntity.F_FileSize = bytes.Length.ToString();
- fileAnnexesEntity.F_FileExtensions = FileEextension;
- fileAnnexesEntity.F_FileType = FileEextension.Replace(".", "");
- fileAnnexesEntity.F_CreateUserId = loginuser.userId;
- fileAnnexesEntity.F_CreateUserName = loginuser.realName;
- annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity);
- }
- var result = stuEnrollIBLL.IsPhoto(stuId, true, fileGuid);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetCloth(string stuId, bool status)
- {
- var result = stuEnrollIBLL.GetCloth(stuId, status);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetClothSize(string stuId, bool status)
- {
- var result = stuEnrollIBLL.GetClothSize(stuId, status);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetArticles(string stuId, bool status)
- {
- var result = stuEnrollIBLL.GetArticles(stuId, status);
- if (result.Item1)
- {
- return Success(result.Item2);
- }
- else
- {
- return Fail(result.Item2);
- }
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult GetMoney()
- {
- stuEnrollIBLL.GetMoney();
- return Success("操作成功");
- }
- /// <summary>
- /// 下载文件
- /// </summary>
- /// <param name="fileId">文件id</param>
- /// <returns></returns>
- [HttpPost]
- public void DownWrod()
- {
- ExcelHelper.aaaaa();
- }
-
- /// <summary>
- /// 关联照片
- /// </summary>
- /// <returns></returns>
- public ActionResult RelationPhoto()
- {
-
- stuEnrollIBLL.RelationPhoto();
- return Success("关联成功");
- }
-
-
- /// <summary>
- /// 同步学生数据
- /// </summary>
- /// <returns></returns>
- public ActionResult Synchronization()
- {
- stuEnrollIBLL.Synchronization();
- return Success("同步成功");
- }
-
-
-
- /// <summary>
- /// 招生统计数据
- /// </summary>
- /// <param name="queryJson"></param>
- /// <returns></returns>
- public ActionResult GetStatisticData(string queryJson)
- {
- var data = stuEnrollIBLL.GetList(queryJson);
- //是否报到
- var datagroupIsReport = data.OrderByDescending(x => x.IsReport).GroupBy(x => x.IsReport).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "报到" : "未报到") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsReport = new List<string>();
- var seriesDataIsReport = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsReport)
- {
- legendDataIsReport.Add(item.status);
- seriesDataIsReport.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //是否住宿
- var datagroupIsCheckIn = data.OrderByDescending(x => x.IsCheckIn).GroupBy(x => x.IsCheckIn).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "住宿" : "走读") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsCheckIn = new List<string>();
- var seriesDataIsCheckIn = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsCheckIn)
- {
- legendDataIsCheckIn.Add(item.status);
- seriesDataIsCheckIn.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //是否资助
- var datagroupIsSubsidize1 = data.OrderByDescending(x => x.IsSubsidize1).GroupBy(x => x.IsSubsidize1).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "资助" : "不资助") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsSubsidize1 = new List<string>();
- var seriesDataIsSubsidize1 = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsSubsidize1)
- {
- legendDataIsSubsidize1.Add(item.status);
- seriesDataIsSubsidize1.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //是否军训
- var datagroupIsMilitary = data.OrderByDescending(x => x.IsMilitary).GroupBy(x => x.IsMilitary).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "军训" : "不军训") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsMilitary = new List<string>();
- var seriesDataIsMilitary = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsMilitary)
- {
- legendDataIsMilitary.Add(item.status);
- seriesDataIsMilitary.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //缴费状态
- var datagroupIsPay = data.OrderByDescending(x => x.IsPay).GroupBy(x => x.IsPay).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "缴费" : "未缴费") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsPay = new List<string>();
- var seriesDataIsPay = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsPay)
- {
- legendDataIsPay.Add(item.status);
- seriesDataIsPay.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //拍照
- var datagroupIsMug = data.OrderByDescending(x => x.IsMug).GroupBy(x => x.IsMug).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "已拍照" : "未拍照") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsMug = new List<string>();
- var seriesDataIsMug = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsMug)
- {
- legendDataIsMug.Add(item.status);
- seriesDataIsMug.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //领取军训服
- var datagroupIsTakeCloths = data.OrderByDescending(x => x.IsTakeCloths).GroupBy(x => x.IsTakeCloths).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsTakeCloths = new List<string>();
- var seriesDataIsTakeCloths = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsTakeCloths)
- {
- legendDataIsTakeCloths.Add(item.status);
- seriesDataIsTakeCloths.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //量取校服尺寸
- var datagroupIsQuantity = data.OrderByDescending(x => x.IsQuantity).GroupBy(x => x.IsQuantity).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "已量" : "未量") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsQuantity = new List<string>();
- var seriesDataIsQuantity = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsQuantity)
- {
- legendDataIsQuantity.Add(item.status);
- seriesDataIsQuantity.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
- //领取床上用品
- var datagroupIsGetBeddingArticle = data.OrderByDescending(x => x.IsGetBeddingArticle).GroupBy(x => x.IsGetBeddingArticle).Select(x => new
- {
- status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理",
- count = x.Select(y => y.StuId).Count()
- });
- var legendDataIsGetBeddingArticle = new List<string>();
- var seriesDataIsGetBeddingArticle = new List<WfSchemeReportModelOfPie>();
- foreach (var item in datagroupIsGetBeddingArticle)
- {
- legendDataIsGetBeddingArticle.Add(item.status);
- seriesDataIsGetBeddingArticle.Add(new WfSchemeReportModelOfPie()
- {
- value = item.count,
- name = item.status
- });
- }
-
- var jsonData = new
- {
- legendDataIsReport = legendDataIsReport,
- seriesDataIsReport = seriesDataIsReport,
- legendDataIsCheckIn = legendDataIsCheckIn,
- seriesDataIsCheckIn = seriesDataIsCheckIn,
- legendDataIsSubsidize1 = legendDataIsSubsidize1,
- seriesDataIsSubsidize1 = seriesDataIsSubsidize1,
- legendDataIsMilitary = legendDataIsMilitary,
- seriesDataIsMilitary = seriesDataIsMilitary,
- legendDataIsPay = legendDataIsPay,
- seriesDataIsPay = seriesDataIsPay,
- legendDataIsMug = legendDataIsMug,
- seriesDataIsMug = seriesDataIsMug,
- legendDataIsTakeCloths = legendDataIsTakeCloths,
- seriesDataIsTakeCloths = seriesDataIsTakeCloths,
- legendDataIsQuantity = legendDataIsQuantity,
- seriesDataIsQuantity = seriesDataIsQuantity,
- legendDataIsGetBeddingArticle = legendDataIsGetBeddingArticle,
- seriesDataIsGetBeddingArticle = seriesDataIsGetBeddingArticle
- };
-
- return Success(jsonData);
- }
-
-
- #endregion
-
- }
- }
|