fix 订餐返回当前信息,增加数量入参和响应

This commit is contained in:
2024-03-21 10:35:24 +08:00
parent 374bad21c4
commit d840a04231
3 changed files with 14 additions and 6 deletions

View File

@@ -79,7 +79,10 @@ public class DishesMenusController : ControllerBase
/// <param name="categoryCodes"></param>
/// <returns></returns>
[HttpGet("dishes-selections")]
public async Task<List<DishesDetailResponse>> GetDishesUnderCurrentMenuAsync(Guid businessPlaceCode, DateTime date, ShiftEnumType? shiftType, [FromQuery] List<Guid> categoryCodes)
public async Task<List<DishesDetailResponse>> GetDishesUnderCurrentMenuAsync(Guid businessPlaceCode,
DateTime date,
ShiftEnumType? shiftType,
[FromQuery] List<Guid> categoryCodes)
{
return await _dishesMenuService.GetDishesUnderCurrentMenuAsync(businessPlaceCode, date, shiftType, categoryCodes);
}

View File

@@ -42,6 +42,11 @@ public class DishesDetailResponse
/// </summary>
public int Number { get; set; }
/// <summary>
/// 剩余数量
/// </summary>
public int Number { get; set; }
/// <summary>
/// 单位
/// </summary>

View File

@@ -115,11 +115,11 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService
Version = 0,
});
(mealInfo == null).ThrowIfTrue("余额不足,无法消费");
}
//金额+-
mealInfo.Balance += order.Amount;
(mealInfo.Balance < 0).ThrowIfTrue("余额不足,无法消费");
(mealInfo == null).ThrowIfTrue("余额不足,无法消费");
}
//金额+-
mealInfo.Balance += order.Amount;
(mealInfo.Balance < 0).ThrowIfTrue("余额不足,无法消费");
var effectMeal = await DbContext.Updateable<GainfoMealEntity>()
.SetColumns(x => x.Balance == mealInfo.Balance)