This commit is contained in:
tanglong 2025-07-28 15:19:17 +08:00
parent 4af2ed6c7d
commit b11ae8d679
4 changed files with 25 additions and 44 deletions

View File

@ -97,25 +97,29 @@ namespace YD_AllHeartRates.Api.Mqtt
if (studentList == null || devices == null)
{
studentList = (from d in _smartSportsContext.Device
join s in _smartSportsContext.Student on d.StudentNo equals s.StudentNo
join c in _smartSportsContext.Class on s.ClassId equals c.Id
where s.SchoolCode == AppSettings.SchoolCode && s.StudentStatus == 1
select new StudentDto
{
SchoolCode = s.SchoolCode,
StudentNo = s.StudentNo,
StudentName = s.StudentName,
Sex = s.Sex,
Age = s.Age,
HeartRateId = d.Code,
JumpRopeId = d.Code,
ClassId = s.ClassId,
ClassName = s.ClassName,
GradeId = c.GradeId,
GradeName = c.GradeName ?? "",
DeviceType = d.DeviceType,
}).ToList();
studentList = (
from s in _smartSportsContext.Student
join c in _smartSportsContext.Class on s.ClassId equals c.Id
join d in _smartSportsContext.Device on s.StudentNo equals d.StudentNo into sd
from d in sd.DefaultIfEmpty()
where s.SchoolCode == AppSettings.SchoolCode && s.StudentStatus == 1
select new StudentDto
{
SchoolCode = s.SchoolCode,
StudentNo = s.StudentNo,
StudentName = s.StudentName,
Sex = s.Sex,
Age = s.Age,
HeartRateId = d != null ? d.Code : "",
JumpRopeId = d != null ? d.Code : "",
ClassId = s.ClassId,
ClassName = s.ClassName,
GradeId = c.GradeId,
GradeName = c.GradeName ?? "",
DeviceType = d != null ? d.DeviceType : 0
}
).ToList();
devices = _smartSportsContext.Device.Where(x => x.SchoolCode == AppSettings.SchoolCode && !string.IsNullOrWhiteSpace(x.StudentNo)).ToList();

View File

@ -1,23 +0,0 @@
namespace YD_AllHeartRates.Api
{
public class XS
{
/*
便
*/
}
}

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+adb7a5132ba408ee1c99d16fb2ead9bed7a7ccc5")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4af2ed6c7dde8915d38199959dc15eb0626ad29e")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
6198966bba43cd9c423a58fba5f3c39b124d08b73c11ccc008ce22ad17ebb10f
beaa3e786d777e801e865749bc1ed887c9c8bed6062702fc86efc5e999ecbaef