Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development

This commit is contained in:
cheche
2024-01-08 11:39:21 +08:00
54 changed files with 621 additions and 460 deletions

View File

@@ -5,4 +5,6 @@ namespace Dlhis.Basic.Organization.Services;
public interface IWerkService : IScopeDependency
{
Task<List<WerkResponse>> GetListAsync();
Task<WerkResponse> GetCurrentAsync();
}

View File

@@ -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($"该档案不存在");

View File

@@ -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>();

View File

@@ -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();
}
}