From ab38e4f6313bb3e053f7a26535f865da6829dae9 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期四, 11 九月 2025 15:53:03 +0800 Subject: [PATCH] - --- FlexJobApi.Core/Jobs/CalcUserAgeByIdCardJob.cs | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/FlexJobApi.Core/Jobs/CalcUserAgeByIdCardJob.cs b/FlexJobApi.Core/Jobs/CalcUserAgeByIdCardJob.cs index 0f05eae..e717f0d 100644 --- a/FlexJobApi.Core/Jobs/CalcUserAgeByIdCardJob.cs +++ b/FlexJobApi.Core/Jobs/CalcUserAgeByIdCardJob.cs @@ -24,10 +24,17 @@ var enities = await rep.AsQueryable() .Where(it => it.Type == EnumUserType.Personal && it.Identity != null && it.Identity != "") .ToListAsync(stoppingToken); - foreach (var entity in enities) + if (enities.IsNotNull()) { - var age = entity.Identity.GetAge(); - entity.Age = age; + foreach (var entity in enities) + { + var age = entity.Identity.GetAge(); + if (age.HasValue) + { + entity.Age = age; + } + } + await rep.UpdateNowAsync(enities); } } } -- Gitblit v1.9.1