feat 获取人脸登记详情
This commit is contained in:
@@ -46,4 +46,14 @@ public class SummariesController : ControllerBase
|
||||
{
|
||||
return await _summaryService.GetDoorDataAsync();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("faceRecordDetail")]
|
||||
public async Task<object> GetCurrentFactoryFaceDetailAsync()
|
||||
{
|
||||
return await _summaryService.GetCurrentFactoryFaceDetailAsync();
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,6 @@ public interface ISummaryService : IScopeDependency
|
||||
Task<DoorHomeDataResponse> GetDoorHomeDataAsync();
|
||||
|
||||
Task<DoorDataResponse> GetDoorDataAsync();
|
||||
}
|
||||
|
||||
Task<object> GetCurrentFactoryFaceDetailAsync();
|
||||
}
|
||||
@@ -13,6 +13,7 @@ namespace Dlhis.Basic.Summary.Services.Implements;
|
||||
public class SummaryService : ISummaryService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
private readonly IDbContext _faceDbContext;
|
||||
private readonly IGainfoStore _gainfoStore;
|
||||
private readonly ICurrentUser _currentUser;
|
||||
|
||||
@@ -21,6 +22,8 @@ public class SummaryService : ISummaryService
|
||||
_dbContext = dbContext;
|
||||
_gainfoStore = gainfoStore;
|
||||
_currentUser = currentUser;
|
||||
|
||||
_faceDbContext = dbContext.ChangeDb("face");
|
||||
}
|
||||
|
||||
public async Task<AttendanceSummaryResponse> GetAttendanceSummaryAsync()
|
||||
@@ -168,6 +171,20 @@ public class SummaryService : ISummaryService
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<object> GetCurrentFactoryFaceDetailAsync()
|
||||
{
|
||||
var currentTenantId = _currentUser.GetStringTenantId();
|
||||
var userCodes = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Factory == currentTenantId).Select(x => x.Code).ToListAsync();
|
||||
var total = userCodes.Count;
|
||||
var exists = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => userCodes.Contains(x.UserCode)).CountAsync();
|
||||
|
||||
return new
|
||||
{
|
||||
total, exists
|
||||
};
|
||||
}
|
||||
|
||||
private static List<TrendDto> FixTrend(IEnumerable<TrendDto> dtos, DateTime start, DateTime end)
|
||||
{
|
||||
var result = dtos.ToList();
|
||||
|
||||
Reference in New Issue
Block a user