From eb3cd5d3b2d5e40a65eccb2617f4854219ab6605 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Sun, 25 Jun 2023 15:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=B0=E5=A2=9E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8E=A5=E5=8F=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/Tnb.Systems/Permission/DepartmentService.cs | 10 +++++++--- system/Tnb.Systems/Tnb.Systems.csproj | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/system/Tnb.Systems/Permission/DepartmentService.cs b/system/Tnb.Systems/Permission/DepartmentService.cs index 0e74df6e..85325c15 100644 --- a/system/Tnb.Systems/Permission/DepartmentService.cs +++ b/system/Tnb.Systems/Permission/DepartmentService.cs @@ -6,6 +6,7 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; +using JNPF.Logging; using JNPF.Systems.Entitys.Dto.Department; using JNPF.Systems.Entitys.Dto.Organize; using JNPF.Systems.Entitys.Dto.SysConfig; @@ -248,7 +249,8 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra if (await _repository.IsAnyAsync(o => o.ParentId == input.parentId && o.FullName == input.fullName && o.Category == "department" && o.DeleteMark == null)) throw Oops.Oh(ErrorCode.D2019); OrganizeEntity? entity = input.Adapt(); - entity.Category = "department"; + // entity.Category = "department"; + entity.Category = input.category; entity.Id = SnowflakeIdHelper.NextId(); entity.EnabledMark = 1; entity.CreatorTime = DateTime.Now; @@ -473,7 +475,8 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra var processVal = jsonObj.GetValue("rowprocess"); if (processVal is not null) { - var dic = _repository.GetList().ToDictionary(x => x.FullName, x => x.Id); + //modifyby zhoukeda 2023.06.25 + var dic = _repository.GetList(x=>x.DeleteMark==null).ToDictionary(x => x.FullName, x => x.Id); var procList = jsonObj.Value("rowprocess"); var pids = procList.Select(x => x.Value("id")).Distinct().ToList(); var dbProcIds = await _repository.AsSugarClient().Queryable().Where(it => pids.Contains(it.process_id)).Select(it => it.process_id).ToListAsync(); @@ -517,8 +520,9 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra if (sysConfig.qyhIsSynOrg) await _synThirdInfoService.SynDep(1, 1, sysConfig, orgList); } - catch (Exception) + catch (Exception e) { + Log.Error(e.Message); } #endregion } diff --git a/system/Tnb.Systems/Tnb.Systems.csproj b/system/Tnb.Systems/Tnb.Systems.csproj index 35ba2198..49f58031 100644 --- a/system/Tnb.Systems/Tnb.Systems.csproj +++ b/system/Tnb.Systems/Tnb.Systems.csproj @@ -17,4 +17,8 @@ + + + +