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.
 
 
 
 
 
 

1279 lines
38 KiB

  1. using Learun.Application.TwoDevelopment.EducationalAdministration;
  2. using Learun.Util;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web.Mvc;
  8. using Hangfire.Annotations;
  9. using Learun.Application.Base.SystemModule;
  10. using Newtonsoft.Json;
  11. using System.Data;
  12. using Learun.Application.WorkFlow;
  13. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  14. {
  15. /// <summary>
  16. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  17. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  18. /// 创 建:超级管理员
  19. /// 日 期:2019-07-17 11:20
  20. /// 描 述:新生录取管理
  21. /// </summary>
  22. public class StuEnrollController : MvcControllerBase
  23. {
  24. private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL();
  25. private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
  26. private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
  27. #region 视图功能
  28. /// <summary>
  29. /// 主页面
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Index()
  34. {
  35. return View();
  36. }
  37. [HttpGet]
  38. public ActionResult StudentStatus()
  39. {
  40. return View();
  41. }
  42. [HttpGet]
  43. public ActionResult AmountForm()
  44. {
  45. return View();
  46. }
  47. [HttpGet]
  48. public ActionResult CardPrint()
  49. {
  50. return View();
  51. }
  52. [HttpGet]
  53. public ActionResult Report()
  54. {
  55. return View();
  56. }
  57. [HttpGet]
  58. public ActionResult EnrollTypeForm()
  59. {
  60. return View();
  61. }
  62. [HttpGet]
  63. /// <summary>
  64. /// 是否饼状图
  65. /// </summary>
  66. /// <returns></returns>
  67. public ActionResult Peichart()
  68. {
  69. //是否报道
  70. 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";
  71. var data = stuEnrollIBLL.Execute(sql);
  72. List<object> list2 = new List<object>();
  73. list2.Add(new
  74. {
  75. name = "报道人数",
  76. value = data.Rows[0]["num1"].ToString()
  77. });
  78. list2.Add(new
  79. {
  80. name = "未报道人数",
  81. value = data.Rows[0]["num2"].ToString()
  82. });
  83. var jsonData = new
  84. {
  85. rows = list2
  86. };
  87. //是否住宿
  88. 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";
  89. var data1 = stuEnrollIBLL.Execute(sql);
  90. List<object> list3 = new List<object>();
  91. list3.Add(new
  92. {
  93. name = "住宿人数",
  94. value = data.Rows[0]["num1"].ToString()
  95. });
  96. list3.Add(new
  97. {
  98. name = "未住宿人数",
  99. value = data.Rows[0]["num2"].ToString()
  100. });
  101. var jsonData1 = new
  102. {
  103. rows = list3
  104. };
  105. ///是否资助
  106. 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";
  107. var data2 = stuEnrollIBLL.Execute(sql);
  108. List<object> list4 = new List<object>();
  109. list4.Add(new
  110. {
  111. name = "资助人数",
  112. value = data.Rows[0]["num1"].ToString()
  113. });
  114. list4.Add(new
  115. {
  116. name = "未资助人数",
  117. value = data.Rows[0]["num2"].ToString()
  118. });
  119. var jsonData2 = new
  120. {
  121. rows = list4
  122. };
  123. //是否军训
  124. 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";
  125. var data3 = stuEnrollIBLL.Execute(sql);
  126. List<object> list5 = new List<object>();
  127. list5.Add(new
  128. {
  129. name = "军训人数",
  130. value = data.Rows[0]["num1"].ToString()
  131. });
  132. list5.Add(new
  133. {
  134. name = "未军训人数",
  135. value = data.Rows[0]["num2"].ToString()
  136. });
  137. var jsonData3 = new
  138. {
  139. rows = list5
  140. };
  141. //是否缴费
  142. 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";
  143. var data4 = stuEnrollIBLL.Execute(sql);
  144. List<object> list6 = new List<object>();
  145. list6.Add(new
  146. {
  147. name = "缴费人数",
  148. value = data.Rows[0]["num1"].ToString()
  149. });
  150. list6.Add(new
  151. {
  152. name = "未缴费人数",
  153. value = data.Rows[0]["num2"].ToString()
  154. });
  155. var jsonData4 = new
  156. {
  157. rows = list6
  158. };
  159. return JsonResult(jsonData);
  160. }
  161. /// <summary>
  162. /// 是否住宿
  163. /// </summary>
  164. /// <returns></returns>
  165. [HttpGet]
  166. public ActionResult CheckIn()
  167. {
  168. return View();
  169. }
  170. /// <summary>
  171. /// 是否住宿
  172. /// </summary>
  173. /// <returns></returns>
  174. [HttpGet]
  175. public ActionResult PayAfter()
  176. {
  177. return View();
  178. }
  179. /// <summary>
  180. /// 是否资助
  181. /// </summary>
  182. /// <returns></returns>
  183. [HttpGet]
  184. public ActionResult IsHelp()
  185. {
  186. return View();
  187. }
  188. /// <summary>
  189. /// 完善资助信息
  190. /// </summary>
  191. /// <returns></returns>
  192. [HttpGet]
  193. public ActionResult IsHelpForm()
  194. {
  195. return View();
  196. }
  197. /// <summary>
  198. /// 资助变更
  199. /// </summary>
  200. /// <returns></returns>
  201. [HttpGet]
  202. public ActionResult HelpChange()
  203. {
  204. return View();
  205. }
  206. /// <summary>
  207. /// 资助变更列表
  208. /// </summary>
  209. /// <returns></returns>
  210. [HttpGet]
  211. public ActionResult IndexHelpChange()
  212. {
  213. return View();
  214. }
  215. /// <summary>
  216. /// 新生学费管理
  217. /// </summary>
  218. /// <returns></returns>
  219. [HttpGet]
  220. public ActionResult StuTuition()
  221. {
  222. return View();
  223. }
  224. /// <summary>
  225. /// 是否军训
  226. /// </summary>
  227. /// <returns></returns>
  228. [HttpGet]
  229. public ActionResult Military()
  230. {
  231. return View();
  232. }
  233. /// <summary>
  234. /// 是否军训
  235. /// </summary>
  236. /// <returns></returns>
  237. [HttpGet]
  238. public ActionResult IsPay()
  239. {
  240. return View();
  241. }
  242. [HttpGet]
  243. public ActionResult CheckInUrl()
  244. {
  245. return View();
  246. }
  247. [HttpGet]
  248. public ActionResult SubsidizeUrl()
  249. {
  250. return View();
  251. }
  252. [HttpGet]
  253. public ActionResult MilitaryUrl()
  254. {
  255. return View();
  256. }
  257. /// <summary>
  258. /// 是否拍照
  259. /// </summary>
  260. /// <returns></returns>
  261. [HttpGet]
  262. public ActionResult IsPhoto()
  263. {
  264. return View();
  265. }
  266. /// <summary>
  267. /// 是否领取军训服
  268. /// </summary>
  269. /// <returns></returns>
  270. [HttpGet]
  271. public ActionResult GetCloth()
  272. {
  273. return View();
  274. }
  275. /// <summary>
  276. /// 是否量校服尺寸
  277. /// </summary>
  278. /// <returns></returns>
  279. [HttpGet]
  280. public ActionResult GetClothSize()
  281. {
  282. return View();
  283. }
  284. /// <summary>
  285. /// 是否领取床上用品
  286. /// </summary>
  287. /// <returns></returns>
  288. [HttpGet]
  289. public ActionResult GetArticles()
  290. {
  291. return View();
  292. }
  293. /// <summary>
  294. /// 表单页
  295. /// <summary>
  296. /// <returns></returns>
  297. [HttpGet]
  298. public ActionResult Form()
  299. {
  300. return View();
  301. }
  302. [HttpGet]
  303. public ActionResult FormView()
  304. {
  305. return View();
  306. }
  307. public ActionResult AllocationClass()
  308. {
  309. return View();
  310. }
  311. public ActionResult AllocationDormitory()
  312. {
  313. return View();
  314. }
  315. public ActionResult NewAllocationDormitory()
  316. {
  317. return View();
  318. }
  319. public ActionResult NewAllocationBed()
  320. {
  321. return View();
  322. }
  323. /// <summary>
  324. /// 招生统计
  325. /// </summary>
  326. /// <returns></returns>
  327. public ActionResult StatisticIndex()
  328. {
  329. return View();
  330. }
  331. #endregion
  332. #region 获取数据
  333. /// <summary>
  334. /// 获取页面显示列表数据
  335. /// <summary>
  336. /// <param name="queryJson">查询参数</param>
  337. /// <returns></returns>
  338. [HttpGet]
  339. [AjaxOnly]
  340. public ActionResult GetPageList(string pagination, string queryJson)
  341. {
  342. Pagination paginationobj = pagination.ToObject<Pagination>();
  343. var data = stuEnrollIBLL.GetPageList(paginationobj, queryJson);
  344. var jsonData = new
  345. {
  346. rows = data,
  347. total = paginationobj.total,
  348. page = paginationobj.page,
  349. records = paginationobj.records
  350. };
  351. return Success(jsonData);
  352. }
  353. /// <summary>
  354. ///
  355. /// </summary>
  356. /// <param name="queryJson"></param>
  357. /// <param name="type">1:军训管理;2:学费管理</param>
  358. /// <returns></returns>
  359. [HttpGet]
  360. [AjaxOnly]
  361. public ActionResult GetMilitaryStatistics(string queryJson,int type)
  362. {
  363. var result = stuEnrollIBLL.GetMilitaryStatistics(queryJson, type);
  364. return Success(result);
  365. }
  366. [HttpGet]
  367. [AjaxOnly]
  368. public ActionResult GetDormitorys(string pagination, string queryJson)
  369. {
  370. Pagination paginationobj = pagination.ToObject<Pagination>();
  371. var data = stuEnrollIBLL.GetDormitorys(paginationobj, queryJson);
  372. var jsonData = new
  373. {
  374. rows = data,
  375. total = paginationobj.total,
  376. page = paginationobj.page,
  377. records = paginationobj.records
  378. };
  379. return Success(jsonData);
  380. }
  381. /// <summary>
  382. /// 获取页面显示列表数据
  383. /// <summary>
  384. /// <param name="queryJson">查询参数</param>
  385. /// <returns></returns>
  386. [HttpGet]
  387. [AjaxOnly]
  388. public ActionResult GetReportPageList(string pagination, string queryJson)
  389. {
  390. Pagination paginationobj = pagination.ToObject<Pagination>();
  391. var data = stuEnrollIBLL.GetReportPageList(paginationobj, queryJson);
  392. var jsonData = new
  393. {
  394. rows = data,
  395. total = paginationobj.total,
  396. page = paginationobj.page,
  397. records = paginationobj.records
  398. };
  399. return Success(jsonData);
  400. }
  401. /// <summary>
  402. /// 获取表单数据
  403. /// <summary>
  404. /// <returns></returns>
  405. [HttpGet]
  406. [AjaxOnly]
  407. public ActionResult GetFormData(string keyValue)
  408. {
  409. var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  410. if (string.IsNullOrEmpty(StuEnrollData.CheckInUrl))
  411. {
  412. StuEnrollData.CheckInUrl = Guid.NewGuid().ToString();
  413. }
  414. if (string.IsNullOrEmpty(StuEnrollData.SubsidizeUrl))
  415. {
  416. StuEnrollData.SubsidizeUrl = Guid.NewGuid().ToString();
  417. }
  418. if (string.IsNullOrEmpty(StuEnrollData.MilitaryUrl))
  419. {
  420. StuEnrollData.MilitaryUrl = Guid.NewGuid().ToString();
  421. }
  422. var jsonData = new
  423. {
  424. StuEnroll = StuEnrollData,
  425. };
  426. return Success(jsonData);
  427. }
  428. [HttpPost]
  429. [AjaxOnly]
  430. public ActionResult RealationPhoto()
  431. {
  432. var studentList = stuEnrollIBLL.AllStudent().ToList();
  433. foreach (var student in studentList)
  434. {
  435. if (string.IsNullOrEmpty(student.PhotoUrl))
  436. {
  437. student.PhotoUrl = Guid.NewGuid().ToString();
  438. stuEnrollIBLL.SaveEntity(student.StuId, student);
  439. }
  440. var annexEntity = annexesFileIBLL.GetEntityByFolderId(student.PhotoUrl);
  441. if (annexEntity == null)
  442. {
  443. annexEntity = new AnnexesFileEntity();
  444. annexEntity.Create();
  445. annexEntity.F_Id = Guid.NewGuid().ToString();
  446. }
  447. }
  448. return Success("");
  449. }
  450. [HttpGet]
  451. [AjaxOnly]
  452. public ActionResult GetStuInfo(string stuId)
  453. {
  454. var result = stuEnrollIBLL.GetStuInfo(stuId);
  455. return Success(result);
  456. }
  457. [HttpGet]
  458. [AjaxOnly]
  459. public ActionResult GetYearListByClass()
  460. {
  461. var classList = classInfoIBLL.GetAllClass().ToList();
  462. var result = classList.GroupBy(a => a.Grade).Select(m => m.Key).ToList();
  463. List<object> list = new List<object>();
  464. foreach (var item in result)
  465. {
  466. list.Add(new { year = item });
  467. }
  468. return Success(list);
  469. }
  470. [HttpPost]
  471. [AjaxOnly]
  472. public ActionResult GetStuDefaultInfo(string StuId)
  473. {
  474. var result = stuEnrollIBLL.GetStuDefaultInfo(StuId);
  475. return Success(result);
  476. }
  477. [HttpPost]
  478. [AjaxOnly]
  479. public ActionResult GetPaymentInfo()
  480. {
  481. var result = stuEnrollIBLL.GetPaymentInfo();
  482. return Success(result);
  483. }
  484. [HttpPost]
  485. [AjaxOnly]
  486. public ActionResult GetCheckInStatistics(string DeptNo, string MajorNo, string ClassNo)
  487. {
  488. var result = stuEnrollIBLL.GetCheckInStatistics(DeptNo, MajorNo, ClassNo);
  489. return Success(result);
  490. }
  491. [HttpPost]
  492. [AjaxOnly]
  493. public ActionResult GetHelpStatistics(string DeptNo, string MajorNo, string ClassNo)
  494. {
  495. var result = stuEnrollIBLL.GetHelpStatistics(DeptNo, MajorNo, ClassNo);
  496. return Success(result);
  497. }
  498. /// <summary>
  499. /// 获取左侧树形数据
  500. /// <summary>
  501. /// <returns></returns>
  502. [HttpGet]
  503. [AjaxOnly]
  504. public ActionResult GetTreeNew()
  505. {
  506. var data = stuEnrollIBLL.GetTree();
  507. return Success(data);
  508. }
  509. /// <summary>
  510. /// 获取左侧树形数据
  511. /// <summary>
  512. /// <returns></returns>
  513. [HttpGet]
  514. [AjaxOnly]
  515. public ActionResult GetBedTree(string classNo, string gender)
  516. {
  517. var data = stuEnrollIBLL.GetBedTree(classNo, gender);
  518. return Success(data);
  519. }
  520. /// <summary>
  521. /// 获取表单数据
  522. /// <summary>
  523. /// <returns></returns>
  524. [HttpGet]
  525. [AjaxOnly]
  526. public ActionResult GetFormDataByProcessId(string processId)
  527. {
  528. StuEnrollEntity data = stuEnrollIBLL.GetEntityByProcessId(processId);
  529. var jsonData = new
  530. {
  531. StuEnroll = data,
  532. };
  533. return Success(jsonData);
  534. }
  535. #endregion
  536. #region 提交数据
  537. /// <summary>
  538. /// 删除实体数据
  539. /// <param name="keyValue">主键</param>
  540. /// <summary>
  541. /// <returns></returns>
  542. [HttpPost]
  543. [AjaxOnly]
  544. public ActionResult DeleteForm(string keyValue)
  545. {
  546. stuEnrollIBLL.DeleteEntity(keyValue);
  547. return Success("删除成功!");
  548. }
  549. /// <summary>
  550. /// 保存实体数据(新增、修改)
  551. /// <param name="keyValue">主键</param>
  552. /// <summary>
  553. /// <returns></returns>
  554. [HttpPost]
  555. [ValidateAntiForgeryToken]
  556. [AjaxOnly]
  557. public ActionResult SaveForm(string keyValue, string strEntity)
  558. {
  559. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  560. stuEnrollIBLL.SaveEntity(keyValue, entity);
  561. return Success("保存成功!");
  562. }
  563. /// <summary>
  564. /// 保存实收金额
  565. /// <param name="keyValue">主键</param>
  566. /// <summary>
  567. /// <returns></returns>
  568. [HttpPost]
  569. [ValidateAntiForgeryToken]
  570. [AjaxOnly]
  571. public ActionResult SaveActualPayAmount(string keyValue, string strEntity)
  572. {
  573. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  574. var newEntity = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  575. newEntity.ActualPayAmount = entity.ActualPayAmount;
  576. stuEnrollIBLL.SaveEntity(keyValue, newEntity);
  577. return Success("保存成功!");
  578. }
  579. /// <summary>
  580. /// 保存实体数据(新增、修改)
  581. /// <param name="keyValue">主键</param>
  582. /// <summary>
  583. /// <returns></returns>
  584. [HttpPost]
  585. [AjaxOnly]
  586. public ActionResult EditEnrollType(string stuIds, string enrollType)
  587. {
  588. if (!string.IsNullOrEmpty(stuIds))
  589. {
  590. stuEnrollIBLL.EditEnrollType(stuIds, enrollType);
  591. }
  592. return Success("保存成功!");
  593. }
  594. [HttpPost]
  595. [AjaxOnly]
  596. public ActionResult AllocationClass(string classNo, string dataJson)
  597. {
  598. stuEnrollIBLL.AllocationClass(classNo, dataJson);
  599. return Success("分配成功!");
  600. }
  601. [HttpPost]
  602. [AjaxOnly]
  603. public ActionResult NewAllocationDormitory(string classNo, string dataJson)
  604. {
  605. stuEnrollIBLL.NewAllocationDormitory(classNo, dataJson);
  606. return Success("分配成功!");
  607. }
  608. [HttpPost]
  609. [AjaxOnly]
  610. public ActionResult AllocationDormitory(string dormitoryNo, string stuId, string dormitoryName)
  611. {
  612. stuEnrollIBLL.AllocationDormiotry(dormitoryNo, stuId, dormitoryName);
  613. return Success("分配成功!");
  614. }
  615. [HttpPost]
  616. [AjaxOnly]
  617. public ActionResult SyncDept()
  618. {
  619. stuEnrollIBLL.SyncDept();
  620. return Success("同步成功");
  621. }
  622. [HttpPost]
  623. [AjaxOnly]
  624. public ActionResult SyncMajor()
  625. {
  626. stuEnrollIBLL.SyncMajor();
  627. return Success("同步成功");
  628. }
  629. [HttpPost]
  630. [AjaxOnly]
  631. public ActionResult Sign(string stuId, bool status)
  632. {
  633. var result = stuEnrollIBLL.Sign(stuId, status);
  634. if (result.Item1)
  635. {
  636. return Success(result.Item2);
  637. }
  638. else
  639. {
  640. return Fail(result.Item2);
  641. }
  642. }
  643. [HttpPost]
  644. [AjaxOnly]
  645. public ActionResult AllReport()
  646. {
  647. stuEnrollIBLL.AllReport();
  648. return Success("操作成功");
  649. }
  650. [HttpPost]
  651. [AjaxOnly]
  652. public ActionResult AllPhoto()
  653. {
  654. stuEnrollIBLL.AllPhoto();
  655. return Success("操作成功");
  656. }
  657. [HttpPost]
  658. [AjaxOnly]
  659. public ActionResult AllGetCloth()
  660. {
  661. stuEnrollIBLL.AllGetCloth();
  662. return Success("操作成功");
  663. }
  664. [HttpPost]
  665. [AjaxOnly]
  666. public ActionResult AllGetSize()
  667. {
  668. stuEnrollIBLL.AllGetSize();
  669. return Success("操作成功");
  670. }
  671. [HttpPost]
  672. [AjaxOnly]
  673. public ActionResult AllGetArticle()
  674. {
  675. stuEnrollIBLL.AllGetArticle();
  676. return Success("操作成功");
  677. }
  678. [HttpPost]
  679. [AjaxOnly]
  680. public ActionResult Report(string stuId, bool status)
  681. {
  682. var result = stuEnrollIBLL.Report(stuId, status);
  683. if (result.Item1)
  684. {
  685. return Success(result.Item2);
  686. }
  687. else
  688. {
  689. return Fail(result.Item2);
  690. }
  691. }
  692. [HttpPost]
  693. [AjaxOnly]
  694. public ActionResult Stay(string stuId, bool status, bool payAfter = false)
  695. {
  696. var result = stuEnrollIBLL.Stay(stuId, status, payAfter);
  697. if (result.Item1)
  698. {
  699. return Success(result.Item2);
  700. }
  701. else
  702. {
  703. return Fail(result.Item2);
  704. }
  705. }
  706. /// <summary>
  707. /// 生成帐号
  708. /// </summary>
  709. /// <returns></returns>
  710. [HttpPost]
  711. [AjaxOnly]
  712. public ActionResult Generate()
  713. {
  714. stuEnrollIBLL.GenerateAccout();
  715. return Success("生成成功!");
  716. }
  717. [HttpPost]
  718. [AjaxOnly]
  719. public ActionResult AllStay()
  720. {
  721. stuEnrollIBLL.AllStay();
  722. return Success("操作成功");
  723. }
  724. [HttpPost]
  725. [AjaxOnly]
  726. public ActionResult Help(string stuId, bool status, bool payAfter = false)
  727. {
  728. var result = stuEnrollIBLL.Help(stuId, status, payAfter);
  729. if (result.Item1)
  730. {
  731. return Success(result.Item2);
  732. }
  733. else
  734. {
  735. return Fail(result.Item2);
  736. }
  737. }
  738. [HttpPost]
  739. [AjaxOnly]
  740. public ActionResult AllHelp()
  741. {
  742. stuEnrollIBLL.AllHelp();
  743. return Success("操作成功");
  744. }
  745. /// <summary>
  746. /// 学生学费管理-确认资助
  747. /// </summary>
  748. /// <returns></returns>
  749. [HttpPost]
  750. [AjaxOnly]
  751. public ActionResult Support(string keyValue)
  752. {
  753. var stuIds = "";
  754. if (keyValue.Contains(","))
  755. {
  756. var keyValueArr = keyValue.Split(',');
  757. stuIds = string.Join("','", keyValueArr);
  758. }
  759. else
  760. {
  761. stuIds = keyValue;
  762. }
  763. stuEnrollIBLL.Support(stuIds);
  764. return Success("操作成功");
  765. }
  766. /// <summary>
  767. /// 学生资助管理-完善资助信息
  768. /// </summary>
  769. /// <returns></returns>
  770. [HttpPost]
  771. [AjaxOnly]
  772. public ActionResult SupplySupport(string keyValue, string strEntity)
  773. {
  774. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  775. stuEnrollIBLL.SupplySupport(keyValue, entity);
  776. return Success("保存成功!");
  777. }
  778. /// <summary>
  779. /// 提交资助变更
  780. /// </summary>
  781. /// <param name="keyValue"></param>
  782. /// <returns></returns>
  783. [HttpPost]
  784. [AjaxOnly]
  785. public ActionResult ChangeStatusById(string keyValue, string processId)
  786. {
  787. stuEnrollIBLL.ChangeStatusById(keyValue, 1, processId);
  788. return Success("操作成功!");
  789. }
  790. /// <summary>
  791. /// 学生资助管理-资助变更
  792. /// </summary>
  793. /// <returns></returns>
  794. [HttpPost]
  795. [AjaxOnly]
  796. public ActionResult SupportChange(string keyValue, string strEntity)
  797. {
  798. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  799. stuEnrollIBLL.SupportChange(keyValue, entity);
  800. return Success("保存成功!");
  801. }
  802. [HttpPost]
  803. [AjaxOnly]
  804. public ActionResult Military(string stuId, bool status, bool payAfter = false)
  805. {
  806. var result = stuEnrollIBLL.Military(stuId, status, payAfter);
  807. if (result.Item1)
  808. {
  809. return Success(result.Item2);
  810. }
  811. else
  812. {
  813. return Fail(result.Item2);
  814. }
  815. }
  816. [HttpPost]
  817. [AjaxOnly]
  818. public ActionResult AllMilitary()
  819. {
  820. stuEnrollIBLL.AllMilitary();
  821. return Success("成功");
  822. }
  823. [HttpPost]
  824. [AjaxOnly]
  825. public ActionResult IsPay(string stuId, bool status)
  826. {
  827. var result = stuEnrollIBLL.IsPay(stuId, status);
  828. if (result.Item1)
  829. {
  830. return Success(result.Item2);
  831. }
  832. else
  833. {
  834. return Fail(result.Item2);
  835. }
  836. }
  837. [HttpPost]
  838. [AjaxOnly]
  839. public ActionResult IsPhoto(string stuId, string base64url)
  840. {
  841. var loginuser = LoginUserInfo.Get();
  842. //头像处理
  843. var folderId = Guid.NewGuid().ToString();
  844. string filePath = Config.GetValue("AnnexesFile");
  845. string uploadDate = DateTime.Now.ToString("yyyyMMdd");
  846. string FileEextension = ".png";
  847. string fileGuid = Guid.NewGuid().ToString();
  848. string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, loginuser.account, uploadDate, fileGuid, FileEextension);
  849. //创建文件夹
  850. string path = Path.GetDirectoryName(virtualPath);
  851. Directory.CreateDirectory(path);
  852. AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity();
  853. if (!System.IO.File.Exists(virtualPath))
  854. {
  855. byte[] bytes = Convert.FromBase64String(base64url.Replace("data:image/png;base64,", ""));
  856. FileInfo file = new FileInfo(virtualPath);
  857. FileStream fs = file.Create();
  858. fs.Write(bytes, 0, bytes.Length);
  859. fs.Close();
  860. //文件信息写入数据库
  861. fileAnnexesEntity.F_Id = fileGuid;
  862. fileAnnexesEntity.F_FileName = "userphoto.png";
  863. fileAnnexesEntity.F_FilePath = virtualPath;
  864. fileAnnexesEntity.F_FileSize = bytes.Length.ToString();
  865. fileAnnexesEntity.F_FileExtensions = FileEextension;
  866. fileAnnexesEntity.F_FileType = FileEextension.Replace(".", "");
  867. fileAnnexesEntity.F_CreateUserId = loginuser.userId;
  868. fileAnnexesEntity.F_CreateUserName = loginuser.realName;
  869. annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity);
  870. }
  871. var result = stuEnrollIBLL.IsPhoto(stuId, true, fileGuid);
  872. if (result.Item1)
  873. {
  874. return Success(result.Item2);
  875. }
  876. else
  877. {
  878. return Fail(result.Item2);
  879. }
  880. }
  881. [HttpPost]
  882. [AjaxOnly]
  883. public ActionResult GetCloth(string stuId, bool status)
  884. {
  885. var result = stuEnrollIBLL.GetCloth(stuId, status);
  886. if (result.Item1)
  887. {
  888. return Success(result.Item2);
  889. }
  890. else
  891. {
  892. return Fail(result.Item2);
  893. }
  894. }
  895. [HttpPost]
  896. [AjaxOnly]
  897. public ActionResult GetClothSize(string stuId, bool status)
  898. {
  899. var result = stuEnrollIBLL.GetClothSize(stuId, status);
  900. if (result.Item1)
  901. {
  902. return Success(result.Item2);
  903. }
  904. else
  905. {
  906. return Fail(result.Item2);
  907. }
  908. }
  909. [HttpPost]
  910. [AjaxOnly]
  911. public ActionResult GetArticles(string stuId, bool status)
  912. {
  913. var result = stuEnrollIBLL.GetArticles(stuId, status);
  914. if (result.Item1)
  915. {
  916. return Success(result.Item2);
  917. }
  918. else
  919. {
  920. return Fail(result.Item2);
  921. }
  922. }
  923. [HttpPost]
  924. [AjaxOnly]
  925. public ActionResult GetMoney()
  926. {
  927. stuEnrollIBLL.GetMoney();
  928. return Success("操作成功");
  929. }
  930. /// <summary>
  931. /// 下载文件
  932. /// </summary>
  933. /// <param name="fileId">文件id</param>
  934. /// <returns></returns>
  935. [HttpPost]
  936. public void DownWrod()
  937. {
  938. ExcelHelper.aaaaa();
  939. }
  940. /// <summary>
  941. /// 关联照片
  942. /// </summary>
  943. /// <returns></returns>
  944. public ActionResult RelationPhoto()
  945. {
  946. stuEnrollIBLL.RelationPhoto();
  947. return Success("关联成功");
  948. }
  949. /// <summary>
  950. /// 同步学生数据
  951. /// </summary>
  952. /// <returns></returns>
  953. public ActionResult Synchronization()
  954. {
  955. stuEnrollIBLL.Synchronization();
  956. return Success("同步成功");
  957. }
  958. /// <summary>
  959. /// 招生统计数据
  960. /// </summary>
  961. /// <param name="queryJson"></param>
  962. /// <returns></returns>
  963. public ActionResult GetStatisticData(string queryJson)
  964. {
  965. var data = stuEnrollIBLL.GetList(queryJson);
  966. //是否报到
  967. var datagroupIsReport = data.OrderByDescending(x => x.IsReport).GroupBy(x => x.IsReport).Select(x => new
  968. {
  969. status = x.Key.HasValue ? (x.Key.Value == true ? "报到" : "未报到") : "未处理",
  970. count = x.Select(y => y.StuId).Count()
  971. });
  972. var legendDataIsReport = new List<string>();
  973. var seriesDataIsReport = new List<WfSchemeReportModelOfPie>();
  974. foreach (var item in datagroupIsReport)
  975. {
  976. legendDataIsReport.Add(item.status);
  977. seriesDataIsReport.Add(new WfSchemeReportModelOfPie()
  978. {
  979. value = item.count,
  980. name = item.status
  981. });
  982. }
  983. //是否住宿
  984. var datagroupIsCheckIn = data.OrderByDescending(x => x.IsCheckIn).GroupBy(x => x.IsCheckIn).Select(x => new
  985. {
  986. status = x.Key.HasValue ? (x.Key.Value == true ? "住宿" : "走读") : "未处理",
  987. count = x.Select(y => y.StuId).Count()
  988. });
  989. var legendDataIsCheckIn = new List<string>();
  990. var seriesDataIsCheckIn = new List<WfSchemeReportModelOfPie>();
  991. foreach (var item in datagroupIsCheckIn)
  992. {
  993. legendDataIsCheckIn.Add(item.status);
  994. seriesDataIsCheckIn.Add(new WfSchemeReportModelOfPie()
  995. {
  996. value = item.count,
  997. name = item.status
  998. });
  999. }
  1000. //是否资助
  1001. var datagroupIsSubsidize1 = data.OrderByDescending(x => x.IsSubsidize1).GroupBy(x => x.IsSubsidize1).Select(x => new
  1002. {
  1003. status = x.Key.HasValue ? (x.Key.Value == true ? "资助" : "不资助") : "未处理",
  1004. count = x.Select(y => y.StuId).Count()
  1005. });
  1006. var legendDataIsSubsidize1 = new List<string>();
  1007. var seriesDataIsSubsidize1 = new List<WfSchemeReportModelOfPie>();
  1008. foreach (var item in datagroupIsSubsidize1)
  1009. {
  1010. legendDataIsSubsidize1.Add(item.status);
  1011. seriesDataIsSubsidize1.Add(new WfSchemeReportModelOfPie()
  1012. {
  1013. value = item.count,
  1014. name = item.status
  1015. });
  1016. }
  1017. //是否军训
  1018. var datagroupIsMilitary = data.OrderByDescending(x => x.IsMilitary).GroupBy(x => x.IsMilitary).Select(x => new
  1019. {
  1020. status = x.Key.HasValue ? (x.Key.Value == true ? "军训" : "不军训") : "未处理",
  1021. count = x.Select(y => y.StuId).Count()
  1022. });
  1023. var legendDataIsMilitary = new List<string>();
  1024. var seriesDataIsMilitary = new List<WfSchemeReportModelOfPie>();
  1025. foreach (var item in datagroupIsMilitary)
  1026. {
  1027. legendDataIsMilitary.Add(item.status);
  1028. seriesDataIsMilitary.Add(new WfSchemeReportModelOfPie()
  1029. {
  1030. value = item.count,
  1031. name = item.status
  1032. });
  1033. }
  1034. //缴费状态
  1035. var datagroupIsPay = data.OrderByDescending(x => x.IsPay).GroupBy(x => x.IsPay).Select(x => new
  1036. {
  1037. status = x.Key.HasValue ? (x.Key.Value == true ? "缴费" : "未缴费") : "未处理",
  1038. count = x.Select(y => y.StuId).Count()
  1039. });
  1040. var legendDataIsPay = new List<string>();
  1041. var seriesDataIsPay = new List<WfSchemeReportModelOfPie>();
  1042. foreach (var item in datagroupIsPay)
  1043. {
  1044. legendDataIsPay.Add(item.status);
  1045. seriesDataIsPay.Add(new WfSchemeReportModelOfPie()
  1046. {
  1047. value = item.count,
  1048. name = item.status
  1049. });
  1050. }
  1051. //拍照
  1052. var datagroupIsMug = data.OrderByDescending(x => x.IsMug).GroupBy(x => x.IsMug).Select(x => new
  1053. {
  1054. status = x.Key.HasValue ? (x.Key.Value == true ? "已拍照" : "未拍照") : "未处理",
  1055. count = x.Select(y => y.StuId).Count()
  1056. });
  1057. var legendDataIsMug = new List<string>();
  1058. var seriesDataIsMug = new List<WfSchemeReportModelOfPie>();
  1059. foreach (var item in datagroupIsMug)
  1060. {
  1061. legendDataIsMug.Add(item.status);
  1062. seriesDataIsMug.Add(new WfSchemeReportModelOfPie()
  1063. {
  1064. value = item.count,
  1065. name = item.status
  1066. });
  1067. }
  1068. //领取军训服
  1069. var datagroupIsTakeCloths = data.OrderByDescending(x => x.IsTakeCloths).GroupBy(x => x.IsTakeCloths).Select(x => new
  1070. {
  1071. status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理",
  1072. count = x.Select(y => y.StuId).Count()
  1073. });
  1074. var legendDataIsTakeCloths = new List<string>();
  1075. var seriesDataIsTakeCloths = new List<WfSchemeReportModelOfPie>();
  1076. foreach (var item in datagroupIsTakeCloths)
  1077. {
  1078. legendDataIsTakeCloths.Add(item.status);
  1079. seriesDataIsTakeCloths.Add(new WfSchemeReportModelOfPie()
  1080. {
  1081. value = item.count,
  1082. name = item.status
  1083. });
  1084. }
  1085. //量取校服尺寸
  1086. var datagroupIsQuantity = data.OrderByDescending(x => x.IsQuantity).GroupBy(x => x.IsQuantity).Select(x => new
  1087. {
  1088. status = x.Key.HasValue ? (x.Key.Value == true ? "已量" : "未量") : "未处理",
  1089. count = x.Select(y => y.StuId).Count()
  1090. });
  1091. var legendDataIsQuantity = new List<string>();
  1092. var seriesDataIsQuantity = new List<WfSchemeReportModelOfPie>();
  1093. foreach (var item in datagroupIsQuantity)
  1094. {
  1095. legendDataIsQuantity.Add(item.status);
  1096. seriesDataIsQuantity.Add(new WfSchemeReportModelOfPie()
  1097. {
  1098. value = item.count,
  1099. name = item.status
  1100. });
  1101. }
  1102. //领取床上用品
  1103. var datagroupIsGetBeddingArticle = data.OrderByDescending(x => x.IsGetBeddingArticle).GroupBy(x => x.IsGetBeddingArticle).Select(x => new
  1104. {
  1105. status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理",
  1106. count = x.Select(y => y.StuId).Count()
  1107. });
  1108. var legendDataIsGetBeddingArticle = new List<string>();
  1109. var seriesDataIsGetBeddingArticle = new List<WfSchemeReportModelOfPie>();
  1110. foreach (var item in datagroupIsGetBeddingArticle)
  1111. {
  1112. legendDataIsGetBeddingArticle.Add(item.status);
  1113. seriesDataIsGetBeddingArticle.Add(new WfSchemeReportModelOfPie()
  1114. {
  1115. value = item.count,
  1116. name = item.status
  1117. });
  1118. }
  1119. var jsonData = new
  1120. {
  1121. legendDataIsReport = legendDataIsReport,
  1122. seriesDataIsReport = seriesDataIsReport,
  1123. legendDataIsCheckIn = legendDataIsCheckIn,
  1124. seriesDataIsCheckIn = seriesDataIsCheckIn,
  1125. legendDataIsSubsidize1 = legendDataIsSubsidize1,
  1126. seriesDataIsSubsidize1 = seriesDataIsSubsidize1,
  1127. legendDataIsMilitary = legendDataIsMilitary,
  1128. seriesDataIsMilitary = seriesDataIsMilitary,
  1129. legendDataIsPay = legendDataIsPay,
  1130. seriesDataIsPay = seriesDataIsPay,
  1131. legendDataIsMug = legendDataIsMug,
  1132. seriesDataIsMug = seriesDataIsMug,
  1133. legendDataIsTakeCloths = legendDataIsTakeCloths,
  1134. seriesDataIsTakeCloths = seriesDataIsTakeCloths,
  1135. legendDataIsQuantity = legendDataIsQuantity,
  1136. seriesDataIsQuantity = seriesDataIsQuantity,
  1137. legendDataIsGetBeddingArticle = legendDataIsGetBeddingArticle,
  1138. seriesDataIsGetBeddingArticle = seriesDataIsGetBeddingArticle
  1139. };
  1140. return Success(jsonData);
  1141. }
  1142. #endregion
  1143. }
  1144. }