fix 多重名No映射问题

This commit is contained in:
2024-10-11 16:11:07 +08:00
parent c4ec53c6d7
commit b412df0f87
2 changed files with 4 additions and 3 deletions

View File

@@ -120,6 +120,7 @@ public class AppointmentService : IAppointmentService
.Where(x => (x.IsEnterDoorArea && SqlFunc.DateIsSame(x.DoorStart, now)) || (x.IsEnterWorkplace && SqlFunc.DateIsSame(x.WorkplaceStart, now))) .Where(x => (x.IsEnterDoorArea && SqlFunc.DateIsSame(x.DoorStart, now)) || (x.IsEnterWorkplace && SqlFunc.DateIsSame(x.WorkplaceStart, now)))
.Select(x => new AppointmentDetailResponse .Select(x => new AppointmentDetailResponse
{ {
No = x.No,
Mst = SqlFunc.Subqueryable<VisitorAppointmentDetailEntity>().Where(p => p.No == x.No).First<AppointmentPageResponse>() Mst = SqlFunc.Subqueryable<VisitorAppointmentDetailEntity>().Where(p => p.No == x.No).First<AppointmentPageResponse>()
}, true) }, true)
.SingleAsync(); .SingleAsync();

View File

@@ -58,12 +58,12 @@ public class AppointmentReceiveItemDto : IValidatableObject
/// <summary> /// <summary>
/// 访客开始 /// 访客开始
/// </summary> /// </summary>
public DateTime DoorStart { get; set; } public DateTime? DoorStart { get; set; }
/// <summary> /// <summary>
/// 访问结束 /// 访问结束
/// </summary> /// </summary>
public DateTime DoorEnd { get; set; } public DateTime? DoorEnd { get; set; }
/// <summary> /// <summary>
/// 进入车间 /// 进入车间
@@ -95,7 +95,7 @@ public class AppointmentReceiveItemDto : IValidatableObject
yield return new ValidationResult($"{Name}门岗区域不可为空", new[] { nameof(ApplyWorkplaceAreas) }); yield return new ValidationResult($"{Name}门岗区域不可为空", new[] { nameof(ApplyWorkplaceAreas) });
} }
if (DoorStart >= DoorEnd) if (!DoorStart.HasValue || !DoorEnd.HasValue || DoorStart >= DoorEnd)
{ {
yield return new ValidationResult($"{Name}门禁来访时间有误", new[] { nameof(DoorStart) }); yield return new ValidationResult($"{Name}门禁来访时间有误", new[] { nameof(DoorStart) });
} }