fix idno匹配,避免人员归档后重复操作

This commit is contained in:
2025-05-26 14:33:52 +08:00
parent 80f845f630
commit 196f3413c5

View File

@@ -399,6 +399,9 @@ public class AppointmentService : IAppointmentService
private async Task GenerateDeviceTasksAsync(VisitorAppointmentDetailEntity detail, bool withWorkplace, DeviceTaskEnumType deviceTaskType, string source)
{
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.IdNo == detail.IdNo || x.Code == detail.IdNo).SingleAsync();
gainfo.ThrowIfNull("人员信息不存在");
var areaCodes = GetValidAreaCodes(detail, withWorkplace).ToList();
if (areaCodes.IsEmpty()) return;
@@ -418,7 +421,7 @@ public class AppointmentService : IAppointmentService
DeviceType = DeviceTypeEnumType.Door,
DeviceUniqueNo = x.UniqueNo,
Status = DeviceTaskStatusEnumType.Wait,
UserNo = detail.UserNo,
UserNo = gainfo.No,
Type = deviceTaskType,
Priority = 100,
TenantId = x.TenantId,