From 6f450ffa6628d206d4f60284e16e84e4adbcd789 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期二, 19 八月 2025 13:12:02 +0800
Subject: [PATCH] feat:开发

---
 FlexJobApi.Core/Jobs/CalcUserAgeByIdCardJob.cs                                     |   13 ++++++++++---
 FlexJobApi.FlexJobServer.Application/TaskUsers/Commands/ApplyTaskCommandHandler.cs |    5 ++++-
 FlexJobApi.Core/Jobs/CalcTaskSatusByDateJob.cs                                     |    1 +
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/FlexJobApi.Core/Jobs/CalcTaskSatusByDateJob.cs b/FlexJobApi.Core/Jobs/CalcTaskSatusByDateJob.cs
index 772395e..267883a 100644
--- a/FlexJobApi.Core/Jobs/CalcTaskSatusByDateJob.cs
+++ b/FlexJobApi.Core/Jobs/CalcTaskSatusByDateJob.cs
@@ -31,6 +31,7 @@
                 {
                     entity.ReleaseStatus = EnumTaskReleaseStatus.Stopped;
                 }
+                await rep.UpdateNowAsync(entities);
             }
         }
     }
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);
             }
         }
     }
diff --git a/FlexJobApi.FlexJobServer.Application/TaskUsers/Commands/ApplyTaskCommandHandler.cs b/FlexJobApi.FlexJobServer.Application/TaskUsers/Commands/ApplyTaskCommandHandler.cs
index d4d3d00..bc707d8 100644
--- a/FlexJobApi.FlexJobServer.Application/TaskUsers/Commands/ApplyTaskCommandHandler.cs
+++ b/FlexJobApi.FlexJobServer.Application/TaskUsers/Commands/ApplyTaskCommandHandler.cs
@@ -65,7 +65,8 @@
                     .Select(it => new
                     {
                         it.Id,
-                        it.EnterpriseId
+                        it.EnterpriseId,
+                        it.ReleaseStatus
                     })
                     .ToListAsync(cancellationToken);
                 var enterpriseIds = tasks.DistinctSelect(it => it.EnterpriseId);
@@ -80,6 +81,8 @@
                 {
                     var task = tasks.FirstOrDefault(it => it.Id == taskId);
                     if (task == null) throw Oops.Oh(EnumErrorCodeType.s404, "浠诲姟");
+                    if (task.ReleaseStatus == EnumTaskReleaseStatus.Stopped)
+                        throw Oops.Oh(EnumErrorCodeType.s510, "浠诲姟宸插仠姝�");
                     var employee = employees.FirstOrDefault(it => it.EnterpriseId == task.EnterpriseId && it.UserId == logier.Id);
                     if (employee == null)
                     {

--
Gitblit v1.9.1