/// <summary>
        /// 获取未安排课表的班级课表信息
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2018-11-06</para>
        /// </summary>
        /// <param name="classRoomId">教室ID</param>
        /// <param name="schoolTimeId">时间段ID</param>
        /// <returns>课次表详情</returns>
        public static ClassTimetableResponse GetNoClassTimetable(long classRoomId, long schoolTimeId)
        {
            ClassTimetableResponse res = new ClassTimetableResponse
            {
                IsClassJoin = false
            };

            SchoolTimeService       service        = SchoolTimeService.CreateSchoolTimeService(schoolTimeId);
            List <TblDatSchoolTime> allSchoolTimes = service.TblDatSchoolTime;
            TblDatTerm term = service.TblDatTerm;

            //获取当前时间段
            var firstTime = allSchoolTimes.FirstOrDefault(x => x.SchoolTimeId == schoolTimeId);

            //第一节课时间段
            res.Time1 = new List <string> {
                firstTime.BeginTime, firstTime.EndTime
            };

            //上课老师
            res.Teacher = TeachService.GetIncumbentTeachers(term.SchoolId);

            //当前教室门牌号
            res.RoomNo = new SchoolClassRoomService(term.SchoolId).GetClassRoom(classRoomId)?.RoomNo;

            //课程与课程等级
            res.ClassTimetableCourse = GetClassTimetableCourseResponse(term.SchoolId, classRoomId);

            ClassTimetableSchoolTimeResult classTimetableSchoolTimeResult = GetClassTimetableSchoolTimeResult(allSchoolTimes, classRoomId, schoolTimeId, term.TermId);

            //星期几与上课时间的数据
            res.WeekDaySchoolTimes = classTimetableSchoolTimeResult
                                     .WeekDaySchoolTimes
                                     .OrderBy(m => m.WeekDay).ToList();

            res.CanClassJoin = classTimetableSchoolTimeResult.CanClassJoin;

            //第二节课时间段
            res.Time2 = classTimetableSchoolTimeResult.Time2;

            return(res);
        }
        /// <summary>
        /// 获取已安排课表的班级课表信息
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2018-11-06</para>
        /// </summary>
        /// <remarks>课程表班级的详情信息</remarks>
        /// <exception cref="BussinessException">
        /// 异常ID:1,异常描述:班级信息为空
        /// </exception>
        private ClassTimetableResponse GetClassTimetable()
        {
            //获取班级
            var classInfo = this.GetClass();

            if (classInfo == null)
            {
                throw new BussinessException(ModelType.Default, 1);
            }

            //基础数据
            ClassTimetableResponse res = new ClassTimetableResponse()
            {
                ClassNo            = classInfo.ClassNo,
                CourseId           = classInfo.CourseId,
                CourseLevelId      = classInfo.CourseLeveId,
                CourseNum          = classInfo.CourseNum,
                StudentsNum        = classInfo.StudentsNum,
                TeaherId           = classInfo.TeacherId,
                CanClassJoin       = false,
                WeekDaySchoolTimes = new List <ClassTimetableSchoolTimeResponse>()
            };

            SchoolTimeService schoolTimeService = new SchoolTimeService(classInfo.TermId);
            //获取学期信息
            TblDatTerm term = schoolTimeService.TblDatTerm;
            //这个学期所有的上课时间
            var allTermClassTime = schoolTimeService.TblDatSchoolTime.OrderBy(x => x.BeginTime).ToList();

            //校区老师
            res.Teacher = TeachService.GetIncumbentTeachers(term.SchoolId, classInfo.TeacherId);

            //课程信息与课程等级
            res.ClassTimetableCourse = GetClassTimetableCourseResponse(term.SchoolId, classInfo.ClassRoomId, classInfo.CourseId);

            //当前教室门牌号
            res.RoomNo = new SchoolClassRoomService(term.SchoolId).GetClassRoom(classInfo.ClassRoomId)?.RoomNo;

            var timClassTime = _classTimeRepository.Value.GetByClassId(classInfo.ClassId);

            //当前班级对应的上课时间段
            var currentClassTimes = allTermClassTime
                                    .Where(m => timClassTime.Select(x => x.SchoolTimeId).Contains(m.SchoolTimeId))
                                    .OrderBy(x => x.BeginTime).ToList();

            //班级第一个时间段
            var firstClassTime = currentClassTimes[0];

            res.Time1 = new List <string> {
                firstClassTime.BeginTime, firstClassTime.EndTime
            };
            res.Time2 = new List <string>();

            var isJoinClass = currentClassTimes.Where(x => x.WeekDay == firstClassTime.WeekDay).OrderBy(x => x.BeginTime).ToList();

            //班级第二个时间段
            if (isJoinClass.Count > 1)
            {
                var secondClassTime = isJoinClass[1];
                res.Time2 = new List <string> {
                    secondClassTime.BeginTime, secondClassTime.EndTime
                };
                res.IsClassJoin = true;
            }

            //星期几与上课时间的数据
            for (int i = 1; i <= 7; i++)
            {
                var classTime = currentClassTimes.Where(x => x.WeekDay == i).ToList();
                ClassTimetableSchoolTimeResponse ctst = new ClassTimetableSchoolTimeResponse
                {
                    HasSchoolTime1 = false,
                    SchoolTimeId1  = 0,
                    HasSchoolTime2 = false,
                    SchoolTimeId2  = 0,
                    IsChecked      = false,
                    WeekDay        = i
                };
                if (classTime.Any())
                {
                    ctst.HasSchoolTime1 = true;
                    ctst.SchoolTimeId1  = classTime[0].SchoolTimeId;
                    ctst.IsChecked      = true;

                    if (classTime.Count > 1)
                    {
                        ctst.HasSchoolTime2 = true;
                        ctst.SchoolTimeId2  = classTime[1].SchoolTimeId;
                    }
                }
                res.WeekDaySchoolTimes.Add(ctst);
            }

            return(res);
        }