From 6b18de28983828bdb2e915b0c4271490017b1ab7 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Wed, 1 Jul 2026 17:14:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=AC=E5=8F=B8=E5=85=AC=E5=91=8A=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/PFAnnourcementController.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/APT.MicroApi/APT.PF.WebApi/Controllers/Api/PFAnnourcementController.cs b/APT.MicroApi/APT.PF.WebApi/Controllers/Api/PFAnnourcementController.cs index 9c26826..2ccb8e5 100644 --- a/APT.MicroApi/APT.PF.WebApi/Controllers/Api/PFAnnourcementController.cs +++ b/APT.MicroApi/APT.PF.WebApi/Controllers/Api/PFAnnourcementController.cs @@ -357,13 +357,16 @@ namespace APT.PF.WebApiControllers.Api.PF return SafeExecute(() => { var result = GetEntity(null, filter, null); + result.CREATE_USER_NAME = ""; if (result.CREATER_ID.HasValue) { - result.CREATE_USER_NAME = GetEntity(result.CREATER_ID.Value).NAME; - } - else - { - result.CREATE_USER_NAME = ""; + //try { result.CREATE_USER_NAME = GetEntity(result.CREATER_ID.Value).NAME; } + //catch { } + var conndefault = ConfigurationManager.ConnectionStrings["default"]; + using (var context = new MigrationContext(conndefault)) + { + result.CREATE_USER_NAME = context.GetEntity(e => e.ID == result.CREATER_ID.Value, null)?.NAME; + } } return result; }); @@ -383,7 +386,7 @@ namespace APT.PF.WebApiControllers.Api.PF DateTime dtS = DateTime.Now.Date; Expression> expression = e => !e.IS_DELETED && e.START <= dtS && e.ISPUBLISH; expression = expression.And(e => e.END == null || e.END >= dtS); - var result =GetOrderEntities(expression, pageFilter, null); + var result = GetOrderEntities(expression, pageFilter, null); return result; }); } From f4146f674ea7229747644aa1299170ad6e39c10f Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Wed, 1 Jul 2026 17:19:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=B0=83=E5=BA=A6=20?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E4=BA=BA=E5=91=98=20=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A7=93=E5=90=8D=EF=BC=88=E4=B9=8B=E5=89=8D=E5=B7=A5=E5=8F=B7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/FMUserTransferController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/APT.MicroApi/APT.FM.WebApi/Controllers/Api/FMUserTransferController.cs b/APT.MicroApi/APT.FM.WebApi/Controllers/Api/FMUserTransferController.cs index 1c8cdea..9e6bbce 100644 --- a/APT.MicroApi/APT.FM.WebApi/Controllers/Api/FMUserTransferController.cs +++ b/APT.MicroApi/APT.FM.WebApi/Controllers/Api/FMUserTransferController.cs @@ -501,7 +501,10 @@ namespace APT.FM.WebApi.Controllers.Api.FM } entity.USER_ID = modelUOld.ID; entity.CREATE_TIME = DateTime.Now; - entity.USERNAME_TRANSFER = APT.Infrastructure.Api.AppContext.CurrentSession.UserName; + if (APT.Infrastructure.Api.AppContext.CurrentSession.UserID.HasValue) + { + entity.USERNAME_TRANSFER = GetEntity(e => e.ID == APT.Infrastructure.Api.AppContext.CurrentSession.UserID.Value)?.NAME; + } this.UnifiedCommit(() => { UpdateEntityNoCommit(entity);