fix 电子餐券超市禁止

This commit is contained in:
2024-09-19 13:55:12 +08:00
parent 3c921ef1c9
commit 33e2db3398

View File

@@ -66,7 +66,7 @@ public class OrderService : BaseOrderService, IOrderService
await DbContext.UpdateAsync(device);
}
Logger.LogInformation("设备IP获取:{deviceNo} {ip}", request.DeviceUniqueNo, ip);
}
catch (Exception)
@@ -680,6 +680,11 @@ public class OrderService : BaseOrderService, IOrderService
var eMealVoucher = await DbContext.Queryable<EMealVoucherEntity>().Where(x => x.No == no).SingleAsync();
var checkData = await PreCheckAsync(request.DeviceUniqueNo, request.CostDateTime);
var isSupermarket = await DbContext.Queryable<BusinessPlaceEntity>().Where(x => x.Code == checkData.BusinessPlaceCode)
.Select(x => x.Catalog == CanteenBusinessPlaceCatalogEnumType.Supermarket)
.SingleAsync();
isSupermarket.ThrowIfTrue("禁止在超市消费");
eMealVoucher.Factories.Contains(checkData.BusinessPlaceTenantId).ThrowIfFalse("禁止在当前厂区消费");
var order = new CanteenOrderEntity