feat 电子餐券

This commit is contained in:
2024-08-14 15:07:08 +08:00
parent 7abb0f312b
commit 89291c8ea5
2 changed files with 1 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ public class GainfoPageRequest : PageDto, IValidatableObject
/// </summary>
[EnumDataType(typeof(GainfoSearchEnumType))]
public GainfoSearchEnumType SearchType { get; set; }
public bool IsSearchAll { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)

View File

@@ -613,7 +613,6 @@ public class OrderService : BaseOrderService, IOrderService
{
if (request.ThirdNo.IsPresent())
{
var redisCache = _serviceProvider.GetService<RedisCache>();
await using var handler = await redisCache.LockAsync($"consume:device:{request.ThirdNo}");
@@ -676,7 +675,6 @@ public class OrderService : BaseOrderService, IOrderService
Msg = message
};
}
async Task<bool> ToCheckAbleOfflineConsumeAsync(string thirdNo)
{
var order = await DbContext.Queryable<CanteenOrderEntity>()
@@ -714,7 +712,6 @@ public class OrderService : BaseOrderService, IOrderService
var current = await DbContext.Queryable<EMealVoucherDetailEntity>()
.Where(x => x.No == no && x.IdNo == idNo).SingleAsync();
(nowDate >= current.Start && nowDate <= current.End).ThrowIfFalse("餐券已过期");
var time = DateTimeOffset.FromUnixTimeMilliseconds(Convert.ToInt64(ts.Reverse().Join(string.Empty))).ToLocalTime().DateTime;
(time.AddMinutes(60) >= DateTime.Now).ThrowIfFalse("二维码已过期");