From f7aedcce911cf4895ce81a08cdd7f0fc0731961d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Tue, 14 Apr 2026 15:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E4=BA=8B=E6=95=99=E7=BB=83=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YD_Event.Application/Event/Dtos/ScoreDtos.cs | 7 ++++++- .../Event/EventScoreService.cs | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/YD_Event.Application/Event/Dtos/ScoreDtos.cs b/YD_Event.Application/Event/Dtos/ScoreDtos.cs index 70189c6..97864c0 100644 --- a/YD_Event.Application/Event/Dtos/ScoreDtos.cs +++ b/YD_Event.Application/Event/Dtos/ScoreDtos.cs @@ -140,13 +140,18 @@ public class CoachLeaderListOutput /// /// 年龄 /// - public int Age { get; set; } + public int? Age { get; set; } /// /// 性别 /// public string Gender { get; set; } + /// + /// 出生日期 + /// + public DateTime? BirthDate { get; set; } + /// /// 身份证号 /// diff --git a/YD_Event.Application/Event/EventScoreService.cs b/YD_Event.Application/Event/EventScoreService.cs index e21e3b0..225e274 100644 --- a/YD_Event.Application/Event/EventScoreService.cs +++ b/YD_Event.Application/Event/EventScoreService.cs @@ -10,6 +10,8 @@ using SqlSugar; using OfficeOpenXml; using OfficeOpenXml.Style; using System.Drawing; +using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.DepositMarketingMemberCardOpenCardCodesResponse.Types; +using YD_Event.Application.AppUser.Dtos; namespace YD_Event.Application.Event; @@ -180,13 +182,24 @@ public class EventScoreService : BaseService, ITransient Id = p.Id, Name = p.Name, Age = p.Age, - Gender = p.Gender.Description(), - IdCardNumber = p.IdCard, - Mobile = p.Phone, + IdCardNumber = p.IdCardImageUrl, + Mobile = p.Mobile, CertificateId = 0 // 需要单独查询,此处先设为0 }) .ToPagedListAsync(input); + foreach (var item in pageResult.Rows) + { + if (item.Age.HasValue) + { + continue; + } + if (item.BirthDate.HasValue) + { + item.Age = MemberOutput.CalculateAgeFromBirthDate(item.BirthDate); + } + } + return pageResult; }