From cf887be6de36d64695d707903fec954efb0ca860 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Mon, 26 Jan 2026 16:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Training/I_TrainingDataService.cs | 20 +++++++++++++++---- .../Training/Request/ClassReportListParam.cs | 10 ++++++++++ .../Training/Response/ClassReportModel.cs | 10 ++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/VOL.Business/Services/Training/I_TrainingDataService.cs b/VOL.Business/Services/Training/I_TrainingDataService.cs index 20fc495..fbae388 100644 --- a/VOL.Business/Services/Training/I_TrainingDataService.cs +++ b/VOL.Business/Services/Training/I_TrainingDataService.cs @@ -2013,6 +2013,8 @@ namespace VOL.Business.Services.Training { Id = td.Id, ClassId = td.ClassId, + GradeName = td.GradeName, + ClassName = td.ClassName, GradeAndClass = $"{td.GradeName}-{td.ClassName}", TeacherName = td.TeacherName, StartingEndingTime = $"{(td.StartTime.HasValue ? td.StartTime.Value.ToString("yyyy-MM-dd HH:mm") : string.Empty)}{(td.EndTime.HasValue ? " - " + td.EndTime.Value.ToString("yyyy-MM-dd HH:mm") : string.Empty)}" @@ -2028,6 +2030,16 @@ namespace VOL.Business.Services.Training query = query.Where(x => x.TeacherName.Contains(paramDto.TeacherName ?? "")); } + if (!paramDto.GradeName.IsNullOrEmpty()) + { + query = query.Where(x => x.GradeName.Contains(paramDto.GradeName ?? "")); + } + + if (!paramDto.ClassName.IsNullOrEmpty()) + { + query = query.Where(x => x.ClassName.Contains(paramDto.ClassName ?? "")); + } + res.Total = await query.CountAsync(); var list = await query @@ -2050,7 +2062,7 @@ namespace VOL.Business.Services.Training var res = new GetClassReportDetailsModel(); var query = from hrd in _teacherRepository.DbContext.Set() - where hrd.ClassRoomRecordId == id + where hrd.ClassRoomRecordId == id select hrd; var heartRateDataList = await query.ToListAsync(); @@ -2063,7 +2075,7 @@ namespace VOL.Business.Services.Training .FirstAsync(); var classRoomStudent = await _teacherRepository.DbContext.Set() - .Where(x => x.ClassRoomRecordId == id) + .Where(x => x.ClassRoomRecordId == id) .ToListAsync(); res.GradeAndClass = $"{classRoom.GradeName}-{classRoom.ClassName}"; @@ -2133,7 +2145,7 @@ namespace VOL.Business.Services.Training //var schoolCode = UserContext.Current.TenantId; var query = from hrd in _teacherRepository.DbContext.Set() - where hrd.ClassRoomRecordId == paramDto.ClassRoomRecordId && + where hrd.ClassRoomRecordId == paramDto.ClassRoomRecordId && hrd.StudentNo == paramDto.StudentNo select hrd; @@ -2155,7 +2167,7 @@ namespace VOL.Business.Services.Training res.Consumption = Math.Abs((int)heartRateDataList.Average(x => x.Consumption ?? 0)); //var baseTime = heartRateDataList.Min(x => x.ScoreTime); - var baseTime = await _teacherRepository.DbContext.Set().Where(x =>x.ClassRoomRecordId == paramDto.ClassRoomRecordId).MinAsync(x => x.ScoreTime); + var baseTime = await _teacherRepository.DbContext.Set().Where(x => x.ClassRoomRecordId == paramDto.ClassRoomRecordId).MinAsync(x => x.ScoreTime); var heartRateWithMinutes = heartRateDataList .Select(data => new diff --git a/VOL.Model/Training/Request/ClassReportListParam.cs b/VOL.Model/Training/Request/ClassReportListParam.cs index 15e80dc..136cac8 100644 --- a/VOL.Model/Training/Request/ClassReportListParam.cs +++ b/VOL.Model/Training/Request/ClassReportListParam.cs @@ -26,6 +26,16 @@ namespace VOL.Model /// public int? ClassId { get; set; } + /// + /// 年级名称 + /// + public string? GradeName { get; set; } + + /// + /// 班级名称 + /// + public string? ClassName { get; set; } + /// /// 教师名 /// diff --git a/VOL.Model/Training/Response/ClassReportModel.cs b/VOL.Model/Training/Response/ClassReportModel.cs index a9c577f..576b837 100644 --- a/VOL.Model/Training/Response/ClassReportModel.cs +++ b/VOL.Model/Training/Response/ClassReportModel.cs @@ -22,6 +22,16 @@ namespace VOL.Model /// public int? ClassId { get; set; } + /// + /// 年级名称 + /// + public string GradeName { get; set; } + + /// + /// 班级名称 + /// + public string ClassName { get; set; } + /// /// 年级-班级 ///