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.
 
 
 
 
 
 

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