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.
 
 
 
 
 
 

673 lines
21 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(string academicYearNo, string semester)
  230. {
  231. var data = arrangeLessonTermService.GetMajors(academicYearNo, semester);
  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(string academicYearNo, string semester)
  240. {
  241. var data = arrangeLessonTermService.GetClassrooms(academicYearNo, semester);
  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(string academicYearNo, string semester)
  255. {
  256. var data = arrangeLessonTermService.GetLessons(academicYearNo, semester);
  257. return data;
  258. }
  259. public IEnumerable<LessonInfoEntity> GetLessonsNotRecord(string academicYearNo, string semester)
  260. {
  261. var data = arrangeLessonTermService.GetLessonsNotRecord(academicYearNo, semester);
  262. return data;
  263. }
  264. public IEnumerable<CdLessonSortDetailEntity> GetLessonSortDetails()
  265. {
  266. var data = arrangeLessonTermService.GetLessonSortDetails();
  267. return data;
  268. }
  269. public IEnumerable<CdLessonSortEntity> GetLessonSorts()
  270. {
  271. var data = arrangeLessonTermService.GetLessonSorts();
  272. return data;
  273. }
  274. public bool GetAny()
  275. {
  276. try
  277. {
  278. return arrangeLessonTermService.GetAny();
  279. }
  280. catch (Exception ex)
  281. {
  282. if (ex is ExceptionEx)
  283. {
  284. throw;
  285. }
  286. else
  287. {
  288. throw ExceptionEx.ThrowBusinessException(ex);
  289. }
  290. }
  291. }
  292. public IEnumerable<CdDeptEntity> GetDepts(string academicYearNo, string semester)
  293. {
  294. var data = arrangeLessonTermService.GetDepts(academicYearNo, semester);
  295. return data;
  296. }
  297. public IEnumerable<CdDeptEntity> GetDeptsNotRecord(string academicYearNo, string semester)
  298. {
  299. var data = arrangeLessonTermService.GetDeptsNotRecord(academicYearNo, semester);
  300. return data;
  301. }
  302. public IEnumerable<CompanyEntity> GetSchools(string academicYearNo, string semester)
  303. {
  304. var data = arrangeLessonTermService.GetSchools(academicYearNo, semester);
  305. return data;
  306. }
  307. public IEnumerable<CompanyEntity> GetSchoolsNotRecord(string academicYearNo, string semester)
  308. {
  309. var data = arrangeLessonTermService.GetSchoolsNotRecord(academicYearNo, semester);
  310. return data;
  311. }
  312. public IEnumerable<CdLessonTypeEntity> GetLessonTypes()
  313. {
  314. var data = arrangeLessonTermService.GetLessonTypes();
  315. return data;
  316. }
  317. public IEnumerable<ArrangeLessonTermEntity> GetPageListForTeacherWorkload(Pagination paginationobj, string queryJson)
  318. {
  319. try
  320. {
  321. return arrangeLessonTermService.GetPageListForTeacherWorkload(paginationobj, queryJson);
  322. }
  323. catch (Exception ex)
  324. {
  325. if (ex is ExceptionEx)
  326. {
  327. throw;
  328. }
  329. else
  330. {
  331. throw ExceptionEx.ThrowBusinessException(ex);
  332. }
  333. }
  334. }
  335. /// <summary>
  336. /// 教学工作量
  337. /// </summary>
  338. /// <param name="paginationobj"></param>
  339. /// <param name="queryJson"></param>
  340. /// <returns></returns>
  341. public IEnumerable<ArrangeLessonTermEntity> GetPageListForTeacherWorkloadByEmpNo(Pagination paginationobj, string queryJson, string empNo)
  342. {
  343. try
  344. {
  345. return arrangeLessonTermService.GetPageListForTeacherWorkloadByEmpNo(paginationobj, queryJson, empNo);
  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 IEnumerable<TeachClassEntity> GetClassLessons()
  360. {
  361. var data = arrangeLessonTermService.GetClassLessons();
  362. return data;
  363. }
  364. public IEnumerable<EmpInfoEntity> GetTeachers(string academicYearNo, string semester)
  365. {
  366. var data = arrangeLessonTermService.GetTeachers(academicYearNo, semester);
  367. return data;
  368. }
  369. public IEnumerable<EmpInfoEntity> GetTeachersNotRecord(string academicYearNo, string semester)
  370. {
  371. var data = arrangeLessonTermService.GetTeachersNotRecord(academicYearNo, semester);
  372. return data;
  373. }
  374. public IEnumerable<ClassInfoEntity> GetClasses(string academicYearNo, string semester)
  375. {
  376. var data = arrangeLessonTermService.GetClasses(academicYearNo, semester);
  377. return data;
  378. }
  379. public IEnumerable<ClassInfoEntity> GetClassesNotRecord(string academicYearNo, string semester)
  380. {
  381. var data = arrangeLessonTermService.GetClassesNotRecord(academicYearNo, semester);
  382. return data;
  383. }
  384. public IEnumerable<StuInfoBasicEntity> GetStus(string academicYearNo, string semester)
  385. {
  386. var data = arrangeLessonTermService.GetStus(academicYearNo, semester);
  387. return data;
  388. }
  389. public IEnumerable<StuInfoBasicEntity> GetStusNotRecord(string academicYearNo, string semester)
  390. {
  391. var data = arrangeLessonTermService.GetStusNotRecord(academicYearNo, semester);
  392. return data;
  393. }
  394. /// <summary>
  395. /// 课程表
  396. /// </summary>
  397. /// <param name="userAccount">账号</param>
  398. /// <param name="userType">用户类型 学生 教师</param>
  399. /// <param name="startDate">查询开始时间</param>
  400. /// <param name="endDate">查询截止时间</param>
  401. /// <returns></returns>
  402. public IEnumerable<TimeTable> GetTimeTable(string userAccount, string userType, string startDate, string endDate)
  403. {
  404. var data = arrangeLessonTermService.GetTimeTable(userAccount, userType, startDate, endDate);
  405. return data;
  406. }
  407. public async Task<bool> AsyncArrangeLessonData()
  408. {
  409. var data = await arrangeLessonTermService.AsyncArrangeLessonData();
  410. return data;
  411. }
  412. /// <summary>
  413. /// 清空当前学期排课数据
  414. /// </summary>
  415. /// <returns></returns>
  416. public async Task<bool> AsyncModifyArrangeLessonData()
  417. {
  418. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonData();
  419. return data;
  420. }
  421. /// <summary>
  422. /// 按条件清空排课数据
  423. /// </summary>
  424. /// <returns></returns>
  425. public async Task<bool> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  426. {
  427. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonDataByCondition(entity);
  428. return data;
  429. }
  430. /// <summary>
  431. /// 按条件同步排课数据
  432. /// </summary>
  433. /// <returns></returns>
  434. public async Task<bool> AsyncArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  435. {
  436. var data = await arrangeLessonTermService.AsyncArrangeLessonDataByCondition(entity);
  437. return data;
  438. }
  439. /// <summary>
  440. /// 课程表【教务】
  441. /// </summary>
  442. /// <param name="startDate">查询开始时间</param>
  443. /// <param name="endDate">查询截止时间</param>
  444. /// <param name="classNo">班级编号</param>
  445. /// <param name="empNo">教师编号</param>
  446. /// <param name="classroomNo">教室编号</param>
  447. /// <returns></returns>
  448. public IEnumerable<TimeTable> GetTimeTableInEducation(string startDate, string endDate, string classNo, string empNo, string schoolId, string classroomNo)
  449. {
  450. try
  451. {
  452. return arrangeLessonTermService.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, classroomNo);
  453. }
  454. catch (Exception ex)
  455. {
  456. if (ex is ExceptionEx)
  457. {
  458. throw;
  459. }
  460. else
  461. {
  462. throw ExceptionEx.ThrowBusinessException(ex);
  463. }
  464. }
  465. }
  466. /// <summary>
  467. /// 课程表【教务】--班级下拉框信息
  468. /// </summary>
  469. /// <returns></returns>
  470. public IEnumerable<SelectModel> GetClassData(string schoolId)
  471. {
  472. try
  473. {
  474. return arrangeLessonTermService.GetClassData(schoolId);
  475. }
  476. catch (Exception ex)
  477. {
  478. if (ex is ExceptionEx)
  479. {
  480. throw;
  481. }
  482. else
  483. {
  484. throw ExceptionEx.ThrowBusinessException(ex);
  485. }
  486. }
  487. }
  488. /// <summary>
  489. /// 课程表【教务】--教师下拉框信息
  490. /// </summary>
  491. /// <param name="startDate"></param>
  492. /// <returns></returns>
  493. public IEnumerable<SelectModel> GetTeacherData(string schoolId)
  494. {
  495. try
  496. {
  497. return arrangeLessonTermService.GetTeacherData(schoolId);
  498. }
  499. catch (Exception ex)
  500. {
  501. if (ex is ExceptionEx)
  502. {
  503. throw;
  504. }
  505. else
  506. {
  507. throw ExceptionEx.ThrowBusinessException(ex);
  508. }
  509. }
  510. }
  511. /// <summary>
  512. /// 课程表【教务】--教室下拉框信息
  513. /// </summary>
  514. /// <returns></returns>
  515. public IEnumerable<SelectModel> GetClassroomData(string schoolId)
  516. {
  517. try
  518. {
  519. return arrangeLessonTermService.GetClassroomData(schoolId);
  520. }
  521. catch (Exception ex)
  522. {
  523. if (ex is ExceptionEx)
  524. {
  525. throw;
  526. }
  527. else
  528. {
  529. throw ExceptionEx.ThrowBusinessException(ex);
  530. }
  531. }
  532. }
  533. /// <summary>
  534. /// 教学调度【教务】--课程下拉框信息
  535. /// </summary>
  536. /// <returns></returns>
  537. public IEnumerable<SelectModel> GetLessonDataInTerm(string queryJson)
  538. {
  539. try
  540. {
  541. return arrangeLessonTermService.GetLessonDataInTerm(queryJson);
  542. }
  543. catch (Exception ex)
  544. {
  545. if (ex is ExceptionEx)
  546. {
  547. throw;
  548. }
  549. else
  550. {
  551. throw ExceptionEx.ThrowBusinessException(ex);
  552. }
  553. }
  554. }
  555. public IEnumerable<TimeTable> GetAllClassLesson(string academicYearNo, string semester)
  556. {
  557. try
  558. {
  559. return arrangeLessonTermService.GetAllClassLesson(academicYearNo, semester);
  560. }
  561. catch (Exception ex)
  562. {
  563. if (ex is ExceptionEx)
  564. {
  565. throw;
  566. }
  567. else
  568. {
  569. throw ExceptionEx.ThrowBusinessException(ex);
  570. }
  571. }
  572. }
  573. public bool InitAsyncDataByCondition(ArrangeLessonTermEntity entity)
  574. {
  575. var data = arrangeLessonTermService.InitAsyncDataByCondition(entity);
  576. return data;
  577. }
  578. /// <summary>
  579. /// 导入
  580. /// </summary>
  581. /// <param name="dt"></param>
  582. /// <param name="fileId"></param>
  583. /// <returns></returns>
  584. public string ArrangeLessonTermImport(DataTable dt, string fileId)
  585. {
  586. try
  587. {
  588. return arrangeLessonTermService.ArrangeLessonTermImport(dt, fileId);
  589. }
  590. catch (Exception ex)
  591. {
  592. if (ex is ExceptionEx)
  593. {
  594. throw;
  595. }
  596. else
  597. {
  598. throw ExceptionEx.ThrowBusinessException(ex);
  599. }
  600. }
  601. }
  602. public string ArrangeLessonTermImportPk(DataTable dt, string fileId)
  603. {
  604. try
  605. {
  606. return arrangeLessonTermService.ArrangeLessonTermImportPk(dt, fileId);
  607. }
  608. catch (Exception ex)
  609. {
  610. if (ex is ExceptionEx)
  611. {
  612. throw;
  613. }
  614. else
  615. {
  616. throw ExceptionEx.ThrowBusinessException(ex);
  617. }
  618. }
  619. }
  620. public async Task<bool> AsyncModifyArrangeLessonDataByConditionNew(ArrangeLessonTermEntity entity)
  621. {
  622. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonDataByConditionNew(entity);
  623. return data;
  624. }
  625. }
  626. }