diff --git a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs index 12b9e3ae..16b66021 100644 --- a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs @@ -203,12 +203,19 @@ public class AppointmentService : IAppointmentService await GenerateDeviceTasksAsync(detail, true, DeviceTaskEnumType.Delete, $"强制离场:{reason}"); await _dbContext.UpdateAsync(detail); - var appointment = await _dbContext.Queryable().Where(x => x.No == detail.No).SingleAsync(); - await _jinkoApiService.SendWorkMessageAsync(new DingTalkWorkMessageRequest + try { - WorkCodes = new List { appointment.Code }, - Content = $"您的访客预约《{appointment.Title}》中的访客{detail.Name}已被强制离场,原因:{reason}。" - }); + var appointment = await _dbContext.Queryable().Where(x => x.No == detail.No).SingleAsync(); + await _jinkoApiService.SendWorkMessageAsync(new DingTalkWorkMessageRequest + { + WorkCodes = new List { appointment.Code }, + Content = $"您的访客预约《{appointment.Title}》中的访客{detail.Name}已被强制离场,原因:{reason}。" + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "发送访客离场通知失败:{msg}", ex.Message); + } } public async Task> GetRecordPageByIdNoAsync(AppointmentIdNoPageRequest request)