示例#1
0
        /// <summary>
        /// 创建补课周补课
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-12 </para>
        /// </summary>
        /// <param name="weekClassId">班级主键编号</param>
        /// <param name="replenishWeekClassTime"></param>
        /// <param name="oldDatClass">常规课班级信息</param>
        /// <param name="classNo">补课周班级生成规则</param>
        /// <param name="datClassList">补课周补课班级</param>
        /// <param name="m">补课周补课信息</param>
        /// <param name="studentTimeLessList">学生考勤数据</param>
        /// <param name="batchNo">批次号</param>
        private void CreateDatClass(long weekClassId, ReplenishWeekClassTimeAddRequest replenishWeekClassTime, TblDatClass oldDatClass, string classNo, List <TblDatClass> datClassList, WeekClassTime m, ViewStudentTimeLess studentTimeLessList, long batchNo)
        {
            replenishWeekClassTime.NewClassId = weekClassId;

            if (!datClassList.Any(c => c.ClassId == weekClassId))
            {
                TblDatClass weekClass = new TblDatClass
                {
                    ClassId      = weekClassId,
                    SchoolId     = this._schoolId,
                    ClassNo      = classNo,
                    TermId       = oldDatClass.TermId,
                    RoomCourseId = oldDatClass.RoomCourseId,
                    ClassRoomId  = m.ClassRoomId,
                    CourseId     = oldDatClass.CourseId,
                    CourseLeveId = oldDatClass.CourseLeveId,
                    TeacherId    = oldDatClass.TeacherId,
                    CourseNum    = oldDatClass.CourseNum,
                    StudentsNum  = oldDatClass.StudentsNum,
                    ClassType    = (int)ClassType.ReplenishWeek,
                    CreateTime   = DateTime.Now,
                    UpdateTime   = DateTime.Now
                };
                datClassList.Add(weekClass);
            }
        }
示例#2
0
        /// <summary>
        /// 查询班级详情信息
        /// <para>作     者:Huang GaoLiang </para>
        /// <para>创建时间:2018-11-02</para>
        /// </summary>
        /// <param name="classId">班级编号</param>
        /// <param name="companyId">公司编号</param>
        /// <returns>返回班及详情信息</returns>
        public static ClassDetailResponse GetClassDetail(long classId, string companyId)
        {
            // 获取当前学期下该编辑编码下的班级信息
            TblDatClassRepository repository = new TblDatClassRepository();
            TblDatClass           datClass   = repository.Load(classId);

            return(GetClassInfo(datClass, companyId));
        }
        private TblDatOperationLog _log;                 // 操作日志

        /// <summary>
        /// 描述:删除补课周补课
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-11</para>
        /// </summary>
        /// <param name="schoolId">校区编号</param>
        /// <param name="studentId">学生编号</param>
        /// <param name="adjustLesson">课次调整业务表</param>
        /// <param name="datClass">班级信息</param>
        /// <param name="log">操作日志</param>
        /// <param name="unitOfWork">事务单元</param>
        public AdjustLessonReplenishWeekFinisher(string schoolId, long studentId, List <TblTimAdjustLesson> adjustLesson, TblDatClass datClass, TblDatOperationLog log, UnitOfWork unitOfWork)
        {
            this._schoolId     = schoolId;
            this._studentId    = studentId;
            this._adjustLesson = adjustLesson;
            this._datClass     = datClass;
            this._log          = log;
            this._unitOfWork   = unitOfWork;
        }
示例#4
0
        /// <summary>
        /// 检查补课周补课数据
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-12 </para>
        /// </summary>
        /// <param name="datClass">班级信息</param>
        /// <param name="AddlessonCount">添加补课记录数</param>
        /// <param name="lessonCount">缺勤总课次</param>
        /// <exception>
        /// 异常ID:21,未找到班级信息
        /// 异常ID:57,补课课次不能大于缺勤课次
        /// </exception>
        private static void CheckDatClass(TblDatClass datClass, int AddlessonCount, int lessonCount)
        {
            if (datClass == null)
            {
                throw new BussinessException((byte)ModelType.Datum, 21);
            }

            if (AddlessonCount > lessonCount)
            {
                throw new BussinessException((byte)ModelType.Timetable, 57);
            }
        }
示例#5
0
        /// <summary>
        /// 根据班级信息查询班级详情信息
        /// <para>作     者:Huang GaoLiang </para>
        /// <para>创建时间:2018-11-02</para>
        /// </summary>
        /// <param name="classInfo">班级查询信息</param>
        /// <returns>返回班级详情信息</returns>
        public static ClassDetailResponse GetClassDetail(ClassInfo classInfo)
        {
            // 获取当前学期下该编辑编码下的班级信息
            TblDatClassRepository repository = new TblDatClassRepository();
            List <long>           termIds    = TermService.GetTermByTermTypeId(classInfo.Year, classInfo.TermTypeId, classInfo.SchoolId).Select(t => t.TermId).ToList(); //获取学期类型下的所有学期

            // 根据学期编号、班级编号、校区编号获取班级信息
            TblDatClass datClass = repository.GetByClassNo(termIds, classInfo.classNo, classInfo.SchoolId);

            if (datClass == null)
            {
                return(null);
            }
            return(GetClassInfo(datClass, classInfo.CompanyId));
        }
示例#6
0
        /// <summary>
        /// 获取班级信息
        /// <para>作     者:Huang GaoLiang </para>
        /// <para>创建时间:2018-11-02</para>
        /// </summary>
        /// <param name="datClass">班级信息</param>
        /// <param name="companyId">公司编号</param>
        /// <returns>返回班级详细信息</returns>
        /// <exception cref="BussinessException">
        /// 异常ID:7,数据异常
        /// </exception>
        private static ClassDetailResponse GetClassInfo(TblDatClass datClass, string companyId)
        {
            ClassDetailResponse dto = new ClassDetailResponse
            {
                ClassId      = datClass.ClassId,
                ClassNo      = datClass.ClassNo,
                RoomCourseId = datClass.RoomCourseId,
                ClassRoomId  = datClass.ClassRoomId,
                CourseId     = datClass.CourseId,
                CourseLeveId = datClass.CourseLeveId,
                TermId       = datClass.TermId,
                CourseNum    = datClass.CourseNum,
                StudentsNum  = datClass.StudentsNum,
                SurplusNum   = datClass.StudentsNum,
            };

            if (dto == null)
            {
                throw new BussinessException((byte)ModelType.SignUp, 7);
            }

            //1、课程名称,课程等级
            CourseResponse course = new CourseService(companyId).GetCourseDetailsAsync(dto.CourseId).Result;

            if (course != null)
            {
                dto.CourseName     = course.CourseCnName;
                dto.CourseLeveName = course.CourseLevels.FirstOrDefault(m => m.CourseLevelId == dto.CourseLeveId)
                                     ?.CourseLevelName;
            }

            dto.TeachName = TeachService.GetTeacher(datClass.TeacherId)?.TeacherName;
            dto.TermName  = TermService.GetTermByTermId(dto.TermId)?.TermName;

            //2、门牌号
            dto.ClassRoomName = new ClassRoomService(dto.ClassRoomId).ClassRoomInfo?.RoomNo;

            //、计算出剩余学位数
            dto.SurplusNum = dto.StudentsNum - MakeLessonService.GetClassScheduleNum(dto.ClassId);

            //3、获取上课时间段数据
            dto.SchoolTimeList = GetDatSchoolTimeInfo(dto.ClassId);

            dto.ClassTime = GetSchoolTime(datClass.ClassId);

            return(dto);
        }
示例#7
0
        /// <summary>
        /// 获取班级信息
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-20</para>
        /// </summary>
        /// <returns>班级信息</returns>
        private TblDatClass GetTblDatClass()
        {
            TblDatClass classInfo = _classRepository.Value.Load(_classId);

            return(classInfo);
        }
示例#8
0
        /// <summary>
        /// 生成补课周补课班级信息
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-12 </para>
        /// </summary>
        /// <param name="replenishWeekClassTime"></param>
        /// <param name="oldDatClass">常规课班级信息</param>
        /// <param name="timAdjustLessonList">补课周补课集合</param>
        /// <param name="classNo">补课周班级生成规则</param>
        /// <param name="newClassList">新班级集合</param>
        /// <param name="adjustLessonList">业务调整数据集合</param>
        /// <param name="m">补课周补课信息</param>
        /// <param name="replenishWeekList">即将生成补课周的信息</param>
        /// <param name="studentTimeLessList">学生考勤数据</param>
        /// <param name="batchNo">批次号</param>
        private void SetDatClass(ReplenishWeekClassTimeAddRequest replenishWeekClassTime, TblDatClass oldDatClass, List <TblTimAdjustLesson> timAdjustLessonList, string classNo, List <TblDatClass> newClassList, List <TblTimAdjustLesson> adjustLessonList, WeekClassTime m, List <WeekClassTime> replenishWeekList, ViewStudentTimeLess studentTimeLessList, long batchNo)
        {
            // 检查该班级是否存在(上课日期/上课时间/下课时间/教室)
            var adjustLesson = timAdjustLessonList.FirstOrDefault(j => j.ClassDate == m.ClassDate &&
                                                                  j.ClassBeginTime == m.ClassBeginTime &&
                                                                  j.ClassEndTime == m.ClassEndTime &&
                                                                  j.ClassRoomId == m.ClassRoomId);

            // 如果补课周补课班级不存在,则需要生成一个补课周补课班级
            long weekClassId = 0;

            // 如果不是连着上的,则判断补课周班级存不存在
            if (!oldDatClass.ClassNo.Contains(HundredEight) && null == adjustLesson)
            {
                weekClassId = IdGenerator.NextId();
            }
            // 如果是连着上的
            else if (oldDatClass.ClassNo.Contains(HundredEight))
            {
                adjustLesson = timAdjustLessonList.FirstOrDefault(j => j.ClassDate == m.ClassDate && j.ClassRoomId == m.ClassRoomId);
                if (adjustLesson == null && adjustLessonList.Any())
                {
                    weekClassId = adjustLessonList.FirstOrDefault().ClassId;
                }
                else
                {
                    weekClassId = IdGenerator.NextId();
                }
            }
            else
            {
                weekClassId = adjustLesson.ClassId;
                replenishWeekClassTime.NewClassId = adjustLesson.ClassId;
            }

            CreateDatClass(weekClassId, replenishWeekClassTime, oldDatClass, classNo, newClassList, m, studentTimeLessList, batchNo);

            var adjust = new TblTimAdjustLesson
            {
                AdjustLessonId = IdGenerator.NextId(),
                BatchNo        = batchNo,
                BusinessType   = (int)LessonBusinessType.AdjustLessonReplenishWeek,
                ClassBeginTime = m.ClassBeginTime,
                ClassDate      = m.ClassDate,
                ClassEndTime   = m.ClassEndTime,
                ClassId        = weekClassId,
                ClassRoomId    = m.ClassRoomId,
                FromLessonId   = studentTimeLessList.LessonId,
                FromTeacherId  = studentTimeLessList.TeacherId,
                ToTeacherId    = studentTimeLessList.TeacherId,
                Remark         = LessonProcessConstants.WeekRemark,
                SchoolId       = this._schoolId,
                SchoolTimeId   = 0,//补课周补课,无需添加上课时间段编号
                StudentId      = replenishWeekClassTime.StudentId,
                Status         = (int)TimAdjustLessonStatus.Normal,
                CreateTime     = DateTime.Now
            };

            adjustLessonList.Add(adjust);
        }