You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

435 lines
12 KiB

  1. using System;
  2. using Learun.Util;
  3. using System.Data;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using System.Web.Mvc;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using Learun.Application.Organization;
  9. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  13. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  14. /// 创 建:超级管理员
  15. /// 日 期:2021-12-16 10:14
  16. /// 描 述:长阳迎新
  17. /// </summary>
  18. public class StuVolunteerController : MvcControllerBase
  19. {
  20. private StuVolunteerIBLL stuVolunteerIBLL = new StuVolunteerBLL();
  21. #region 视图功能
  22. /// <summary>
  23. /// 主页面
  24. /// <summary>
  25. /// <returns></returns>
  26. [HttpGet]
  27. public ActionResult Index()
  28. {
  29. return View();
  30. }
  31. /// <summary>
  32. /// 表单页
  33. /// <summary>
  34. /// <returns></returns>
  35. [HttpGet]
  36. public ActionResult Form()
  37. {
  38. return View();
  39. }
  40. /// <summary>
  41. /// 标注页面
  42. /// <summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult IndexLabel()
  46. {
  47. return View();
  48. }
  49. /// <summary>
  50. /// 志愿表单页
  51. /// <summary>
  52. /// <returns></returns>
  53. [HttpGet]
  54. public ActionResult FormSchool()
  55. {
  56. return View();
  57. }
  58. /// <summary>
  59. /// 志愿表单页
  60. /// <summary>
  61. /// <returns></returns>
  62. [HttpGet]
  63. public ActionResult IndexAccount()
  64. {
  65. return View();
  66. }
  67. /// <summary>
  68. /// 分班页面
  69. /// <summary>
  70. /// <returns></returns>
  71. [HttpGet]
  72. public ActionResult IndexDivide()
  73. {
  74. return View();
  75. }
  76. /// <summary>
  77. /// 录取
  78. /// <summary>
  79. /// <returns></returns>
  80. [HttpGet]
  81. public ActionResult IndexEnroll()
  82. {
  83. return View();
  84. }
  85. /// <summary>
  86. /// 生成二维码
  87. /// <summary>
  88. /// <returns></returns>
  89. [HttpGet]
  90. public ActionResult QRCode()
  91. {
  92. return View();
  93. }
  94. /// <summary>
  95. /// 分班--选择班级
  96. /// <summary>
  97. /// <returns></returns>
  98. [HttpGet]
  99. public ActionResult ClassForm()
  100. {
  101. return View();
  102. }
  103. /// <summary>
  104. /// 生成学籍
  105. /// <summary>
  106. /// <returns></returns>
  107. [HttpGet]
  108. public ActionResult IndexGenerate()
  109. {
  110. return View();
  111. }
  112. /// <summary>
  113. /// 生成学籍--编辑
  114. /// <summary>
  115. /// <returns></returns>
  116. [HttpGet]
  117. public ActionResult FormGenerate()
  118. {
  119. return View();
  120. }
  121. /// <summary>
  122. /// 专业注册
  123. /// </summary>
  124. /// <returns></returns>
  125. [HttpGet]
  126. public ActionResult IndexMajor()
  127. {
  128. return View();
  129. }
  130. /// <summary>
  131. ///
  132. /// </summary>
  133. /// <returns></returns>
  134. [HttpGet]
  135. public ActionResult FormMajor()
  136. {
  137. return View();
  138. }
  139. /// <summary>
  140. /// 专业
  141. /// </summary>
  142. /// <returns></returns>
  143. [HttpGet]
  144. public ActionResult MajorIndex()
  145. {
  146. return View();
  147. }
  148. #endregion
  149. #region 获取数据
  150. /// <summary>
  151. /// 获取页面显示列表数据
  152. /// </summary>
  153. /// <param name="pagination">分页参数</param>
  154. /// <param name="queryJson">查询参数</param>
  155. /// <returns></returns>
  156. [HttpGet]
  157. [AjaxOnly]
  158. public ActionResult GetPageList(string pagination, string queryJson)
  159. {
  160. Pagination paginationobj = pagination.ToObject<Pagination>();
  161. var data = stuVolunteerIBLL.GetPageList(paginationobj, queryJson);
  162. var jsonData = new
  163. {
  164. rows = data,
  165. total = paginationobj.total,
  166. page = paginationobj.page,
  167. records = paginationobj.records
  168. };
  169. return Success(jsonData);
  170. }
  171. /// <summary>
  172. /// 获取表单数据
  173. /// </summary>
  174. /// <param name="keyValue">主键</param>
  175. /// <returns></returns>
  176. [HttpGet]
  177. [AjaxOnly]
  178. public ActionResult GetFormData(string keyValue)
  179. {
  180. var StuVolunteerData = stuVolunteerIBLL.GetStuVolunteerEntity(keyValue);
  181. var jsonData = new
  182. {
  183. StuVolunteer = StuVolunteerData,
  184. };
  185. return Success(jsonData);
  186. }
  187. /// <summary>
  188. /// 获取专业统计
  189. /// </summary>
  190. /// <param name="keyValue"></param>
  191. /// <returns></returns>
  192. [HttpGet]
  193. [AjaxOnly]
  194. public ActionResult GetMajorStatistics(string queryJson)
  195. {
  196. var Data = stuVolunteerIBLL.GetMajorStatistics(queryJson);
  197. var list = Data.GroupBy(x => x.DeptNo).Select(x => new
  198. {
  199. DeptNo = x.FirstOrDefault()?.DeptNo,
  200. MajorNo = x.FirstOrDefault()?.MajorNo,
  201. Grade = x.FirstOrDefault()?.Grade,
  202. ZRNum = x.Count(),
  203. EnrollNum = x.Count(s => s.IsEnroll == true),
  204. WillNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true),
  205. ManNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true && s.Sex == "1"),
  206. WoManNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true && s.Sex == "0")
  207. }).OrderBy(x => x.DeptNo).ThenBy(x=>x.MajorNo).ThenBy(x => x.Grade);
  208. return Success(list);
  209. }
  210. #endregion
  211. #region 提交数据
  212. /// <summary>
  213. /// 删除实体数据
  214. /// </summary>
  215. /// <param name="keyValue">主键</param>
  216. /// <returns></returns>
  217. [HttpPost]
  218. [AjaxOnly]
  219. public ActionResult DeleteForm(string keyValue)
  220. {
  221. stuVolunteerIBLL.DeleteEntity(keyValue);
  222. return Success("删除成功!");
  223. }
  224. /// <summary>
  225. /// 保存实体数据(新增、修改)
  226. /// </summary>
  227. /// <param name="keyValue">主键</param>
  228. /// <param name="strEntity">实体</param>
  229. /// <returns></returns>
  230. [HttpPost]
  231. [ValidateAntiForgeryToken]
  232. [AjaxOnly]
  233. public ActionResult SaveForm(string keyValue, string strEntity)
  234. {
  235. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  236. var userInfo = LoginUserInfo.Get();
  237. if (string.IsNullOrEmpty(keyValue))
  238. {
  239. entity.CreateUser = userInfo.realName;
  240. entity.CreateTime = DateTime.Now;
  241. }
  242. entity.UpdateUser = userInfo.realName;
  243. entity.UpdateTime = DateTime.Now;
  244. var dWList =
  245. stuVolunteerIBLL.GetRepetitions(entity.H_SchoolNo, entity.ApplyNo, entity.CardNo).Where(x => x.ID != keyValue);
  246. if (dWList.Count() > 0)
  247. {
  248. return Fail("保存失败,请检查数据有重复项");
  249. }
  250. stuVolunteerIBLL.SaveEntity(keyValue, entity);
  251. return Success("保存成功!");
  252. }
  253. /// <summary>
  254. /// 分班
  255. /// </summary>
  256. /// <param name="keyValue">主键</param>
  257. /// <param name="ClassNo">班级</param>
  258. /// <returns></returns>
  259. [HttpPost]
  260. [ValidateAntiForgeryToken]
  261. [AjaxOnly]
  262. public ActionResult SaveClassForm(string keyValue, string ClassNo)
  263. {
  264. stuVolunteerIBLL.SaveClassForm(keyValue, ClassNo);
  265. return Success("保存成功!");
  266. }
  267. /// <summary>
  268. /// 分班-审核
  269. /// </summary>
  270. /// <param name="keyValue">主键</param>
  271. /// <param name="ClassStatus">审核状态</param>
  272. /// <returns></returns>
  273. [HttpPost]
  274. [AjaxOnly]
  275. public ActionResult CheckForm(string keyValue, int ClassStatus)
  276. {
  277. stuVolunteerIBLL.CheckForm(keyValue, ClassStatus);
  278. return Success("审核成功!");
  279. }
  280. /// <summary>
  281. /// 生成学籍
  282. /// </summary>
  283. /// <returns></returns>
  284. [HttpPost]
  285. [AjaxOnly]
  286. public ActionResult GenerateStu()
  287. {
  288. stuVolunteerIBLL.GenerateStu();
  289. return Success("生成成功!");
  290. }
  291. #endregion
  292. #region 扩展数据
  293. /// <summary>
  294. /// 标注数据
  295. /// </summary>
  296. /// <param name="keyValue"></param>
  297. /// <returns></returns>
  298. public ActionResult LabelForm(string keyValue)
  299. {
  300. stuVolunteerIBLL.LabelEntity(keyValue);
  301. return Success("标注成功!");
  302. }
  303. /// <summary>
  304. /// 取消数据
  305. /// </summary>
  306. /// <param name="keyValue"></param>
  307. /// <returns></returns>
  308. public ActionResult CancelLabel(string keyValue)
  309. {
  310. stuVolunteerIBLL.CancelLabel(keyValue);
  311. return Success("取消成功!");
  312. }
  313. /// <summary>
  314. /// 标注数据
  315. /// </summary>
  316. /// <param name="keyValue"></param>
  317. /// <returns></returns>
  318. public ActionResult JoinForm(string keyValue)
  319. {
  320. stuVolunteerIBLL.JoinEntity(keyValue);
  321. return Success("标注成功!");
  322. }
  323. /// <summary>
  324. /// 取消数据
  325. /// </summary>
  326. /// <param name="keyValue"></param>
  327. /// <returns></returns>
  328. public ActionResult CanJoinForm(string keyValue)
  329. {
  330. stuVolunteerIBLL.CanJoin(keyValue);
  331. return Success("取消成功!");
  332. }
  333. /// <summary>
  334. /// 填报志愿
  335. /// </summary>
  336. /// <param name="keyValue"></param>
  337. /// <returns></returns>
  338. public ActionResult IsOurSchool(string keyValue, string strEntity)
  339. {
  340. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  341. stuVolunteerIBLL.IsOurSchool(keyValue, entity);
  342. return Success("填报成功!");
  343. }
  344. /// <summary>
  345. /// 录取学生
  346. /// </summary>
  347. /// <param name="keyValue"></param>
  348. /// <returns></returns>
  349. public ActionResult EnrollForm(string keyValue)
  350. {
  351. stuVolunteerIBLL.EnrollEntity(keyValue);
  352. return Success("录取成功!");
  353. }
  354. /// <summary>
  355. /// 取消录取学生
  356. /// </summary>
  357. /// <param name="keyValue"></param>
  358. /// <returns></returns>
  359. public ActionResult CancelForm(string keyValue)
  360. {
  361. stuVolunteerIBLL.CancelEntity(keyValue);
  362. return Success("取消成功!");
  363. }
  364. /// <summary>
  365. /// 提交选择专业
  366. /// </summary>
  367. /// <param name="keyValue"></param>
  368. /// <param name="strEntity"></param>
  369. /// <returns></returns>
  370. public ActionResult SubmitForm(string keyValue, string strEntity)
  371. {
  372. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  373. stuVolunteerIBLL.SaveEntity(keyValue, entity);
  374. return Success("提交成功!");
  375. }
  376. /// <summary>
  377. /// 专业:审核/去审核
  378. /// </summary>
  379. /// <param name="keyValue"></param>
  380. /// <returns></returns>
  381. public ActionResult MajorForm(string keyValue, int MajorStatus)
  382. {
  383. stuVolunteerIBLL.MajorForm(keyValue, MajorStatus);
  384. return Success("录取成功!");
  385. }
  386. /// <summary>
  387. /// 注册专业
  388. /// </summary>
  389. /// <param name="keyValue">主键</param>
  390. /// <param name="ClassStatus">审核状态</param>
  391. /// <returns></returns>
  392. [HttpPost]
  393. [AjaxOnly]
  394. public ActionResult SaveMajorForm(string keyValue, string MajorNo)
  395. {
  396. stuVolunteerIBLL.SaveMajorForm(keyValue, MajorNo);
  397. return Success("注册成功!");
  398. }
  399. #endregion
  400. }
  401. }