From b463e160529dd395e918eaceb76ff9cad3eff97c Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Tue, 16 Apr 2024 10:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Controllers/BaseController.cs | 2 +- Tiobon.Core.Api/Controllers/Ghra_GradeController.cs | 2 +- Tiobon.Core.Api/Tiobon.Core.xml | 2 +- Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs | 2 +- Tiobon.Core.Services/BASE/BaseServices.cs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/BaseController.cs b/Tiobon.Core.Api/Controllers/BaseController.cs index b9c67587..51e9f711 100644 --- a/Tiobon.Core.Api/Controllers/BaseController.cs +++ b/Tiobon.Core.Api/Controllers/BaseController.cs @@ -2,7 +2,7 @@ namespace Tiobon.Core.Controllers { - public class BaseController : Controller + public class BaseController : Controller { #region 初始化 protected IServiceBase _service; diff --git a/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs b/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs index 4d115093..f7e9bff9 100644 --- a/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs @@ -6,7 +6,7 @@ [Route("api/[controller]")] [ApiController, GlobalActionFilter] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghra)] - public class Ghra_GradeController : BaseController + public class Ghra_GradeController : BaseController { public Ghra_GradeController(IGhra_GradeServices service) : base(service) { diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 3559a6cf..93434ad1 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -4,7 +4,7 @@ Tiobon.Core.Api - + diff --git a/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs b/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs index 7a865f07..0fa51e1b 100644 --- a/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs +++ b/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs @@ -96,7 +96,7 @@ public static class SqlSugarAop if (App.User?.ID > 0 && dyCreateBy != null && dyCreateBy.GetValue(entityInfo.EntityValue) == null) dyCreateBy.SetValue(entityInfo.EntityValue, (int)App.User.ID); - if (dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) != null && (DateTime)dyCreateTime.GetValue(entityInfo.EntityValue) == DateTime.MinValue) + if ((dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) is null) || (dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) != null && (DateTime)dyCreateTime.GetValue(entityInfo.EntityValue) == DateTime.MinValue)) dyCreateTime.SetValue(entityInfo.EntityValue, DateTime.Now); break; diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index 9fb96efa..103c195f 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -418,12 +418,12 @@ namespace Tiobon.Core.Services.BASE var api = request.Path.ObjToString().TrimEnd('/').ToLower(); var ip = GetUserIp(UserContext.Context); - BasePoco ent = entity as BasePoco; + var entity1 = Mapper.Map(entity).ToANew(); + BasePoco ent = entity1 as BasePoco; ent.CreateIP = ip; ent.CreateProg = api; - var entity1 = Mapper.Map(entity).ToANew(); return await BaseDal.Add(entity1); }