From 32288af3e5f12bc48d8360114c872fde5d9ff4a8 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期五, 08 八月 2025 09:09:08 +0800
Subject: [PATCH] pref:优化

---
 FlexJobApi.FlexJobServer.Application/Tasks/Commands/TaskInfoCommandHandler.cs |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/FlexJobApi.Application/Tasks/Commands/TaskInfoCommandHandler.cs b/FlexJobApi.FlexJobServer.Application/Tasks/Commands/TaskInfoCommandHandler.cs
similarity index 90%
rename from FlexJobApi.Application/Tasks/Commands/TaskInfoCommandHandler.cs
rename to FlexJobApi.FlexJobServer.Application/Tasks/Commands/TaskInfoCommandHandler.cs
index 63e63bf..fae1531 100644
--- a/FlexJobApi.Application/Tasks/Commands/TaskInfoCommandHandler.cs
+++ b/FlexJobApi.FlexJobServer.Application/Tasks/Commands/TaskInfoCommandHandler.cs
@@ -1,6 +1,7 @@
 锘縰sing FlexJobApi.Core;
 using Furion.DatabaseAccessor;
 using Furion.DistributedIDGenerator;
+using Furion.FriendlyException;
 using Mapster;
 using MediatR;
 using Microsoft.EntityFrameworkCore;
@@ -10,7 +11,7 @@
 using System.Text;
 using System.Threading.Tasks;
 
-namespace FlexJobApi.Application
+namespace FlexJobApi.FlexJobServer.Application
 {
     /// <summary>
     /// 浠诲姟鍛戒护澶勭悊鍣�
@@ -35,6 +36,7 @@
         public async Task<Guid> Handle(SaveTaskInfoCommand request, CancellationToken cancellationToken)
         {
             var logier = JwtUtils.GetCurrentLogier();
+            if (logier.EnterpriseId == null) throw Oops.Oh(EnumErrorCodeType.s400, "褰撳墠鐧诲綍鐢ㄦ埛蹇呴』涓轰紒涓氱敤鎴锋墠鍙互鍒涘缓浠诲姟");
             return await request.SaveData<TaskInfo, SaveTaskInfoCommand>(
                  q =>
                  {
@@ -49,6 +51,9 @@
                      if (request.Id == null)
                      {
                          entity.EnterpriseId = logier.EnterpriseId.Value;
+                         entity.Status = EnumTaskStatus.Wait;
+                         entity.ReleaseStatus = EnumTaskReleaseStatus.InProcess;
+                         entity.RecommendStatus = EnumTaskRecommendStatus.No;
                          BuildCode(entity).Wait();
                      }
                      entity.Benefits = request.Benefits

--
Gitblit v1.9.1