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 27 KiB

4 years ago
4 years ago
4 years ago
4 years ago
2 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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  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 Learun.Application.Base.SystemModule;
  9. using Newtonsoft.Json;
  10. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  11. {
  12. /// <summary>
  13. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  14. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  15. /// 创 建:超级管理员
  16. /// 日 期:2019-07-17 11:20
  17. /// 描 述:新生录取管理
  18. /// </summary>
  19. public class StuEnrollController : MvcControllerBase
  20. {
  21. private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL();
  22. private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
  23. private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
  24. private StuEnrollScoreIBLL stuEnrollScoreIBLL = new StuEnrollScoreBLL();
  25. #region 视图功能
  26. /// <summary>
  27. /// 主页面
  28. /// <summary>
  29. /// <returns></returns>
  30. [HttpGet]
  31. public ActionResult Index()
  32. {
  33. return View();
  34. }
  35. /// <summary>
  36. /// 新生报名
  37. /// <summary>
  38. /// <returns></returns>
  39. [HttpGet]
  40. public ActionResult EnrollForm()
  41. {
  42. return View();
  43. }
  44. /// <summary>
  45. /// 新生报名
  46. /// <summary>
  47. /// <returns></returns>
  48. [HttpGet]
  49. public ActionResult EnrollFormView()
  50. {
  51. return View();
  52. }
  53. /// <summary>
  54. /// 新生报名
  55. /// <summary>
  56. /// <returns></returns>
  57. [HttpGet]
  58. public ActionResult EnrollIndex()
  59. {
  60. return View();
  61. }
  62. /// <summary>
  63. /// 新生报名审核
  64. /// <summary>
  65. /// <returns></returns>
  66. [HttpGet]
  67. public ActionResult EnrollSH()
  68. {
  69. return View();
  70. }
  71. /// <summary>
  72. /// 新生报名审核
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. public ActionResult EnrollLQ()
  77. {
  78. return View();
  79. }
  80. /// <summary>
  81. /// 招生统计
  82. /// <summary>
  83. /// <returns></returns>
  84. [HttpGet]
  85. public ActionResult EnrollIndexTJ()
  86. {
  87. return View();
  88. }
  89. [HttpGet]
  90. public ActionResult StudentStatus()
  91. {
  92. return View();
  93. }
  94. [HttpGet]
  95. public ActionResult AmountForm()
  96. {
  97. return View();
  98. }
  99. [HttpGet]
  100. public ActionResult CardPrint()
  101. {
  102. return View();
  103. }
  104. [HttpGet]
  105. public ActionResult Report()
  106. {
  107. return View();
  108. }
  109. [HttpGet]
  110. public ActionResult EnrollTypeForm()
  111. {
  112. return View();
  113. }
  114. /// <summary>
  115. /// 是否住宿
  116. /// </summary>
  117. /// <returns></returns>
  118. [HttpGet]
  119. public ActionResult CheckIn()
  120. {
  121. return View();
  122. }
  123. /// <summary>
  124. /// 是否住宿
  125. /// </summary>
  126. /// <returns></returns>
  127. [HttpGet]
  128. public ActionResult PayAfter()
  129. {
  130. return View();
  131. }
  132. /// <summary>
  133. /// 是否资助
  134. /// </summary>
  135. /// <returns></returns>
  136. [HttpGet]
  137. public ActionResult IsHelp()
  138. {
  139. return View();
  140. }
  141. /// <summary>
  142. /// 是否军训
  143. /// </summary>
  144. /// <returns></returns>
  145. [HttpGet]
  146. public ActionResult Military()
  147. {
  148. return View();
  149. }
  150. /// <summary>
  151. /// 是否军训
  152. /// </summary>
  153. /// <returns></returns>
  154. [HttpGet]
  155. public ActionResult IsPay()
  156. {
  157. return View();
  158. }
  159. [HttpGet]
  160. public ActionResult CheckInUrl()
  161. {
  162. return View();
  163. }
  164. [HttpGet]
  165. public ActionResult SubsidizeUrl()
  166. {
  167. return View();
  168. }
  169. [HttpGet]
  170. public ActionResult MilitaryUrl()
  171. {
  172. return View();
  173. }
  174. /// <summary>
  175. /// 是否拍照
  176. /// </summary>
  177. /// <returns></returns>
  178. [HttpGet]
  179. public ActionResult IsPhoto()
  180. {
  181. return View();
  182. }
  183. /// <summary>
  184. /// 是否领取军训服
  185. /// </summary>
  186. /// <returns></returns>
  187. [HttpGet]
  188. public ActionResult GetCloth()
  189. {
  190. return View();
  191. }
  192. /// <summary>
  193. /// 是否量校服尺寸
  194. /// </summary>
  195. /// <returns></returns>
  196. [HttpGet]
  197. public ActionResult GetClothSize()
  198. {
  199. return View();
  200. }
  201. /// <summary>
  202. /// 是否领取床上用品
  203. /// </summary>
  204. /// <returns></returns>
  205. [HttpGet]
  206. public ActionResult GetArticles()
  207. {
  208. return View();
  209. }
  210. /// <summary>
  211. /// 表单页
  212. /// <summary>
  213. /// <returns></returns>
  214. [HttpGet]
  215. public ActionResult Form()
  216. {
  217. return View();
  218. }
  219. [HttpGet]
  220. public ActionResult FormView()
  221. {
  222. return View();
  223. }
  224. public ActionResult AllocationClass()
  225. {
  226. return View();
  227. }
  228. public ActionResult AllocationDormitory()
  229. {
  230. return View();
  231. }
  232. public ActionResult NewAllocationDormitory()
  233. {
  234. return View();
  235. }
  236. public ActionResult NewAllocationBed()
  237. {
  238. return View();
  239. }
  240. #endregion
  241. #region 获取数据
  242. /// <summary>
  243. /// 获取表单数据
  244. /// <summary>
  245. /// <returns></returns>
  246. [HttpGet]
  247. [AjaxOnly]
  248. public ActionResult GetFormDataForEnroll(string keyValue)
  249. {
  250. var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  251. var jsonData = new
  252. {
  253. StuEnroll = new
  254. {
  255. StuId = StuEnrollData.StuId,
  256. Gender = StuEnrollData.Gender,
  257. StuName = StuEnrollData.StuName,
  258. IDCard = StuEnrollData.IDCard,
  259. IdCardPto1 = StuEnrollData.IdCardPto1,
  260. },
  261. };
  262. return Success(jsonData);
  263. }
  264. /// <summary>
  265. /// 招生统计
  266. /// <summary>
  267. /// <param name="queryJson">查询参数</param>
  268. /// <returns></returns>
  269. [HttpGet]
  270. [AjaxOnly]
  271. public ActionResult GetTJList(string queryJson)
  272. {
  273. var data = stuEnrollIBLL.GetTJList(queryJson);
  274. return Success(data);
  275. }
  276. /// <summary>
  277. /// 获取页面显示列表数据
  278. /// <summary>
  279. /// <param name="queryJson">查询参数</param>
  280. /// <returns></returns>
  281. [HttpGet]
  282. [AjaxOnly]
  283. public ActionResult GetPageList(string pagination, string queryJson)
  284. {
  285. Pagination paginationobj = pagination.ToObject<Pagination>();
  286. var data = stuEnrollIBLL.GetPageList(paginationobj, queryJson);
  287. var jsonData = new
  288. {
  289. rows = data,
  290. total = paginationobj.total,
  291. page = paginationobj.page,
  292. records = paginationobj.records
  293. };
  294. return Success(jsonData);
  295. }
  296. /// <summary>
  297. /// 获取页面显示列表数据
  298. /// <summary>
  299. /// <param name="queryJson">查询参数</param>
  300. /// <returns></returns>
  301. [HttpGet]
  302. [AjaxOnly]
  303. public ActionResult GetPageListForTJ(string pagination, string queryJson)
  304. {
  305. Pagination paginationobj = pagination.ToObject<Pagination>();
  306. var data = stuEnrollIBLL.GetPageListForTJ(paginationobj, queryJson);
  307. var jsonData = new
  308. {
  309. rows = data,
  310. total = paginationobj.total,
  311. page = paginationobj.page,
  312. records = paginationobj.records
  313. };
  314. return Success(jsonData);
  315. }
  316. /// <summary>
  317. /// 审核页面 获取考试科目信息
  318. /// </summary>
  319. /// <returns></returns>
  320. public ActionResult GetExamDataByStuId(string keyValue)
  321. {
  322. var data = stuEnrollIBLL.GetExamDataByStuId(keyValue);
  323. return Success(data);
  324. }
  325. [HttpGet]
  326. [AjaxOnly]
  327. public ActionResult GetDormitorys(string pagination, string queryJson)
  328. {
  329. Pagination paginationobj = pagination.ToObject<Pagination>();
  330. var data = stuEnrollIBLL.GetDormitorys(paginationobj, queryJson);
  331. var jsonData = new
  332. {
  333. rows = data,
  334. total = paginationobj.total,
  335. page = paginationobj.page,
  336. records = paginationobj.records
  337. };
  338. return Success(jsonData);
  339. }
  340. /// <summary>
  341. /// 获取页面显示列表数据
  342. /// <summary>
  343. /// <param name="queryJson">查询参数</param>
  344. /// <returns></returns>
  345. [HttpGet]
  346. [AjaxOnly]
  347. public ActionResult GetReportPageList(string pagination, string queryJson)
  348. {
  349. Pagination paginationobj = pagination.ToObject<Pagination>();
  350. var data = stuEnrollIBLL.GetReportPageList(paginationobj, queryJson);
  351. var jsonData = new
  352. {
  353. rows = data,
  354. total = paginationobj.total,
  355. page = paginationobj.page,
  356. records = paginationobj.records
  357. };
  358. return Success(jsonData);
  359. }
  360. /// <summary>
  361. /// 获取表单数据
  362. /// <summary>
  363. /// <returns></returns>
  364. [HttpGet]
  365. [AjaxOnly]
  366. public ActionResult GetFormData(string keyValue)
  367. {
  368. var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  369. //获取中考成绩
  370. var MidExamScoreData = stuEnrollIBLL.GetMidExamScoreData(keyValue).OrderBy(x => x.sort);
  371. if (string.IsNullOrEmpty(StuEnrollData.CheckInUrl))
  372. {
  373. StuEnrollData.CheckInUrl = Guid.NewGuid().ToString();
  374. }
  375. if (string.IsNullOrEmpty(StuEnrollData.SubsidizeUrl))
  376. {
  377. StuEnrollData.SubsidizeUrl = Guid.NewGuid().ToString();
  378. }
  379. if (string.IsNullOrEmpty(StuEnrollData.MilitaryUrl))
  380. {
  381. StuEnrollData.MilitaryUrl = Guid.NewGuid().ToString();
  382. }
  383. var jsonData = new
  384. {
  385. StuEnroll = StuEnrollData,
  386. StuEnrollMidExamScore = MidExamScoreData
  387. };
  388. return Success(jsonData);
  389. }
  390. [HttpPost]
  391. [AjaxOnly]
  392. public ActionResult RealationPhoto()
  393. {
  394. var studentList = stuEnrollIBLL.AllStudent().ToList();
  395. foreach (var student in studentList)
  396. {
  397. if (string.IsNullOrEmpty(student.PhotoUrl))
  398. {
  399. student.PhotoUrl = Guid.NewGuid().ToString();
  400. stuEnrollIBLL.SaveEntity(student.StuId, student);
  401. }
  402. var annexEntity = annexesFileIBLL.GetEntityByFolderId(student.PhotoUrl);
  403. if (annexEntity == null)
  404. {
  405. annexEntity = new AnnexesFileEntity();
  406. annexEntity.Create();
  407. annexEntity.F_Id = Guid.NewGuid().ToString();
  408. }
  409. }
  410. return Success("");
  411. }
  412. [HttpGet]
  413. [AjaxOnly]
  414. public ActionResult GetStuInfo(string stuId)
  415. {
  416. var result = stuEnrollIBLL.GetStuInfo(stuId);
  417. return Success(result);
  418. }
  419. [HttpGet]
  420. [AjaxOnly]
  421. public ActionResult GetYearListByClass()
  422. {
  423. var classList = classInfoIBLL.GetAllClass().ToList();
  424. var result = classList.GroupBy(a => a.Grade).Select(m => m.Key).ToList();
  425. List<object> list = new List<object>();
  426. foreach (var item in result)
  427. {
  428. list.Add(new { year = item });
  429. }
  430. return Success(list);
  431. }
  432. [HttpPost]
  433. [AjaxOnly]
  434. public ActionResult GetStuDefaultInfo(string StuId)
  435. {
  436. var result = stuEnrollIBLL.GetStuDefaultInfo(StuId);
  437. return Success(result);
  438. }
  439. [HttpPost]
  440. [AjaxOnly]
  441. public ActionResult GetPaymentInfo()
  442. {
  443. var result = stuEnrollIBLL.GetPaymentInfo();
  444. return Success(result);
  445. }
  446. [HttpPost]
  447. [AjaxOnly]
  448. public ActionResult GetCheckInStatistics(string DeptNo, string MajorNo, string ClassNo)
  449. {
  450. var result = stuEnrollIBLL.GetCheckInStatistics(DeptNo, MajorNo, ClassNo);
  451. return Success(result);
  452. }
  453. [HttpPost]
  454. [AjaxOnly]
  455. public ActionResult GetHelpStatistics(string DeptNo, string MajorNo, string ClassNo)
  456. {
  457. var result = stuEnrollIBLL.GetHelpStatistics(DeptNo, MajorNo, ClassNo);
  458. return Success(result);
  459. }
  460. [HttpPost]
  461. [AjaxOnly]
  462. public ActionResult GetMilitaryStatistics(string DeptNo, string MajorNo, string ClassNo)
  463. {
  464. var result = stuEnrollIBLL.GetMilitaryStatistics(DeptNo, MajorNo, ClassNo);
  465. return Success(result);
  466. }
  467. /// <summary>
  468. /// 获取左侧树形数据
  469. /// <summary>
  470. /// <returns></returns>
  471. [HttpGet]
  472. [AjaxOnly]
  473. public ActionResult GetTreeNew()
  474. {
  475. var data = stuEnrollIBLL.GetTree();
  476. return Success(data);
  477. }
  478. /// <summary>
  479. /// 获取左侧树形数据
  480. /// <summary>
  481. /// <returns></returns>
  482. [HttpGet]
  483. [AjaxOnly]
  484. public ActionResult GetBedTree(string classNo, string gender)
  485. {
  486. var data = stuEnrollIBLL.GetBedTree(classNo, gender);
  487. return Success(data);
  488. }
  489. #endregion
  490. #region 提交数据
  491. /// <summary>
  492. /// 删除实体数据
  493. /// <param name="keyValue">主键</param>
  494. /// <summary>
  495. /// <returns></returns>
  496. [HttpPost]
  497. [AjaxOnly]
  498. public ActionResult DeleteForm(string keyValue)
  499. {
  500. stuEnrollIBLL.DeleteEntity(keyValue);
  501. return Success("删除成功!");
  502. }
  503. /// <summary>
  504. /// 保存实体数据(新增、修改)
  505. /// <param name="keyValue">主键</param>
  506. /// <summary>
  507. /// <returns></returns>
  508. [HttpPost]
  509. [ValidateAntiForgeryToken]
  510. [AjaxOnly]
  511. public ActionResult SaveForm(string keyValue, string strEntity)
  512. {
  513. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  514. stuEnrollIBLL.SaveEntity(keyValue, entity);
  515. return Success("保存成功!");
  516. }
  517. /// <summary>
  518. /// 保存实收金额
  519. /// <param name="keyValue">主键</param>
  520. /// <summary>
  521. /// <returns></returns>
  522. [HttpPost]
  523. [ValidateAntiForgeryToken]
  524. [AjaxOnly]
  525. public ActionResult SaveActualPayAmount(string keyValue, string strEntity)
  526. {
  527. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  528. var newEntity = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  529. newEntity.ActualPayAmount = entity.ActualPayAmount;
  530. stuEnrollIBLL.SaveEntity(keyValue, newEntity);
  531. return Success("保存成功!");
  532. }
  533. /// <summary>
  534. /// 保存实体数据(新增、修改)
  535. /// <param name="keyValue">主键</param>
  536. /// <summary>
  537. /// <returns></returns>
  538. [HttpPost]
  539. [AjaxOnly]
  540. public ActionResult EditEnrollType(string stuIds, string enrollType)
  541. {
  542. if (!string.IsNullOrEmpty(stuIds))
  543. {
  544. stuEnrollIBLL.EditEnrollType(stuIds, enrollType);
  545. }
  546. return Success("保存成功!");
  547. }
  548. [HttpPost]
  549. [AjaxOnly]
  550. public ActionResult AllocationClass(string classNo, string dataJson)
  551. {
  552. stuEnrollIBLL.AllocationClass(classNo, dataJson);
  553. return Success("分配成功!");
  554. }
  555. [HttpPost]
  556. [AjaxOnly]
  557. public ActionResult NewAllocationDormitory(string classNo, string dataJson)
  558. {
  559. stuEnrollIBLL.NewAllocationDormitory(classNo, dataJson);
  560. return Success("分配成功!");
  561. }
  562. [HttpPost]
  563. [AjaxOnly]
  564. public ActionResult AllocationDormitory(string dormitoryNo, string stuId, string dormitoryName)
  565. {
  566. stuEnrollIBLL.AllocationDormiotry(dormitoryNo, stuId, dormitoryName);
  567. return Success("分配成功!");
  568. }
  569. [HttpPost]
  570. [AjaxOnly]
  571. public ActionResult SyncDept()
  572. {
  573. stuEnrollIBLL.SyncDept();
  574. return Success("同步成功");
  575. }
  576. [HttpPost]
  577. [AjaxOnly]
  578. public ActionResult SyncMajor()
  579. {
  580. stuEnrollIBLL.SyncMajor();
  581. return Success("同步成功");
  582. }
  583. [HttpPost]
  584. [AjaxOnly]
  585. public ActionResult Sign(string stuId, bool status)
  586. {
  587. var result = stuEnrollIBLL.Sign(stuId, status);
  588. if (result.Item1)
  589. {
  590. return Success(result.Item2);
  591. }
  592. else
  593. {
  594. return Fail(result.Item2);
  595. }
  596. }
  597. [HttpPost]
  598. [AjaxOnly]
  599. public ActionResult AllReport()
  600. {
  601. stuEnrollIBLL.AllReport();
  602. return Success("操作成功");
  603. }
  604. [HttpPost]
  605. [AjaxOnly]
  606. public ActionResult AllPhoto()
  607. {
  608. stuEnrollIBLL.AllPhoto();
  609. return Success("操作成功");
  610. }
  611. [HttpPost]
  612. [AjaxOnly]
  613. public ActionResult AllGetCloth()
  614. {
  615. stuEnrollIBLL.AllGetCloth();
  616. return Success("操作成功");
  617. }
  618. [HttpPost]
  619. [AjaxOnly]
  620. public ActionResult AllGetSize()
  621. {
  622. stuEnrollIBLL.AllGetSize();
  623. return Success("操作成功");
  624. }
  625. [HttpPost]
  626. [AjaxOnly]
  627. public ActionResult AllGetArticle()
  628. {
  629. stuEnrollIBLL.AllGetArticle();
  630. return Success("操作成功");
  631. }
  632. [HttpPost]
  633. [AjaxOnly]
  634. public ActionResult Report(string stuId, bool status)
  635. {
  636. var result = stuEnrollIBLL.Report(stuId, status);
  637. if (result.Item1)
  638. {
  639. return Success(result.Item2);
  640. }
  641. else
  642. {
  643. return Fail(result.Item2);
  644. }
  645. }
  646. [HttpPost]
  647. [AjaxOnly]
  648. public ActionResult Stay(string stuId, bool status, bool payAfter = false)
  649. {
  650. var result = stuEnrollIBLL.Stay(stuId, status, payAfter);
  651. if (result.Item1)
  652. {
  653. return Success(result.Item2);
  654. }
  655. else
  656. {
  657. return Fail(result.Item2);
  658. }
  659. }
  660. [HttpPost]
  661. [AjaxOnly]
  662. public ActionResult AllStay()
  663. {
  664. stuEnrollIBLL.AllStay();
  665. return Success("操作成功");
  666. }
  667. [HttpPost]
  668. [AjaxOnly]
  669. public ActionResult Help(string stuId, bool status, bool payAfter = false)
  670. {
  671. var result = stuEnrollIBLL.Help(stuId, status, payAfter);
  672. if (result.Item1)
  673. {
  674. return Success(result.Item2);
  675. }
  676. else
  677. {
  678. return Fail(result.Item2);
  679. }
  680. }
  681. [HttpPost]
  682. [AjaxOnly]
  683. public ActionResult AllHelp()
  684. {
  685. stuEnrollIBLL.AllHelp();
  686. return Success("操作成功");
  687. }
  688. [HttpPost]
  689. [AjaxOnly]
  690. public ActionResult Military(string stuId, bool status, bool payAfter = false)
  691. {
  692. var result = stuEnrollIBLL.Military(stuId, status, payAfter);
  693. if (result.Item1)
  694. {
  695. return Success(result.Item2);
  696. }
  697. else
  698. {
  699. return Fail(result.Item2);
  700. }
  701. }
  702. [HttpPost]
  703. [AjaxOnly]
  704. public ActionResult AllMilitary()
  705. {
  706. stuEnrollIBLL.AllMilitary();
  707. return Success("成功");
  708. }
  709. [HttpPost]
  710. [AjaxOnly]
  711. public ActionResult IsPay(string stuId, bool status)
  712. {
  713. var result = stuEnrollIBLL.IsPay(stuId, status);
  714. if (result.Item1)
  715. {
  716. return Success(result.Item2);
  717. }
  718. else
  719. {
  720. return Fail(result.Item2);
  721. }
  722. }
  723. [HttpPost]
  724. [AjaxOnly]
  725. public ActionResult IsPhoto(string stuId, string base64url)
  726. {
  727. var loginuser = LoginUserInfo.Get();
  728. //头像处理
  729. var folderId = Guid.NewGuid().ToString();
  730. string filePath = Config.GetValue("AnnexesFile");
  731. string uploadDate = DateTime.Now.ToString("yyyyMMdd");
  732. string FileEextension = ".png";
  733. string fileGuid = Guid.NewGuid().ToString();
  734. string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, loginuser.account, uploadDate, fileGuid, FileEextension);
  735. //创建文件夹
  736. string path = Path.GetDirectoryName(virtualPath);
  737. Directory.CreateDirectory(path);
  738. AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity();
  739. if (!System.IO.File.Exists(virtualPath))
  740. {
  741. byte[] bytes = Convert.FromBase64String(base64url.Replace("data:image/png;base64,", ""));
  742. FileInfo file = new FileInfo(virtualPath);
  743. FileStream fs = file.Create();
  744. fs.Write(bytes, 0, bytes.Length);
  745. fs.Close();
  746. //文件信息写入数据库
  747. fileAnnexesEntity.F_Id = fileGuid;
  748. fileAnnexesEntity.F_FileName = "userphoto.png";
  749. fileAnnexesEntity.F_FilePath = virtualPath;
  750. fileAnnexesEntity.F_FileSize = bytes.Length.ToString();
  751. fileAnnexesEntity.F_FileExtensions = FileEextension;
  752. fileAnnexesEntity.F_FileType = FileEextension.Replace(".", "");
  753. fileAnnexesEntity.F_CreateUserId = loginuser.userId;
  754. fileAnnexesEntity.F_CreateUserName = loginuser.realName;
  755. annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity);
  756. }
  757. var result = stuEnrollIBLL.IsPhoto(stuId, true, fileGuid);
  758. if (result.Item1)
  759. {
  760. return Success(result.Item2);
  761. }
  762. else
  763. {
  764. return Fail(result.Item2);
  765. }
  766. }
  767. [HttpPost]
  768. [AjaxOnly]
  769. public ActionResult GetCloth(string stuId, bool status)
  770. {
  771. var result = stuEnrollIBLL.GetCloth(stuId, status);
  772. if (result.Item1)
  773. {
  774. return Success(result.Item2);
  775. }
  776. else
  777. {
  778. return Fail(result.Item2);
  779. }
  780. }
  781. [HttpPost]
  782. [AjaxOnly]
  783. public ActionResult GetClothSize(string stuId, bool status)
  784. {
  785. var result = stuEnrollIBLL.GetClothSize(stuId, status);
  786. if (result.Item1)
  787. {
  788. return Success(result.Item2);
  789. }
  790. else
  791. {
  792. return Fail(result.Item2);
  793. }
  794. }
  795. [HttpPost]
  796. [AjaxOnly]
  797. public ActionResult GetArticles(string stuId, bool status)
  798. {
  799. var result = stuEnrollIBLL.GetArticles(stuId, status);
  800. if (result.Item1)
  801. {
  802. return Success(result.Item2);
  803. }
  804. else
  805. {
  806. return Fail(result.Item2);
  807. }
  808. }
  809. [HttpPost]
  810. [AjaxOnly]
  811. public ActionResult GetMoney()
  812. {
  813. stuEnrollIBLL.GetMoney();
  814. return Success("操作成功");
  815. }
  816. /// <summary>
  817. /// 下载文件
  818. /// </summary>
  819. /// <param name="fileId">文件id</param>
  820. /// <returns></returns>
  821. [HttpPost]
  822. public void DownWrod()
  823. {
  824. ExcelHelper.aaaaa();
  825. }
  826. /// <summary>
  827. /// 关联照片
  828. /// </summary>
  829. /// <returns></returns>
  830. public ActionResult RelationPhoto()
  831. {
  832. stuEnrollIBLL.RelationPhoto();
  833. return Success("关联成功");
  834. }
  835. /// <summary>
  836. /// 同步学生数据
  837. /// </summary>
  838. /// <returns></returns>
  839. public ActionResult Synchronization()
  840. {
  841. stuEnrollIBLL.Synchronization();
  842. return Success("同步成功");
  843. }
  844. /// <summary>
  845. /// 报名审核
  846. /// </summary>
  847. /// <returns></returns>
  848. public ActionResult UpdateEnrollStatus(string keyValue, string strEntity)
  849. {
  850. var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue);
  851. if (string.IsNullOrEmpty(StuEnrollData.SubjectNo))
  852. {
  853. return Fail("考试科目不能为空!");
  854. }
  855. stuEnrollIBLL.UpdateEnrollStatus(keyValue, 2);
  856. return Success("保存成功");
  857. }
  858. /// <summary>
  859. /// 报名--去审核
  860. /// </summary>
  861. /// <returns></returns>
  862. public ActionResult NoCheck(string keyValue)
  863. {
  864. stuEnrollIBLL.UpdateEnrollStatus(keyValue, 0);
  865. return Success("保存成功");
  866. }
  867. /// <summary>
  868. /// 录取
  869. /// </summary>
  870. /// <returns></returns>
  871. public ActionResult Admission(string keyValue, int IsAdmission)
  872. {
  873. var count = stuEnrollScoreIBLL.GetNoCheck(keyValue);
  874. if (count > 0)
  875. {
  876. return Fail("该学生有未审核的科目成绩");
  877. }
  878. stuEnrollIBLL.Admission(keyValue, IsAdmission);
  879. return Success("保存成功");
  880. }
  881. #endregion
  882. }
  883. }