fix 唯一号处理

This commit is contained in:
2024-03-06 22:36:02 +08:00
parent 28390abaa5
commit 04f20e7cf2
3 changed files with 5 additions and 2 deletions

View File

@@ -78,6 +78,11 @@ public class DeviceSaveRequest : IValidatableObject
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (Id.HasValue)
{
UniqueNo = null;
}
if (Type != DeviceTypeEnumType.Door && AsAttendance)
{
yield return new ValidationResult($"{DeviceTypeEnumType.Door.GetDescription()}才可设置作为考勤设备", new[] { nameof(AsAttendance) });