fix 用户授权问题,档案调整,
This commit is contained in:
@@ -4,8 +4,18 @@ namespace Dlhis.Basic.BusinessPlace.Response;
|
||||
|
||||
public class BusinessPlaceWithShiftResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 营业点手工号
|
||||
/// </summary>
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
public List<BusinessPlaceShiftResponse> Shifts { get; set; }
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
public List<BusinessPlaceShiftTinyResponse> Shifts { get; set; }
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@ public class BusinessPlaceShiftSaveRequest : IValidatableObject
|
||||
[Required(ErrorMessage = "餐次名称不能为空")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int Sequence { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 时间段
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Dlhis.Basic.BusinessShift.Response;
|
||||
|
||||
public class BusinessPlaceShiftTinyResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营开始时间
|
||||
/// </summary>
|
||||
public TimeOnly Start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营结束时间
|
||||
/// </summary>
|
||||
public TimeOnly End { get; set; }
|
||||
}
|
||||
@@ -76,22 +76,21 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
||||
{
|
||||
return new BusinessPlaceWithShiftResponse()
|
||||
{
|
||||
Shifts = new List<BusinessPlaceShiftResponse>()
|
||||
Shifts = new List<BusinessPlaceShiftTinyResponse>()
|
||||
};
|
||||
}
|
||||
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>().Where(x => x.BusinessPlaceCode == place.Code).ToListAsync();
|
||||
|
||||
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
||||
.Where(x => x.BusinessPlaceCode == place.Code)
|
||||
.OrderBy(x => x.Sequence) //排序
|
||||
.ToListAsync();
|
||||
|
||||
return new BusinessPlaceWithShiftResponse
|
||||
{
|
||||
CustomCode = placeCustomCode,
|
||||
Name = place.Name,
|
||||
Shifts = shifts.Select(shift => new BusinessPlaceShiftResponse
|
||||
Shifts = shifts.Select(shift => new BusinessPlaceShiftTinyResponse
|
||||
{
|
||||
Id = shift.Id,
|
||||
BusinessPlaceCode = place.Code,
|
||||
BusinessPlaceCustomCode = place.CustomCode,
|
||||
BusinessPlace = place.Name,
|
||||
Code = shift.Code,
|
||||
CustomCode = shift.CustomCode,
|
||||
Name = shift.Name,
|
||||
Start = shift.Start,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.MVC;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -28,12 +27,12 @@ public class GainfosController : ControllerBase
|
||||
/// <summary>
|
||||
/// 档案表保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="requests"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("save")]
|
||||
public async Task SaveAsync(GainfoSaveRequest request)
|
||||
public async Task SaveAsync(List<GainfoSaveRequest> requests)
|
||||
{
|
||||
await _gainfoService.SaveAsync(request);
|
||||
await _gainfoService.SaveAsync(requests);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -79,26 +78,5 @@ public class GainfosController : ControllerBase
|
||||
{
|
||||
await _gainfoService.OnboardingAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetAllFields")]
|
||||
public List<string> GetAllFields()
|
||||
{
|
||||
return _gainfoService.GetAllFields();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取固定字段信息字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetAllFieldData")]
|
||||
public List<string> GetAllFieldData(string fieldName)
|
||||
{
|
||||
return _gainfoService.GetAllFieldData(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Request;
|
||||
|
||||
@@ -14,40 +13,37 @@ public class GainfoSaveRequest : IValidatableObject
|
||||
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||
public GainfoStatusEnumType? GainfoStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SAP内部编号
|
||||
/// </summary>
|
||||
public string Ano { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
public string Class { get; set; }
|
||||
public string SapNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Gname { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外文名字
|
||||
/// </summary>
|
||||
public string NameEn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工号
|
||||
/// </summary>
|
||||
public string Ename { get; set; }
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家代码
|
||||
/// </summary>
|
||||
public string Country { get; set; }
|
||||
public string CountryNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型代码
|
||||
/// </summary>
|
||||
public string Idcls { get; set; }
|
||||
public string IdClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
public string IdNO { get; set; }
|
||||
public string IdNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证籍贯区域代码
|
||||
@@ -57,7 +53,7 @@ public class GainfoSaveRequest : IValidatableObject
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public string Sex { get; set; }
|
||||
public GenderEnumType Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生日
|
||||
@@ -72,12 +68,12 @@ public class GainfoSaveRequest : IValidatableObject
|
||||
/// <summary>
|
||||
/// 已婚/未婚
|
||||
/// </summary>
|
||||
public string Postcode { get; set; }
|
||||
public string Marital { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门编码
|
||||
/// </summary>
|
||||
public string Appellation { get; set; }
|
||||
public string DepartmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 民族代码
|
||||
@@ -89,11 +85,6 @@ public class GainfoSaveRequest : IValidatableObject
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
public string Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学历
|
||||
/// </summary>
|
||||
@@ -102,70 +93,27 @@ public class GainfoSaveRequest : IValidatableObject
|
||||
/// <summary>
|
||||
/// 岗位
|
||||
/// </summary>
|
||||
public string Web { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作账号
|
||||
/// </summary>
|
||||
public string Log_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作班次
|
||||
/// </summary>
|
||||
public string Log_shift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
public DateTime Log_date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作IP
|
||||
/// </summary>
|
||||
public string Log_ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在职 F 在职 T离职
|
||||
/// </summary>
|
||||
public string Isowner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime Createdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外文名字
|
||||
/// </summary>
|
||||
public string Gname_en { get; set; }
|
||||
public string Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 卡号
|
||||
/// </summary>
|
||||
public string CarNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人事范围")]
|
||||
public string Werks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人员号
|
||||
/// 在职状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人员号")]
|
||||
public string Pernr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "邮箱")]
|
||||
public string Email { get; set; }
|
||||
public string Employed { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ public class GainfoPageResponse
|
||||
/// <summary>
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
public string GType { get; set; }
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
|
||||
@@ -6,17 +6,14 @@ namespace Dlhis.Basic.Organization.Services;
|
||||
|
||||
public interface IGainfoService : IScopeDependency
|
||||
{
|
||||
Task SaveAsync(GainfoSaveRequest request);
|
||||
|
||||
Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request);
|
||||
|
||||
|
||||
Task SaveAsync(List<GainfoSaveRequest> requests);
|
||||
|
||||
Task UpdateAsync(GainfoSaveRequest request);
|
||||
|
||||
Task DimissionAsync(GainfoDImissionRequest request);
|
||||
|
||||
Task OnboardingAsync(GainfoDImissionRequest request);
|
||||
|
||||
public List<string> GetAllFieldData(string fieldName);
|
||||
|
||||
public List<string> GetAllFields();
|
||||
}
|
||||
|
||||
@@ -11,9 +11,18 @@ public interface IGainfoStore : IScopeDependency
|
||||
{
|
||||
ISugarQueryable<GainfoEntity> Queryable(GainfoStatusEnumType? gainfoStatus);
|
||||
|
||||
Task InsertAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities);
|
||||
|
||||
Task UpdateAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities);
|
||||
|
||||
Task DeleteAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities);
|
||||
Task InsertAsync(List<GainfoEntity> entities, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working);
|
||||
Task InsertAsync(GainfoEntity entity, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working);
|
||||
|
||||
|
||||
|
||||
Task UpdateAsync(List<GainfoEntity> entities, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working);
|
||||
Task UpdateAsync(GainfoEntity entity, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working);
|
||||
|
||||
|
||||
|
||||
Task DeleteAsync(List<GainfoEntity> entities, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working);
|
||||
Task DeleteAsync(GainfoEntity entity, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
|
||||
public class GainfoService : IGainfoService
|
||||
{
|
||||
|
||||
private readonly IGainfoStore _gainfoStore;
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
@@ -28,9 +27,12 @@ public class GainfoService : IGainfoService
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
||||
public async Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
||||
{
|
||||
var page = _gainfoStore.Queryable(request.Status)
|
||||
request.DepartmentNos = await GetRecursionDepartmentNosAsync(request.DepartmentNos);
|
||||
|
||||
var page = await _gainfoStore.Queryable(request.Status)
|
||||
.WhereIF(request.DepartmentNos.Any(), gainfo => request.DepartmentNos.Contains(gainfo.DepartmentNo))
|
||||
.Select<GainfoPageResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
@@ -42,15 +44,19 @@ public class GainfoService : IGainfoService
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public async Task SaveAsync(GainfoSaveRequest request)
|
||||
public async Task SaveAsync(List<GainfoSaveRequest> request)
|
||||
{
|
||||
var gainfos = new List<GainfoEntity>();
|
||||
GainfoEntity aginfoEntity = request.Adapt<GainfoEntity>();
|
||||
//todo check
|
||||
var entities = request.Adapt<List<GainfoEntity>>();
|
||||
entities.ForEach(x =>
|
||||
{
|
||||
if (x.No.IsEmpty())
|
||||
{
|
||||
x.No = "F" + Guid.NewGuid().ToString();
|
||||
}
|
||||
});
|
||||
|
||||
aginfoEntity.No = "F" + Guid.NewGuid().ToString();
|
||||
gainfos.Add(aginfoEntity);
|
||||
|
||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||
await _gainfoStore.InsertAsync(entities);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,13 +71,7 @@ public class GainfoService : IGainfoService
|
||||
gainfo.ThrowIfNull("档案数据不存在,无法更新");
|
||||
|
||||
request.Adapt(gainfo);
|
||||
|
||||
var gainfos = new List<GainfoEntity>()
|
||||
{
|
||||
gainfo
|
||||
};
|
||||
|
||||
await _gainfoStore.UpdateAsync(request.GainfoStatus, gainfos);
|
||||
await _gainfoStore.UpdateAsync(gainfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -79,25 +79,19 @@ public class GainfoService : IGainfoService
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
[Transactional]
|
||||
public async Task DimissionAsync(GainfoDImissionRequest request)
|
||||
{
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||
.Where(x => x.No == request.UserId)
|
||||
.FirstAsync();
|
||||
gainfo.ThrowIfNull($"该档案不存在");
|
||||
|
||||
gainfo.ThrowIfNull("该档案不存在");
|
||||
|
||||
//添加到离职表
|
||||
var gainfos = new List<GainfoEntity>
|
||||
{
|
||||
gainfo
|
||||
};
|
||||
|
||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Leave, gainfos);
|
||||
|
||||
await _gainfoStore.InsertAsync(gainfo, GainfoStatusEnumType.Leave);
|
||||
//删除原数据
|
||||
await _gainfoStore.DeleteAsync(GainfoStatusEnumType.Working, gainfos);
|
||||
await _gainfoStore.DeleteAsync(gainfo, GainfoStatusEnumType.Working);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,43 +105,50 @@ public class GainfoService : IGainfoService
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.External)
|
||||
.Where(x => x.No == request.UserId)
|
||||
.FirstAsync();
|
||||
|
||||
gainfo.ThrowIfNull($"该档案不存在");
|
||||
|
||||
//添加到正式表
|
||||
var gainfos = new List<GainfoEntity>
|
||||
{
|
||||
gainfo
|
||||
};
|
||||
|
||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||
//添加到正式表,不删除原数据,留档处理
|
||||
await _gainfoStore.InsertAsync(gainfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllFields()
|
||||
{
|
||||
var entityType = typeof(Gainfofields);
|
||||
var propertyNames = entityType.GetProperties().Select(p => p.Name).ToList();
|
||||
|
||||
return propertyNames;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取固定字段数据
|
||||
/// </summary>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllFieldData(string fieldName)
|
||||
{
|
||||
var columnData = _dbContext.Queryable<Gainfofields>().Select<string>(fieldName).ToList();
|
||||
|
||||
return columnData;
|
||||
}
|
||||
|
||||
//-------------------------------------------help methods ------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// 递归获取部门No
|
||||
/// </summary>
|
||||
/// <param name="departmentNos"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<List<string>> GetRecursionDepartmentNosAsync(List<string> departmentNos)
|
||||
{
|
||||
if (departmentNos == null || departmentNos.Count == 0)
|
||||
{
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
var departments = await _dbContext.Queryable<DepartmentEntity>().ToListAsync();
|
||||
var currentNos = departments.Where(x => departmentNos.Contains(x.Code)).ToList();
|
||||
|
||||
foreach (var item in currentNos)
|
||||
{
|
||||
RecursionGetNext(item.Code, departments, departmentNos);
|
||||
}
|
||||
|
||||
return departmentNos.Distinct().ToList();
|
||||
|
||||
void RecursionGetNext(string currentCode, List<DepartmentEntity> departments, List<string> result)
|
||||
{
|
||||
var next = departments.Where(x => x.PCode == currentCode).ToList();
|
||||
foreach (var item in next)
|
||||
{
|
||||
result.Add(item.Code);
|
||||
}
|
||||
|
||||
foreach (var item in next)
|
||||
{
|
||||
RecursionGetNext(item.Code, departments, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,21 +34,37 @@ public class GainfoStore : IGainfoStore
|
||||
return _dbContext.Queryable<GainfoEntity>();
|
||||
}
|
||||
|
||||
public async Task InsertAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities)
|
||||
|
||||
public async Task InsertAsync(List<GainfoEntity> entities, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working)
|
||||
{
|
||||
await _dbContext.Client.Insertable(entities).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities)
|
||||
public async Task InsertAsync(GainfoEntity entity, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working)
|
||||
{
|
||||
await _dbContext.Client.Insertable(entity).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateAsync(List<GainfoEntity> entities, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working)
|
||||
{
|
||||
await _dbContext.Client.Updateable(entities).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities)
|
||||
public async Task UpdateAsync(GainfoEntity entity, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working)
|
||||
{
|
||||
await _dbContext.Client.Updateable(entity).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(List<GainfoEntity> entities, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working)
|
||||
{
|
||||
await _dbContext.Client.Deleteable(entities).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(GainfoEntity entity, GainfoStatusEnumType gainfoStatus = GainfoStatusEnumType.Working)
|
||||
{
|
||||
await _dbContext.Client.Deleteable(entity).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
//*************************************************************** help method *********************************************************************************
|
||||
|
||||
@@ -67,4 +83,6 @@ public class GainfoStore : IGainfoStore
|
||||
|
||||
return tableName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -45,5 +45,11 @@ public class CanteenBusinessShiftEntity : SugarBaseEntity, ITenantId
|
||||
[SugarColumn(ColumnDescription = "经营结束时间")]
|
||||
public TimeOnly End { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "序号")]
|
||||
public int Sequence { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class GainfoEntity : SugarBaseEntity
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人员类型")]
|
||||
public string GType { get; set; }
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
@@ -148,3 +148,14 @@ public class GainfoEntity : SugarBaseEntity
|
||||
[SugarColumn(ColumnDescription = "在职状态")]
|
||||
public string Employed { get; set; }
|
||||
}
|
||||
|
||||
//[SugarTable(TableName = "GainfoLeave", TableDescription = "离职人员档案表")]
|
||||
//public class GainfoLeaveEntity : GainfoEntity
|
||||
//{
|
||||
|
||||
//}
|
||||
//[SugarTable(TableName = "GainfoExternal", TableDescription = "外部人员档案表")]
|
||||
//public class GainfoExternalEntity : GainfoEntity
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Dlhis.Entity.Basic.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户档案字段列表
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "Gainfofields", TableDescription = "用户档案字段列表")]
|
||||
public class Gainfofields : SugarBaseEntity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人员类型")]
|
||||
public string Class { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "国家代码")]
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "证件类型")]
|
||||
public string Idcls { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证籍贯区
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "身份证籍贯区")]
|
||||
public string Native { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部门编码")]
|
||||
public string Appellation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 民族代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "民族代码")]
|
||||
public string Nation { get; set; }
|
||||
}
|
||||
}
|
||||
10
Src/Dlhis.Entity/Sys/Entities/IdentityResourceClaims.cs
Normal file
10
Src/Dlhis.Entity/Sys/Entities/IdentityResourceClaims.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Dlhis.Entity.Sys.Entities;
|
||||
|
||||
public class IdentityResourceClaims
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string IdentityResourceId { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
}
|
||||
23
Src/Dlhis.Entity/Sys/Entities/IdentityResources.cs
Normal file
23
Src/Dlhis.Entity/Sys/Entities/IdentityResources.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace Dlhis.Entity.Sys.Entities;
|
||||
|
||||
public class IdentityResources
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public bool Required { get; set; }
|
||||
|
||||
public bool Emphasize { get; set; }
|
||||
|
||||
public bool ShowInDiscoveryDocument { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public DateTime Updated { get; set; }
|
||||
|
||||
public bool NonEditable { get; set; }
|
||||
}
|
||||
16
Src/Dlhis.Entity/Sys/Entities/UserClaims.cs
Normal file
16
Src/Dlhis.Entity/Sys/Entities/UserClaims.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Sys.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// identity-userclaim
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "UserClaims")]
|
||||
public class UserClaims
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public string ClaimType { get; set; }
|
||||
public string ClaimValue { get; set; }
|
||||
}
|
||||
@@ -5,37 +5,79 @@ namespace Dlhis.Entity.Sys.Entities;
|
||||
/// <summary>
|
||||
/// identity-user
|
||||
/// </summary>
|
||||
[SugarTable("Users")]
|
||||
[SugarTable(TableName = "Users")]
|
||||
public class UserEntity
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号大写
|
||||
/// </summary>
|
||||
public string NormalizedUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮件
|
||||
/// </summary>
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮件大写
|
||||
/// </summary>
|
||||
public string NormalizedEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮件确认
|
||||
/// </summary>
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码hash
|
||||
/// </summary>
|
||||
public string PasswordHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 安全时间戳
|
||||
/// </summary>
|
||||
public string SecurityStamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 并发时间戳
|
||||
/// </summary>
|
||||
public string ConcurrencyStamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号确认
|
||||
/// </summary>
|
||||
public string PhoneNumberConfirmed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 双重验证启用
|
||||
/// </summary>
|
||||
public bool TwoFactorEnabled { get; set; }
|
||||
|
||||
public bool LockoutEnd { get; set; }
|
||||
/// <summary>
|
||||
/// 账号锁定结束时间
|
||||
/// </summary>
|
||||
public DateTime? LockoutEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 锁定启用
|
||||
/// </summary>
|
||||
public bool LockoutEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登陆错误次数
|
||||
/// </summary>
|
||||
public int AccessFailedCount { get; set; }
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace Dlhis.User.Identity.Controllers;
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[Authorize(Roles = "admin")]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class UsersController : ControllerBase
|
||||
@@ -27,6 +26,7 @@ public class UsersController : ControllerBase
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize(Roles = "admin")]
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<UserResponse>> GetPageAsync([FromQuery] UserPageRequest request)
|
||||
{
|
||||
@@ -37,6 +37,7 @@ public class UsersController : ControllerBase
|
||||
/// 获取用户列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Authorize(Roles = "admin")]
|
||||
[HttpGet("list")]
|
||||
public async Task<List<UserResponse>> GetUsersAsync()
|
||||
{
|
||||
@@ -49,4 +50,11 @@ public class UsersController : ControllerBase
|
||||
{
|
||||
return await _userService.GetUserByIdAsync(id);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpPost("avatar")]
|
||||
public async Task UploadUserAvatarAsync([FromForm] UserAvatarUploadRequest request)
|
||||
{
|
||||
await _userService.UploadUserAvatarAsync(request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,6 @@ public interface IUserService : IScopeDependency
|
||||
Task<List<UserResponse>> GetUsersAsync();
|
||||
|
||||
Task<UserResponse> GetUserByIdAsync(int id);
|
||||
|
||||
Task UploadUserAvatarAsync(UserAvatarUploadRequest request);
|
||||
}
|
||||
|
||||
@@ -51,4 +51,9 @@ public class UserService : IUserService
|
||||
var user = await _dbContext.Queryable<UserEntity>().Where(x => x.Id == id).Select<UserResponse>().FirstAsync();
|
||||
return user;
|
||||
}
|
||||
|
||||
public async Task UploadUserAvatarAsync(UserAvatarUploadRequest request)
|
||||
{
|
||||
var user = await _dbContext.Queryable<UserEntity>().Where(x => x.Id == request.UserId).Select<UserResponse>().FirstAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user