您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

683 行
20 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. using System.Threading.Tasks;
  6. using Learun.Application.Organization;
  7. using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService;
  8. namespace Learun.Application.TwoDevelopment.EducationalAdministration
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2019-02-27 11:05
  15. /// 描 述:排课
  16. /// </summary>
  17. public class ArrangeLessonTermBLL : ArrangeLessonTermIBLL
  18. {
  19. private ArrangeLessonTermService arrangeLessonTermService = new ArrangeLessonTermService();
  20. #region 获取数据
  21. /// <summary>
  22. /// 获取列表数据
  23. /// <summary>
  24. /// <returns></returns>
  25. public IEnumerable<ArrangeLessonTermEntity> GetList(string queryJson)
  26. {
  27. try
  28. {
  29. return arrangeLessonTermService.GetList(queryJson);
  30. }
  31. catch (Exception ex)
  32. {
  33. if (ex is ExceptionEx)
  34. {
  35. throw;
  36. }
  37. else
  38. {
  39. throw ExceptionEx.ThrowBusinessException(ex);
  40. }
  41. }
  42. }
  43. public IEnumerable<ArrangeLessonTermEntity> GetListForTimeTable(string queryJson)
  44. {
  45. try
  46. {
  47. return arrangeLessonTermService.GetListForTimeTable(queryJson);
  48. }
  49. catch (Exception ex)
  50. {
  51. if (ex is ExceptionEx)
  52. {
  53. throw;
  54. }
  55. else
  56. {
  57. throw ExceptionEx.ThrowBusinessException(ex);
  58. }
  59. }
  60. }
  61. /// <summary>
  62. /// 获取列表分页数据
  63. /// <param name="pagination">分页参数</param>
  64. /// <summary>
  65. /// <returns></returns>
  66. public IEnumerable<ArrangeLessonTermEntity> GetPageList(Pagination pagination, string queryJson)
  67. {
  68. try
  69. {
  70. return arrangeLessonTermService.GetPageList(pagination, queryJson);
  71. }
  72. catch (Exception ex)
  73. {
  74. if (ex is ExceptionEx)
  75. {
  76. throw;
  77. }
  78. else
  79. {
  80. throw ExceptionEx.ThrowBusinessException(ex);
  81. }
  82. }
  83. }
  84. /// <summary>
  85. /// 获取列表分页数据
  86. /// <param name="pagination">分页参数</param>
  87. /// <summary>
  88. /// <returns></returns>
  89. public IEnumerable<LessonStatictisEntity> GetcoursestatictisList(Pagination pagination, string queryJson)
  90. {
  91. try
  92. {
  93. return arrangeLessonTermService.GetcoursestatictisList(pagination, queryJson);
  94. }
  95. catch (Exception ex)
  96. {
  97. if (ex is ExceptionEx)
  98. {
  99. throw;
  100. }
  101. else
  102. {
  103. throw ExceptionEx.ThrowBusinessException(ex);
  104. }
  105. }
  106. }
  107. /// <summary>
  108. /// 获取实体数据
  109. /// <param name="keyValue">主键</param>
  110. /// <summary>
  111. /// <returns></returns>
  112. public ArrangeLessonTermEntity GetEntity(string keyValue)
  113. {
  114. try
  115. {
  116. return arrangeLessonTermService.GetEntity(keyValue);
  117. }
  118. catch (Exception ex)
  119. {
  120. if (ex is ExceptionEx)
  121. {
  122. throw;
  123. }
  124. else
  125. {
  126. throw ExceptionEx.ThrowBusinessException(ex);
  127. }
  128. }
  129. }
  130. public IEnumerable<ArrangeLessonTermEntity> GetListByEmpNo(List<string> empNos)
  131. {
  132. try
  133. {
  134. return arrangeLessonTermService.GetListByEmpNo(empNos);
  135. }
  136. catch (Exception ex)
  137. {
  138. if (ex is ExceptionEx)
  139. {
  140. throw;
  141. }
  142. else
  143. {
  144. throw ExceptionEx.ThrowBusinessException(ex);
  145. }
  146. }
  147. }
  148. #endregion
  149. #region 提交数据
  150. /// <summary>
  151. /// 删除实体数据
  152. /// <param name="keyValue">主键</param>
  153. /// <summary>
  154. /// <returns></returns>
  155. public void DeleteEntity(string keyValue)
  156. {
  157. try
  158. {
  159. arrangeLessonTermService.DeleteEntity(keyValue);
  160. }
  161. catch (Exception ex)
  162. {
  163. if (ex is ExceptionEx)
  164. {
  165. throw;
  166. }
  167. else
  168. {
  169. throw ExceptionEx.ThrowBusinessException(ex);
  170. }
  171. }
  172. }
  173. /// <summary>
  174. /// 保存实体数据(新增、修改)
  175. /// <param name="keyValue">主键</param>
  176. /// <summary>
  177. /// <returns></returns>
  178. public void SaveEntity(string keyValue, ArrangeLessonTermEntity entity)
  179. {
  180. try
  181. {
  182. arrangeLessonTermService.SaveEntity(keyValue, entity);
  183. }
  184. catch (Exception ex)
  185. {
  186. if (ex is ExceptionEx)
  187. {
  188. throw;
  189. }
  190. else
  191. {
  192. throw ExceptionEx.ThrowBusinessException(ex);
  193. }
  194. }
  195. }
  196. public IEnumerable<StuInfoBasicEntity> GetStudents()
  197. {
  198. try
  199. {
  200. return arrangeLessonTermService.GetStudents();
  201. }
  202. catch (Exception ex)
  203. {
  204. if (ex is ExceptionEx)
  205. {
  206. throw;
  207. }
  208. else
  209. {
  210. throw ExceptionEx.ThrowBusinessException(ex);
  211. }
  212. }
  213. }
  214. #endregion
  215. /// <summary>
  216. /// 获取相关课程考勤的学生信息
  217. /// </summary>
  218. /// <param name="year"></param>
  219. /// <param name="semester"></param>
  220. /// <param name="empno"></param>
  221. /// <param name="lessonNo"></param>
  222. /// <param name="teachClassNo"></param>
  223. /// <returns></returns>
  224. public IEnumerable<StuSelectLessonListEntity> AttendanceStudents(Pagination pagination, string queryJson)
  225. {
  226. var data = arrangeLessonTermService.AttendanceStudents(pagination, queryJson);
  227. return data;
  228. }
  229. public IEnumerable<CdMajorEntity> GetMajors()
  230. {
  231. var data = arrangeLessonTermService.GetMajors();
  232. return data;
  233. }
  234. public IEnumerable<CdMajorEntity> GetMajorsNotRecord(string academicYearNo, string semester)
  235. {
  236. var data = arrangeLessonTermService.GetMajorsNotRecord(academicYearNo, semester);
  237. return data;
  238. }
  239. public IEnumerable<ClassroomInfoEntity> GetClassrooms()
  240. {
  241. var data = arrangeLessonTermService.GetClassrooms();
  242. return data;
  243. }
  244. public IEnumerable<ClassroomInfoEntity> GetClassroomsNotRecord(string academicYearNo, string semester)
  245. {
  246. var data = arrangeLessonTermService.GetClassroomsNotRecord(academicYearNo, semester);
  247. return data;
  248. }
  249. public IEnumerable<CdClassTypeEntity> GetClassType()
  250. {
  251. var data = arrangeLessonTermService.GetClassType();
  252. return data;
  253. }
  254. public IEnumerable<LessonInfoEntity> GetLessons()
  255. {
  256. var data = arrangeLessonTermService.GetLessons();
  257. return data;
  258. }
  259. public IEnumerable<CdClassTypeEntity> GetClassroomType()
  260. {
  261. var data = arrangeLessonTermService.GetClassroomType();
  262. return data;
  263. }
  264. public IEnumerable<DepartmentEntity> GetDepartments()
  265. {
  266. var data = arrangeLessonTermService.GetDepartments();
  267. return data;
  268. }
  269. public IEnumerable<LessonInfoEntity> GetLessonsNotRecord(string academicYearNo, string semester)
  270. {
  271. var data = arrangeLessonTermService.GetLessonsNotRecord(academicYearNo, semester);
  272. return data;
  273. }
  274. public IEnumerable<CdLessonSortDetailEntity> GetLessonSortDetails()
  275. {
  276. var data = arrangeLessonTermService.GetLessonSortDetails();
  277. return data;
  278. }
  279. public IEnumerable<CdLessonSortEntity> GetLessonSorts()
  280. {
  281. var data = arrangeLessonTermService.GetLessonSorts();
  282. return data;
  283. }
  284. public bool GetAny()
  285. {
  286. try
  287. {
  288. return arrangeLessonTermService.GetAny();
  289. }
  290. catch (Exception ex)
  291. {
  292. if (ex is ExceptionEx)
  293. {
  294. throw;
  295. }
  296. else
  297. {
  298. throw ExceptionEx.ThrowBusinessException(ex);
  299. }
  300. }
  301. }
  302. public IEnumerable<CdDeptEntity> GetDepts()
  303. {
  304. var data = arrangeLessonTermService.GetDepts();
  305. return data;
  306. }
  307. public IEnumerable<CdDeptEntity> GetDeptsNotRecord(string academicYearNo, string semester)
  308. {
  309. var data = arrangeLessonTermService.GetDeptsNotRecord(academicYearNo, semester);
  310. return data;
  311. }
  312. public IEnumerable<CompanyEntity> GetSchools()
  313. {
  314. var data = arrangeLessonTermService.GetSchools();
  315. return data;
  316. }
  317. public IEnumerable<CompanyEntity> GetSchoolsNotRecord(string academicYearNo, string semester)
  318. {
  319. var data = arrangeLessonTermService.GetSchoolsNotRecord(academicYearNo, semester);
  320. return data;
  321. }
  322. public IEnumerable<CdLessonTypeEntity> GetLessonTypes()
  323. {
  324. var data = arrangeLessonTermService.GetLessonTypes();
  325. return data;
  326. }
  327. public IEnumerable<ArrangeLessonTermEntity> GetPageListForTeacherWorkload(Pagination paginationobj, string queryJson)
  328. {
  329. try
  330. {
  331. return arrangeLessonTermService.GetPageListForTeacherWorkload(paginationobj, queryJson);
  332. }
  333. catch (Exception ex)
  334. {
  335. if (ex is ExceptionEx)
  336. {
  337. throw;
  338. }
  339. else
  340. {
  341. throw ExceptionEx.ThrowBusinessException(ex);
  342. }
  343. }
  344. }
  345. /// <summary>
  346. /// 教学工作量
  347. /// </summary>
  348. /// <param name="paginationobj"></param>
  349. /// <param name="queryJson"></param>
  350. /// <returns></returns>
  351. public IEnumerable<ArrangeLessonTermEntity> GetPageListForTeacherWorkloadByEmpNo(Pagination paginationobj, string queryJson, string empNo)
  352. {
  353. try
  354. {
  355. return arrangeLessonTermService.GetPageListForTeacherWorkloadByEmpNo(paginationobj, queryJson, empNo);
  356. }
  357. catch (Exception ex)
  358. {
  359. if (ex is ExceptionEx)
  360. {
  361. throw;
  362. }
  363. else
  364. {
  365. throw ExceptionEx.ThrowBusinessException(ex);
  366. }
  367. }
  368. }
  369. public IEnumerable<TeachClassEntity> GetClassLessons()
  370. {
  371. var data = arrangeLessonTermService.GetClassLessons();
  372. return data;
  373. }
  374. public IEnumerable<EmpInfoEntity> GetTeachers()
  375. {
  376. var data = arrangeLessonTermService.GetTeachers();
  377. return data;
  378. }
  379. public IEnumerable<EmpInfoEntity> GetTeachersNotRecord(string academicYearNo, string semester)
  380. {
  381. var data = arrangeLessonTermService.GetTeachersNotRecord(academicYearNo, semester);
  382. return data;
  383. }
  384. public IEnumerable<ClassInfoEntity> GetClasses()
  385. {
  386. var data = arrangeLessonTermService.GetClasses();
  387. return data;
  388. }
  389. public IEnumerable<ClassInfoEntity> GetClassesNotRecord(string academicYearNo, string semester)
  390. {
  391. var data = arrangeLessonTermService.GetClassesNotRecord(academicYearNo, semester);
  392. return data;
  393. }
  394. public IEnumerable<StuInfoBasicEntity> GetStus()
  395. {
  396. var data = arrangeLessonTermService.GetStus();
  397. return data;
  398. }
  399. public IEnumerable<StuInfoBasicEntity> GetStusNotRecord(string academicYearNo, string semester)
  400. {
  401. var data = arrangeLessonTermService.GetStusNotRecord(academicYearNo, semester);
  402. return data;
  403. }
  404. /// <summary>
  405. /// 课程表
  406. /// </summary>
  407. /// <param name="userAccount">账号</param>
  408. /// <param name="userType">用户类型 学生 教师</param>
  409. /// <param name="startDate">查询开始时间</param>
  410. /// <param name="endDate">查询截止时间</param>
  411. /// <returns></returns>
  412. public IEnumerable<TimeTable> GetTimeTable(string userAccount, string userType, string startDate, string endDate)
  413. {
  414. var data = arrangeLessonTermService.GetTimeTable(userAccount, userType, startDate, endDate);
  415. return data;
  416. }
  417. public async Task<bool> AsyncArrangeLessonData()
  418. {
  419. var data = await arrangeLessonTermService.AsyncArrangeLessonData();
  420. return data;
  421. }
  422. /// <summary>
  423. /// 清空当前学期排课数据
  424. /// </summary>
  425. /// <returns></returns>
  426. public async Task<bool> AsyncModifyArrangeLessonData()
  427. {
  428. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonData();
  429. return data;
  430. }
  431. /// <summary>
  432. /// 按条件清空排课数据
  433. /// </summary>
  434. /// <returns></returns>
  435. public async Task<bool> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  436. {
  437. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonDataByCondition(entity);
  438. return data;
  439. }
  440. /// <summary>
  441. /// 按条件同步排课数据
  442. /// </summary>
  443. /// <returns></returns>
  444. public async Task<bool> AsyncArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  445. {
  446. var data = await arrangeLessonTermService.AsyncArrangeLessonDataByCondition(entity);
  447. return data;
  448. }
  449. /// <summary>
  450. /// 课程表【教务】
  451. /// </summary>
  452. /// <param name="startDate">查询开始时间</param>
  453. /// <param name="endDate">查询截止时间</param>
  454. /// <param name="classNo">班级编号</param>
  455. /// <param name="empNo">教师编号</param>
  456. /// <param name="classroomNo">教室编号</param>
  457. /// <returns></returns>
  458. public IEnumerable<TimeTable> GetTimeTableInEducation(string startDate, string endDate, string classNo, string empNo, string schoolId, string classroomNo)
  459. {
  460. try
  461. {
  462. return arrangeLessonTermService.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, classroomNo);
  463. }
  464. catch (Exception ex)
  465. {
  466. if (ex is ExceptionEx)
  467. {
  468. throw;
  469. }
  470. else
  471. {
  472. throw ExceptionEx.ThrowBusinessException(ex);
  473. }
  474. }
  475. }
  476. /// <summary>
  477. /// 课程表【教务】--班级下拉框信息
  478. /// </summary>
  479. /// <returns></returns>
  480. public IEnumerable<SelectModel> GetClassData(string schoolId)
  481. {
  482. try
  483. {
  484. return arrangeLessonTermService.GetClassData(schoolId);
  485. }
  486. catch (Exception ex)
  487. {
  488. if (ex is ExceptionEx)
  489. {
  490. throw;
  491. }
  492. else
  493. {
  494. throw ExceptionEx.ThrowBusinessException(ex);
  495. }
  496. }
  497. }
  498. /// <summary>
  499. /// 课程表【教务】--教师下拉框信息
  500. /// </summary>
  501. /// <param name="startDate"></param>
  502. /// <returns></returns>
  503. public IEnumerable<SelectModel> GetTeacherData(string schoolId)
  504. {
  505. try
  506. {
  507. return arrangeLessonTermService.GetTeacherData(schoolId);
  508. }
  509. catch (Exception ex)
  510. {
  511. if (ex is ExceptionEx)
  512. {
  513. throw;
  514. }
  515. else
  516. {
  517. throw ExceptionEx.ThrowBusinessException(ex);
  518. }
  519. }
  520. }
  521. /// <summary>
  522. /// 课程表【教务】--教室下拉框信息
  523. /// </summary>
  524. /// <returns></returns>
  525. public IEnumerable<SelectModel> GetClassroomData(string schoolId)
  526. {
  527. try
  528. {
  529. return arrangeLessonTermService.GetClassroomData(schoolId);
  530. }
  531. catch (Exception ex)
  532. {
  533. if (ex is ExceptionEx)
  534. {
  535. throw;
  536. }
  537. else
  538. {
  539. throw ExceptionEx.ThrowBusinessException(ex);
  540. }
  541. }
  542. }
  543. /// <summary>
  544. /// 教学调度【教务】--课程下拉框信息
  545. /// </summary>
  546. /// <returns></returns>
  547. public IEnumerable<SelectModel> GetLessonDataInTerm(string queryJson)
  548. {
  549. try
  550. {
  551. return arrangeLessonTermService.GetLessonDataInTerm(queryJson);
  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. public IEnumerable<TimeTable> GetAllClassLesson(string academicYearNo, string semester)
  566. {
  567. try
  568. {
  569. return arrangeLessonTermService.GetAllClassLesson(academicYearNo, semester);
  570. }
  571. catch (Exception ex)
  572. {
  573. if (ex is ExceptionEx)
  574. {
  575. throw;
  576. }
  577. else
  578. {
  579. throw ExceptionEx.ThrowBusinessException(ex);
  580. }
  581. }
  582. }
  583. public bool InitAsyncDataByCondition(ArrangeLessonTermEntity entity)
  584. {
  585. var data = arrangeLessonTermService.InitAsyncDataByCondition(entity);
  586. return data;
  587. }
  588. /// <summary>
  589. /// 导入
  590. /// </summary>
  591. /// <param name="dt"></param>
  592. /// <param name="fileId"></param>
  593. /// <returns></returns>
  594. public string ArrangeLessonTermImport(DataTable dt, string fileId)
  595. {
  596. try
  597. {
  598. return arrangeLessonTermService.ArrangeLessonTermImport(dt, fileId);
  599. }
  600. catch (Exception ex)
  601. {
  602. if (ex is ExceptionEx)
  603. {
  604. throw;
  605. }
  606. else
  607. {
  608. throw ExceptionEx.ThrowBusinessException(ex);
  609. }
  610. }
  611. }
  612. public string ArrangeLessonTermImportPk(DataTable dt, string fileId)
  613. {
  614. try
  615. {
  616. return arrangeLessonTermService.ArrangeLessonTermImportPk(dt, fileId);
  617. }
  618. catch (Exception ex)
  619. {
  620. if (ex is ExceptionEx)
  621. {
  622. throw;
  623. }
  624. else
  625. {
  626. throw ExceptionEx.ThrowBusinessException(ex);
  627. }
  628. }
  629. }
  630. public async Task<bool> AsyncModifyArrangeLessonDataByConditionNew(ArrangeLessonTermEntity entity)
  631. {
  632. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonDataByConditionNew(entity);
  633. return data;
  634. }
  635. }
  636. }