fix 修复已知问题

This commit is contained in:
2024-12-13 16:31:04 +08:00
parent 02a2971256
commit a33f86969b
17 changed files with 162 additions and 225 deletions

View File

@@ -2,6 +2,8 @@
using Dlhis.Basic.Appointment.Response;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Services;
using Dlhis.Dh.Api;
using Dlhis.Dh.Api.Requests;
using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Device.Entities;
using Dlhis.Entity.Device.Enums;
@@ -24,16 +26,22 @@ public class AppointmentService : IAppointmentService
private readonly IDbContext _dbContext;
private readonly IDataProtectionProvider _dataProtectionProvider;
private readonly ICurrentUser _currentUser;
private readonly IDhApi _dhApi;
private readonly ILogger<AppointmentService> _logger;
private readonly IGainfoFaceService _gainfoFaceService;
public AppointmentService(IDbContext dbContext,
IDataProtectionProvider dataProtectionProvider,
ICurrentUser currentUser,
IGainfoFaceService gainfoFaceService)
IDhApi dhApi,
IGainfoFaceService gainfoFaceService,
ILogger<AppointmentService> logger)
{
_dbContext = dbContext;
_dataProtectionProvider = dataProtectionProvider;
_currentUser = currentUser;
_dhApi = dhApi;
_logger = logger;
_gainfoFaceService = gainfoFaceService;
}
@@ -44,7 +52,11 @@ public class AppointmentService : IAppointmentService
return await _dbContext.Queryable<VisitorAppointmentEntity>()
.WhereIF(request.SearchDateTimePeriod.HasValue(),
x => x.Date >= request.SearchDateTimePeriod.Start && x.Date <= request.SearchDateTimePeriod.End)
.WhereIF(request.Search.IsPresent(), x => x.Code == request.Search)
.WhereIF(request.Search.IsPresent(), x => x.Code == request.Search ||
SqlFunc.Subqueryable<VisitorAppointmentDetailEntity>()
.Where(p => p.No != x.No)
.Where(p => p.IdNo == request.Search || p.Name == request.Search).Any()
)
.Where(x => x.Factory == factory)
.Select<AppointmentPageResponse>()
.ToPageListAsync(request);
@@ -94,6 +106,19 @@ public class AppointmentService : IAppointmentService
detail.ArrivedTime = DateTime.Now;
await _dbContext.UpdateAsync(detail);
try
{
await _dhApi.SendFaceAsync(new FaceRequest
{
IdNo = detail.IdNo,
Face = request.Base64Image
});
}
catch (Exception e)
{
_logger.LogError(e, "上传face数据到大华失败:{msg}", e.Message);
}
}
public async Task GenerateTaskAndUpdateFaceAsync(long detailId, string base64, DeviceTaskEnumType deviceTaskType)