代码更新

This commit is contained in:
tanglong 2026-01-07 14:35:06 +08:00
parent f9f4a53c41
commit 922cd4beca
32 changed files with 67 additions and 20 deletions

View File

@ -29,7 +29,7 @@ namespace YD_XinWei.Commons.Dto.LargeScreen
///年级名称
/// </summary>
///
public string? GradeName { get; set; }
public string GradeName { get; set; }
/// <summary>
///班级Id
@ -41,7 +41,7 @@ namespace YD_XinWei.Commons.Dto.LargeScreen
///班级名称
/// </summary>
///
public string? ClassName { get; set; }
public string ClassName { get; set; }
/// <summary>
@ -72,7 +72,7 @@ namespace YD_XinWei.Commons.Dto.LargeScreen
/// <summary>
///得分
/// </summary>
public float Score { get; set; }
public double Score { get; set; }
/// <summary>
/// 等级

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a425fcc1a41944f64a69d9b5ababdd07169c6a0d")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f9f4a53c41a5029c82bfb442fd4e2b9f2980218f")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
ccb578c866c97170d1abbe168fb35ec821458a73a52b86c4e9d961def395e327
1a65a50200bd94af6e2d6f3826d955a8c36d582414a4f0b14ef8b8181a24901d

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+782af8743bef71ca7e5f90325feac2f11e237ba5")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f9f4a53c41a5029c82bfb442fd4e2b9f2980218f")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
69251adfa64a9b3b7fb3d391959c24ebf8b50dfa3951efbe3b21fe9890d5cf9d
74c4dd81c8aa3b83c88922809ca51fe25d7816fdf64b1c08a9bf0d7628572ab1

View File

@ -23,6 +23,7 @@ namespace YD_XinWei.Api.AutoMappers
CreateMap<XW_SportsTestData, TrainDto>();
CreateMap<XW_TrainStudents, TrainStudentsDto>();
CreateMap<XW_TrainSetting, TrainSettingDto>();
CreateMap<XW_TrainViolationsBO, TrainViolationsBODto>();
}

View File

@ -106,6 +106,33 @@ namespace YD_XinWei.Api.Services.Impl
res.BasicInfo.FemaleCount = studentList.Count(x => x.Sex == 2);
res.BasicInfo.MaleCount = studentList.Count(x => x.Sex == 1);
//var sportsTestData = _caching.Get<List<SportsTestDataDto>>(sportsTestDataKey);
//if (sportsTestData == null || sportsTestData.Count == 0)
//{
// sportsTestData = await _sportsContext.SportsTestValue.Where(x => x.SchoolCode == schoolCode && x.DataSource == DataSource.XW)
// .Select(x => new SportsTestDataDto()
// {
// SchoolCode = x.SchoolCode,
// CategoryValue = x.CategoryValue,
// ClassId = x.ClassId,
// ClassName = x.ClassName,
// GradeId = x.GradeId,
// GradeName = x.GradeName,
// TeacherId = x.TeacherId,
// StudentNo = x.StudentNo,
// StudentName = x.StudentName,
// Sex = x.Sex,
// ScoreTime = x.ScoreTime,
// Height = x.Height,
// Weight = x.Weight,
// Value = x.Value,
// Score = x.Score,
// Rank = x.Rank
// }).ToListAsync();
// //_caching.AddObject(sportsTestDataKey, sportsTestData, 60);
//}
var sportsTestData = _caching.Get<List<SportsTestDataDto>>(sportsTestDataKey);
if (sportsTestData == null || sportsTestData.Count == 0)

View File

@ -16,6 +16,7 @@ using YD_XinWei.Commons.Utils;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using Newtonsoft.Json.Linq;
using VOL.Entity.Enum;
using System.Text.Json;
namespace YD_XinWei.Api.Services.Impl
{
@ -337,12 +338,27 @@ namespace YD_XinWei.Api.Services.Impl
/// <returns></returns>
public async Task<TrainDto> AddTrain(AddTrainDto dto)
{
var jsonOptions = new JsonSerializerOptions
{
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
string dtoJson = System.Text.Json.JsonSerializer.Serialize(dto, jsonOptions);
await File.WriteAllTextAsync(
$"/tmp/add_train_{DateTime.Now:yyyyMMdd_HHmmss}.json",
dtoJson
);
var xwProject = await _sportsContext.XW_TestingProject.ToListAsync();
var healthStandards = await _sportsContext.HealthStandards.ToListAsync();
try
{
dto.StudentList.ForEach(stu =>
var entity = _mapper.Map<XW_SportsTestData>(dto);
entity.StudentList.ForEach(stu =>
{
var project = xwProject.Where(x => x.ProjectId == dto.ProjectId).FirstOrDefault();
string categoryEnum = project?.CategoryEnum ?? "";
@ -396,7 +412,6 @@ namespace YD_XinWei.Api.Services.Impl
dto.StudentList.ForEach(x => { x.OrgId = dto.OrgId; });
var entity = _mapper.Map<XW_SportsTestData>(dto);
await _sportsContext.XW_SportsTestData.AddAsync(entity);
var sportsTestValueEntinys = await AddSportsTestValueEntity(dto, healthStandards, xwProject);
@ -441,14 +456,18 @@ namespace YD_XinWei.Api.Services.Impl
if (categoryEnum == "BMI")
{
value = (data.Achievement2 ?? 0) / 10;
sportsTestValueEntity.Height = (data.Achievement ?? 0) / 10;
sportsTestValueEntity.Weight = (data.OriginalAchievement ?? 0) / 100;
value = (float)Math.Round((data.Achievement2 ?? 0) / 10.0, 2);
sportsTestValueEntity.Height = (float)Math.Round((data.Achievement ?? 0) / 10.0, 2);
sportsTestValueEntity.Weight = (float)Math.Round((data.OriginalAchievement ?? 0) / 100.0, 2);
}
else if (categoryEnum == "MeterRun_50")
{
value = (data.Achievement ?? 0) / 1000;
value = (float)Math.Round((data.Achievement ?? 0) / 1000.0, 3);
}
else
value = data.Achievement ?? 0;

View File

@ -51,7 +51,7 @@ namespace VOL.Entity.DomainModels.XinWei
/// </summary>
[Display(Name = "GradeId")]
[Comment("年级ID")]
public int? GradeId { get; set; }
public int GradeId { get; set; }
/// <summary>
/// 年级名称
@ -65,7 +65,7 @@ namespace VOL.Entity.DomainModels.XinWei
/// </summary>
[Display(Name = "ClassId")]
[Comment("班级ID")]
public int? ClassId { get; set; }
public int ClassId { get; set; }
/// <summary>
/// 班级名称
@ -121,7 +121,7 @@ namespace VOL.Entity.DomainModels.XinWei
/// </summary>
[Display(Name = "Sex")]
[Comment("性别(1男2女)")]
public int? Sex { get; set; }
public int Sex { get; set; }
/// <summary>
/// 学号

View File

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

View File

@ -1 +1 @@
44bf2b0755fc92c02e14f869acecaba774e270464c23f9a46cf45200909a3238
c35501667fb409e53e82d34e66d4b85f445164ed8f6b4d80af1f430abf23cf38

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+782af8743bef71ca7e5f90325feac2f11e237ba5")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f9f4a53c41a5029c82bfb442fd4e2b9f2980218f")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
7553d3a5ba1bd3869f0000b8e3dd2c02f16ecdfc233ab9c15be111fe83a5f3aa
3ee2a4997ca5a7a114829a3edd61a9285483441b9edac8b0338989a7c9e658a8