diff --git a/WebFirst/database/sqlite.db b/WebFirst/database/sqlite.db
index 707b9b1d..33c5eb78 100644
Binary files a/WebFirst/database/sqlite.db and b/WebFirst/database/sqlite.db differ
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml
index bee8e277..de78d0ff 100644
--- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml
@@ -168,6 +168,14 @@
+
+
+ 动态条件分页查询
+
+
+
+
+
动态条件分页查询
@@ -270,6 +278,14 @@
+
+
+ 动态条件分页查询
+
+
+
+
+
角色管理
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DeptController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DeptController.cs
new file mode 100644
index 00000000..e2c7252d
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DeptController.cs
@@ -0,0 +1,52 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Yi.Framework.Common.Models;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+using Yi.Framework.WebCore;
+using Yi.Framework.WebCore.AttributeExtend;
+using Yi.Framework.WebCore.AuthorizationPolicy;
+
+namespace Yi.Framework.ApiMicroservice.Controllers
+{
+ [ApiController]
+ [Route("api/[controller]/[action]")]
+ public class DeptController : BaseSimpleCrudController
+ {
+ private IDeptService _iDeptService;
+ public DeptController(ILogger logger, IDeptService iDeptService) : base(logger, iDeptService)
+ {
+ _iDeptService = iDeptService;
+ }
+
+ ///
+ /// 动态条件分页查询
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ public async Task PageList([FromQuery] DeptEntity dept, [FromQuery] PageParModel page)
+ {
+ return Result.Success().SetData(await _iDeptService.SelctPageList(dept, page));
+ }
+
+
+
+ public override async Task Add(DeptEntity entity)
+ {
+ return await base.Add(entity);
+ }
+
+ public override async Task Update(DeptEntity entity)
+ {
+ return await base.Update(entity);
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/PostController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/PostController.cs
new file mode 100644
index 00000000..81ae790c
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/PostController.cs
@@ -0,0 +1,52 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Yi.Framework.Common.Models;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+using Yi.Framework.WebCore;
+using Yi.Framework.WebCore.AttributeExtend;
+using Yi.Framework.WebCore.AuthorizationPolicy;
+
+namespace Yi.Framework.ApiMicroservice.Controllers
+{
+ [ApiController]
+ [Route("api/[controller]/[action]")]
+ public class PostController : BaseSimpleCrudController
+ {
+ private IPostService _iPostService;
+ public PostController(ILogger logger, IPostService iPostService) : base(logger, iPostService)
+ {
+ _iPostService = iPostService;
+ }
+
+ ///
+ /// 动态条件分页查询
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ public async Task PageList([FromQuery] PostEntity post, [FromQuery] PageParModel page)
+ {
+ return Result.Success().SetData(await _iPostService.SelctPageList(post, page));
+ }
+
+
+
+ public override async Task Add(PostEntity entity)
+ {
+ return await base.Add(entity);
+ }
+
+ public override async Task Update(PostEntity entity)
+ {
+ return await base.Update(entity);
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db
index 04e42201..dd3876ef 100644
Binary files a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IDeptService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IDeptService.cs
new file mode 100644
index 00000000..8c26ddab
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IDeptService.cs
@@ -0,0 +1,19 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Yi.Framework.Common.Models;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Interface
+{
+ public partial interface IDeptService:IBaseService
+ {
+ ///
+ /// 动态条件分页查询
+ ///
+ ///
+ ///
+ ///
+ Task>> SelctPageList(DeptEntity dept, PageParModel page);
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IPostService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IPostService.cs
new file mode 100644
index 00000000..2402b5ff
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IPostService.cs
@@ -0,0 +1,19 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Yi.Framework.Common.Models;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Interface
+{
+ public partial interface IPostService:IBaseService
+ {
+ ///
+ /// 动态条件分页查询
+ ///
+ ///
+ ///
+ ///
+ Task>> SelctPageList(PostEntity post, PageParModel page);
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDeptService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDeptService.cs
new file mode 100644
index 00000000..cae8ca25
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDeptService.cs
@@ -0,0 +1,9 @@
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Interface
+{
+ public partial interface IDeptService:IBaseService
+ {
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDictionaryInfoService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDictionaryInfoService.cs
index 5cdaf1d3..7bf4b670 100644
--- a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDictionaryInfoService.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IDictionaryInfoService.cs
@@ -1,12 +1,9 @@
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Yi.Framework.Common.Models;
-using Yi.Framework.Model.Models;
+using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
- public partial interface IDictionaryInfoService : IBaseService
- {
+ public partial interface IDictionaryInfoService:IBaseService
+ {
}
}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IPostService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IPostService.cs
new file mode 100644
index 00000000..7a512f14
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IPostService.cs
@@ -0,0 +1,9 @@
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Interface
+{
+ public partial interface IPostService:IBaseService
+ {
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IRoleDeptService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IRoleDeptService.cs
new file mode 100644
index 00000000..4ab659ea
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IRoleDeptService.cs
@@ -0,0 +1,9 @@
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Interface
+{
+ public partial interface IRoleDeptService:IBaseService
+ {
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IUserPostService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IUserPostService.cs
new file mode 100644
index 00000000..9caf7f6e
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IUserPostService.cs
@@ -0,0 +1,9 @@
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Interface
+{
+ public partial interface IUserPostService:IBaseService
+ {
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DeptEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DeptEntity.cs
new file mode 100644
index 00000000..c8628796
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DeptEntity.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json.Serialization;
+using SqlSugar;
+namespace Yi.Framework.Model.Models
+{
+ ///
+ /// 部门表
+ ///
+ [SugarTable("Dept")]
+ public partial class DeptEntity:IBaseModelEntity
+ {
+ public DeptEntity()
+ {
+ this.CreateTime = DateTime.Now;
+ }
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
+ public long Id { get; set; }
+ ///
+ /// 部门名称
+ ///
+ [SugarColumn(ColumnName="DeptName" )]
+ public string DeptName { get; set; }
+ ///
+ /// 部门编码
+ ///
+ [SugarColumn(ColumnName="DeptCode" )]
+ public string DeptCode { get; set; }
+ ///
+ /// 负责人
+ ///
+ [SugarColumn(ColumnName="Leader" )]
+ public string Leader { get; set; }
+ ///
+ /// 父级id
+ ///
+ [SugarColumn(ColumnName="ParentId" )]
+ public long? ParentId { get; set; }
+ ///
+ /// 创建者
+ ///
+ [SugarColumn(ColumnName="CreateUser" )]
+ public long? CreateUser { get; set; }
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName="CreateTime" )]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 修改者
+ ///
+ [SugarColumn(ColumnName="ModifyUser" )]
+ public long? ModifyUser { get; set; }
+ ///
+ /// 修改时间
+ ///
+ [SugarColumn(ColumnName="ModifyTime" )]
+ public DateTime? ModifyTime { get; set; }
+ ///
+ /// 是否删除
+ ///
+ [SugarColumn(ColumnName="IsDeleted" )]
+ public bool? IsDeleted { get; set; }
+ ///
+ /// 租户Id
+ ///
+ [SugarColumn(ColumnName="TenantId" )]
+ public long? TenantId { get; set; }
+ ///
+ /// 排序字段
+ ///
+ [SugarColumn(ColumnName="OrderNum" )]
+ public int? OrderNum { get; set; }
+ ///
+ /// 描述
+ ///
+ [SugarColumn(ColumnName="Remark" )]
+ public string Remark { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryEntity.cs
index e0693c09..c95a26fa 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryEntity.cs
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
{
public DictionaryEntity()
{
- this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
@@ -22,7 +21,7 @@ namespace Yi.Framework.Model.Models
///
/// 字典名称
///
- [SugarColumn(ColumnName= "DictName")]
+ [SugarColumn(ColumnName="DictName" )]
public string DictName { get; set; }
///
/// 字典类型
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryInfoEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryInfoEntity.cs
index 15d17ac2..c789177d 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryInfoEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/DictionaryInfoEntity.cs
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
{
public DictionaryInfoEntity()
{
- this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/LogEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/LogEntity.cs
index 6317608e..b7a085b1 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/LogEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/LogEntity.cs
@@ -5,15 +5,10 @@ using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
- ///
- /// 日志表
- ///
-
public partial class LogEntity:IBaseModelEntity
{
public LogEntity()
{
- this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
@@ -24,7 +19,6 @@ namespace Yi.Framework.Model.Models
///
[SugarColumn(ColumnName="CreateUser" )]
public long? CreateUser { get; set; }
-
///
/// 修改者
///
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/PostEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/PostEntity.cs
new file mode 100644
index 00000000..35e513ca
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/PostEntity.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json.Serialization;
+using SqlSugar;
+namespace Yi.Framework.Model.Models
+{
+ ///
+ /// 岗位表
+ ///
+ [SugarTable("Post")]
+ public partial class PostEntity:IBaseModelEntity
+ {
+ public PostEntity()
+ {
+ this.CreateTime = DateTime.Now;
+ }
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
+ public long Id { get; set; }
+ ///
+ /// 岗位编码
+ ///
+ [SugarColumn(ColumnName="PostCode" )]
+ public string PostCode { get; set; }
+ ///
+ /// 岗位名称
+ ///
+ [SugarColumn(ColumnName="PostName" )]
+ public string PostName { get; set; }
+ ///
+ /// 创建者
+ ///
+ [SugarColumn(ColumnName="CreateUser" )]
+ public long? CreateUser { get; set; }
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName="CreateTime" )]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 修改者
+ ///
+ [SugarColumn(ColumnName="ModifyUser" )]
+ public long? ModifyUser { get; set; }
+ ///
+ /// 修改时间
+ ///
+ [SugarColumn(ColumnName="ModifyTime" )]
+ public DateTime? ModifyTime { get; set; }
+ ///
+ /// 是否删除
+ ///
+ [SugarColumn(ColumnName="IsDeleted" )]
+ public bool? IsDeleted { get; set; }
+ ///
+ /// 租户Id
+ ///
+ [SugarColumn(ColumnName="TenantId" )]
+ public long? TenantId { get; set; }
+ ///
+ /// 排序字段
+ ///
+ [SugarColumn(ColumnName="OrderNum" )]
+ public int? OrderNum { get; set; }
+ ///
+ /// 描述
+ ///
+ [SugarColumn(ColumnName="Remark" )]
+ public string Remark { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleDeptEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleDeptEntity.cs
new file mode 100644
index 00000000..9400a984
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleDeptEntity.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json.Serialization;
+using SqlSugar;
+namespace Yi.Framework.Model.Models
+{
+ ///
+ /// 角色部门关系表
+ ///
+ [SugarTable("RoleDept")]
+ public partial class RoleDeptEntity:IBaseModelEntity
+ {
+ public RoleDeptEntity()
+ {
+ this.CreateTime = DateTime.Now;
+ }
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
+ public long Id { get; set; }
+ ///
+ /// 角色id
+ ///
+ [SugarColumn(ColumnName="RoleId" )]
+ public long? RoleId { get; set; }
+ ///
+ /// 部门id
+ ///
+ [SugarColumn(ColumnName="Dept" )]
+ public long? Dept { get; set; }
+ ///
+ /// 创建者
+ ///
+ [SugarColumn(ColumnName="CreateUser" )]
+ public long? CreateUser { get; set; }
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName="CreateTime" )]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 修改者
+ ///
+ [SugarColumn(ColumnName="ModifyUser" )]
+ public long? ModifyUser { get; set; }
+ ///
+ /// 修改时间
+ ///
+ [SugarColumn(ColumnName="ModifyTime" )]
+ public DateTime? ModifyTime { get; set; }
+ ///
+ /// 是否删除
+ ///
+ [SugarColumn(ColumnName="IsDeleted" )]
+ public bool? IsDeleted { get; set; }
+ ///
+ /// 租户Id
+ ///
+ [SugarColumn(ColumnName="TenantId" )]
+ public long? TenantId { get; set; }
+ ///
+ /// 排序字段
+ ///
+ [SugarColumn(ColumnName="OrderNum" )]
+ public int? OrderNum { get; set; }
+ ///
+ /// 描述
+ ///
+ [SugarColumn(ColumnName="Remark" )]
+ public string Remark { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleEntity.cs
index 02458345..63a36218 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleEntity.cs
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
{
public RoleEntity()
{
- //this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
@@ -55,7 +54,7 @@ namespace Yi.Framework.Model.Models
[SugarColumn(ColumnName="ModifyUser" )]
public long? ModifyUser { get; set; }
///
- ///
+ /// 角色编码
///
[SugarColumn(ColumnName="RoleCode" )]
public string RoleCode { get; set; }
@@ -69,5 +68,10 @@ namespace Yi.Framework.Model.Models
///
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
+ ///
+ /// 角色数据范围
+ ///
+ [SugarColumn(ColumnName="DataScope" )]
+ public int? DataScope { get; set; }
}
}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleMenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleMenuEntity.cs
index 8f8e45a1..e5cd3f1b 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleMenuEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/RoleMenuEntity.cs
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
{
public RoleMenuEntity()
{
- this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/TenantEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/TenantEntity.cs
index 3c473c47..408b15d9 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/TenantEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/TenantEntity.cs
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
{
public TenantEntity()
{
- this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserEntity.cs
index 62c42358..95f35eb0 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserEntity.cs
@@ -118,5 +118,10 @@ namespace Yi.Framework.Model.Models
///
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
+ ///
+ /// 部门id
+ ///
+ [SugarColumn(ColumnName="DeptId" )]
+ public long? DeptId { get; set; }
}
}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserPostEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserPostEntity.cs
new file mode 100644
index 00000000..8f422276
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserPostEntity.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json.Serialization;
+using SqlSugar;
+namespace Yi.Framework.Model.Models
+{
+ ///
+ /// 用户岗位表
+ ///
+ [SugarTable("UserPost")]
+ public partial class UserPostEntity:IBaseModelEntity
+ {
+ public UserPostEntity()
+ {
+ this.CreateTime = DateTime.Now;
+ }
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
+ public long Id { get; set; }
+ ///
+ /// 用户id s
+ ///
+ [SugarColumn(ColumnName="UserId" )]
+ public long? UserId { get; set; }
+ ///
+ /// 岗位id
+ ///
+ [SugarColumn(ColumnName="Post" )]
+ public long? Post { get; set; }
+ ///
+ /// 创建者
+ ///
+ [SugarColumn(ColumnName="CreateUser" )]
+ public long? CreateUser { get; set; }
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName="CreateTime" )]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 修改者
+ ///
+ [SugarColumn(ColumnName="ModifyUser" )]
+ public long? ModifyUser { get; set; }
+ ///
+ /// 修改时间
+ ///
+ [SugarColumn(ColumnName="ModifyTime" )]
+ public DateTime? ModifyTime { get; set; }
+ ///
+ /// 是否删除
+ ///
+ [SugarColumn(ColumnName="IsDeleted" )]
+ public bool? IsDeleted { get; set; }
+ ///
+ /// 租户Id
+ ///
+ [SugarColumn(ColumnName="TenantId" )]
+ public long? TenantId { get; set; }
+ ///
+ /// 排序字段
+ ///
+ [SugarColumn(ColumnName="OrderNum" )]
+ public int? OrderNum { get; set; }
+ ///
+ /// 描述
+ ///
+ [SugarColumn(ColumnName="Remark" )]
+ public string Remark { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserRoleEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserRoleEntity.cs
index 147747ef..d1db9129 100644
--- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserRoleEntity.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/UserRoleEntity.cs
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
{
public UserRoleEntity()
{
- this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
@@ -40,6 +39,11 @@ namespace Yi.Framework.Model.Models
[SugarColumn(ColumnName="CreateTime" )]
public DateTime? CreateTime { get; set; }
///
+ /// 修改者
+ ///
+ [SugarColumn(ColumnName="ModifyUser" )]
+ public long? ModifyUser { get; set; }
+ ///
/// 修改时间
///
[SugarColumn(ColumnName="ModifyTime" )]
@@ -54,10 +58,5 @@ namespace Yi.Framework.Model.Models
///
[SugarColumn(ColumnName="TenantId" )]
public long? TenantId { get; set; }
- ///
- /// 修改者
- ///
- [SugarColumn(ColumnName="ModifyUser" )]
- public long? ModifyUser { get; set; }
}
}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/DeptService.cs b/Yi.Framework.Net6/Yi.Framework.Service/DeptService.cs
new file mode 100644
index 00000000..bc016d60
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/DeptService.cs
@@ -0,0 +1,26 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Yi.Framework.Common.Models;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Service
+{
+ public partial class DeptService : BaseService, IDeptService
+ {
+ public async Task>> SelctPageList(DeptEntity dept, PageParModel page)
+ {
+ RefAsync total = 0;
+ var data = await _repository._DbQueryable
+ .WhereIF(!string.IsNullOrEmpty(dept.DeptName), u => u.DeptName.Contains(dept.DeptName))
+ .WhereIF(dept.IsDeleted.IsNotNull(), u => u.IsDeleted == dept.IsDeleted)
+ .OrderBy(u => u.OrderNum, OrderByType.Desc)
+ .ToPageListAsync(page.PageNum, page.PageSize, total);
+
+ return new PageModel>(data, total);
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/PostService.cs b/Yi.Framework.Net6/Yi.Framework.Service/PostService.cs
new file mode 100644
index 00000000..62d617e6
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/PostService.cs
@@ -0,0 +1,28 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Yi.Framework.Common.Models;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Service
+{
+ public partial class PostService : BaseService, IPostService
+ {
+ public async Task>> SelctPageList(PostEntity post, PageParModel page)
+ {
+ RefAsync total = 0;
+ var data = await _repository._DbQueryable
+ .WhereIF(!string.IsNullOrEmpty(post.PostName), u => u.PostName.Contains(post.PostName))
+ .WhereIF(!string.IsNullOrEmpty(post.PostCode), u => u.PostCode.Contains(post.PostCode))
+ .WhereIF(post.IsDeleted.IsNotNull(), u => u.IsDeleted == post.IsDeleted)
+
+ .OrderBy(u => u.OrderNum, OrderByType.Desc)
+ .ToPageListAsync(page.PageNum, page.PageSize, total);
+
+ return new PageModel>(data, total);
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/DeptService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/DeptService.cs
new file mode 100644
index 00000000..c799e682
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/DeptService.cs
@@ -0,0 +1,14 @@
+using SqlSugar;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Service
+{
+ public partial class DeptService : BaseService, IDeptService
+ {
+ public DeptService(IRepository repository) : base(repository)
+ {
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/PostService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/PostService.cs
new file mode 100644
index 00000000..e534e610
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/PostService.cs
@@ -0,0 +1,14 @@
+using SqlSugar;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Service
+{
+ public partial class PostService : BaseService, IPostService
+ {
+ public PostService(IRepository repository) : base(repository)
+ {
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/RoleDeptService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/RoleDeptService.cs
new file mode 100644
index 00000000..08f62036
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/RoleDeptService.cs
@@ -0,0 +1,14 @@
+using SqlSugar;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Service
+{
+ public partial class RoleDeptService : BaseService, IRoleDeptService
+ {
+ public RoleDeptService(IRepository repository) : base(repository)
+ {
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/UserPostService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/UserPostService.cs
new file mode 100644
index 00000000..124cfdab
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/UserPostService.cs
@@ -0,0 +1,14 @@
+using SqlSugar;
+using Yi.Framework.Interface;
+using Yi.Framework.Model.Models;
+using Yi.Framework.Repository;
+
+namespace Yi.Framework.Service
+{
+ public partial class UserPostService : BaseService, IUserPostService
+ {
+ public UserPostService(IRepository repository) : base(repository)
+ {
+ }
+ }
+}
diff --git a/Yi.Vue3.X.RuoYi/src/api/system/dept.js b/Yi.Vue3.X.RuoYi/src/api/system/dept.js
index fc943cd4..285a5631 100644
--- a/Yi.Vue3.X.RuoYi/src/api/system/dept.js
+++ b/Yi.Vue3.X.RuoYi/src/api/system/dept.js
@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询部门列表
export function listDept(query) {
return request({
- url: '/system/dept/list',
+ url: '/dept/pageList',
method: 'get',
params: query
})
@@ -20,7 +20,7 @@ export function listDeptExcludeChild(deptId) {
// 查询部门详细
export function getDept(deptId) {
return request({
- url: '/system/dept/' + deptId,
+ url: '/dept/getById/' + deptId,
method: 'get'
})
}
@@ -28,7 +28,7 @@ export function getDept(deptId) {
// 新增部门
export function addDept(data) {
return request({
- url: '/system/dept',
+ url: '/dept/add',
method: 'post',
data: data
})
@@ -37,7 +37,7 @@ export function addDept(data) {
// 修改部门
export function updateDept(data) {
return request({
- url: '/system/dept',
+ url: '/dept/update',
method: 'put',
data: data
})
@@ -45,8 +45,13 @@ export function updateDept(data) {
// 删除部门
export function delDept(deptId) {
+ if("string"==typeof(deptId))
+ {
+ deptId=[deptId];
+ }
return request({
- url: '/system/dept/' + deptId,
- method: 'delete'
+ url: '/dept/delList',
+ method: 'delete',
+ data:postId
})
}
\ No newline at end of file
diff --git a/Yi.Vue3.X.RuoYi/src/api/system/post.js b/Yi.Vue3.X.RuoYi/src/api/system/post.js
index 1a8e9ca0..0a0aaf35 100644
--- a/Yi.Vue3.X.RuoYi/src/api/system/post.js
+++ b/Yi.Vue3.X.RuoYi/src/api/system/post.js
@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询岗位列表
export function listPost(query) {
return request({
- url: '/system/post/list',
+ url: '/post/pageList',
method: 'get',
params: query
})
@@ -12,7 +12,7 @@ export function listPost(query) {
// 查询岗位详细
export function getPost(postId) {
return request({
- url: '/system/post/' + postId,
+ url: '/post/getById/' + postId,
method: 'get'
})
}
@@ -20,7 +20,7 @@ export function getPost(postId) {
// 新增岗位
export function addPost(data) {
return request({
- url: '/system/post',
+ url: '/post/add',
method: 'post',
data: data
})
@@ -29,7 +29,7 @@ export function addPost(data) {
// 修改岗位
export function updatePost(data) {
return request({
- url: '/system/post',
+ url: '/post/update',
method: 'put',
data: data
})
@@ -37,8 +37,13 @@ export function updatePost(data) {
// 删除岗位
export function delPost(postId) {
+ if("string"==typeof(postId))
+ {
+ postId=[postId];
+ }
return request({
- url: '/system/post/' + postId,
- method: 'delete'
+ url: '/post/delList',
+ method: 'delete',
+ data:postId
})
}
diff --git a/Yi.Vue3.X.RuoYi/src/views/system/post/index.vue b/Yi.Vue3.X.RuoYi/src/views/system/post/index.vue
index 5edee07b..752670f4 100644
--- a/Yi.Vue3.X.RuoYi/src/views/system/post/index.vue
+++ b/Yi.Vue3.X.RuoYi/src/views/system/post/index.vue
@@ -17,8 +17,8 @@
@keyup.enter="handleQuery"
/>
-
-
+
+
-
+
-
-
+
+
-
+
@@ -126,11 +126,11 @@
-
-
+
+
-
-
+
+
{
- postList.value = response.rows;
- total.value = response.total;
+ postList.value = response.data.data;
+ total.value = response.data.total;
loading.value = false;
});
}
@@ -203,11 +203,11 @@ function cancel() {
/** 表单重置 */
function reset() {
form.value = {
- postId: undefined,
+ id: undefined,
postCode: undefined,
postName: undefined,
- postSort: 0,
- status: "0",
+ orderNum: 0,
+ isDeleted: false,
remark: undefined
};
proxy.resetForm("postRef");
@@ -224,7 +224,7 @@ function resetQuery() {
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
- ids.value = selection.map(item => item.postId);
+ ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
@@ -237,7 +237,7 @@ function handleAdd() {
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
- const postId = row.postId || ids.value;
+ const postId = row.id || ids.value;
getPost(postId).then(response => {
form.value = response.data;
open.value = true;
@@ -248,7 +248,7 @@ function handleUpdate(row) {
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
if (valid) {
- if (form.value.postId != undefined) {
+ if (form.value.id != undefined) {
updatePost(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
@@ -266,7 +266,7 @@ function submitForm() {
}
/** 删除按钮操作 */
function handleDelete(row) {
- const postIds = row.postId || ids.value;
+ const postIds = row.id || ids.value;
proxy.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() {
return delPost(postIds);
}).then(() => {