fix 处理营业点分配功能问题

This commit is contained in:
2024-07-02 15:53:55 +08:00
parent 38ab947790
commit 2cea51232f
9 changed files with 46 additions and 91 deletions

View File

@@ -27,6 +27,7 @@ public class BusinessPlaceShiftSaveMealShiftRequest : IValidatableObject
/// <summary>
/// 时间段
/// </summary>
[Required(ErrorMessage = "时间段不可为空")]
public TimePeriod TimePeriod { get; set; }
@@ -37,14 +38,14 @@ public class BusinessPlaceShiftSaveMealShiftRequest : IValidatableObject
yield return new ValidationResult("时间段配置错误", new[] { nameof(TimePeriod) });
}
if (TimePeriod?.Start == null || TimePeriod?.End == null)
if (TimePeriod!.Start == null || TimePeriod!.End == null)
{
yield return new ValidationResult("时间段配置错误", new[] { nameof(TimePeriod) });
}
if (TimePeriod.Start == TimePeriod.End)
if (TimePeriod!.Start == TimePeriod!.End)
{
yield return new ValidationResult("时间段设置区间有误,开始时段不能等于结束时段.", new[] { nameof(TimePeriod) });
}
}
}
}