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.
 
 
 
 
 
 

461 lines
13 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 = stuVolunteerIBLL.GetRepetitions(entity.H_SchoolNo, entity.ApplyNo, entity.CardNo).FirstOrDefault();
  245. if (string.IsNullOrEmpty(keyValue))
  246. {
  247. if (dWList != null)
  248. {
  249. return Fail("保存失败,请检查数据有重复项");
  250. }
  251. }
  252. else
  253. {
  254. if (dWList != null && dWList.ID != keyValue)
  255. {
  256. return Fail("保存失败,请检查数据有重复项");
  257. }
  258. }
  259. stuVolunteerIBLL.SaveEntity(keyValue, entity);
  260. return Success("保存成功!");
  261. }
  262. public ActionResult Volunteer(string keyValue, string strEntity)
  263. {
  264. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  265. var save = stuVolunteerIBLL.GetStuVolunteerEntity(keyValue);
  266. var userInfo = LoginUserInfo.Get();
  267. entity.UpdateUser = userInfo.realName;
  268. entity.UpdateTime = DateTime.Now;
  269. var dWList = stuVolunteerIBLL.GetRepetitions(save.H_SchoolNo, save.ApplyNo, save.CardNo).Where(x => x.ID != keyValue);
  270. if (dWList.Count() > 0)
  271. {
  272. return Fail("保存失败,请检查数据有重复项");
  273. }
  274. stuVolunteerIBLL.SaveEntity(keyValue, entity);
  275. return Success("保存成功!");
  276. }
  277. /// <summary>
  278. /// 分班
  279. /// </summary>
  280. /// <param name="keyValue">主键</param>
  281. /// <param name="ClassNo">班级</param>
  282. /// <returns></returns>
  283. [HttpPost]
  284. [ValidateAntiForgeryToken]
  285. [AjaxOnly]
  286. public ActionResult SaveClassForm(string keyValue, string ClassNo)
  287. {
  288. stuVolunteerIBLL.SaveClassForm(keyValue, ClassNo);
  289. return Success("保存成功!");
  290. }
  291. /// <summary>
  292. /// 分班-审核
  293. /// </summary>
  294. /// <param name="keyValue">主键</param>
  295. /// <param name="ClassStatus">审核状态</param>
  296. /// <returns></returns>
  297. [HttpPost]
  298. [AjaxOnly]
  299. public ActionResult CheckForm(string keyValue, int ClassStatus)
  300. {
  301. stuVolunteerIBLL.CheckForm(keyValue, ClassStatus);
  302. return Success("审核成功!");
  303. }
  304. /// <summary>
  305. /// 生成学籍
  306. /// </summary>
  307. /// <returns></returns>
  308. [HttpPost]
  309. [AjaxOnly]
  310. public ActionResult GenerateStu()
  311. {
  312. stuVolunteerIBLL.GenerateStu();
  313. return Success("生成成功!");
  314. }
  315. #endregion
  316. #region 扩展数据
  317. /// <summary>
  318. /// 标注数据
  319. /// </summary>
  320. /// <param name="keyValue"></param>
  321. /// <returns></returns>
  322. public ActionResult LabelForm(string keyValue)
  323. {
  324. stuVolunteerIBLL.LabelEntity(keyValue);
  325. return Success("标注成功!");
  326. }
  327. /// <summary>
  328. /// 取消数据
  329. /// </summary>
  330. /// <param name="keyValue"></param>
  331. /// <returns></returns>
  332. public ActionResult CancelLabel(string keyValue)
  333. {
  334. stuVolunteerIBLL.CancelLabel(keyValue);
  335. return Success("取消成功!");
  336. }
  337. /// <summary>
  338. /// 标注数据
  339. /// </summary>
  340. /// <param name="keyValue"></param>
  341. /// <returns></returns>
  342. public ActionResult JoinForm(string keyValue)
  343. {
  344. stuVolunteerIBLL.JoinEntity(keyValue);
  345. return Success("标注成功!");
  346. }
  347. /// <summary>
  348. /// 取消数据
  349. /// </summary>
  350. /// <param name="keyValue"></param>
  351. /// <returns></returns>
  352. public ActionResult CanJoinForm(string keyValue)
  353. {
  354. stuVolunteerIBLL.CanJoin(keyValue);
  355. return Success("取消成功!");
  356. }
  357. /// <summary>
  358. /// 填报志愿
  359. /// </summary>
  360. /// <param name="keyValue"></param>
  361. /// <returns></returns>
  362. public ActionResult IsOurSchool(string keyValue, string strEntity)
  363. {
  364. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  365. stuVolunteerIBLL.IsOurSchool(keyValue, entity);
  366. return Success("填报成功!");
  367. }
  368. /// <summary>
  369. /// 录取学生
  370. /// </summary>
  371. /// <param name="keyValue"></param>
  372. /// <returns></returns>
  373. public ActionResult EnrollForm(string keyValue)
  374. {
  375. stuVolunteerIBLL.EnrollEntity(keyValue);
  376. return Success("录取成功!");
  377. }
  378. /// <summary>
  379. /// 取消录取学生
  380. /// </summary>
  381. /// <param name="keyValue"></param>
  382. /// <returns></returns>
  383. public ActionResult CancelForm(string keyValue)
  384. {
  385. stuVolunteerIBLL.CancelEntity(keyValue);
  386. return Success("取消成功!");
  387. }
  388. /// <summary>
  389. /// 提交选择专业
  390. /// </summary>
  391. /// <param name="keyValue"></param>
  392. /// <param name="strEntity"></param>
  393. /// <returns></returns>
  394. public ActionResult SubmitForm(string keyValue, string strEntity)
  395. {
  396. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  397. stuVolunteerIBLL.SaveEntity(keyValue, entity);
  398. return Success("提交成功!");
  399. }
  400. /// <summary>
  401. /// 专业:审核/去审核
  402. /// </summary>
  403. /// <param name="keyValue"></param>
  404. /// <returns></returns>
  405. public ActionResult MajorForm(string keyValue, int MajorStatus)
  406. {
  407. stuVolunteerIBLL.MajorForm(keyValue, MajorStatus);
  408. return Success("录取成功!");
  409. }
  410. /// <summary>
  411. /// 注册专业
  412. /// </summary>
  413. /// <param name="keyValue">主键</param>
  414. /// <param name="ClassStatus">审核状态</param>
  415. /// <returns></returns>
  416. [HttpPost]
  417. [AjaxOnly]
  418. public ActionResult SaveMajorForm(string keyValue, string MajorNo)
  419. {
  420. stuVolunteerIBLL.SaveMajorForm(keyValue, MajorNo);
  421. return Success("注册成功!");
  422. }
  423. #endregion
  424. }
  425. }