Преглед изворни кода

更新数据包,修复非租户模式下导出数据包异常的问题。
新增数据字典和数据字典类型批量删除接口。

zhontai пре 3 година
родитељ
комит
05b82f674a

+ 45 - 0
Admin.Core.Repository/Admin/Role/Output/RoleDataOutput.cs

@@ -0,0 +1,45 @@
+using System.Collections.Generic;
+
+namespace Admin.Core.Repository.Personnel.Output
+{
+    /// <summary>
+    /// 角色数据导出
+    /// </summary>
+    public class RoleDataOutput
+    {
+        /// <summary>
+        /// 租户Id
+        /// </summary>
+        public long? TenantId { get; set; }
+
+        /// <summary>
+        /// 用户Id
+        /// </summary>
+        public long Id { get; set; }
+
+        /// <summary>
+        /// 名称
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 编码
+        /// </summary>
+        public string Code { get; set; }
+
+        /// <summary>
+        /// 说明
+        /// </summary>
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 启用
+        /// </summary>
+		public bool Enabled { get; set; }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+		public int Sort { get; set; }
+    }
+}

+ 50 - 0
Admin.Core.Repository/Admin/User/Output/UserDataOutput.cs

@@ -0,0 +1,50 @@
+using System.Collections.Generic;
+
+namespace Admin.Core.Repository.Personnel.Output
+{
+    /// <summary>
+    /// 用户数据导出
+    /// </summary>
+    public class UserDataOutput
+    {
+        /// <summary>
+        /// 租户Id
+        /// </summary>
+        public long? TenantId { get; set; }
+
+        /// <summary>
+        /// 用户Id
+        /// </summary>
+        public long Id { get; set; }
+
+        /// <summary>
+        /// 账号
+        /// </summary>
+        public string UserName { get; set; }
+
+        /// <summary>
+        /// 密码
+        /// </summary>
+        public string Password { get; set; }
+
+        /// <summary>
+        /// 昵称
+        /// </summary>
+        public string NickName { get; set; }
+
+        /// <summary>
+        /// 头像
+        /// </summary>
+        public string Avatar { get; set; }
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        public int Status { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+}

+ 2 - 20
Admin.Core.Repository/Base/DbHelper.cs

@@ -531,31 +531,13 @@ namespace Admin.Core.Repository
 
                 #region 用户
 
-                var users = await db.Queryable<UserEntity>().ToListAsync(a => new
-                {
-                    a.TenantId,
-                    a.Id,
-                    a.UserName,
-                    a.Password,
-                    a.NickName,
-                    a.Avatar,
-                    a.Status,
-                    a.Remark
-                });
+                var users = await db.Queryable<UserEntity>().ToListAsync<UserDataOutput>();
 
                 #endregion
 
                 #region 角色
 
-                var roles = await db.Queryable<RoleEntity>().ToListAsync(a => new
-                {
-                    a.TenantId,
-                    a.Id,
-                    a.Name,
-                    a.Code,
-                    a.Sort,
-                    a.Description
-                });
+                var roles = await db.Queryable<RoleEntity>().ToListAsync<RoleDataOutput>();
 
                 #endregion
 

+ 7 - 0
Admin.Core.Service/Admin/Dictionary/DictionaryService.cs

@@ -85,5 +85,12 @@ namespace Admin.Core.Service.Admin.Dictionary
 
             return ResponseOutput.Result(result);
         }
+
+        public async Task<IResponseOutput> BatchSoftDeleteAsync(long[] ids)
+        {
+            var result = await _dictionaryRepository.SoftDeleteAsync(ids);
+
+            return ResponseOutput.Result(result);
+        }
     }
 }

+ 2 - 0
Admin.Core.Service/Admin/Dictionary/IDictionaryService.cs

@@ -19,5 +19,7 @@ namespace Admin.Core.Service.Admin.Dictionary
         Task<IResponseOutput> DeleteAsync(long id);
 
         Task<IResponseOutput> SoftDeleteAsync(long id);
+
+        Task<IResponseOutput> BatchSoftDeleteAsync(long[] ids);
     }
 }

+ 7 - 0
Admin.Core.Service/Admin/DictionaryType/DictionaryTypeService.cs

@@ -85,5 +85,12 @@ namespace Admin.Core.Service.Admin.DictionaryType
 
             return ResponseOutput.Result(result);
         }
+
+        public async Task<IResponseOutput> BatchSoftDeleteAsync(long[] ids)
+        {
+            var result = await _DictionaryTypeRepository.SoftDeleteAsync(ids);
+
+            return ResponseOutput.Result(result);
+        }
     }
 }

+ 2 - 0
Admin.Core.Service/Admin/DictionaryType/IDictionaryTypeService.cs

@@ -19,5 +19,7 @@ namespace Admin.Core.Service.Admin.DictionaryType
         Task<IResponseOutput> DeleteAsync(long id);
 
         Task<IResponseOutput> SoftDeleteAsync(long id);
+
+        Task<IResponseOutput> BatchSoftDeleteAsync(long[] ids);
     }
 }

+ 14 - 0
Admin.Core/Admin.Core.xml

@@ -246,6 +246,13 @@
             <param name="id"></param>
             <returns></returns>
         </member>
+        <member name="M:Admin.Core.Controllers.Admin.DictionaryController.BatchSoftDelete(System.Int64[])">
+            <summary>
+            批量删除数据字典
+            </summary>
+            <param name="ids"></param>
+            <returns></returns>
+        </member>
         <member name="T:Admin.Core.Controllers.Admin.DictionaryTypeController">
             <summary>
             数据字典类型
@@ -286,6 +293,13 @@
             <param name="id"></param>
             <returns></returns>
         </member>
+        <member name="M:Admin.Core.Controllers.Admin.DictionaryTypeController.BatchSoftDelete(System.Int64[])">
+            <summary>
+            批量删除数据字典类型
+            </summary>
+            <param name="ids"></param>
+            <returns></returns>
+        </member>
         <member name="T:Admin.Core.Controllers.Admin.DocumentController">
             <summary>
             文档管理

+ 11 - 0
Admin.Core/Controllers/Admin/DictionaryController.cs

@@ -74,5 +74,16 @@ namespace Admin.Core.Controllers.Admin
         {
             return await _dictionaryService.SoftDeleteAsync(id);
         }
+
+        /// <summary>
+        /// 批量删除数据字典
+        /// </summary>
+        /// <param name="ids"></param>
+        /// <returns></returns>
+        [HttpPut]
+        public async Task<IResponseOutput> BatchSoftDelete(long[] ids)
+        {
+            return await _dictionaryService.BatchSoftDeleteAsync(ids);
+        }
     }
 }

+ 11 - 0
Admin.Core/Controllers/Admin/DictionaryTypeController.cs

@@ -74,5 +74,16 @@ namespace Admin.Core.Controllers.Admin
         {
             return await _DictionaryTypeService.SoftDeleteAsync(id);
         }
+
+        /// <summary>
+        /// 批量删除数据字典类型
+        /// </summary>
+        /// <param name="ids"></param>
+        /// <returns></returns>
+        [HttpPut]
+        public async Task<IResponseOutput> BatchSoftDelete(long[] ids)
+        {
+            return await _DictionaryTypeService.BatchSoftDeleteAsync(ids);
+        }
     }
 }

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
Admin.Core/Db/Data/data-share.json


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
Admin.Core/Db/Data/data.json


Неке датотеке нису приказане због велике количине промена