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.
 
 
 
 
 
 

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