From be8e576dd8eb3bba797fccdd72b27ae8e4d56866 Mon Sep 17 00:00:00 2001 From: Grady <3392207530@qq.com> Date: Mon, 5 Dec 2022 16:23:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BC=82=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WorkFlowCore/Commons/Common.WebApi/ExceptionMiddleware.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WorkFlowCore/Commons/Common.WebApi/ExceptionMiddleware.cs b/WorkFlowCore/Commons/Common.WebApi/ExceptionMiddleware.cs index c3bb9c6..8d47562 100644 --- a/WorkFlowCore/Commons/Common.WebApi/ExceptionMiddleware.cs +++ b/WorkFlowCore/Commons/Common.WebApi/ExceptionMiddleware.cs @@ -30,7 +30,7 @@ namespace Common.WebApi { context.Response.ContentType="application/json"; context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; - context.Response.Body.WriteAsync(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(OutputDto.Failed($"发生异常:{ex.Message}"), new JsonSerializerSettings + await context.Response.Body.WriteAsync(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(OutputDto.Failed($"发生异常:{ex.Message}"), new JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }))); -- Gitee From c1c78c0ca81c09127b0254229e330472c5392abf Mon Sep 17 00:00:00 2001 From: Grady <3392207530@qq.com> Date: Mon, 5 Dec 2022 17:38:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E4=B8=8D=E5=90=88?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WorkFlowCore/Commons/Common.EventBus/EventConsumerAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WorkFlowCore/Commons/Common.EventBus/EventConsumerAttribute.cs b/WorkFlowCore/Commons/Common.EventBus/EventConsumerAttribute.cs index 9e50753..4a79893 100644 --- a/WorkFlowCore/Commons/Common.EventBus/EventConsumerAttribute.cs +++ b/WorkFlowCore/Commons/Common.EventBus/EventConsumerAttribute.cs @@ -13,8 +13,8 @@ namespace Common.EventBus public EventConsumerAttribute(string groupId = null, bool isRandom = false) { - GroupId = groupId; if (isRandom) groupId += $"-{Guid.NewGuid()}"; + GroupId = groupId; } } } -- Gitee From 52dad2cfcb65eda50bf861eb2b9389e144f8dc3d Mon Sep 17 00:00:00 2001 From: Grady <3392207530@qq.com> Date: Mon, 5 Dec 2022 18:11:20 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common.BaseRepositories4EF/EfContextExtensions.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/WorkFlowCore/Commons/Common.BaseRepositories4EF/EfContextExtensions.cs b/WorkFlowCore/Commons/Common.BaseRepositories4EF/EfContextExtensions.cs index 35d5e1c..6b4bc18 100644 --- a/WorkFlowCore/Commons/Common.BaseRepositories4EF/EfContextExtensions.cs +++ b/WorkFlowCore/Commons/Common.BaseRepositories4EF/EfContextExtensions.cs @@ -22,14 +22,11 @@ namespace Common.BaseRepositories4EF return queryable; } - public static IQueryable AddSoftDeleteContition(this IQueryable queryable, ICommonSession session) where TEntity : class, IEntity + public static IQueryable AddSoftDeleteContition(this IQueryable queryable) where TEntity : class, IEntity { if (typeof(ISoftDeleteEntity).IsAssignableFrom(typeof(TEntity))) { - if (!string.IsNullOrEmpty(session?.User?.TenantId)) - { - queryable = queryable.Where("Deleted={0}", true); - } + queryable = queryable.Where("Deleted={0}", true); } return queryable; } -- Gitee From 14fc6f5a6dba40d3a8e47ac46f06eda509d23709 Mon Sep 17 00:00:00 2001 From: Grady <3392207530@qq.com> Date: Tue, 6 Dec 2022 16:47:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E8=AD=A6=E5=91=8A=E5=92=8C=E4=B8=80=E4=B8=AABUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization.Core/Organizations/OrganizationManager.cs | 4 +++- .../Repositories/OrganizationRepository.cs | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/WorkFlowCore/UserOrganization/Organization.Core/Organizations/OrganizationManager.cs b/WorkFlowCore/UserOrganization/Organization.Core/Organizations/OrganizationManager.cs index a44a1f4..72c9d16 100644 --- a/WorkFlowCore/UserOrganization/Organization.Core/Organizations/OrganizationManager.cs +++ b/WorkFlowCore/UserOrganization/Organization.Core/Organizations/OrganizationManager.cs @@ -80,7 +80,9 @@ namespace Organization.Core.Organizations if (org == null) return null; var userOrgs = await userOrganizationRepository.GetListAsync(uo => uo.OrganizationCode == org.Code); await userOrganizationRepository.DeleteManyAsync(userOrgs); - return await organizationRepository.InsertAsync(org); + await organizationRepository.DeleteAsync(org); + + return org; } public async Task SetOrganizationLeaders(string orgCode,params Guid[] userIds) diff --git a/WorkFlowCore/UserOrganization/Organization.Framework/Repositories/OrganizationRepository.cs b/WorkFlowCore/UserOrganization/Organization.Framework/Repositories/OrganizationRepository.cs index dbc7e43..81d96c6 100644 --- a/WorkFlowCore/UserOrganization/Organization.Framework/Repositories/OrganizationRepository.cs +++ b/WorkFlowCore/UserOrganization/Organization.Framework/Repositories/OrganizationRepository.cs @@ -14,11 +14,8 @@ namespace Organization.Framework.Repositories { public class OrganizationRepository : BasicRepository4EF, IOrganizationRepository { - private readonly DbContext dbContext; - - public OrganizationRepository(DbContext dbContext, IUnitOfWork unitOfWork, ICommonSession session) : base(unitOfWork, session) + public OrganizationRepository(IUnitOfWork unitOfWork, ICommonSession session) : base(unitOfWork, session) { - this.dbContext = dbContext; } public int GetMaxNum() -- Gitee