fix 获取订餐最晚时间
This commit is contained in:
@@ -8,6 +8,7 @@ using Kurisu.Core.DataAccess.Dto;
|
|||||||
using Kurisu.SqlSugar.Extensions;
|
using Kurisu.SqlSugar.Extensions;
|
||||||
using Kurisu.SqlSugar.Services;
|
using Kurisu.SqlSugar.Services;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
@@ -59,20 +60,27 @@ public class DishesService : IDishesService
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var shift = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>()
|
var shift = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>()
|
||||||
.Where(x => x.PlaceCode == request.PlaceCode)
|
.Where(x => x.PlaceCode == request.PlaceCode)
|
||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
shift.ThrowIfNull($"营业点{request.PlaceCode}吗,没有餐别!");
|
|
||||||
|
|
||||||
var BusinessShiftMealRelationships = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
var BusinessShiftMealRelationships = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
||||||
.Where(x => x.ShiftCode == shift.ShiftCode)
|
.Where(x => x.ShiftCode == shift.ShiftCode)
|
||||||
.Select<BusinessShiftMealRelationshipResponse>()
|
.Select<BusinessShiftMealRelationshipResponse>()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// 读取配置中的时间
|
// 读取最晚订餐的时间
|
||||||
var eightThirtyPmStr = _configuration["EightThirtyPM"];
|
var strDatetime = await _dbContext.Queryable<CanteenSettingEntity>()
|
||||||
DateTime.TryParseExact(eightThirtyPmStr, "HH:mm:ss", null, DateTimeStyles.None, out var dateTime);
|
.Where(x => x.UniqueType == CanteenSettingUnqiueEnumType.Tenant && x.Item == CanteenSettingItemEnumType.BookingDeadline && x.Enable)
|
||||||
|
.Select(x => x.Value)
|
||||||
|
.FirstAsync();
|
||||||
|
|
||||||
|
DateTime dateTime;
|
||||||
|
DateTime.TryParseExact(strDatetime, "HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out dateTime);
|
||||||
|
|
||||||
|
|
||||||
var payTypes = new List<BalanceRecordSourceEnumType> { BalanceRecordSourceEnumType.Cash };
|
var payTypes = new List<BalanceRecordSourceEnumType> { BalanceRecordSourceEnumType.Cash };
|
||||||
if (shift.TenantId == request.Factory)
|
if (shift.TenantId == request.Factory)
|
||||||
@@ -88,5 +96,11 @@ public class DishesService : IDishesService
|
|||||||
};
|
};
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new GetDishesMenusBookingResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"EightThirtyPM": "20:30:00",
|
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"InternalRequest": {
|
"InternalRequest": {
|
||||||
"CommonRequestUrl": "http://common",
|
"CommonRequestUrl": "http://common",
|
||||||
|
|||||||
@@ -115,15 +115,7 @@ public class GetMiniProgramOrderResponse
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string OrderStatusCN => OrderStatus.GetDescription();
|
public string OrderStatusCN => OrderStatus.GetDescription();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单类型
|
|
||||||
/// </summary>
|
|
||||||
public CanteenMenuEnumType OrderType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单类型CN
|
|
||||||
/// </summary>
|
|
||||||
public string OrderTypeCN => OrderType.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 总金额
|
/// 总金额
|
||||||
|
|||||||
Reference in New Issue
Block a user