dd
This commit is contained in:
parent
c1a7f8a2ff
commit
61ad29d944
@ -1129,6 +1129,28 @@ namespace VOL.Ai.Services
|
|||||||
await _classRoomRecordRepository.AddAsync(entity);
|
await _classRoomRecordRepository.AddAsync(entity);
|
||||||
await _classRoomRecordRepository.SaveChangesAsync();
|
await _classRoomRecordRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
var classroomSettingList = new List<Ai_ClassroomSetting>();
|
||||||
|
|
||||||
|
if (entity.Id > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in paramDto.ClassroomSettingList)
|
||||||
|
{
|
||||||
|
classroomSettingList.Add(new Ai_ClassroomSetting()
|
||||||
|
{
|
||||||
|
ClassRoomRecordId = entity.Id,
|
||||||
|
ClassroomStageId = item.ClassroomStageId,
|
||||||
|
Density = item.Density,
|
||||||
|
Duration = item.Duration
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (classroomSettingList.Count > 0)
|
||||||
|
{
|
||||||
|
await _classroomSettingRepository.AddRangeAsync(classroomSettingList);
|
||||||
|
await _classroomSettingRepository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new Ai_ClassRoomRecordDto()
|
return new Ai_ClassRoomRecordDto()
|
||||||
{
|
{
|
||||||
ClassRoomRecordId = entity.Id,
|
ClassRoomRecordId = entity.Id,
|
||||||
@ -1429,18 +1451,36 @@ namespace VOL.Ai.Services
|
|||||||
&& (paramDto.ClassRoomStageId <= 0 || hrd.ClassroomStageId == paramDto.ClassRoomStageId)
|
&& (paramDto.ClassRoomStageId <= 0 || hrd.ClassroomStageId == paramDto.ClassRoomStageId)
|
||||||
select hrd;
|
select hrd;
|
||||||
|
|
||||||
|
|
||||||
var heartRateDataList = await query.ToListAsync();
|
var heartRateDataList = await query.ToListAsync();
|
||||||
|
|
||||||
if (heartRateDataList.Count == 0)
|
if (heartRateDataList.Count == 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
var classRoom = await _teacherRepository.DbContext.Set<Ai_ClassRoomRecord>().Include(x => x.ClassroomStudentRecord)
|
var classRoom = await _teacherRepository.DbContext.Set<Ai_ClassRoomRecord>().Include(x => x.ClassroomStudentRecord)
|
||||||
.Where(x => x.SchoolCode == paramDto.SchoolCode && x.Id == paramDto.ClassRoomStageId)
|
.Where(x => x.SchoolCode == paramDto.SchoolCode && x.Id == paramDto.ClassRoomRecordId)
|
||||||
.FirstAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (classRoom == null)
|
||||||
|
{
|
||||||
|
throw new Exception("未找到对应的班级记录");
|
||||||
|
}
|
||||||
|
|
||||||
|
var classroomStageList = await (from s in _classroomSettingRepository.DbContext.Set<Ai_ClassroomSetting>()
|
||||||
|
join t in _classroomStageRepository.DbContext.Set<Ai_ClassroomStage>()
|
||||||
|
on s.ClassroomStageId equals t.Id
|
||||||
|
where s.ClassRoomRecordId == paramDto.ClassRoomRecordId
|
||||||
|
select new ClassroomStageInfoDto
|
||||||
|
{
|
||||||
|
ClassroomStageId = s.ClassroomStageId,
|
||||||
|
ClassroomStageName = t.Name,
|
||||||
|
Duration = s.Duration,
|
||||||
|
Density = s.Density
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
res.ClassroomStageList = classroomStageList;
|
||||||
|
|
||||||
var classRoomStudent = await _teacherRepository.DbContext.Set<Ai_ClassroomStudentRecord>()
|
var classRoomStudent = await _teacherRepository.DbContext.Set<Ai_ClassroomStudentRecord>()
|
||||||
.Where(x => x.SchoolCode == paramDto.SchoolCode && x.Id == paramDto.ClassRoomStageId)
|
.Where(x => x.SchoolCode == paramDto.SchoolCode && x.ClassRoomRecordId == paramDto.ClassRoomRecordId)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
res.GradeAndClass = $"{classRoom.GradeName}-{classRoom.ClassName}";
|
res.GradeAndClass = $"{classRoom.GradeName}-{classRoom.ClassName}";
|
||||||
@ -1499,10 +1539,8 @@ namespace VOL.Ai.Services
|
|||||||
{
|
{
|
||||||
var res = new GetStudentClassReportDetailsModel();
|
var res = new GetStudentClassReportDetailsModel();
|
||||||
|
|
||||||
var schoolCode = UserContext.Current.TenantId;
|
|
||||||
|
|
||||||
var query = from hrd in _teacherRepository.DbContext.Set<Ai_HeartRateData>()
|
var query = from hrd in _teacherRepository.DbContext.Set<Ai_HeartRateData>()
|
||||||
where hrd.SchoolCode == schoolCode &&
|
where hrd.SchoolCode == paramDto.SchoolCode &&
|
||||||
hrd.ClassRoomRecordId == paramDto.ClassRoomRecordId &&
|
hrd.ClassRoomRecordId == paramDto.ClassRoomRecordId &&
|
||||||
hrd.StudentNo == paramDto.StudentNo
|
hrd.StudentNo == paramDto.StudentNo
|
||||||
select hrd;
|
select hrd;
|
||||||
@ -1525,7 +1563,7 @@ namespace VOL.Ai.Services
|
|||||||
res.Consumption = Math.Abs((int)heartRateDataList.Average(x => x.Consumption ?? 0));
|
res.Consumption = Math.Abs((int)heartRateDataList.Average(x => x.Consumption ?? 0));
|
||||||
|
|
||||||
//var baseTime = heartRateDataList.Min(x => x.ScoreTime);
|
//var baseTime = heartRateDataList.Min(x => x.ScoreTime);
|
||||||
var baseTime = await _teacherRepository.DbContext.Set<Ai_HeartRateData>().Where(x => x.SchoolCode == schoolCode && x.ClassRoomRecordId == paramDto.ClassRoomRecordId).MinAsync(x => x.ScoreTime);
|
var baseTime = await _teacherRepository.DbContext.Set<Ai_HeartRateData>().Where(x => x.SchoolCode == paramDto.SchoolCode && x.ClassRoomRecordId == paramDto.ClassRoomRecordId).MinAsync(x => x.ScoreTime);
|
||||||
|
|
||||||
var heartRateWithMinutes = heartRateDataList
|
var heartRateWithMinutes = heartRateDataList
|
||||||
.Select(data => new
|
.Select(data => new
|
||||||
|
@ -66,6 +66,11 @@ namespace VOL.Model.Ai.Request
|
|||||||
/// 课堂记录学生列表
|
/// 课堂记录学生列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ClassroomStudentRecordRequest> ClassroomStudentRecord { get; set; }
|
public List<ClassroomStudentRecordRequest> ClassroomStudentRecord { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 课堂设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<ClassroomSettingDto> ClassroomSettingList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
using System;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -62,6 +65,11 @@ namespace VOL.Model.Ai.Response
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Consumption { get; set; }
|
public string Consumption { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 课堂阶段
|
||||||
|
/// </summary>
|
||||||
|
public List<ClassroomStageInfoDto> ClassroomStageList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学生运动记录
|
/// 学生运动记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -77,4 +85,30 @@ namespace VOL.Model.Ai.Response
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SportsProportionData> HeartRateTrend { get; set; } = new List<SportsProportionData>();
|
public List<SportsProportionData> HeartRateTrend { get; set; } = new List<SportsProportionData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 课堂阶段
|
||||||
|
/// </summary>
|
||||||
|
public class ClassroomStageInfoDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 阶段Id
|
||||||
|
/// </summary>
|
||||||
|
public int ClassroomStageId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阶段名称
|
||||||
|
/// </summary>
|
||||||
|
public string ClassroomStageName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 时长
|
||||||
|
/// </summary>x
|
||||||
|
public int Duration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 密度
|
||||||
|
/// </summary>
|
||||||
|
public int Density { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using VOL.Model.Ai;
|
||||||
using VOL.Model.Norm.Response;
|
using VOL.Model.Norm.Response;
|
||||||
|
|
||||||
namespace VOL.Model.Training.Response
|
namespace VOL.Model.Training.Response
|
||||||
@ -27,7 +28,7 @@ namespace VOL.Model.Training.Response
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学生课堂记录详情
|
/// 学生课堂记录详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetStudentClassReportDetailsDto
|
public class GetStudentClassReportDetailsDto : Ai_Request
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 课堂Id
|
/// 课堂Id
|
||||||
|
@ -552,7 +552,7 @@ namespace VOL.WebApi.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取学生心率报告
|
/// 获取跳绳报告
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpGet(nameof(JumpRopeReport))]
|
[HttpGet(nameof(JumpRopeReport))]
|
||||||
[ServiceFilter(typeof(ValidateDeviceFilter))]
|
[ServiceFilter(typeof(ValidateDeviceFilter))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user