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.
 
 
 
 
 
 

599 lines
18 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="keyValue">主键</param>
  87. /// <summary>
  88. /// <returns></returns>
  89. public ArrangeLessonTermEntity GetEntity(string keyValue)
  90. {
  91. try
  92. {
  93. return arrangeLessonTermService.GetEntity(keyValue);
  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. public IEnumerable<ArrangeLessonTermEntity> GetListByEmpNo(List<string> empNos)
  108. {
  109. try
  110. {
  111. return arrangeLessonTermService.GetListByEmpNo(empNos);
  112. }
  113. catch (Exception ex)
  114. {
  115. if (ex is ExceptionEx)
  116. {
  117. throw;
  118. }
  119. else
  120. {
  121. throw ExceptionEx.ThrowBusinessException(ex);
  122. }
  123. }
  124. }
  125. #endregion
  126. #region 提交数据
  127. /// <summary>
  128. /// 删除实体数据
  129. /// <param name="keyValue">主键</param>
  130. /// <summary>
  131. /// <returns></returns>
  132. public void DeleteEntity(string keyValue)
  133. {
  134. try
  135. {
  136. arrangeLessonTermService.DeleteEntity(keyValue);
  137. }
  138. catch (Exception ex)
  139. {
  140. if (ex is ExceptionEx)
  141. {
  142. throw;
  143. }
  144. else
  145. {
  146. throw ExceptionEx.ThrowBusinessException(ex);
  147. }
  148. }
  149. }
  150. /// <summary>
  151. /// 保存实体数据(新增、修改)
  152. /// <param name="keyValue">主键</param>
  153. /// <summary>
  154. /// <returns></returns>
  155. public void SaveEntity(string keyValue, ArrangeLessonTermEntity entity)
  156. {
  157. try
  158. {
  159. arrangeLessonTermService.SaveEntity(keyValue, entity);
  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. public IEnumerable<StuInfoBasicEntity> GetStudents()
  174. {
  175. try
  176. {
  177. return arrangeLessonTermService.GetStudents();
  178. }
  179. catch (Exception ex)
  180. {
  181. if (ex is ExceptionEx)
  182. {
  183. throw;
  184. }
  185. else
  186. {
  187. throw ExceptionEx.ThrowBusinessException(ex);
  188. }
  189. }
  190. }
  191. #endregion
  192. /// <summary>
  193. /// 获取相关课程考勤的学生信息
  194. /// </summary>
  195. /// <param name="year"></param>
  196. /// <param name="semester"></param>
  197. /// <param name="empno"></param>
  198. /// <param name="lessonNo"></param>
  199. /// <param name="teachClassNo"></param>
  200. /// <returns></returns>
  201. public IEnumerable<StuSelectLessonListEntity> AttendanceStudents(Pagination pagination, string queryJson)
  202. {
  203. var data = arrangeLessonTermService.AttendanceStudents(pagination, queryJson);
  204. return data;
  205. }
  206. public IEnumerable<CdMajorEntity> GetMajors(string academicYearNo, string semester)
  207. {
  208. var data = arrangeLessonTermService.GetMajors(academicYearNo, semester);
  209. return data;
  210. }
  211. public IEnumerable<CdMajorEntity> GetMajorsNotRecord(string academicYearNo, string semester)
  212. {
  213. var data = arrangeLessonTermService.GetMajorsNotRecord(academicYearNo, semester);
  214. return data;
  215. }
  216. public IEnumerable<ClassroomInfoEntity> GetClassrooms(string academicYearNo, string semester)
  217. {
  218. var data = arrangeLessonTermService.GetClassrooms(academicYearNo, semester);
  219. return data;
  220. }
  221. public IEnumerable<ClassroomInfoEntity> GetClassroomsNotRecord(string academicYearNo, string semester)
  222. {
  223. var data = arrangeLessonTermService.GetClassroomsNotRecord(academicYearNo, semester);
  224. return data;
  225. }
  226. public IEnumerable<CdClassTypeEntity> GetClassType()
  227. {
  228. var data = arrangeLessonTermService.GetClassType();
  229. return data;
  230. }
  231. public IEnumerable<LessonInfoEntity> GetLessons(string academicYearNo, string semester)
  232. {
  233. var data = arrangeLessonTermService.GetLessons(academicYearNo, semester);
  234. return data;
  235. }
  236. public IEnumerable<LessonInfoEntity> GetLessonsNotRecord(string academicYearNo, string semester)
  237. {
  238. var data = arrangeLessonTermService.GetLessonsNotRecord(academicYearNo, semester);
  239. return data;
  240. }
  241. public IEnumerable<CdLessonSortDetailEntity> GetLessonSortDetails()
  242. {
  243. var data = arrangeLessonTermService.GetLessonSortDetails();
  244. return data;
  245. }
  246. public IEnumerable<CdLessonSortEntity> GetLessonSorts()
  247. {
  248. var data = arrangeLessonTermService.GetLessonSorts();
  249. return data;
  250. }
  251. public bool GetAny()
  252. {
  253. try
  254. {
  255. return arrangeLessonTermService.GetAny();
  256. }
  257. catch (Exception ex)
  258. {
  259. if (ex is ExceptionEx)
  260. {
  261. throw;
  262. }
  263. else
  264. {
  265. throw ExceptionEx.ThrowBusinessException(ex);
  266. }
  267. }
  268. }
  269. public IEnumerable<CdDeptEntity> GetDepts(string academicYearNo, string semester)
  270. {
  271. var data = arrangeLessonTermService.GetDepts(academicYearNo, semester);
  272. return data;
  273. }
  274. public IEnumerable<CdDeptEntity> GetDeptsNotRecord(string academicYearNo, string semester)
  275. {
  276. var data = arrangeLessonTermService.GetDeptsNotRecord(academicYearNo, semester);
  277. return data;
  278. }
  279. public IEnumerable<CompanyEntity> GetSchools(string academicYearNo, string semester)
  280. {
  281. var data = arrangeLessonTermService.GetSchools(academicYearNo, semester);
  282. return data;
  283. }
  284. public IEnumerable<CompanyEntity> GetSchoolsNotRecord(string academicYearNo, string semester)
  285. {
  286. var data = arrangeLessonTermService.GetSchoolsNotRecord(academicYearNo, semester);
  287. return data;
  288. }
  289. public IEnumerable<CdLessonTypeEntity> GetLessonTypes()
  290. {
  291. var data = arrangeLessonTermService.GetLessonTypes();
  292. return data;
  293. }
  294. public IEnumerable<ArrangeLessonTermEntity> GetPageListForTeacherWorkload(Pagination paginationobj, string queryJson)
  295. {
  296. try
  297. {
  298. return arrangeLessonTermService.GetPageListForTeacherWorkload(paginationobj, queryJson);
  299. }
  300. catch (Exception ex)
  301. {
  302. if (ex is ExceptionEx)
  303. {
  304. throw;
  305. }
  306. else
  307. {
  308. throw ExceptionEx.ThrowBusinessException(ex);
  309. }
  310. }
  311. }
  312. /// <summary>
  313. /// 教学工作量
  314. /// </summary>
  315. /// <param name="paginationobj"></param>
  316. /// <param name="queryJson"></param>
  317. /// <returns></returns>
  318. public IEnumerable<ArrangeLessonTermEntity> GetPageListForTeacherWorkloadByEmpNo(Pagination paginationobj, string queryJson, string empNo)
  319. {
  320. try
  321. {
  322. return arrangeLessonTermService.GetPageListForTeacherWorkloadByEmpNo(paginationobj, queryJson, empNo);
  323. }
  324. catch (Exception ex)
  325. {
  326. if (ex is ExceptionEx)
  327. {
  328. throw;
  329. }
  330. else
  331. {
  332. throw ExceptionEx.ThrowBusinessException(ex);
  333. }
  334. }
  335. }
  336. public IEnumerable<TeachClassEntity> GetClassLessons()
  337. {
  338. var data = arrangeLessonTermService.GetClassLessons();
  339. return data;
  340. }
  341. public IEnumerable<EmpInfoEntity> GetTeachers(string academicYearNo, string semester)
  342. {
  343. var data = arrangeLessonTermService.GetTeachers(academicYearNo, semester);
  344. return data;
  345. }
  346. public IEnumerable<EmpInfoEntity> GetTeachersNotRecord(string academicYearNo, string semester)
  347. {
  348. var data = arrangeLessonTermService.GetTeachersNotRecord(academicYearNo, semester);
  349. return data;
  350. }
  351. public IEnumerable<ClassInfoEntity> GetClasses(string academicYearNo, string semester)
  352. {
  353. var data = arrangeLessonTermService.GetClasses(academicYearNo, semester);
  354. return data;
  355. }
  356. public IEnumerable<ClassInfoEntity> GetClassesNotRecord(string academicYearNo, string semester)
  357. {
  358. var data = arrangeLessonTermService.GetClassesNotRecord(academicYearNo, semester);
  359. return data;
  360. }
  361. public IEnumerable<StuInfoBasicEntity> GetStus(string academicYearNo, string semester)
  362. {
  363. var data = arrangeLessonTermService.GetStus(academicYearNo, semester);
  364. return data;
  365. }
  366. public IEnumerable<StuInfoBasicEntity> GetStusNotRecord(string academicYearNo, string semester)
  367. {
  368. var data = arrangeLessonTermService.GetStusNotRecord(academicYearNo, semester);
  369. return data;
  370. }
  371. /// <summary>
  372. /// 课程表
  373. /// </summary>
  374. /// <param name="userAccount">账号</param>
  375. /// <param name="userType">用户类型 学生 教师</param>
  376. /// <param name="startDate">查询开始时间</param>
  377. /// <param name="endDate">查询截止时间</param>
  378. /// <returns></returns>
  379. public IEnumerable<TimeTable> GetTimeTable(string userAccount, string userType, string startDate, string endDate)
  380. {
  381. var data = arrangeLessonTermService.GetTimeTable(userAccount, userType, startDate, endDate);
  382. return data;
  383. }
  384. public async Task<bool> AsyncArrangeLessonData()
  385. {
  386. var data = await arrangeLessonTermService.AsyncArrangeLessonData();
  387. return data;
  388. }
  389. /// <summary>
  390. /// 清空当前学期排课数据
  391. /// </summary>
  392. /// <returns></returns>
  393. public async Task<bool> AsyncModifyArrangeLessonData()
  394. {
  395. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonData();
  396. return data;
  397. }
  398. /// <summary>
  399. /// 按条件清空排课数据
  400. /// </summary>
  401. /// <returns></returns>
  402. public async Task<bool> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  403. {
  404. var data = await arrangeLessonTermService.AsyncModifyArrangeLessonDataByCondition(entity);
  405. return data;
  406. }
  407. /// <summary>
  408. /// 按条件同步排课数据
  409. /// </summary>
  410. /// <returns></returns>
  411. public async Task<bool> AsyncArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
  412. {
  413. var data = await arrangeLessonTermService.AsyncArrangeLessonDataByCondition(entity);
  414. return data;
  415. }
  416. /// <summary>
  417. /// 课程表【教务】
  418. /// </summary>
  419. /// <param name="startDate">查询开始时间</param>
  420. /// <param name="endDate">查询截止时间</param>
  421. /// <param name="classNo">班级编号</param>
  422. /// <param name="empNo">教师编号</param>
  423. /// <param name="classroomNo">教室编号</param>
  424. /// <returns></returns>
  425. public IEnumerable<TimeTable> GetTimeTableInEducation(string startDate, string endDate, string classNo, string empNo, string schoolId, string classroomNo)
  426. {
  427. try
  428. {
  429. return arrangeLessonTermService.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, classroomNo);
  430. }
  431. catch (Exception ex)
  432. {
  433. if (ex is ExceptionEx)
  434. {
  435. throw;
  436. }
  437. else
  438. {
  439. throw ExceptionEx.ThrowBusinessException(ex);
  440. }
  441. }
  442. }
  443. /// <summary>
  444. /// 课程表【教务】--班级下拉框信息
  445. /// </summary>
  446. /// <returns></returns>
  447. public IEnumerable<SelectModel> GetClassData(string schoolId)
  448. {
  449. try
  450. {
  451. return arrangeLessonTermService.GetClassData(schoolId);
  452. }
  453. catch (Exception ex)
  454. {
  455. if (ex is ExceptionEx)
  456. {
  457. throw;
  458. }
  459. else
  460. {
  461. throw ExceptionEx.ThrowBusinessException(ex);
  462. }
  463. }
  464. }
  465. /// <summary>
  466. /// 课程表【教务】--教师下拉框信息
  467. /// </summary>
  468. /// <param name="startDate"></param>
  469. /// <returns></returns>
  470. public IEnumerable<SelectModel> GetTeacherData(string schoolId)
  471. {
  472. try
  473. {
  474. return arrangeLessonTermService.GetTeacherData(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. /// <returns></returns>
  492. public IEnumerable<SelectModel> GetClassroomData(string schoolId)
  493. {
  494. try
  495. {
  496. return arrangeLessonTermService.GetClassroomData(schoolId);
  497. }
  498. catch (Exception ex)
  499. {
  500. if (ex is ExceptionEx)
  501. {
  502. throw;
  503. }
  504. else
  505. {
  506. throw ExceptionEx.ThrowBusinessException(ex);
  507. }
  508. }
  509. }
  510. /// <summary>
  511. /// 教学调度【教务】--课程下拉框信息
  512. /// </summary>
  513. /// <returns></returns>
  514. public IEnumerable<SelectModel> GetLessonDataInTerm(string queryJson)
  515. {
  516. try
  517. {
  518. return arrangeLessonTermService.GetLessonDataInTerm(queryJson);
  519. }
  520. catch (Exception ex)
  521. {
  522. if (ex is ExceptionEx)
  523. {
  524. throw;
  525. }
  526. else
  527. {
  528. throw ExceptionEx.ThrowBusinessException(ex);
  529. }
  530. }
  531. }
  532. public IEnumerable<TimeTable> GetAllClassLesson(string academicYearNo, string semester)
  533. {
  534. try
  535. {
  536. return arrangeLessonTermService.GetAllClassLesson(academicYearNo, semester);
  537. }
  538. catch (Exception ex)
  539. {
  540. if (ex is ExceptionEx)
  541. {
  542. throw;
  543. }
  544. else
  545. {
  546. throw ExceptionEx.ThrowBusinessException(ex);
  547. }
  548. }
  549. }
  550. public bool InitAsyncDataByCondition(ArrangeLessonTermEntity entity)
  551. {
  552. var data = arrangeLessonTermService.InitAsyncDataByCondition(entity);
  553. return data;
  554. }
  555. }
  556. }