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> /// </summary>
[EnumDataType(typeof(GainfoSearchEnumType))] [EnumDataType(typeof(GainfoSearchEnumType))]
public GainfoSearchEnumType SearchType { get; set; } public GainfoSearchEnumType SearchType { get; set; }
public bool IsSearchAll { get; set; } public bool IsSearchAll { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)

View File

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