岗位管理:增删改查功能
This commit is contained in:
@@ -168,6 +168,14 @@
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DeptController.PageList(Yi.Framework.Model.Models.DeptEntity,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
动态条件分页查询
|
||||
</summary>
|
||||
<param name="dept"></param>
|
||||
<param name="page"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryController.PageList(Yi.Framework.Model.Models.DictionaryEntity,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
动态条件分页查询
|
||||
@@ -270,6 +278,14 @@
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.PostController.PageList(Yi.Framework.Model.Models.PostEntity,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
动态条件分页查询
|
||||
</summary>
|
||||
<param name="post"></param>
|
||||
<param name="page"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.Framework.ApiMicroservice.Controllers.RoleController">
|
||||
<summary>
|
||||
角色管理
|
||||
|
||||
@@ -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<DeptEntity>
|
||||
{
|
||||
private IDeptService _iDeptService;
|
||||
public DeptController(ILogger<DeptEntity> logger, IDeptService iDeptService) : base(logger, iDeptService)
|
||||
{
|
||||
_iDeptService = iDeptService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态条件分页查询
|
||||
/// </summary>
|
||||
/// <param name="dept"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] DeptEntity dept, [FromQuery] PageParModel page)
|
||||
{
|
||||
return Result.Success().SetData(await _iDeptService.SelctPageList(dept, page));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override async Task<Result> Add(DeptEntity entity)
|
||||
{
|
||||
return await base.Add(entity);
|
||||
}
|
||||
|
||||
public override async Task<Result> Update(DeptEntity entity)
|
||||
{
|
||||
return await base.Update(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<PostEntity>
|
||||
{
|
||||
private IPostService _iPostService;
|
||||
public PostController(ILogger<PostEntity> logger, IPostService iPostService) : base(logger, iPostService)
|
||||
{
|
||||
_iPostService = iPostService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态条件分页查询
|
||||
/// </summary>
|
||||
/// <param name="post"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] PostEntity post, [FromQuery] PageParModel page)
|
||||
{
|
||||
return Result.Success().SetData(await _iPostService.SelctPageList(post, page));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override async Task<Result> Add(PostEntity entity)
|
||||
{
|
||||
return await base.Add(entity);
|
||||
}
|
||||
|
||||
public override async Task<Result> Update(PostEntity entity)
|
||||
{
|
||||
return await base.Update(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
19
Yi.Framework.Net6/Yi.Framework.Interface/IDeptService.cs
Normal file
19
Yi.Framework.Net6/Yi.Framework.Interface/IDeptService.cs
Normal file
@@ -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<DeptEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 动态条件分页查询
|
||||
/// </summary>
|
||||
/// <param name="dept"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageModel<List<DeptEntity>>> SelctPageList(DeptEntity dept, PageParModel page);
|
||||
}
|
||||
}
|
||||
19
Yi.Framework.Net6/Yi.Framework.Interface/IPostService.cs
Normal file
19
Yi.Framework.Net6/Yi.Framework.Interface/IPostService.cs
Normal file
@@ -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<PostEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 动态条件分页查询
|
||||
/// </summary>
|
||||
/// <param name="post"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageModel<List<PostEntity>>> SelctPageList(PostEntity post, PageParModel page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public partial interface IDeptService:IBaseService<DeptEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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<DictionaryInfoEntity>
|
||||
{
|
||||
public partial interface IDictionaryInfoService:IBaseService<DictionaryInfoEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public partial interface IPostService:IBaseService<PostEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public partial interface IRoleDeptService:IBaseService<RoleDeptEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public partial interface IUserPostService:IBaseService<UserPostEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 部门表
|
||||
///</summary>
|
||||
[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; }
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="DeptName" )]
|
||||
public string DeptName { get; set; }
|
||||
/// <summary>
|
||||
/// 部门编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="DeptCode" )]
|
||||
public string DeptCode { get; set; }
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Leader" )]
|
||||
public string Leader { get; set; }
|
||||
/// <summary>
|
||||
/// 父级id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ParentId" )]
|
||||
public long? ParentId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateUser" )]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateTime" )]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyTime" )]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="IsDeleted" )]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="OrderNum" )]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
/// <summary>
|
||||
/// 字典名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName= "DictName")]
|
||||
[SugarColumn(ColumnName="DictName" )]
|
||||
public string DictName { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public DictionaryInfoEntity()
|
||||
{
|
||||
this.IsDeleted = false;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
|
||||
@@ -5,15 +5,10 @@ using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志表
|
||||
///</summary>
|
||||
|
||||
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
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateUser" )]
|
||||
public long? CreateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 岗位表
|
||||
///</summary>
|
||||
[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; }
|
||||
/// <summary>
|
||||
/// 岗位编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="PostCode" )]
|
||||
public string PostCode { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="PostName" )]
|
||||
public string PostName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateUser" )]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateTime" )]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyTime" )]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="IsDeleted" )]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="OrderNum" )]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色部门关系表
|
||||
///</summary>
|
||||
[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; }
|
||||
/// <summary>
|
||||
/// 角色id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="RoleId" )]
|
||||
public long? RoleId { get; set; }
|
||||
/// <summary>
|
||||
/// 部门id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Dept" )]
|
||||
public long? Dept { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateUser" )]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateTime" )]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyTime" )]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="IsDeleted" )]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="OrderNum" )]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
/// <summary>
|
||||
///
|
||||
/// 角色编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="RoleCode" )]
|
||||
public string RoleCode { get; set; }
|
||||
@@ -69,5 +68,10 @@ namespace Yi.Framework.Model.Models
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 角色数据范围
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="DataScope" )]
|
||||
public int? DataScope { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public RoleMenuEntity()
|
||||
{
|
||||
this.IsDeleted = false;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public TenantEntity()
|
||||
{
|
||||
this.IsDeleted = false;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
|
||||
@@ -118,5 +118,10 @@ namespace Yi.Framework.Model.Models
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 部门id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="DeptId" )]
|
||||
public long? DeptId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户岗位表
|
||||
///</summary>
|
||||
[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; }
|
||||
/// <summary>
|
||||
/// 用户id s
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="UserId" )]
|
||||
public long? UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Post" )]
|
||||
public long? Post { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateUser" )]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateTime" )]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyTime" )]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="IsDeleted" )]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="OrderNum" )]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Remark" )]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyTime" )]
|
||||
@@ -54,10 +58,5 @@ namespace Yi.Framework.Model.Models
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
26
Yi.Framework.Net6/Yi.Framework.Service/DeptService.cs
Normal file
26
Yi.Framework.Net6/Yi.Framework.Service/DeptService.cs
Normal file
@@ -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<DeptEntity>, IDeptService
|
||||
{
|
||||
public async Task<PageModel<List<DeptEntity>>> SelctPageList(DeptEntity dept, PageParModel page)
|
||||
{
|
||||
RefAsync<int> 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<List<DeptEntity>>(data, total);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Yi.Framework.Net6/Yi.Framework.Service/PostService.cs
Normal file
28
Yi.Framework.Net6/Yi.Framework.Service/PostService.cs
Normal file
@@ -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<PostEntity>, IPostService
|
||||
{
|
||||
public async Task<PageModel<List<PostEntity>>> SelctPageList(PostEntity post, PageParModel page)
|
||||
{
|
||||
RefAsync<int> 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<List<PostEntity>>(data, total);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<DeptEntity>, IDeptService
|
||||
{
|
||||
public DeptService(IRepository<DeptEntity> repository) : base(repository)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<PostEntity>, IPostService
|
||||
{
|
||||
public PostService(IRepository<PostEntity> repository) : base(repository)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<RoleDeptEntity>, IRoleDeptService
|
||||
{
|
||||
public RoleDeptService(IRepository<RoleDeptEntity> repository) : base(repository)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<UserPostEntity>, IUserPostService
|
||||
{
|
||||
public UserPostService(IRepository<UserPostEntity> repository) : base(repository)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user