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.
 
 
 
 
 
 

619 lines
16 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. namespace Learun.Application.TwoDevelopment.EducationalAdministration
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2019-02-21 16:53
  12. /// 描 述:学生学籍
  13. /// </summary>
  14. public class StuInfoBasicBLL : StuInfoBasicIBLL
  15. {
  16. private StuInfoBasicService stuInfoBasicService = new StuInfoBasicService();
  17. #region 获取数据
  18. /// <summary>
  19. /// 获取页面显示列表数据
  20. /// <summary>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. public IEnumerable<StuInfoBasicEntity> GetPageList(Pagination pagination, string queryJson)
  24. {
  25. try
  26. {
  27. return stuInfoBasicService.GetPageList(pagination, queryJson);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowBusinessException(ex);
  38. }
  39. }
  40. }
  41. /// <summary>
  42. /// 获取页面显示列表数据
  43. /// <summary>
  44. /// <param name="queryJson">查询参数</param>
  45. /// <returns></returns>
  46. public IEnumerable<StuInfoBasicEntity> GetPageListOfSoonGraduate(Pagination pagination, string queryJson)
  47. {
  48. try
  49. {
  50. return stuInfoBasicService.GetPageListOfSoonGraduate(pagination, queryJson);
  51. }
  52. catch (Exception ex)
  53. {
  54. if (ex is ExceptionEx)
  55. {
  56. throw;
  57. }
  58. else
  59. {
  60. throw ExceptionEx.ThrowBusinessException(ex);
  61. }
  62. }
  63. }
  64. /// <summary>
  65. /// 获取StuInfoBasic表实体数据
  66. /// <param name="keyValue">主键</param>
  67. /// <summary>
  68. /// <returns></returns>
  69. public StuInfoBasicEntity GetStuInfoBasicEntity(string keyValue)
  70. {
  71. try
  72. {
  73. return stuInfoBasicService.GetStuInfoBasicEntity(keyValue);
  74. }
  75. catch (Exception ex)
  76. {
  77. if (ex is ExceptionEx)
  78. {
  79. throw;
  80. }
  81. else
  82. {
  83. throw ExceptionEx.ThrowBusinessException(ex);
  84. }
  85. }
  86. }
  87. /// <summary>
  88. /// 获取准许毕业学生的专业
  89. /// <summary>
  90. /// <returns></returns>
  91. public List<CdMajorEntity> GetMajorInfoWithGraduation()
  92. {
  93. try
  94. {
  95. return stuInfoBasicService.GetMajorInfoWithGraduation();
  96. }
  97. catch (Exception ex)
  98. {
  99. if (ex is ExceptionEx)
  100. {
  101. throw;
  102. }
  103. else
  104. {
  105. throw ExceptionEx.ThrowBusinessException(ex);
  106. }
  107. }
  108. }
  109. /// <summary>
  110. /// 根据专业顺序生成毕业证号
  111. /// <summary>
  112. /// <returns></returns>
  113. public void CreateGraduateNoByMajor(string CityCode, string SchoolCode, string MajorList)
  114. {
  115. try
  116. {
  117. stuInfoBasicService.CreateGraduateNoByMajor(CityCode, SchoolCode, MajorList);
  118. }
  119. catch (Exception ex)
  120. {
  121. if (ex is ExceptionEx)
  122. {
  123. throw;
  124. }
  125. else
  126. {
  127. throw ExceptionEx.ThrowBusinessException(ex);
  128. }
  129. }
  130. }
  131. /// <summary>
  132. /// 获取StuInfoBasic表实体数据
  133. /// <param name="keyValue">主键</param>
  134. /// <summary>
  135. /// <returns></returns>
  136. public StuInfoBasicEntity GetStuNoByAccount(string keyValue)
  137. {
  138. try
  139. {
  140. return stuInfoBasicService.GetStuNoByAccount(keyValue);
  141. }
  142. catch (Exception ex)
  143. {
  144. if (ex is ExceptionEx)
  145. {
  146. throw;
  147. }
  148. else
  149. {
  150. throw ExceptionEx.ThrowBusinessException(ex);
  151. }
  152. }
  153. }
  154. public List<string> GetSaveClassStudents(string account)
  155. {
  156. try
  157. {
  158. return stuInfoBasicService.GetSaveClassStudents(account);
  159. }
  160. catch (Exception ex)
  161. {
  162. if (ex is ExceptionEx)
  163. {
  164. throw;
  165. }
  166. else
  167. {
  168. throw ExceptionEx.ThrowBusinessException(ex);
  169. }
  170. }
  171. }
  172. public StuInfoBasicEntity GetStuInfoBasicEntityByStuNo(string enCode)
  173. {
  174. try
  175. {
  176. return stuInfoBasicService.GetStuInfoBasicEntityByStuNo(enCode);
  177. }
  178. catch (Exception ex)
  179. {
  180. if (ex is ExceptionEx)
  181. {
  182. throw;
  183. }
  184. else
  185. {
  186. throw ExceptionEx.ThrowBusinessException(ex);
  187. }
  188. }
  189. }
  190. public string GetPhotoByStuNo(string enCode)
  191. {
  192. try
  193. {
  194. return stuInfoBasicService.GetPhotoByStuNo(enCode);
  195. }
  196. catch (Exception ex)
  197. {
  198. if (ex is ExceptionEx)
  199. {
  200. throw;
  201. }
  202. else
  203. {
  204. throw ExceptionEx.ThrowBusinessException(ex);
  205. }
  206. }
  207. }
  208. public StuInfoBasicEntity GetStuInfoBasicEntityByStuName(string name)
  209. {
  210. try
  211. {
  212. return stuInfoBasicService.GetStuInfoBasicEntityByStuName(name);
  213. }
  214. catch (Exception ex)
  215. {
  216. if (ex is ExceptionEx)
  217. {
  218. throw;
  219. }
  220. else
  221. {
  222. throw ExceptionEx.ThrowBusinessException(ex);
  223. }
  224. }
  225. }
  226. /// <summary>
  227. /// 获取左侧树形数据
  228. /// <summary>
  229. /// <returns></returns>
  230. public List<TreeModel> GetTree()
  231. {
  232. try
  233. {
  234. DataTable list = stuInfoBasicService.GetSqlTree();
  235. List<TreeModel> treeList = new List<TreeModel>();
  236. foreach (DataRow item in list.Rows)
  237. {
  238. TreeModel node = new TreeModel
  239. {
  240. id = item["classno"].ToString(),
  241. text = item["classname"].ToString(),
  242. value = item["classno"].ToString(),
  243. showcheck = false,
  244. checkstate = 0,
  245. isexpand = true,
  246. parentId = ""
  247. };
  248. treeList.Add(node);
  249. }
  250. return treeList.ToTree();
  251. }
  252. catch (Exception ex)
  253. {
  254. if (ex is ExceptionEx)
  255. {
  256. throw;
  257. }
  258. else
  259. {
  260. throw ExceptionEx.ThrowBusinessException(ex);
  261. }
  262. }
  263. }
  264. public StuInfoBasicEntity GetStuInfoBasicEntityByIdCard(string idcard)
  265. {
  266. try
  267. {
  268. return stuInfoBasicService.GetStuInfoBasicEntityByIdCard(idcard);
  269. }
  270. catch (Exception ex)
  271. {
  272. if (ex is ExceptionEx)
  273. {
  274. throw;
  275. }
  276. else
  277. {
  278. throw ExceptionEx.ThrowBusinessException(ex);
  279. }
  280. }
  281. }
  282. #endregion
  283. #region 提交数据
  284. /// <summary>
  285. /// 生成教师帐号
  286. /// </summary>
  287. public void GenerateAccout()
  288. {
  289. try
  290. {
  291. stuInfoBasicService.GenerateAccout();
  292. }
  293. catch (Exception ex)
  294. {
  295. if (ex is ExceptionEx)
  296. {
  297. throw;
  298. }
  299. else
  300. {
  301. throw ExceptionEx.ThrowBusinessException(ex);
  302. }
  303. }
  304. }
  305. public bool GetAny()
  306. {
  307. try
  308. {
  309. return stuInfoBasicService.GetAny();
  310. }
  311. catch (Exception ex)
  312. {
  313. if (ex is ExceptionEx)
  314. {
  315. throw;
  316. }
  317. else
  318. {
  319. throw ExceptionEx.ThrowBusinessException(ex);
  320. }
  321. }
  322. }
  323. public IEnumerable<StuInfoBasicEntity> GetAllList()
  324. {
  325. try
  326. {
  327. return stuInfoBasicService.GetAllList();
  328. }
  329. catch (Exception ex)
  330. {
  331. if (ex is ExceptionEx)
  332. {
  333. throw;
  334. }
  335. else
  336. {
  337. throw ExceptionEx.ThrowBusinessException(ex);
  338. }
  339. }
  340. }
  341. public IEnumerable<StuInfoBasicEntity> GetStuInfoByClassNo(string classNo)
  342. {
  343. try
  344. {
  345. return stuInfoBasicService.GetStuInfoByClassNo(classNo);
  346. }
  347. catch (Exception ex)
  348. {
  349. if (ex is ExceptionEx)
  350. {
  351. throw;
  352. }
  353. else
  354. {
  355. throw ExceptionEx.ThrowBusinessException(ex);
  356. }
  357. }
  358. }
  359. public void SyncDept()
  360. {
  361. try
  362. {
  363. stuInfoBasicService.SyncDept();
  364. }
  365. catch (Exception ex)
  366. {
  367. if (ex is ExceptionEx)
  368. {
  369. throw;
  370. }
  371. else
  372. {
  373. throw ExceptionEx.ThrowBusinessException(ex);
  374. }
  375. }
  376. }
  377. public void SyncMajor()
  378. {
  379. try
  380. {
  381. stuInfoBasicService.SyncMajor();
  382. }
  383. catch (Exception ex)
  384. {
  385. if (ex is ExceptionEx)
  386. {
  387. throw;
  388. }
  389. else
  390. {
  391. throw ExceptionEx.ThrowBusinessException(ex);
  392. }
  393. }
  394. }
  395. public void UpdateAccount()
  396. {
  397. try
  398. {
  399. stuInfoBasicService.UpdateAccount();
  400. }
  401. catch (Exception ex)
  402. {
  403. if (ex is ExceptionEx)
  404. {
  405. throw;
  406. }
  407. else
  408. {
  409. throw ExceptionEx.ThrowBusinessException(ex);
  410. }
  411. }
  412. }
  413. /// <summary>
  414. /// 删除实体数据
  415. /// <param name="keyValue">主键</param>
  416. /// <summary>
  417. /// <returns></returns>
  418. public void DeleteEntity(string keyValue)
  419. {
  420. try
  421. {
  422. stuInfoBasicService.DeleteEntity(keyValue);
  423. }
  424. catch (Exception ex)
  425. {
  426. if (ex is ExceptionEx)
  427. {
  428. throw;
  429. }
  430. else
  431. {
  432. throw ExceptionEx.ThrowBusinessException(ex);
  433. }
  434. }
  435. }
  436. /// <summary>
  437. /// 领取毕业证
  438. /// <param name="keyValue">主键</param>
  439. /// <summary>
  440. /// <returns></returns>
  441. public void GetCard(string keyValue)
  442. {
  443. try
  444. {
  445. stuInfoBasicService.GetCard(keyValue);
  446. }
  447. catch (Exception ex)
  448. {
  449. if (ex is ExceptionEx)
  450. {
  451. throw;
  452. }
  453. else
  454. {
  455. throw ExceptionEx.ThrowBusinessException(ex);
  456. }
  457. }
  458. }
  459. /// <summary>
  460. /// 毕业生归档
  461. /// <param name="keyValue">主键</param>
  462. /// <summary>
  463. /// <returns></returns>
  464. public void StuStore()
  465. {
  466. try
  467. {
  468. stuInfoBasicService.StuStore();
  469. }
  470. catch (Exception ex)
  471. {
  472. if (ex is ExceptionEx)
  473. {
  474. throw;
  475. }
  476. else
  477. {
  478. throw ExceptionEx.ThrowBusinessException(ex);
  479. }
  480. }
  481. }
  482. /// <summary>
  483. /// 审核全部
  484. /// </summary>
  485. public void CheckAll()
  486. {
  487. try
  488. {
  489. stuInfoBasicService.CheckAll();
  490. }
  491. catch (Exception ex)
  492. {
  493. if (ex is ExceptionEx)
  494. {
  495. throw;
  496. }
  497. else
  498. {
  499. throw ExceptionEx.ThrowBusinessException(ex);
  500. }
  501. }
  502. }
  503. /// <summary>
  504. /// 准许毕业
  505. /// </summary>
  506. public void AllowGraduate(string stuNo, string status)
  507. {
  508. try
  509. {
  510. stuInfoBasicService.AllowGraduate(stuNo, status);
  511. }
  512. catch (Exception ex)
  513. {
  514. if (ex is ExceptionEx)
  515. {
  516. throw;
  517. }
  518. else
  519. {
  520. throw ExceptionEx.ThrowBusinessException(ex);
  521. }
  522. }
  523. }
  524. public void SynPhoto()
  525. {
  526. try
  527. {
  528. stuInfoBasicService.SynPhoto();
  529. }
  530. catch (Exception ex)
  531. {
  532. if (ex is ExceptionEx)
  533. {
  534. throw;
  535. }
  536. else
  537. {
  538. throw ExceptionEx.ThrowBusinessException(ex);
  539. }
  540. }
  541. }
  542. /// <summary>
  543. /// 保存实体数据(新增、修改)
  544. /// <param name="keyValue">主键</param>
  545. /// <summary>
  546. /// <returns></returns>
  547. public void SaveEntity(string keyValue, StuInfoBasicEntity entity)
  548. {
  549. try
  550. {
  551. stuInfoBasicService.SaveEntity(keyValue, entity);
  552. }
  553. catch (Exception ex)
  554. {
  555. if (ex is ExceptionEx)
  556. {
  557. throw;
  558. }
  559. else
  560. {
  561. throw ExceptionEx.ThrowBusinessException(ex);
  562. }
  563. }
  564. }
  565. /// <summary>
  566. /// 更新学生数据
  567. /// </summary>
  568. /// <param name="dt"></param>
  569. /// <param name="fileId"></param>
  570. /// <returns></returns>
  571. public (int snum, int fnum) StuInfoBasicUpdateImport(DataTable dt, string fileId, string classno)
  572. {
  573. try
  574. {
  575. return stuInfoBasicService.StuInfoBasicUpdateImport(dt, fileId, classno);
  576. }
  577. catch (Exception ex)
  578. {
  579. if (ex is ExceptionEx)
  580. {
  581. throw;
  582. }
  583. else
  584. {
  585. throw ExceptionEx.ThrowBusinessException(ex);
  586. }
  587. }
  588. }
  589. #endregion
  590. }
  591. }