fix 菜单时效范围
This commit is contained in:
@@ -186,6 +186,18 @@ public class DishesMenuService : IDishesMenuService
|
||||
|
||||
await _dbContext.Client.Deleteable<DishesMenuEntity>().Where(where).ExecuteCommandAsync();
|
||||
await _dbContext.InsertAsync(entities);
|
||||
|
||||
if (request.Items.Any())
|
||||
{
|
||||
Expression<Func<DishesMenuEntity, bool>> whereCheck = LinqExpressionExtension.False<DishesMenuEntity>();
|
||||
request.Items.ForEach(p =>
|
||||
{
|
||||
whereCheck = where.Or(x => !(x.EndDate < p.Period.Start || x.StartDate > p.Period.End));
|
||||
});
|
||||
|
||||
var duplicate = await _dbContext.Queryable<DishesMenuEntity>().Where(whereCheck).AnyAsync();
|
||||
duplicate.ThrowIfTrue("菜单时效冲突");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode)
|
||||
|
||||
Reference in New Issue
Block a user