fix 修复电子餐券退款问题
This commit is contained in:
@@ -536,14 +536,12 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
}
|
||||
|
||||
var originData = eMealVoucherQrCode.OriginData.Split(':');
|
||||
|
||||
var no = originData[0];
|
||||
var ts = originData[1];
|
||||
var idNo = originData[3];
|
||||
var idNo = originData.Length == 4 ? originData[3] : originData[2];
|
||||
|
||||
try
|
||||
{
|
||||
await EMealVoucherConsumeAsync(request.Adapt<ConsumeRequest>(), gainfo, eMealVoucherQrCode.OriginData, no, ts, idNo);
|
||||
await EMealVoucherConsumeAsync(request.Adapt<ConsumeRequest>(), gainfo, eMealVoucherQrCode.OriginData, no, idNo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -667,17 +665,13 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
return await DbContext.Queryable<GainfoEntity>().Where(x => x.Code == gainfoQrCode.UserCode).SingleAsync();
|
||||
}
|
||||
|
||||
private async Task EMealVoucherConsumeAsync(ConsumeRequest request, GainfoEntity gainfo, string originData, string no, string ts, string idNo)
|
||||
private async Task EMealVoucherConsumeAsync(ConsumeRequest request, GainfoEntity gainfo, string originData, string no, string idNo)
|
||||
{
|
||||
var nowDate = DateTime.Now.Date;
|
||||
var current = await DbContext.Queryable<EMealVoucherDetailEntity>()
|
||||
.Where(x => x.No == no && x.IdNo == idNo).SingleAsync();
|
||||
(nowDate >= current.Start && nowDate <= current.End).ThrowIfFalse("餐券已过期");
|
||||
|
||||
//todo 临时注释
|
||||
// var time = DateTimeOffset.FromUnixTimeMilliseconds(Convert.ToInt64(ts.Reverse().Join(string.Empty))).ToLocalTime().DateTime;
|
||||
// (time.AddMinutes(60) >= DateTime.Now).ThrowIfFalse("餐券二维码已过期");
|
||||
|
||||
var eMealVoucher = await DbContext.Queryable<EMealVoucherEntity>().Where(x => x.No == no).SingleAsync();
|
||||
|
||||
var checkData = await PreCheckAsync(request.DeviceUniqueNo, request.CostDateTime);
|
||||
|
||||
Reference in New Issue
Block a user