Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development
This commit is contained in:
@@ -31,4 +31,14 @@ public class WerksController : ControllerBase
|
||||
{
|
||||
return await _werkService.GetListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前组织信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("current")]
|
||||
public async Task<WerkResponse> GetCurrentAsync()
|
||||
{
|
||||
return await _werkService.GetCurrentAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Request
|
||||
namespace Dlhis.Basic.Organization.Request;
|
||||
|
||||
public class GainfoPageRequest : PageDto
|
||||
{
|
||||
public class GainfoPageRequest : PageDto
|
||||
{
|
||||
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||
public GainfoStatusEnumType gainfoStatus { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 档案类型
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||
public GainfoStatusEnumType Status { get; set; } = GainfoStatusEnumType.Working;
|
||||
|
||||
/// <summary>
|
||||
/// 部门号(部门树传入)
|
||||
/// </summary>
|
||||
public List<string> DepartmentNos { get; set; }
|
||||
}
|
||||
|
||||
@@ -2,45 +2,47 @@
|
||||
|
||||
public class GainfoPageResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 档案号
|
||||
/// </summary>
|
||||
public string Guestno { get; set; }
|
||||
public string No { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SAP内部编号
|
||||
/// </summary>
|
||||
public string Ano { get; set; }
|
||||
public string SapNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
public string Class { get; set; }
|
||||
public string GType { 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>
|
||||
/// 身份证籍贯区域代码
|
||||
@@ -50,7 +52,7 @@ public class GainfoPageResponse
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public string Sex { get; set; }
|
||||
public string Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生日
|
||||
@@ -65,12 +67,12 @@ public class GainfoPageResponse
|
||||
/// <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>
|
||||
/// 民族代码
|
||||
@@ -82,11 +84,6 @@ public class GainfoPageResponse
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
public string Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学历
|
||||
/// </summary>
|
||||
@@ -95,7 +92,12 @@ public class GainfoPageResponse
|
||||
/// <summary>
|
||||
/// 岗位
|
||||
/// </summary>
|
||||
public string Web { get; set; }
|
||||
public string Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 卡号
|
||||
/// </summary>
|
||||
public string CarNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
@@ -103,42 +105,12 @@ public class GainfoPageResponse
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作账号
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
public string Log_id { get; set; }
|
||||
public string Werks { 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; }
|
||||
|
||||
/// <summary>
|
||||
/// 卡号
|
||||
/// </summary>
|
||||
public string CarNo { get; set; }
|
||||
public string Employed { get; set; }
|
||||
}
|
||||
|
||||
@@ -5,4 +5,6 @@ namespace Dlhis.Basic.Organization.Services;
|
||||
public interface IWerkService : IScopeDependency
|
||||
{
|
||||
Task<List<WerkResponse>> GetListAsync();
|
||||
|
||||
Task<WerkResponse> GetCurrentAsync();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GainfoService : IGainfoService
|
||||
/// <returns></returns>
|
||||
public Task<Pagination<GainfoPageResponse>> GetPageAsync(GainfoPageRequest request)
|
||||
{
|
||||
var page = _gainfoStore.Queryable(request.gainfoStatus)
|
||||
var page = _gainfoStore.Queryable(request.Status)
|
||||
.Select<GainfoPageResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class GainfoService : IGainfoService
|
||||
var gainfos = new List<GainfoEntity>();
|
||||
GainfoEntity aginfoEntity = request.Adapt<GainfoEntity>();
|
||||
|
||||
aginfoEntity.Guestno = "F" + Guid.NewGuid().ToString();
|
||||
aginfoEntity.No = "F" + Guid.NewGuid().ToString();
|
||||
gainfos.Add(aginfoEntity);
|
||||
|
||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||
@@ -84,7 +84,7 @@ public class GainfoService : IGainfoService
|
||||
public async Task DimissionAsync(GainfoDImissionRequest request)
|
||||
{
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||
.Where(x => x.Guestno == request.UserId)
|
||||
.Where(x => x.No == request.UserId)
|
||||
.FirstAsync();
|
||||
gainfo.ThrowIfNull($"该档案不存在");
|
||||
|
||||
@@ -109,7 +109,7 @@ public class GainfoService : IGainfoService
|
||||
public async Task OnboardingAsync(GainfoDImissionRequest request)
|
||||
{
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.External)
|
||||
.Where(x => x.Guestno == request.UserId)
|
||||
.Where(x => x.No == request.UserId)
|
||||
.FirstAsync();
|
||||
gainfo.ThrowIfNull($"该档案不存在");
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GainfoStore : IGainfoStore
|
||||
if (gainfoStatus.HasValue && gainfoStatus != GainfoStatusEnumType.Working)
|
||||
{
|
||||
var tableName = typeof(GainfoEntity).GetCustomAttribute<SugarTable>().TableName;
|
||||
return _dbContext.Queryable<GainfoEntity>().AS(tableName + "_" + gainfoStatus);
|
||||
return _dbContext.Queryable<GainfoEntity>().AS(tableName + gainfoStatus);
|
||||
}
|
||||
|
||||
return _dbContext.Queryable<GainfoEntity>();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
@@ -7,10 +8,12 @@ namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
public class WerkService : IWerkService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
private readonly ICurrentUser _currentUser;
|
||||
|
||||
public WerkService(IDbContext dbContext)
|
||||
public WerkService(IDbContext dbContext, ICurrentUser currentUser)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_currentUser = currentUser;
|
||||
}
|
||||
|
||||
public async Task<List<WerkResponse>> GetListAsync()
|
||||
@@ -19,4 +22,13 @@ public class WerkService : IWerkService
|
||||
.Select<WerkResponse>()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<WerkResponse> GetCurrentAsync()
|
||||
{
|
||||
var tenant = _currentUser.GetStringTenantId();
|
||||
return await _dbContext.Queryable<WerkEntity>()
|
||||
.Where(x => x.Code == tenant)
|
||||
.Select<WerkResponse>()
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user