feat 电子餐券

This commit is contained in:
2024-08-14 15:07:08 +08:00
parent ee86311697
commit 4f7b984dfc
27 changed files with 552 additions and 106 deletions

View File

@@ -82,6 +82,11 @@ public class EMealVoucherReceiveRequest : IValidatableObject
{
yield return new ValidationResult("来宾数量不匹配", new[] { nameof(Number) });
}
if (Details.DistinctBy(x => x.IdNo).Count() != Details.Count)
{
yield return new ValidationResult("证件信息重复", new[] { "IdNo" });
}
}
}

View File

@@ -43,7 +43,7 @@ public class EMealVoucherService : IEMealVoucherService
Phone = x.Phone,
Start = x.Start,
End = x.End,
Amount = x.Amount
Balance = x.Amount
}).ToList();
var id = await _dbContext.InsertReturnIdentityAsync(voucher);