Esempio n. 1
0
        /// <summary>
        /// 写生排课
        /// <para>作    者:郭伟佳</para>
        /// <para>创建时间:2019-01-02</para>
        /// </summary>
        /// <param name="lifeClassInfo">写生课信息对象</param>
        /// <param name="lifeClassLessonList">班级学生信息对象</param>
        private void MakeLifeClass(TblTimLifeClass lifeClassInfo, List <LifeClassLessonMakeRequest> lifeClassLessonList)
        {
            if (lifeClassLessonList.Count == 0)
            {
                return;
            }
            using (UnitOfWork unitOfWork = new UnitOfWork())
            {
                try
                {
                    unitOfWork.BeginTransaction();

                    LifeClassLessonCreator lessonCreator = new LifeClassLessonCreator(lifeClassInfo, lifeClassLessonList, unitOfWork); //实例化课次生产者
                    LessonService          lessonService = new LessonService(unitOfWork);
                    lessonService.Create(lessonCreator);                                                                               //课次生产

                    unitOfWork.CommitTransaction();
                }
                catch (Exception ex)
                {
                    unitOfWork.RollbackTransaction();
                    throw ex;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 开始真实排课
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2018-11-08</para>
        /// </summary>
        /// <param name="makeLessonId">排课Id</param>
        /// <param name="unitOfWork">工作单元</param>
        private void MakeInternal(long makeLessonId, UnitOfWork unitOfWork)
        {
            MakeLessonCreator lessonCreator = new MakeLessonCreator(makeLessonId, unitOfWork);  //实例化课次生产者
            LessonService     lessonService = new LessonService(unitOfWork);

            lessonService.Create(lessonCreator);                                    //课次生产

            new StudentService(this._schoolId).UpdateStudentStatusById(this._studentId, unitOfWork, StudyStatus.Reading);
        }
Esempio n. 3
0
        /// <summary>
        /// 描述:班级上课时间调整课次信息保存
        /// <para>作者:瞿琦</para>
        /// <para>创建时间:2019-3-8</para>
        /// </summary>
        /// <param name="iRequest">要保存的课次调整信息</param>
        /// <exception cref="AMS.Core.BussinessException">
        /// 异常Id:7,异常描述:上课时间段编号不能为空
        /// 异常Id:61,异常描述:调整日期不能小于当前日期
        /// </exception>
        public override void Adjust(IAdjustLessonRequest iRequest)
        {
            var request = iRequest as AdjustClassTimeRequest;

            if (request.NewClassDate <= DateTime.Now)  //如果调整日期小于当前日期,则抛出异常
            {
                throw new BussinessException(ModelType.Timetable, 61);
            }
            using (var unitOfWork = new UnitOfWork())
            {
                try
                {
                    unitOfWork.BeginTransaction();
                    var           lessonRepository = unitOfWork.GetCustomRepository <TblTimLessonRepository, TblTimLesson>();
                    LessonService lessonService    = new LessonService(unitOfWork);
                    //获取班级上课时间段
                    var classTimeList = this.GetClassTimesList(request.ClassId);
                    if (!classTimeList.Any())
                    {
                        throw new BussinessException(ModelType.Datum, 7);
                    }
                    //1.获取要更换时间段的课次
                    var changeLessonList = lessonRepository.GetTimLessonByClassIdList(new List <long>()
                    {
                        request.ClassId
                    }, new List <DateTime> {
                        request.OldClassDate
                    }, LessonUltimateStatus.Normal);

                    //2.向调整课次业务表添加数据
                    var adjustLessonList = AddAdjustLessonInfo(request, changeLessonList, classTimeList, unitOfWork);

                    //3.提供要销毁的课次对象
                    var lessonClassTimeFinisher = new AdjustLessonClassTimeFinisher(adjustLessonList, changeLessonList);
                    lessonService.Finish(lessonClassTimeFinisher);

                    //4.提供要更新的课次
                    var lessonClassTimeCreator = new AdjustLessonClassTimeCreator(request, adjustLessonList, changeLessonList, classTimeList);
                    if (lessonClassTimeCreator.IsLessonData)
                    {
                        lessonService.Create(lessonClassTimeCreator);                       //正常课次
                    }
                    var replenishLessonService = new ReplenishLessonService(unitOfWork);
                    if (lessonClassTimeCreator.IsReplenishLessonData)
                    {
                        replenishLessonService.Create(lessonClassTimeCreator);               //补课调课
                    }

                    unitOfWork.CommitTransaction();
                }
                catch (Exception)
                {
                    unitOfWork.RollbackTransaction();
                    throw;
                }
            }
        }
        /// <summary>
        /// 描述:休学办理
        /// <para>作    者:瞿琦</para>
        /// <para>创建时间:2018-11-7</para>
        /// </summary>
        /// <param name="iRequest">休学的相关数据</param>
        /// <param name="companyId">公司编号</param>
        /// <exception cref="AMS.Core.BussinessException">
        /// 异常ID:8,异常描述:没有要休学的课程
        /// </exception>
        public override void Transact(IRefundOrderTransactRequest iRequest, string companyId)   //
        {
            lock (LocalThreadLock.GetLockKeyName(LockKeyNames.LOCK_AMSSCHOOLSTUDENT, base._schoolId, base._studentId.ToString()))
            {
                var request = iRequest as LeaveSchoolOrderAddRequest;
                //获取学生课次费用明细
                var courseLessonList = base.GetCourseLessonList(request.LeaveTime, companyId);

                if (!courseLessonList.Any()) //如果订单课程已休学则获取不到学生课次费用明细,则抛出异常
                {
                    throw new BussinessException(ModelType.Order, 8);
                }

                using (var unitOfWork = new UnitOfWork())
                {
                    try
                    {
                        unitOfWork.BeginTransaction();
                        //1.写入退费订单主表                      --休学订单表
                        var refundOrder = AddOdrRefundOrder(request, courseLessonList, unitOfWork);
                        //2.写入退费订单课程明细
                        AddOdrRefundOrdeEnroll(courseLessonList, refundOrder, unitOfWork);
                        //3.写入休学表详细信息表
                        var leaveSchoolOrder = AddOdrLeaveSchoolOrder(request, courseLessonList, refundOrder, unitOfWork);
                        //4.添加附件
                        AddAttachment(request, leaveSchoolOrder, unitOfWork);
                        //5、课次调用
                        LeaveSchoolLessonFinisher leaveSchoolFinisher = new LeaveSchoolLessonFinisher(refundOrder, leaveSchoolOrder, unitOfWork);
                        LessonService             lessonService       = new LessonService(unitOfWork);
                        lessonService.Finish(leaveSchoolFinisher);//课次销毁
                        //6、资金调用
                        LeaveSchoolOrderTrade orderTrade = new LeaveSchoolOrderTrade(refundOrder);
                        TradeService          trade      = new TradeService(orderTrade, unitOfWork);
                        trade.Trade();
                        //7、修改课程明细表为休学状态
                        EnrollOrderService service = new EnrollOrderService(this._schoolId);
                        var enrollOrderItemIdList  = courseLessonList.Select(x => x.EnrollOrderItemId).ToList();
                        service.ChangeToLeaveSchool(enrollOrderItemIdList, unitOfWork).Wait();
                        //8.修改学生状态
                        var studentService = new StudentService(this._schoolId);
                        studentService.UpdateStudentStatusById(this._studentId, unitOfWork, StudyStatus.Suspension);

                        unitOfWork.CommitTransaction();
                    }
                    catch (Exception ex)
                    {
                        unitOfWork.RollbackTransaction();
                        throw ex;
                    }
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 课表作废,订单作废时会用到
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2018-11-08</para>
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <param name="unitOfWork">工作单元</param>
        public static void Cancel(long orderId, UnitOfWork unitOfWork)
        {
            List <TblOdrEnrollOrderItem> enrollOrderItems = new TblOdrEnrollOrderItemRepository().GetByEnrollOrderId(orderId).Result;

            var enrollOrderItemIds = enrollOrderItems.Select(x => x.EnrollOrderItemId);

            List <TblTimMakeLesson> makeLessons = new TblTimMakeLessonRepository().GetByEnrollOrderItemId(enrollOrderItemIds).Result;

            foreach (var makeLesson in makeLessons)
            {
                CancelMakeLessonFinisher cancelMakeLesson = new CancelMakeLessonFinisher(makeLesson.MakeLessonId, unitOfWork);
                LessonService            lessonService    = new LessonService(unitOfWork);
                lessonService.Finish(cancelMakeLesson);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 描述:全校上课日期调整信息保存
        /// <para>作者:瞿琦</para>
        /// <para>创建时间:2019-3-8</para>
        /// </summary>
        /// <param name="iRequest">要保存的课程调整信息</param>
        /// <exception cref="AMS.Core.BussinessException">
        /// 异常Id:61,异常描述:调整日期不能小于当前日期
        /// </exception>
        public override void Adjust(IAdjustLessonRequest iRequest)
        {
            AdjustSchoolClassTimeRequest request = iRequest as AdjustSchoolClassTimeRequest;

            if (request.AdjustDate <= DateTime.Now)  //如果调整时间小于当前时间,则抛出异常
            {
                throw new BussinessException(ModelType.Timetable, 61);
            }
            using (var unitOfWork = new UnitOfWork())
            {
                try
                {
                    unitOfWork.BeginTransaction();
                    var           lessonRepository = unitOfWork.GetCustomRepository <TblTimLessonRepository, TblTimLesson>();
                    LessonService lessonService    = new LessonService(unitOfWork);
                    //1.要更换全校上课日期的课次
                    var changeLessonList = lessonRepository.GetTimLessonByClassIdList(request.LessonInfoList.Select(x => x.ClassId), request.LessonInfoList.Select(x => x.ClassDate), LessonUltimateStatus.Normal);

                    //2.向调整课次业务表添加数据
                    var adjustLessonList = AddAdjustLessonInfo(request.AdjustDate, changeLessonList, unitOfWork);
                    //3.提供要销毁的课次对象
                    var schoolClassTimeFinisher = new AdjustLessonSchoolClassTimeFinisher(adjustLessonList, changeLessonList);
                    lessonService.Finish(schoolClassTimeFinisher);
                    //4.提供要更新的课次
                    var schoolClassTimeCreator = new AdjustLessonSchoolClassTimeCreator(request.AdjustDate, adjustLessonList, changeLessonList);
                    if (schoolClassTimeCreator.IsLessonData)
                    {
                        lessonService.Create(schoolClassTimeCreator);                        //正常课次
                    }
                    var replenishLessonService = new ReplenishLessonService(unitOfWork);
                    if (schoolClassTimeCreator.IsReplenishLessonData)
                    {
                        replenishLessonService.Create(schoolClassTimeCreator);               //补课调课
                    }

                    unitOfWork.CommitTransaction();
                }
                catch (Exception ex)
                {
                    unitOfWork.RollbackTransaction();
                    throw ex;
                }
            }
        }
        /// <summary>
        /// 描述:老师代课信息保存
        /// <para>作者:瞿琦</para>
        /// <para>创建时间:2019-3-8</para>
        /// </summary>
        /// <param name="iRequest">要保存的代课老师信息</param>
        public override void Adjust(IAdjustLessonRequest iRequest)
        {
            AdjustTeacherRequest request = iRequest as AdjustTeacherRequest;

            using (var unitOfWork = new UnitOfWork())
            {
                try
                {
                    unitOfWork.BeginTransaction();
                    var lessonRepository = unitOfWork.GetCustomRepository <TblTimLessonRepository, TblTimLesson>();

                    LessonService lessonService = new LessonService(unitOfWork);
                    //1.要更换老师的课次
                    var changeLessonList = lessonRepository.GetTimLessonByClassIdList(request.LessonInfoList.Select(x => x.ClassId), request.LessonInfoList.Select(x => x.ClassDate), LessonUltimateStatus.Normal);

                    //2.向调整课次业务表添加数据
                    var adjustLessonList = AddAdjustLessonInfo(request.TeacherId, changeLessonList, unitOfWork);

                    //3.提供要销毁的课次对象
                    var lessonTeacherFinisher = new AdjustLessonTeacherFinisher(adjustLessonList, changeLessonList);
                    lessonService.Finish(lessonTeacherFinisher);
                    //4.提供要更新的课次
                    var lessonCreator = new AdjustLessonTeacherCreator(request.TeacherId, adjustLessonList, changeLessonList);
                    if (lessonCreator.IsLessonData)          //正常课次有数据则创建
                    {
                        lessonService.Create(lessonCreator); //正常课次
                    }
                    var replenishLessonService = new ReplenishLessonService(unitOfWork);
                    if (lessonCreator.IsReplenishLessonData)          //补课调课有数据则创建
                    {
                        replenishLessonService.Create(lessonCreator); //补课调课
                    }

                    unitOfWork.CommitTransaction();
                }
                catch (Exception ex)
                {
                    unitOfWork.RollbackTransaction();
                    throw ex;
                }
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 描述:保存转班办理
        /// <para>作    者:瞿琦</para>
        /// <para>创建时间:2018-11-7</para>
        /// </summary>
        /// <param name="dto">要保存的转班信息</param>
        /// <returns>无</returns>
        public void ChangeIn(ChangeClassAddRequest dto)
        {
            lock (LocalThreadLock.GetLockKeyName(LockKeyNames.LOCK_AMSSCHOOLSTUDENT, this._schoolId, this._studentId.ToString()))
            {
                //验证
                var outClassTimes = this.ValidateSubmit(dto);  //实际转出课次
                using (var unitOfWork = new UnitOfWork())
                {
                    try
                    {
                        unitOfWork.BeginTransaction();
                        //1、插入转班表
                        var timChangeClassEntity = AddTimChangeClass(dto, outClassTimes, unitOfWork);
                        //2、课表数据操作---作废
                        ChangeClassLessonFinisher lessonFinisher = new ChangeClassLessonFinisher(timChangeClassEntity, unitOfWork);
                        LessonService             lessonService  = new LessonService(unitOfWork);
                        lessonService.Finish(lessonFinisher);//课次销毁

                        //3、课表数据操作---转班重新排课
                        ChangeClassLessonCreator creator = new ChangeClassLessonCreator(timChangeClassEntity, lessonFinisher.EnrollOrderItemId, unitOfWork);
                        lessonService.Create(creator);

                        //4.修改学生状态及课次
                        var studentService = new StudentService(this._schoolId);
                        studentService.UpdateStudentStatusById(this._studentId, unitOfWork);

                        unitOfWork.CommitTransaction();
                    }
                    catch (Exception e)
                    {
                        unitOfWork.RollbackTransaction();
                        throw;
                    }
                }
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 删除班级
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2018-09-25</para>
        /// </summary>
        /// <param name="classId">班级Id</param>
        /// <param name="createUserName">创建人名称</param>
        /// <exception cref="BussinessException">
        /// 异常ID:20,异常描述:班级已被排课不能进行删除
        /// </exception>
        public void DeleteClass(long classId, string createUserName)
        {
            //验证班级是否排课
            bool classIsUse = LessonService.ClassIsUse(classId);

            if (classIsUse)
            {
                //班级已使用,不能删除
                throw new BussinessException(ModelType.Datum, 20);
            }

            //审核Id
            long auditId = VerifyGetAuditId(base.TblAutAudit.SchoolId);

            var autClass = _tblAutClassRepository.Value.GetAsync(auditId, classId).Result;

            //删除班级课表数据
            _tblAutClassRepository.Value.DeleteByClassId(auditId, autClass.ClassId);
            //删除班级上课时间
            _tblAutClassTimeRepository.Value.DeleteByClassId(auditId, autClass.ClassId);

            //校验是否为最后一个班级
            this.VerifyDeleteClassFallback(auditId);
        }
Esempio n. 10
0
        /// <summary>
        /// 描述:撤销排课
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-11</para>
        /// </summary>
        /// <param name="iRequest">撤销排课请求参数</param>
        /// <exception>
        /// 异常ID:1,未找到数据
        /// 异常ID:46,该课程已考勤,不能撤销!
        /// </exception>
        public override void Adjust(IAdjustLessonRequest iRequest)
        {
            AdjustRevokeRequest request = iRequest as AdjustRevokeRequest;

            lock (LocalThreadLock.GetLockKeyName(LockKeyNames.LOCK_AMSSCHOOLSTUDENT, this._schoolId, request.StudentId.ToString()))
            {
                LessonFinisherInfo info = new LessonFinisherInfo();

                // 根据课次编号获取学生课次信息
                var timLessonStudent = new StudentTimetableService(this._schoolId, request.StudentId).GetStudentTimLessonByLessId(request.LessonId);
                if (timLessonStudent == null)
                {
                    throw new BussinessException(ModelType.Default, 1);
                }

                // 如果考勤状态是已考勤或者是已补签
                if (timLessonStudent.AttendStatus == (int)AttendStatus.Normal || timLessonStudent.AdjustType == (int)AdjustType.SUPPLEMENTCONFIRMED)
                {
                    throw new BussinessException(ModelType.Timetable, 46);
                }

                // 根据课次编号获取学生排课记录信息
                TblTimLesson       timLesson       = new StudentTimetableService(this._schoolId, request.StudentId).GetTimLessonById(request.LessonId);
                TblTimAdjustLesson timAdjustLesson = new TblTimAdjustLesson
                {
                    AdjustLessonId = IdGenerator.NextId(),
                    SchoolId       = this._schoolId,
                    BatchNo        = IdGenerator.NextId(),
                    FromLessonId   = timLesson.LessonId,
                    FromTeacherId  = timLesson.TeacherId,
                    ToTeacherId    = "",
                    StudentId      = request.StudentId,
                    ClassRoomId    = timLesson.ClassRoomId,
                    ClassId        = timLesson.ClassId,
                    SchoolTimeId   = 0,
                    ClassDate      = timLesson.ClassDate,
                    ClassBeginTime = timLesson.ClassBeginTime,
                    ClassEndTime   = timLesson.ClassEndTime,
                    BusinessType   = (int)LessonBusinessType.CancelMakeLess,
                    Remark         = LessonProcessConstants.Remark,
                    Status         = (int)TimAdjustLessonStatus.Invalid,
                    CreateTime     = DateTime.Now,
                };

                using (var unitOfWork = new UnitOfWork())
                {
                    try
                    {
                        unitOfWork.BeginTransaction();

                        // 1、写入调整课次业务表
                        unitOfWork.GetCustomRepository <TblTimAdjustLessonRepository, TblTimAdjustLesson>().Add(timAdjustLesson);

                        // 2、调用课次服务
                        var           adjustLessonRevokeFinisher = new AdjustLessonRevokeFinisher(this._schoolId, request.StudentId, request.LessonId, unitOfWork);
                        LessonService lessonService = new LessonService(unitOfWork);
                        lessonService.Finish(adjustLessonRevokeFinisher);

                        unitOfWork.CommitTransaction();
                    }
                    catch (Exception ex)
                    {
                        unitOfWork.RollbackTransaction();
                        throw ex;
                    }
                }
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 描述:办理
        /// <para>作    者:瞿琦</para>
        /// <para>创建时间:2018-11-8</para>
        /// </summary>
        /// <param name="iRequest">要退费的信息</param>
        /// <param name="companyId">公司编号</param>
        /// <returns>无</returns>
        /// <exception cref="AMS.Core.BussinessException">
        /// 异常ID:22,异常描述:找不到可退班的订单课程
        /// 异常ID:20,异常描述:该订单课程已退班退费
        /// </exception>
        public override void Transact(IRefundOrderTransactRequest iRequest, string companyId)
        {
            lock (LocalThreadLock.GetLockKeyName(LockKeyNames.LOCK_AMSSCHOOLSTUDENT, this._schoolId, this._studentId.ToString()))
            {
                var request       = iRequest as LeaveClassOrderAddRequest;
                var vailteRequest = EnrollOrderService.GetEnrollOrderItemIdByEnroOrderList(request.RefundCourseLesson);
                if (!request.RefundCourseLesson.Any())
                {
                    throw new BussinessException((byte)ModelType.Order, 22);
                }
                if (vailteRequest.Any(x => x.Status != OrderItemStatus.Enroll))  //如果订单课程不是已报名,则抛出异常
                {
                    throw new BussinessException((byte)ModelType.Order, 20);
                }

                //获取要退班的课次
                var courseLessonList = base.GetCourseLessonList(request.LeaveTime, companyId).Where(x => request.RefundCourseLesson.Contains(x.EnrollOrderItemId)).ToList();
                if (!courseLessonList.Any()) //如果要退费的订单课程为空,则抛出异常
                {
                    throw new BussinessException((byte)ModelType.Order, 22);
                }

                using (var unitOfWork = new UnitOfWork())
                {
                    try
                    {
                        unitOfWork.BeginTransaction();
                        //1.退费订单
                        var tblOdrRefundOrder = AddOdrRefundOrder(request, courseLessonList, unitOfWork);
                        //2.退费订单课程明细
                        AddOdrRefundOrdeEnroll(courseLessonList, tblOdrRefundOrder, unitOfWork);
                        //3.其他费用
                        AddOdrRefundOrderCost(request, tblOdrRefundOrder, unitOfWork);
                        //4.支付信息
                        AddOdrRefundPay(request, tblOdrRefundOrder, unitOfWork);
                        //5.退班详细信息
                        var tblOdrLeaveClassOrder = AddOdrLeaveClassOrder(request, tblOdrRefundOrder, unitOfWork);
                        //6.添加附件
                        AddAttachment(request, tblOdrRefundOrder, unitOfWork);

                        //7、课次调用
                        LeaveClassLessonFinisher leaveSchoolFinisher = new LeaveClassLessonFinisher(tblOdrRefundOrder, tblOdrLeaveClassOrder, request.RefundCourseLesson, unitOfWork);
                        LessonService            lessonService       = new LessonService(unitOfWork);
                        lessonService.Finish(leaveSchoolFinisher);//课次销毁


                        //8、资金调用
                        LeaveClassOrderTrade orderTrade = new LeaveClassOrderTrade(tblOdrRefundOrder, request.RefundType);
                        TradeService         trade      = new TradeService(orderTrade, unitOfWork);
                        trade.Trade();

                        //9、修改为退班状态
                        EnrollOrderService service = new EnrollOrderService(this._schoolId);
                        var enrollOrderItemIdList  = courseLessonList.Select(x => x.EnrollOrderItemId).ToList();
                        service.ChangeToLeaveClass(enrollOrderItemIdList, unitOfWork).Wait();

                        //10.修改学生状态
                        var studentService = new StudentService(this._schoolId);
                        studentService.UpdateStudentStatusById(this._studentId, unitOfWork);

                        unitOfWork.CommitTransaction();
                    }
                    catch (Exception ex)
                    {
                        unitOfWork.RollbackTransaction();
                        throw;
                    }
                }
            }
        }
Esempio n. 12
0
        /// <summary>
        /// 删除已安排的补课周课次
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-12 </para>
        /// </summary>
        /// <param name="adjustLessonIds">安排补课班级记录编号</param>
        /// <exception>
        /// 异常ID:1,未找到数据
        /// </exception>
        public void RemoveClassTime(List <long> adjustLessonIds)
        {
            var adjustLesson = _timAdjustLessonRepository.Value.GetTimAdjustLessonList(adjustLessonIds);

            if (!adjustLesson.Any())
            {
                throw new BussinessException((byte)ModelType.Default, 1);
            }

            lock (LocalThreadLock.GetLockKeyName(LockKeyNames.LOCK_AMSSCHOOLSTUDENT, this._schoolId, adjustLesson.FirstOrDefault().StudentId.ToString()))
            {
                // 获取班级信息
                TimAdjustLessonInDto inDto = new TimAdjustLessonInDto
                {
                    SchoolId     = this._schoolId,
                    ToTeacherId  = this._teacherId,
                    BusinessType = ProcessBusinessType.C_AdjustLessonReplenishWeek
                };
                long        classId  = _timAdjustLessonRepository.Value.Load(adjustLesson.FirstOrDefault().AdjustLessonId).ClassId;
                TblDatClass datClass = new ReplenishWeekClassService(classId).TblDatClass;

                // 操作日志
                TblDatOperationLog log = new TblDatOperationLog()
                {
                    OperationLogId = IdGenerator.NextId(),
                    SchoolId       = this._schoolId,
                    BusinessType   = (int)LogBusinessType.ReplenishWeekCancel,
                    BusinessId     = adjustLesson.FirstOrDefault().AdjustLessonId,
                    FlowStatus     = (int)OperationFlowStatus.Cancel,
                    OperatorId     = this._teacherId,
                    OperatorName   = this._teacherName,
                    Remark         = JsonConvert.SerializeObject($"ID是{adjustLesson.FirstOrDefault().StudentId}学生,被删除班级ID是{adjustLesson.FirstOrDefault().ClassId},上课时间是{adjustLesson.FirstOrDefault().ClassDate.ToString("yyyy-MM-dd")}     {adjustLesson.FirstOrDefault().ClassBeginTime}"),
                    CreateTime     = DateTime.Now,
                };

                // 要判断该课次是否该老师的课次,防止别人乱传ID
                if (adjustLesson.FirstOrDefault().ToTeacherId == this._teacherId)
                {
                    adjustLesson.FirstOrDefault().Status = (int)TimAdjustLessonStatus.Invalid;

                    using (var unitOfWork = new UnitOfWork())
                    {
                        try
                        {
                            unitOfWork.BeginTransaction();

                            // 调用课次服务
                            var adjustLessonWeekRevokeFinisher = new AdjustLessonReplenishWeekFinisher(this._schoolId, adjustLesson.FirstOrDefault().StudentId, adjustLesson, datClass, log, unitOfWork);

                            LessonService lessonService = new LessonService(unitOfWork);
                            lessonService.Finish(adjustLessonWeekRevokeFinisher);

                            unitOfWork.CommitTransaction();
                        }
                        catch (Exception ex)
                        {
                            unitOfWork.RollbackTransaction();
                            throw ex;
                        }
                    }
                }
            }
        }