|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- using System;
- using Learun.Util;
- using System.Data;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using System.Web.Mvc;
- using System.Collections.Generic;
- using System.Linq;
- using Learun.Application.Organization;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
- /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- /// 创 建:超级管理员
- /// 日 期:2021-12-16 10:14
- /// 描 述:长阳迎新
- /// </summary>
- public class StuVolunteerController : MvcControllerBase
- {
- private StuVolunteerIBLL stuVolunteerIBLL = new StuVolunteerBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 标注页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexLabel()
- {
- return View();
- }
-
- /// <summary>
- /// 志愿表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormSchool()
- {
- return View();
- }
-
- /// <summary>
- /// 志愿表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexAccount()
- {
- return View();
- }
-
- /// <summary>
- /// 分班页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexDivide()
- {
- return View();
- }
-
- /// <summary>
- /// 录取
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexEnroll()
- {
- return View();
- }
-
- /// <summary>
- /// 生成二维码
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult QRCode()
- {
- return View();
- }
- /// <summary>
- /// 分班--选择班级
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ClassForm()
- {
- return View();
- }
- /// <summary>
- /// 生成学籍
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexGenerate()
- {
- return View();
- }
- /// <summary>
- /// 生成学籍--编辑
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormGenerate()
- {
- return View();
- }
-
- /// <summary>
- /// 专业注册
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexMajor()
- {
- return View();
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormMajor()
- {
- return View();
- }
-
- /// <summary>
- /// 专业
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult MajorIndex()
- {
- return View();
- }
- #endregion
-
- #region 获取数据
-
- /// <summary>
- /// 获取页面显示列表数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = stuVolunteerIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var StuVolunteerData = stuVolunteerIBLL.GetStuVolunteerEntity(keyValue);
- var jsonData = new
- {
- StuVolunteer = StuVolunteerData,
- };
- return Success(jsonData);
- }
-
- /// <summary>
- /// 获取专业统计
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetMajorStatistics(string queryJson)
- {
- var Data = stuVolunteerIBLL.GetMajorStatistics(queryJson);
- var list = Data.GroupBy(x => x.DeptNo).Select(x => new
- {
- DeptNo = x.FirstOrDefault()?.DeptNo,
- MajorNo = x.FirstOrDefault()?.MajorNo,
- Grade = x.FirstOrDefault()?.Grade,
- ZRNum = x.Count(),
- EnrollNum = x.Count(s => s.IsEnroll == true),
- WillNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true),
- ManNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true && s.Sex == "1"),
- WoManNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true && s.Sex == "0")
- }).OrderBy(x => x.DeptNo).ThenBy(x=>x.MajorNo).ThenBy(x => x.Grade);
- return Success(list);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- stuVolunteerIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="strEntity">实体</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string strEntity)
- {
- StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
- var userInfo = LoginUserInfo.Get();
- if (string.IsNullOrEmpty(keyValue))
- {
- entity.CreateUser = userInfo.realName;
- entity.CreateTime = DateTime.Now;
- }
- entity.UpdateUser = userInfo.realName;
- entity.UpdateTime = DateTime.Now;
- var dWList =
- stuVolunteerIBLL.GetRepetitions(entity.H_SchoolNo, entity.ApplyNo, entity.CardNo).Where(x => x.ID != keyValue);
- if (dWList.Count() > 0)
- {
- return Fail("保存失败,请检查数据有重复项");
- }
- stuVolunteerIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
-
- /// <summary>
- /// 分班
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="ClassNo">班级</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveClassForm(string keyValue, string ClassNo)
- {
- stuVolunteerIBLL.SaveClassForm(keyValue, ClassNo);
- return Success("保存成功!");
- }
- /// <summary>
- /// 分班-审核
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="ClassStatus">审核状态</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult CheckForm(string keyValue, int ClassStatus)
- {
- stuVolunteerIBLL.CheckForm(keyValue, ClassStatus);
- return Success("审核成功!");
- }
- /// <summary>
- /// 生成学籍
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult GenerateStu()
- {
- stuVolunteerIBLL.GenerateStu();
- return Success("生成成功!");
- }
-
- #endregion
-
-
- #region 扩展数据
-
- /// <summary>
- /// 标注数据
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult LabelForm(string keyValue)
- {
- stuVolunteerIBLL.LabelEntity(keyValue);
- return Success("标注成功!");
- }
-
- /// <summary>
- /// 取消数据
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult CancelLabel(string keyValue)
- {
- stuVolunteerIBLL.CancelLabel(keyValue);
- return Success("取消成功!");
- }
-
- /// <summary>
- /// 标注数据
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult JoinForm(string keyValue)
- {
- stuVolunteerIBLL.JoinEntity(keyValue);
- return Success("标注成功!");
- }
-
- /// <summary>
- /// 取消数据
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult CanJoinForm(string keyValue)
- {
- stuVolunteerIBLL.CanJoin(keyValue);
- return Success("取消成功!");
- }
-
-
- /// <summary>
- /// 填报志愿
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult IsOurSchool(string keyValue, string strEntity)
- {
- StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
- stuVolunteerIBLL.IsOurSchool(keyValue, entity);
- return Success("填报成功!");
- }
-
- /// <summary>
- /// 录取学生
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult EnrollForm(string keyValue)
- {
- stuVolunteerIBLL.EnrollEntity(keyValue);
- return Success("录取成功!");
- }
-
- /// <summary>
- /// 取消录取学生
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult CancelForm(string keyValue)
- {
- stuVolunteerIBLL.CancelEntity(keyValue);
- return Success("取消成功!");
- }
-
- /// <summary>
- /// 提交选择专业
- /// </summary>
- /// <param name="keyValue"></param>
- /// <param name="strEntity"></param>
- /// <returns></returns>
- public ActionResult SubmitForm(string keyValue, string strEntity)
- {
- StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
-
- stuVolunteerIBLL.SaveEntity(keyValue, entity);
- return Success("提交成功!");
- }
-
- /// <summary>
- /// 专业:审核/去审核
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult MajorForm(string keyValue, int MajorStatus)
- {
- stuVolunteerIBLL.MajorForm(keyValue, MajorStatus);
- return Success("录取成功!");
- }
-
- /// <summary>
- /// 注册专业
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="ClassStatus">审核状态</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult SaveMajorForm(string keyValue, string MajorNo)
- {
- stuVolunteerIBLL.SaveMajorForm(keyValue, MajorNo);
- return Success("注册成功!");
- }
- #endregion
- }
- }
|