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.

StuEnrollController.cs 38 KiB

4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289
  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. /// <summary>
  471. /// 获取年级(最大)
  472. /// </summary>
  473. /// <returns></returns>
  474. [HttpGet]
  475. [AjaxOnly]
  476. public ActionResult GetYearListByMaxClass()
  477. {
  478. var classList = classInfoIBLL.GetAllClass().ToList();
  479. var grade = classList.OrderByDescending(x => x.Grade).Select(x => x.Grade).FirstOrDefault();
  480. return Success(grade);
  481. }
  482. [HttpPost]
  483. [AjaxOnly]
  484. public ActionResult GetStuDefaultInfo(string StuId)
  485. {
  486. var result = stuEnrollIBLL.GetStuDefaultInfo(StuId);
  487. return Success(result);
  488. }
  489. [HttpPost]
  490. [AjaxOnly]
  491. public ActionResult GetPaymentInfo()
  492. {
  493. var result = stuEnrollIBLL.GetPaymentInfo();
  494. return Success(result);
  495. }
  496. [HttpPost]
  497. [AjaxOnly]
  498. public ActionResult GetCheckInStatistics(string DeptNo, string MajorNo, string ClassNo)
  499. {
  500. var result = stuEnrollIBLL.GetCheckInStatistics(DeptNo, MajorNo, ClassNo);
  501. return Success(result);
  502. }
  503. [HttpPost]
  504. [AjaxOnly]
  505. public ActionResult GetHelpStatistics(string DeptNo, string MajorNo, string ClassNo)
  506. {
  507. var result = stuEnrollIBLL.GetHelpStatistics(DeptNo, MajorNo, ClassNo);
  508. return Success(result);
  509. }
  510. /// <summary>
  511. /// 获取左侧树形数据
  512. /// <summary>
  513. /// <returns></returns>
  514. [HttpGet]
  515. [AjaxOnly]
  516. public ActionResult GetTreeNew()
  517. {
  518. var data = stuEnrollIBLL.GetTree();
  519. return Success(data);
  520. }
  521. /// <summary>
  522. /// 获取左侧树形数据
  523. /// <summary>
  524. /// <returns></returns>
  525. [HttpGet]
  526. [AjaxOnly]
  527. public ActionResult GetBedTree(string classNo, string gender)
  528. {
  529. var data = stuEnrollIBLL.GetBedTree(classNo, gender);
  530. return Success(data);
  531. }
  532. /// <summary>
  533. /// 获取表单数据
  534. /// <summary>
  535. /// <returns></returns>
  536. [HttpGet]
  537. [AjaxOnly]
  538. public ActionResult GetFormDataByProcessId(string processId)
  539. {
  540. StuEnrollEntity data = stuEnrollIBLL.GetEntityByProcessId(processId);
  541. var jsonData = new
  542. {
  543. StuEnroll = data,
  544. };
  545. return Success(jsonData);
  546. }
  547. #endregion
  548. #region 提交数据
  549. /// <summary>
  550. /// 删除实体数据
  551. /// <param name="keyValue">主键</param>
  552. /// <summary>
  553. /// <returns></returns>
  554. [HttpPost]
  555. [AjaxOnly]
  556. public ActionResult DeleteForm(string keyValue)
  557. {
  558. stuEnrollIBLL.DeleteEntity(keyValue);
  559. return Success("删除成功!");
  560. }
  561. /// <summary>
  562. /// 保存实体数据(新增、修改)
  563. /// <param name="keyValue">主键</param>
  564. /// <summary>
  565. /// <returns></returns>
  566. [HttpPost]
  567. [ValidateAntiForgeryToken]
  568. [AjaxOnly]
  569. public ActionResult SaveForm(string keyValue, string strEntity)
  570. {
  571. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  572. stuEnrollIBLL.SaveEntity(keyValue, entity);
  573. return Success("保存成功!");
  574. }
  575. /// <summary>
  576. /// 保存实收金额
  577. /// <param name="keyValue">主键</param>
  578. /// <summary>
  579. /// <returns></returns>
  580. [HttpPost]
  581. [ValidateAntiForgeryToken]
  582. [AjaxOnly]
  583. public ActionResult SaveActualPayAmount(string keyValue, string strEntity)
  584. {
  585. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  586. var newEntity = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  587. newEntity.ActualPayAmount = entity.ActualPayAmount;
  588. stuEnrollIBLL.SaveEntity(keyValue, newEntity);
  589. return Success("保存成功!");
  590. }
  591. /// <summary>
  592. /// 保存实体数据(新增、修改)
  593. /// <param name="keyValue">主键</param>
  594. /// <summary>
  595. /// <returns></returns>
  596. [HttpPost]
  597. [AjaxOnly]
  598. public ActionResult EditEnrollType(string stuIds, string enrollType)
  599. {
  600. if (!string.IsNullOrEmpty(stuIds))
  601. {
  602. stuEnrollIBLL.EditEnrollType(stuIds, enrollType);
  603. }
  604. return Success("保存成功!");
  605. }
  606. [HttpPost]
  607. [AjaxOnly]
  608. public ActionResult AllocationClass(string classNo, string dataJson)
  609. {
  610. stuEnrollIBLL.AllocationClass(classNo, dataJson);
  611. return Success("分配成功!");
  612. }
  613. [HttpPost]
  614. [AjaxOnly]
  615. public ActionResult NewAllocationDormitory(string classNo, string dataJson)
  616. {
  617. stuEnrollIBLL.NewAllocationDormitory(classNo, dataJson);
  618. return Success("分配成功!");
  619. }
  620. [HttpPost]
  621. [AjaxOnly]
  622. public ActionResult AllocationDormitory(string dormitoryNo, string stuId, string dormitoryName)
  623. {
  624. stuEnrollIBLL.AllocationDormiotry(dormitoryNo, stuId, dormitoryName);
  625. return Success("分配成功!");
  626. }
  627. [HttpPost]
  628. [AjaxOnly]
  629. public ActionResult SyncDept()
  630. {
  631. stuEnrollIBLL.SyncDept();
  632. return Success("同步成功");
  633. }
  634. [HttpPost]
  635. [AjaxOnly]
  636. public ActionResult SyncMajor()
  637. {
  638. stuEnrollIBLL.SyncMajor();
  639. return Success("同步成功");
  640. }
  641. [HttpPost]
  642. [AjaxOnly]
  643. public ActionResult Sign(string stuId, bool status)
  644. {
  645. var result = stuEnrollIBLL.Sign(stuId, status);
  646. if (result.Item1)
  647. {
  648. return Success(result.Item2);
  649. }
  650. else
  651. {
  652. return Fail(result.Item2);
  653. }
  654. }
  655. [HttpPost]
  656. [AjaxOnly]
  657. public ActionResult AllReport()
  658. {
  659. stuEnrollIBLL.AllReport();
  660. return Success("操作成功");
  661. }
  662. [HttpPost]
  663. [AjaxOnly]
  664. public ActionResult AllPhoto()
  665. {
  666. stuEnrollIBLL.AllPhoto();
  667. return Success("操作成功");
  668. }
  669. [HttpPost]
  670. [AjaxOnly]
  671. public ActionResult AllGetCloth()
  672. {
  673. stuEnrollIBLL.AllGetCloth();
  674. return Success("操作成功");
  675. }
  676. [HttpPost]
  677. [AjaxOnly]
  678. public ActionResult AllGetSize()
  679. {
  680. stuEnrollIBLL.AllGetSize();
  681. return Success("操作成功");
  682. }
  683. [HttpPost]
  684. [AjaxOnly]
  685. public ActionResult AllGetArticle()
  686. {
  687. stuEnrollIBLL.AllGetArticle();
  688. return Success("操作成功");
  689. }
  690. [HttpPost]
  691. [AjaxOnly]
  692. public ActionResult Report(string stuId, bool status)
  693. {
  694. var result = stuEnrollIBLL.Report(stuId, status);
  695. if (result.Item1)
  696. {
  697. return Success(result.Item2);
  698. }
  699. else
  700. {
  701. return Fail(result.Item2);
  702. }
  703. }
  704. [HttpPost]
  705. [AjaxOnly]
  706. public ActionResult Stay(string stuId, bool status, bool payAfter = false)
  707. {
  708. var result = stuEnrollIBLL.Stay(stuId, status, payAfter);
  709. if (result.Item1)
  710. {
  711. return Success(result.Item2);
  712. }
  713. else
  714. {
  715. return Fail(result.Item2);
  716. }
  717. }
  718. /// <summary>
  719. /// 生成帐号
  720. /// </summary>
  721. /// <returns></returns>
  722. [HttpPost]
  723. [AjaxOnly]
  724. public ActionResult Generate()
  725. {
  726. stuEnrollIBLL.GenerateAccout();
  727. return Success("生成成功!");
  728. }
  729. [HttpPost]
  730. [AjaxOnly]
  731. public ActionResult AllStay()
  732. {
  733. stuEnrollIBLL.AllStay();
  734. return Success("操作成功");
  735. }
  736. [HttpPost]
  737. [AjaxOnly]
  738. public ActionResult Help(string stuId, bool status, bool payAfter = false)
  739. {
  740. var result = stuEnrollIBLL.Help(stuId, status, payAfter);
  741. if (result.Item1)
  742. {
  743. return Success(result.Item2);
  744. }
  745. else
  746. {
  747. return Fail(result.Item2);
  748. }
  749. }
  750. [HttpPost]
  751. [AjaxOnly]
  752. public ActionResult AllHelp()
  753. {
  754. stuEnrollIBLL.AllHelp();
  755. return Success("操作成功");
  756. }
  757. /// <summary>
  758. /// 学生学费管理-确认资助
  759. /// </summary>
  760. /// <returns></returns>
  761. [HttpPost]
  762. [AjaxOnly]
  763. public ActionResult Support(string keyValue)
  764. {
  765. var stuIds = "";
  766. if (keyValue.Contains(","))
  767. {
  768. var keyValueArr = keyValue.Split(',');
  769. stuIds = string.Join("','", keyValueArr);
  770. }
  771. else
  772. {
  773. stuIds = keyValue;
  774. }
  775. stuEnrollIBLL.Support(stuIds);
  776. return Success("操作成功");
  777. }
  778. /// <summary>
  779. /// 学生资助管理-完善资助信息
  780. /// </summary>
  781. /// <returns></returns>
  782. [HttpPost]
  783. [AjaxOnly]
  784. public ActionResult SupplySupport(string keyValue, string strEntity)
  785. {
  786. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  787. stuEnrollIBLL.SupplySupport(keyValue, entity);
  788. return Success("保存成功!");
  789. }
  790. /// <summary>
  791. /// 提交资助变更
  792. /// </summary>
  793. /// <param name="keyValue"></param>
  794. /// <returns></returns>
  795. [HttpPost]
  796. [AjaxOnly]
  797. public ActionResult ChangeStatusById(string keyValue, string processId)
  798. {
  799. stuEnrollIBLL.ChangeStatusById(keyValue, 1, processId);
  800. return Success("操作成功!");
  801. }
  802. /// <summary>
  803. /// 学生资助管理-资助变更
  804. /// </summary>
  805. /// <returns></returns>
  806. [HttpPost]
  807. [AjaxOnly]
  808. public ActionResult SupportChange(string keyValue, string strEntity)
  809. {
  810. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  811. stuEnrollIBLL.SupportChange(keyValue, entity);
  812. return Success("保存成功!");
  813. }
  814. [HttpPost]
  815. [AjaxOnly]
  816. public ActionResult Military(string stuId, bool status, bool payAfter = false)
  817. {
  818. var result = stuEnrollIBLL.Military(stuId, status, payAfter);
  819. if (result.Item1)
  820. {
  821. return Success(result.Item2);
  822. }
  823. else
  824. {
  825. return Fail(result.Item2);
  826. }
  827. }
  828. [HttpPost]
  829. [AjaxOnly]
  830. public ActionResult AllMilitary()
  831. {
  832. stuEnrollIBLL.AllMilitary();
  833. return Success("成功");
  834. }
  835. [HttpPost]
  836. [AjaxOnly]
  837. public ActionResult IsPay(string stuId, bool status)
  838. {
  839. var result = stuEnrollIBLL.IsPay(stuId, status);
  840. if (result.Item1)
  841. {
  842. return Success(result.Item2);
  843. }
  844. else
  845. {
  846. return Fail(result.Item2);
  847. }
  848. }
  849. [HttpPost]
  850. [AjaxOnly]
  851. public ActionResult IsPhoto(string stuId, string base64url)
  852. {
  853. var loginuser = LoginUserInfo.Get();
  854. //头像处理
  855. var folderId = Guid.NewGuid().ToString();
  856. string filePath = Config.GetValue("AnnexesFile");
  857. string uploadDate = DateTime.Now.ToString("yyyyMMdd");
  858. string FileEextension = ".png";
  859. string fileGuid = Guid.NewGuid().ToString();
  860. string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, loginuser.account, uploadDate, fileGuid, FileEextension);
  861. //创建文件夹
  862. string path = Path.GetDirectoryName(virtualPath);
  863. Directory.CreateDirectory(path);
  864. AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity();
  865. if (!System.IO.File.Exists(virtualPath))
  866. {
  867. byte[] bytes = Convert.FromBase64String(base64url.Replace("data:image/png;base64,", ""));
  868. FileInfo file = new FileInfo(virtualPath);
  869. FileStream fs = file.Create();
  870. fs.Write(bytes, 0, bytes.Length);
  871. fs.Close();
  872. //文件信息写入数据库
  873. fileAnnexesEntity.F_Id = fileGuid;
  874. fileAnnexesEntity.F_FileName = "userphoto.png";
  875. fileAnnexesEntity.F_FilePath = virtualPath;
  876. fileAnnexesEntity.F_FileSize = bytes.Length.ToString();
  877. fileAnnexesEntity.F_FileExtensions = FileEextension;
  878. fileAnnexesEntity.F_FileType = FileEextension.Replace(".", "");
  879. fileAnnexesEntity.F_CreateUserId = loginuser.userId;
  880. fileAnnexesEntity.F_CreateUserName = loginuser.realName;
  881. annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity);
  882. }
  883. var result = stuEnrollIBLL.IsPhoto(stuId, true, fileGuid);
  884. if (result.Item1)
  885. {
  886. return Success(result.Item2);
  887. }
  888. else
  889. {
  890. return Fail(result.Item2);
  891. }
  892. }
  893. [HttpPost]
  894. [AjaxOnly]
  895. public ActionResult GetCloth(string stuId, bool status)
  896. {
  897. var result = stuEnrollIBLL.GetCloth(stuId, status);
  898. if (result.Item1)
  899. {
  900. return Success(result.Item2);
  901. }
  902. else
  903. {
  904. return Fail(result.Item2);
  905. }
  906. }
  907. [HttpPost]
  908. [AjaxOnly]
  909. public ActionResult GetClothSize(string stuId, bool status)
  910. {
  911. var result = stuEnrollIBLL.GetClothSize(stuId, status);
  912. if (result.Item1)
  913. {
  914. return Success(result.Item2);
  915. }
  916. else
  917. {
  918. return Fail(result.Item2);
  919. }
  920. }
  921. [HttpPost]
  922. [AjaxOnly]
  923. public ActionResult GetArticles(string stuId, bool status)
  924. {
  925. var result = stuEnrollIBLL.GetArticles(stuId, status);
  926. if (result.Item1)
  927. {
  928. return Success(result.Item2);
  929. }
  930. else
  931. {
  932. return Fail(result.Item2);
  933. }
  934. }
  935. [HttpPost]
  936. [AjaxOnly]
  937. public ActionResult GetMoney()
  938. {
  939. stuEnrollIBLL.GetMoney();
  940. return Success("操作成功");
  941. }
  942. /// <summary>
  943. /// 下载文件
  944. /// </summary>
  945. /// <param name="fileId">文件id</param>
  946. /// <returns></returns>
  947. [HttpPost]
  948. public void DownWrod()
  949. {
  950. ExcelHelper.aaaaa();
  951. }
  952. /// <summary>
  953. /// 关联照片
  954. /// </summary>
  955. /// <returns></returns>
  956. public ActionResult RelationPhoto()
  957. {
  958. stuEnrollIBLL.RelationPhoto();
  959. return Success("关联成功");
  960. }
  961. /// <summary>
  962. /// 同步学生数据
  963. /// </summary>
  964. /// <returns></returns>
  965. public ActionResult Synchronization()
  966. {
  967. stuEnrollIBLL.Synchronization();
  968. return Success("同步成功");
  969. }
  970. /// <summary>
  971. /// 招生统计数据
  972. /// </summary>
  973. /// <param name="queryJson"></param>
  974. /// <returns></returns>
  975. public ActionResult GetStatisticData(string queryJson)
  976. {
  977. var data = stuEnrollIBLL.GetList(queryJson);
  978. //是否报到
  979. var datagroupIsReport = data.OrderByDescending(x => x.IsReport).GroupBy(x => x.IsReport).Select(x => new
  980. {
  981. status = x.Key.HasValue ? (x.Key.Value == true ? "报到" : "未报到") : "未处理",
  982. count = x.Select(y => y.StuId).Count()
  983. });
  984. var legendDataIsReport = new List<string>();
  985. var seriesDataIsReport = new List<WfSchemeReportModelOfPie>();
  986. foreach (var item in datagroupIsReport)
  987. {
  988. legendDataIsReport.Add(item.status);
  989. seriesDataIsReport.Add(new WfSchemeReportModelOfPie()
  990. {
  991. value = item.count,
  992. name = item.status
  993. });
  994. }
  995. //是否住宿
  996. var datagroupIsCheckIn = data.OrderByDescending(x => x.IsCheckIn).GroupBy(x => x.IsCheckIn).Select(x => new
  997. {
  998. status = x.Key.HasValue ? (x.Key.Value == true ? "住宿" : "走读") : "未处理",
  999. count = x.Select(y => y.StuId).Count()
  1000. });
  1001. var legendDataIsCheckIn = new List<string>();
  1002. var seriesDataIsCheckIn = new List<WfSchemeReportModelOfPie>();
  1003. foreach (var item in datagroupIsCheckIn)
  1004. {
  1005. legendDataIsCheckIn.Add(item.status);
  1006. seriesDataIsCheckIn.Add(new WfSchemeReportModelOfPie()
  1007. {
  1008. value = item.count,
  1009. name = item.status
  1010. });
  1011. }
  1012. //是否资助
  1013. var datagroupIsSubsidize1 = data.OrderByDescending(x => x.IsSubsidize1).GroupBy(x => x.IsSubsidize1).Select(x => new
  1014. {
  1015. status = x.Key.HasValue ? (x.Key.Value == true ? "资助" : "不资助") : "未处理",
  1016. count = x.Select(y => y.StuId).Count()
  1017. });
  1018. var legendDataIsSubsidize1 = new List<string>();
  1019. var seriesDataIsSubsidize1 = new List<WfSchemeReportModelOfPie>();
  1020. foreach (var item in datagroupIsSubsidize1)
  1021. {
  1022. legendDataIsSubsidize1.Add(item.status);
  1023. seriesDataIsSubsidize1.Add(new WfSchemeReportModelOfPie()
  1024. {
  1025. value = item.count,
  1026. name = item.status
  1027. });
  1028. }
  1029. //是否军训
  1030. var datagroupIsMilitary = data.OrderByDescending(x => x.IsMilitary).GroupBy(x => x.IsMilitary).Select(x => new
  1031. {
  1032. status = x.Key.HasValue ? (x.Key.Value == true ? "军训" : "不军训") : "未处理",
  1033. count = x.Select(y => y.StuId).Count()
  1034. });
  1035. var legendDataIsMilitary = new List<string>();
  1036. var seriesDataIsMilitary = new List<WfSchemeReportModelOfPie>();
  1037. foreach (var item in datagroupIsMilitary)
  1038. {
  1039. legendDataIsMilitary.Add(item.status);
  1040. seriesDataIsMilitary.Add(new WfSchemeReportModelOfPie()
  1041. {
  1042. value = item.count,
  1043. name = item.status
  1044. });
  1045. }
  1046. //缴费状态
  1047. var datagroupIsPay = data.OrderByDescending(x => x.IsPay).GroupBy(x => x.IsPay).Select(x => new
  1048. {
  1049. status = x.Key.HasValue ? (x.Key.Value == true ? "缴费" : "未缴费") : "未处理",
  1050. count = x.Select(y => y.StuId).Count()
  1051. });
  1052. var legendDataIsPay = new List<string>();
  1053. var seriesDataIsPay = new List<WfSchemeReportModelOfPie>();
  1054. foreach (var item in datagroupIsPay)
  1055. {
  1056. legendDataIsPay.Add(item.status);
  1057. seriesDataIsPay.Add(new WfSchemeReportModelOfPie()
  1058. {
  1059. value = item.count,
  1060. name = item.status
  1061. });
  1062. }
  1063. //拍照
  1064. var datagroupIsMug = data.OrderByDescending(x => x.IsMug).GroupBy(x => x.IsMug).Select(x => new
  1065. {
  1066. status = x.Key.HasValue ? (x.Key.Value == true ? "已拍照" : "未拍照") : "未处理",
  1067. count = x.Select(y => y.StuId).Count()
  1068. });
  1069. var legendDataIsMug = new List<string>();
  1070. var seriesDataIsMug = new List<WfSchemeReportModelOfPie>();
  1071. foreach (var item in datagroupIsMug)
  1072. {
  1073. legendDataIsMug.Add(item.status);
  1074. seriesDataIsMug.Add(new WfSchemeReportModelOfPie()
  1075. {
  1076. value = item.count,
  1077. name = item.status
  1078. });
  1079. }
  1080. //领取军训服
  1081. var datagroupIsTakeCloths = data.OrderByDescending(x => x.IsTakeCloths).GroupBy(x => x.IsTakeCloths).Select(x => new
  1082. {
  1083. status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理",
  1084. count = x.Select(y => y.StuId).Count()
  1085. });
  1086. var legendDataIsTakeCloths = new List<string>();
  1087. var seriesDataIsTakeCloths = new List<WfSchemeReportModelOfPie>();
  1088. foreach (var item in datagroupIsTakeCloths)
  1089. {
  1090. legendDataIsTakeCloths.Add(item.status);
  1091. seriesDataIsTakeCloths.Add(new WfSchemeReportModelOfPie()
  1092. {
  1093. value = item.count,
  1094. name = item.status
  1095. });
  1096. }
  1097. //量取校服尺寸
  1098. var datagroupIsQuantity = data.OrderByDescending(x => x.IsQuantity).GroupBy(x => x.IsQuantity).Select(x => new
  1099. {
  1100. status = x.Key.HasValue ? (x.Key.Value == true ? "已量" : "未量") : "未处理",
  1101. count = x.Select(y => y.StuId).Count()
  1102. });
  1103. var legendDataIsQuantity = new List<string>();
  1104. var seriesDataIsQuantity = new List<WfSchemeReportModelOfPie>();
  1105. foreach (var item in datagroupIsQuantity)
  1106. {
  1107. legendDataIsQuantity.Add(item.status);
  1108. seriesDataIsQuantity.Add(new WfSchemeReportModelOfPie()
  1109. {
  1110. value = item.count,
  1111. name = item.status
  1112. });
  1113. }
  1114. //领取床上用品
  1115. var datagroupIsGetBeddingArticle = data.OrderByDescending(x => x.IsGetBeddingArticle).GroupBy(x => x.IsGetBeddingArticle).Select(x => new
  1116. {
  1117. status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理",
  1118. count = x.Select(y => y.StuId).Count()
  1119. });
  1120. var legendDataIsGetBeddingArticle = new List<string>();
  1121. var seriesDataIsGetBeddingArticle = new List<WfSchemeReportModelOfPie>();
  1122. foreach (var item in datagroupIsGetBeddingArticle)
  1123. {
  1124. legendDataIsGetBeddingArticle.Add(item.status);
  1125. seriesDataIsGetBeddingArticle.Add(new WfSchemeReportModelOfPie()
  1126. {
  1127. value = item.count,
  1128. name = item.status
  1129. });
  1130. }
  1131. var jsonData = new
  1132. {
  1133. legendDataIsReport = legendDataIsReport,
  1134. seriesDataIsReport = seriesDataIsReport,
  1135. legendDataIsCheckIn = legendDataIsCheckIn,
  1136. seriesDataIsCheckIn = seriesDataIsCheckIn,
  1137. legendDataIsSubsidize1 = legendDataIsSubsidize1,
  1138. seriesDataIsSubsidize1 = seriesDataIsSubsidize1,
  1139. legendDataIsMilitary = legendDataIsMilitary,
  1140. seriesDataIsMilitary = seriesDataIsMilitary,
  1141. legendDataIsPay = legendDataIsPay,
  1142. seriesDataIsPay = seriesDataIsPay,
  1143. legendDataIsMug = legendDataIsMug,
  1144. seriesDataIsMug = seriesDataIsMug,
  1145. legendDataIsTakeCloths = legendDataIsTakeCloths,
  1146. seriesDataIsTakeCloths = seriesDataIsTakeCloths,
  1147. legendDataIsQuantity = legendDataIsQuantity,
  1148. seriesDataIsQuantity = seriesDataIsQuantity,
  1149. legendDataIsGetBeddingArticle = legendDataIsGetBeddingArticle,
  1150. seriesDataIsGetBeddingArticle = seriesDataIsGetBeddingArticle
  1151. };
  1152. return Success(jsonData);
  1153. }
  1154. #endregion
  1155. }
  1156. }