ソースを参照

更新nuget包
实现部门和岗位管理

zhontai 3 年 前
コミット
232cde6c9e

+ 3 - 3
Admin.Core.Common/Admin.Core.Common.csproj

@@ -34,15 +34,15 @@
     <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
     <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
-    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.11.1" />
+    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.12.0" />
     <PackageReference Include="System.Drawing.Common" Version="5.0.2" />
-    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.11.1" />
+    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.0" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.12" />
 	<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
 	<PackageReference Include="Autofac.Extras.DynamicProxy" Version="6.0.0" />
 	<PackageReference Include="NLog" Version="4.7.10" />
-	<PackageReference Include="NLog.Web.AspNetCore" Version="4.12.0" />
+	<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
Admin.Core.Service/Admin/Permission/IPermissionService.cs

@@ -24,7 +24,7 @@ namespace Admin.Core.Service.Admin.Permission
 
         Task<IResponseOutput> GetTenantPermissionList(long tenantId);
 
-        Task<IResponseOutput> ListAsync(string key, DateTime? start, DateTime? end);
+        Task<IResponseOutput> GetListAsync(string key, DateTime? start, DateTime? end);
 
         Task<IResponseOutput> AddGroupAsync(PermissionAddGroupInput input);
 

+ 1 - 1
Admin.Core.Service/Admin/Permission/PermissionService.cs

@@ -82,7 +82,7 @@ namespace Admin.Core.Service.Admin.Permission
             return ResponseOutput.Ok(output);
         }
 
-        public async Task<IResponseOutput> ListAsync(string key, DateTime? start, DateTime? end)
+        public async Task<IResponseOutput> GetListAsync(string key, DateTime? start, DateTime? end)
         {
             if (end.HasValue)
             {

+ 1 - 1
Admin.Core.Service/Personnel/Organization/IOrganizationService.cs

@@ -10,7 +10,7 @@ namespace Admin.Core.Service.Personnel.Organization
     {
         Task<IResponseOutput> GetAsync(long id);
 
-        Task<IResponseOutput> PageAsync(PageInput<OrganizationEntity> model);
+        Task<IResponseOutput> GetListAsync(string key);
 
         Task<IResponseOutput> AddAsync(OrganizationAddInput input);
 

+ 6 - 15
Admin.Core.Service/Personnel/Organization/OrganizationService.cs

@@ -23,22 +23,13 @@ namespace Admin.Core.Service.Personnel.Organization
             return ResponseOutput.Ok(result);
         }
 
-        public async Task<IResponseOutput> PageAsync(PageInput<OrganizationEntity> input)
+        public async Task<IResponseOutput> GetListAsync(string key)
         {
-            var key = input.Filter?.Name;
-
-            var list = await _organizationRepository.Select
-            .WhereIf(key.NotNull(), a => a.Name.Contains(key) || a.Code.Contains(key))
-            .Count(out var total)
-            .OrderByDescending(true, c => c.Id)
-            .Page(input.CurrentPage, input.PageSize)
-            .ToListAsync<OrganizationListOutput>();
-
-            var data = new PageOutput<OrganizationListOutput>()
-            {
-                List = list,
-                Total = total
-            };
+            var data = await _organizationRepository
+                .WhereIf(key.NotNull(), a => a.Name.Contains(key) || a.Code.Contains(key))
+                .OrderBy(a => a.ParentId)
+                .OrderBy(a => a.Sort)
+                .ToListAsync<OrganizationListOutput>();
 
             return ResponseOutput.Ok(data);
         }

+ 1 - 1
Admin.Core.Tests/Admin.Core.Tests.csproj

@@ -7,7 +7,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.7" />
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.8" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">

+ 5 - 5
Admin.Core/Admin.Core.csproj

@@ -45,17 +45,17 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="AspNetCoreRateLimit" Version="4.0.0" />
+    <PackageReference Include="AspNetCoreRateLimit" Version="4.0.1" />
     <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
     <PackageReference Include="Autofac.Extras.DynamicProxy" Version="6.0.0" />
     <PackageReference Include="Caching.CSRedis" Version="3.6.60" />
     <PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.0.0" />
-    <PackageReference Include="FluentValidation.AspNetCore" Version="10.2.3" />
+    <PackageReference Include="FluentValidation.AspNetCore" Version="10.3.0" />
     <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
-    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.7" />
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.7" />
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.8" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.8" />
     <PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />   
-    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.4" />
+    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.5" />
   </ItemGroup>
 
   <ItemGroup>

+ 5 - 3
Admin.Core/Admin.Core.xml

@@ -882,11 +882,13 @@
             <param name="id"></param>
             <returns></returns>
         </member>
-        <member name="M:Admin.Core.Controllers.Personnel.OrganizationController.GetPage(Admin.Core.Common.Input.PageInput{Admin.Core.Model.Personnel.OrganizationEntity})">
+        <member name="M:Admin.Core.Controllers.Personnel.OrganizationController.GetList(System.String)">
             <summary>
-            查询分页组织架构
+            查询组织架构列表
             </summary>
-            <param name="model"></param>
+            <param name="key"></param>
+            <param name="start"></param>
+            <param name="end"></param>
             <returns></returns>
         </member>
         <member name="M:Admin.Core.Controllers.Personnel.OrganizationController.Add(Admin.Core.Service.Personnel.Organization.Input.OrganizationAddInput)">

+ 1 - 1
Admin.Core/Controllers/Admin/PermissionController.cs

@@ -29,7 +29,7 @@ namespace Admin.Core.Controllers.Admin
         [HttpGet]
         public async Task<IResponseOutput> GetList(string key, DateTime? start, DateTime? end)
         {
-            return await _permissionService.ListAsync(key, start, end);
+            return await _permissionService.GetListAsync(key, start, end);
         }
 
         /// <summary>

+ 4 - 4
Admin.Core/Controllers/Personnel/OrganizationController.cs

@@ -32,14 +32,14 @@ namespace Admin.Core.Controllers.Personnel
         }
 
         /// <summary>
-        /// 查询分页组织架构
+        /// 查询组织架构列表
         /// </summary>
-        /// <param name="model"></param>
+        /// <param name="key"></param>
         /// <returns></returns>
         [HttpPost]
-        public async Task<IResponseOutput> GetPage(PageInput<OrganizationEntity> model)
+        public async Task<IResponseOutput> GetList(string key)
         {
-            return await _organizationService.PageAsync(model);
+            return await _organizationService.GetListAsync(key);
         }
 
         /// <summary>