From 3f1f6d152555e7ebd57b23546e99da9cfa90bc2d Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 14 Nov 2025 15:06:43 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=89=8B=E5=8A=A8=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E7=85=A7=E7=89=87=E6=94=AF=E6=8C=81=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=A4=A7=E5=8D=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/AppointmentService.cs | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs index c8060cc3..ff03760b 100644 --- a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs @@ -127,24 +127,6 @@ public class AppointmentService : IAppointmentService await GenerateDeviceTasksAsync(detail, false, DeviceTaskEnumType.Add, "访客门岗认证生成"); } - private async Task UploadFaceToDhAsync(string idNo, string base64Image) - { - try - { - var r = await _dhApi.SendFaceAsync(new FaceRequest - { - IdNo = idNo, - Face = base64Image - }); - - _logger.LogInformation("上传face数据到大华成功: {idNo} . {json}", idNo, r.ToJson()); - } - catch (Exception e) - { - _logger.LogError(e, "上传face数据到大华失败:{msg}", e.Message); - } - } - public async Task GetTodayByIdNoAsync(string idNo, string factory) { var protector = _dataProtectionProvider.CreateProtector("gainfo:external:idno"); @@ -185,7 +167,6 @@ public class AppointmentService : IAppointmentService .FirstAsync(); } - public async Task FocusLeaveAsync(long id, string reason) { // 根据访客预约详情ID获取记录,若不存在则抛出异常 @@ -327,6 +308,8 @@ public class AppointmentService : IAppointmentService var detail = await _dbContext.Queryable().Where(x => x.Id == detailId).SingleAsync(); detail.ThrowIfNull("数据不存在"); + await UploadFaceToDhAsync(detail.IdNo, base64); + await _gainfoFaceService.UploadExternalFaceAsync(new GainfoUploadFaceRequest { UserNo = detail.IdNo, @@ -470,4 +453,23 @@ public class AppointmentService : IAppointmentService } } } + + + private async Task UploadFaceToDhAsync(string idNo, string base64Image) + { + try + { + var r = await _dhApi.SendFaceAsync(new FaceRequest + { + IdNo = idNo, + Face = base64Image + }); + + _logger.LogInformation("上传face数据到大华成功: {idNo} . {json}", idNo, r.ToJson()); + } + catch (Exception e) + { + _logger.LogError(e, "上传face数据到大华失败:{msg}", e.Message); + } + } } \ No newline at end of file