/// <summary> /// 描述:获取转班明细列表 /// <para>作 者:瞿琦</para> /// <para>创建时间:2019-3-6</para> /// </summary> /// <param name="searcher">列表筛选条件</param> /// <returns>转班明细分页列表</returns> public PageResult <ChangeClassListResponse> GetChangeClassList(ChangeClassListSearchRequest searcher) { var viewChangeClassRepository = new ViewTimChangeClassRepository(); //获取转班明细列表信息 var timChangeClassList = viewChangeClassRepository.GetTimeChangeClassList(this._schoolId, searcher); var timChangeClassQuery = AutoMapper.Mapper.Map <List <ChangeClassListResponse> >(timChangeClassList.Data); var classIdList = new List <long>(); classIdList.AddRange(timChangeClassQuery.Select(x => x.OutClassId)); //将转出班级Id集合添加到集合 classIdList.AddRange(timChangeClassQuery.Select(x => x.InClassId)); //将转入班级Id集合添加到集合 //获取所有的学期类型 var termTypeService = new TermTypeService(); var allTermTypeList = termTypeService.GetAll(); //获取班级信息集合 var classList = DefaultClassService.GetClassByClassIdAsync(classIdList).Result; //获取所有的课程信息 var courseList = CourseService.GetAllAsync().Result; //获取所有的人员 var userList = EmployeeService.GetAllBySchoolId(_schoolId); foreach (var item in timChangeClassQuery) { //学期类型信息 var termModel = allTermTypeList.FirstOrDefault(x => x.TermTypeId == item.TermTypeId); //转出班级信息 var outClassModel = classList.FirstOrDefault(x => x.ClassId == item.OutClassId); //获取转出班级的课程信息 var outCourseModel = courseList.FirstOrDefault(x => x.CourseId == outClassModel.CourseId); //获取转出班级教师 var outTeacherModel = userList.FirstOrDefault(x => x.EmployeeId == outClassModel.TeacherId); //转入班级信息 var inClassModel = classList.FirstOrDefault(x => x.ClassId == item.InClassId); //获取转入班级的课程信息 var inCourseModel = courseList.FirstOrDefault(x => x.CourseId == inClassModel.CourseId); //获取转入班级老师 var inTeacherModel = userList.FirstOrDefault(x => x.EmployeeId == inClassModel.TeacherId); item.TermTypeName = termModel == null ? "" : termModel.TermTypeName; //学期类型 item.OutClassName = outCourseModel == null?"": outCourseModel.ClassCnName; item.OutClassNo = outClassModel == null ? "" : outClassModel.ClassNo; item.OutClassTeacher = outTeacherModel == null?"": outTeacherModel.EmployeeName; item.InClassName = inCourseModel == null?"": inCourseModel.ClassCnName; item.InClassNo = inClassModel == null?"": inClassModel.ClassNo; item.InClassTeacher = inTeacherModel == null?"": inTeacherModel.EmployeeName; } var result = new PageResult <ChangeClassListResponse> { Data = timChangeClassQuery, CurrentPage = timChangeClassList.CurrentPage, PageSize = timChangeClassList.PageSize, TotalData = timChangeClassList.TotalData, }; return(result); }
/// <summary> /// 获取学生课次费用明细(已排课+未排课) /// <para>作 者:瞿琦</para> /// <para>创建时间:2018-11-8</para> /// </summary> /// <param name="leaveTime">休学日期</param> /// <param name="companyId">公司编号</param> /// <returns>报名课次费用明细</returns> /// <exception cref="AMS.Core.BussinessException">无</exception> internal List <RefundOrderTransactDetailListResponse> GetCourseLessonList(DateTime leaveTime, string companyId) { //获取所有的课程信息 var courseList = CourseService.GetAllAsync().Result; //获取所有的学期类型 var termTypeList = new TermTypeService().GetAll(); //获取所有的课程级别集合 var courseLevelList = new CourseLevelService(companyId).GetList().Result; var enrollOrderTrade = new EnrollOrderService(this._schoolId); //已排课的信息 var studentTimetableService = new StudentTimetableService(this._schoolId, this._studentId); var hasLessonList = studentTimetableService.GetLeaveSchoolLessonCount(leaveTime); //获取休学课次信息 var enroOrderList = new List <RefundOrderTransactDetailListResponse>(); var enroOrderItemList = enrollOrderTrade.GetStudentEnroOrderItem(this._studentId, leaveTime); foreach (var item in enroOrderItemList) { var lessonArray = hasLessonList.FirstOrDefault(x => x.EnrollOrderItemId == item.EnrollOrderItemId); var lessonCount = lessonArray?.Count ?? 0; //休学课次 //上课课次 var haveClassLesson = item.ClassTimes - (item.ClassTimes - item.ClassTimesUse) - lessonCount; //上课课次=报名课次-未排课次-休学课次 var refundNum = item.PayAmount - (haveClassLesson * (item.TuitionFee + item.MaterialFee)); var refundAmount = refundNum > 0 ? refundNum : 0; //退费金额=实收金额-扣除金额 退费金额为负数时等于0 var entity = new RefundOrderTransactDetailListResponse { Year = item.Year, TermTypeId = item.TermTypeId, TermTypeName = termTypeList.FirstOrDefault(k => k.TermTypeId == item.TermTypeId)?.TermTypeName, EnrollOrderItemId = item.EnrollOrderItemId, CourseId = item.CourseId, CourseName = courseList.FirstOrDefault(k => k.CourseId == item.CourseId)?.CourseCnName, CourseLevelId = item.CourseLevelId, CourseLevelName = courseLevelList.FirstOrDefault(k => k.CourseLevelId == item.CourseLevelId)?.LevelCnName, ClassTimes = item.ClassTimes, PaidAmount = item.PayAmount, HaveClassLesson = haveClassLesson, //上课课次=报名课次-休学课次-未排课课次 DeductAmount = haveClassLesson * (item.TuitionFee + item.MaterialFee), //扣除费用=上课课次*原课次单价 LeaveSchoolLessons = lessonCount, //排课部分休学课次 RefundAmount = refundAmount, ////退费金额=实收金额-扣除金额 退费金额为负数时等于0 没有排课时退费金额=实收金额 TuitionFee = item.TuitionFee, MaterialFee = item.MaterialFee, DiscountFee = item.DiscountFee, Status = item.Status }; enroOrderList.Add(entity); } return(enroOrderList); }
/// <summary> /// 未跟家长确认的排课 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2018-11-02</para> /// </summary> /// <param name="orderItem">报名订单课程明细项</param> /// <param name="unconfirmedMakeLesson">未确认排课集合</param> /// <remarks>排课列表</remarks> private List <MakeLessonItemListResponse> UnconfirmedMakeLesson( TblOdrEnrollOrderItem orderItem, IEnumerable <TblTimMakeLesson> unconfirmedMakeLesson) { List <MakeLessonItemListResponse> res = new List <MakeLessonItemListResponse>(); foreach (var item in unconfirmedMakeLesson) { //班级代码 string classNo = _courseBasicData.Classs.FirstOrDefault(x => x.ClassId.Equals(item.ClassId))?.ClassNo ?? string.Empty; //学期名称 string termName = (from a in _courseBasicData.Classs join b in _courseBasicData.Terms on a.TermId equals b.TermId where a.ClassId == item.ClassId select b.TermName).FirstOrDefault() ?? string.Empty; //课程简称 string shortName = (from a in _courseBasicData.Classs join c in _courseBasicData.Courses on a.CourseId equals c.CourseId where a.ClassId == item.ClassId select c.ShortName).FirstOrDefault() ?? string.Empty; //课程等级名称 string levelName = (from a in _courseBasicData.Classs join d in _courseBasicData.CourseLvs on a.CourseLeveId equals d.CourseLevelId where a.ClassId == item.ClassId select d.LevelCnName).FirstOrDefault() ?? string.Empty; //老师名称 var teacherName = (from a in _courseBasicData.Classs join f in _courseBasicData.Teachers on a.TeacherId equals f.TeacherId where a.ClassId == item.ClassId select f.TeacherName).FirstOrDefault() ?? string.Empty; res.Add(new MakeLessonItemListResponse { TermTypeName = TermTypeService.GetTermTypeName(orderItem.TermTypeId), ClassTimes = orderItem.ClassTimes, ClassTimesUse = item.ClassTimes, EnrollOrderItemId = orderItem.EnrollOrderItemId, ShortName = shortName, LevelName = levelName, ClassNo = classNo, TeacherName = teacherName, TermName = termName, Status = 1, }); } return(res); }
/// <summary> /// 描述:根据退费订单的Id获取退费订单的课程明细 /// <para>作 者:瞿 琦</para> /// <para>创建时间:2018-12-20</para> /// </summary> /// <param name="refundOrderId">退费订单表Id</param> /// <param name="companyId">公司编号</param> /// <returns>休学订单课程明细</returns> internal static List <RefundOrderTransactDetailListResponse> GetRefundCourseAmountDetail(long refundOrderId, string companyId) { //获取所有的课程信息 var courseList = CourseService.GetAllAsync().Result; //获取所有的学期类型 var termTypeList = new TermTypeService().GetAll(); //获取所有的课程级别集合 var courseLevelList = new CourseLevelService(companyId).GetList().Result; var refundCourseList = new TblOdrRefundOrdeEnrollRepository().GetRefundOrderByOrderEnroll(refundOrderId); var leaveSchoolCourseIdList = refundCourseList.Select(x => x.EnrollOrderItemId); var courseOrderDetailList = EnrollOrderService.GetEnrollOrderItemIdByEnroOrderList(leaveSchoolCourseIdList); var refundCourseDetail = new List <RefundOrderTransactDetailListResponse>(); foreach (var item in courseOrderDetailList) { var refundCourseInfo = refundCourseList.FirstOrDefault(k => k.EnrollOrderItemId == item.EnrollOrderItemId); //获取上课课次 var haveClassLesson = refundCourseInfo?.UseLessonCount ?? 0; //获取扣除费用 var deductAmount = haveClassLesson * (item.MaterialFee + item.TuitionFee); //获取休学/退班课次 var leaveSchoolLessons = refundCourseInfo?.LessonCount ?? 0; //获取退费金额 var refundAmount = refundCourseInfo?.Amount ?? 0; var entity = new RefundOrderTransactDetailListResponse { Year = item.Year, TermTypeId = item.TermTypeId, TermTypeName = termTypeList.FirstOrDefault(k => k.TermTypeId == item.TermTypeId)?.TermTypeName, EnrollOrderItemId = item.EnrollOrderItemId, CourseId = item.CourseId, CourseName = courseList.FirstOrDefault(k => k.CourseId == item.CourseId)?.CourseCnName, CourseLevelId = item.CourseLevelId, CourseLevelName = courseLevelList.FirstOrDefault(k => k.CourseLevelId == item.CourseLevelId)?.LevelCnName, ClassTimes = item.ClassTimes, PaidAmount = item.PayAmount, HaveClassLesson = haveClassLesson, //上课课次 DeductAmount = deductAmount, //扣除费用 LeaveSchoolLessons = leaveSchoolLessons, //休学/退班课次 RefundAmount = refundAmount, //退费金额 TuitionFee = item.TuitionFee, MaterialFee = item.MaterialFee, DiscountFee = item.DiscountFee, }; refundCourseDetail.Add(entity); } return(refundCourseDetail); }
/// <summary> /// 未排课 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2018-11-02</para> /// </summary> /// <param name="orderItem">报名订单课程明细</param> /// <returns>排课项</returns> private MakeLessonItemListResponse NotMakeLesson(TblOdrEnrollOrderItem orderItem) { MakeLessonItemListResponse res = new MakeLessonItemListResponse { TermTypeName = TermTypeService.GetTermTypeName(orderItem.TermTypeId), ClassTimes = orderItem.ClassTimes, EnrollOrderItemId = orderItem.EnrollOrderItemId, ClassTimesUse = 0, ShortName = string.Empty, ClassNo = string.Empty, TeacherName = string.Empty, TermName = string.Empty, LevelName = string.Empty, Status = 0, }; return(res); }
/// <summary> /// 获取获取学生学习记录信息 /// <para>作 者:郭伟佳</para> /// <para>创建时间:2018-11-07</para> /// </summary> /// <returns>学生学习记录列表</returns> public List <StudentStudyRecordResponse> GetStudentStudyRecordList() { var result = new List <StudentStudyRecordResponse>(); List <int> yearList = new List <int>() { DateTime.Now.Year, DateTime.Now.AddYears(1).Year, DateTime.Now.AddYears(2).Year }; var studentRecordList = _studentRecordRepository.GetStudentRecordListAsync(this._schoolId, this._studentId, yearList).Result; if (studentRecordList != null && studentRecordList.Count > 0) { var teacherList = EmployeeService.GetAllBySchoolId(this._schoolId); var termTypeList = new TermTypeService().GetAll(); foreach (var year in yearList) { var studentRecord = studentRecordList.Where(a => a.Year == year); if (studentRecord != null && studentRecord.Any()) { StudentStudyRecordResponse recordResponse = new StudentStudyRecordResponse(); recordResponse.Year = year; recordResponse.Data = studentRecord.Select(a => new StudentStudyRecordDetailResponse() { EnrollOrderItemId = a.EnrollOrderItemId, TermTypeName = termTypeList.FirstOrDefault(t => t.TermTypeId == a.TermTypeId)?.TermTypeName, TermName = a.TermName, TeacherName = teacherList.FirstOrDefault(t => t.EmployeeId == a.TeacherId)?.EmployeeName, RoomNo = a.RoomNo, CourseName = a.CourseName, ClassNo = a.ClassNo, ClassTimes = a.ClassTimes, ClassDate = a.ClassDate, ArrangedclassTimes = a.ArrangedClassTimes, AttendedClassTimes = a.AttendedClassTimes, RemainingClassTimes = a.RemainingClassTimes }).ToList(); result.Add(recordResponse); } } } return(result); }
/// <summary> /// 获取的排课详情 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2018-11-06</para> /// </summary> /// <param name="enrollOrderItemId">报名课程订单Id</param> /// <returns>学生报名一个课程的排课详细信息</returns> public MakeLessonDetailResponse GetMakeLessonDetail(long enrollOrderItemId) { MakeLessonDetailResponse res = new MakeLessonDetailResponse { CourseInfos = new List <CourseInformation>() }; TblOdrEnrollOrderItem enrollOrderItem = _enrollOrderItemRepository.Load(enrollOrderItemId); TblOdrEnrollOrder enrollOrder = _enrollOrderRepository.Load(enrollOrderItem.EnrollOrderId); TblDatCourse course = CourseService.GetByCourseId(enrollOrderItem.CourseId); res.RegisterInfo = new RegisterInformation() { ClassTimes = enrollOrderItem.ClassTimes, ClassTimesUse = enrollOrderItem.ClassTimesUse, CourseName = string.Empty, LevelName = CourseLevelService.GetById(enrollOrderItem.CourseLevelId)?.LevelCnName ?? string.Empty, Year = enrollOrderItem.Year, CourseType = CourseType.Elective, TermTypeId = enrollOrderItem.TermTypeId, TermTypeName = TermTypeService.GetTermTypeName(enrollOrderItem.TermTypeId), EnrollDate = enrollOrder.CreateTime }; if (course != null) { res.RegisterInfo.CourseName = course.ShortName; res.RegisterInfo.CourseType = CourseType.Compulsory; } List <TblTimMakeLesson> makeLessons = _makeLessonRepository.GetUnconfirmedMakeLessonList(enrollOrderItem.EnrollOrderItemId); if (makeLessons.Any()) { List <long> classIds = makeLessons.Select(x => x.ClassId).ToList(); List <TblDatClass> classes = DefaultClassService.GetClassByClassIdAsync(classIds).Result; List <ViewRoomCourse> classRooms = ClassRoomService.GetClassRoomBySchoolId(enrollOrder.SchoolId); //老师 var teacherList = TeachService.GetTeachers(); foreach (var makeLesson in makeLessons) { var classInfo = classes.FirstOrDefault(x => x.ClassId == makeLesson.ClassId); var classSchoolTimes = new DefaultClassService(classInfo.ClassId).ClassSchoolTimes; //老师信息 var teacher = teacherList.FirstOrDefault(x => x.TeacherId == classInfo.TeacherId); CourseInformation courseInformation = new CourseInformation { ClassId = classInfo.ClassId, Year = enrollOrderItem.Year, ClassNo = classInfo.ClassNo, ClassTimesUse = makeLesson.ClassTimes, CourseName = course?.ShortName ?? string.Empty, FirstClassTime = makeLesson.FirstClassTime, RoomNo = classRooms.FirstOrDefault(x => x.ClassRoomId == classInfo.ClassRoomId)?.RoomNo ?? string.Empty, LevelName = CourseLevelService.GetById(classInfo.CourseLeveId)?.LevelCnName ?? string.Empty, TeacherName = teacher?.TeacherName ?? string.Empty, TermName = TermService.GetTermByTermId(classInfo.TermId)?.TermName ?? string.Empty, Week = classSchoolTimes.Select(x => x.WeekDay) .Distinct() .OrderBy(x => x) .Select(x => WeekDayConvert.IntToString(x)) .ToList(), PeriodTime = new List <string>() }; foreach (var item in classSchoolTimes) { string time = item.BeginTime + "-" + item.EndTime; if (courseInformation.PeriodTime.Any(x => x == time)) { continue; } courseInformation.PeriodTime.Add(time); } res.CourseInfos.Add(courseInformation); } } return(res); }