|
- 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
-
- }
- }
|