fix GetDishesMenusBookingResponse修改字段
This commit is contained in:
@@ -93,9 +93,9 @@ public class DishesMenusController : ControllerBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("setting")]
|
[HttpGet("setting")]
|
||||||
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(Guid PLaceCode)
|
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
||||||
{
|
{
|
||||||
return await _dishesService.GetDishesMenusBookingSetting(PLaceCode);
|
return await _dishesService.GetDishesMenusBookingSetting(request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Dlhis.Basic.Dishes.Request
|
||||||
|
{
|
||||||
|
public class GetDishesMenusBookingRequest
|
||||||
|
{
|
||||||
|
public Guid PlaceCode { get; set; }
|
||||||
|
|
||||||
|
public string Factory { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,16 +19,6 @@ namespace Dlhis.Basic.Dishes.Response
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ShiftEnumType ShiftType { get; set; }
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 经营开始时间
|
|
||||||
/// </summary>
|
|
||||||
public TimeOnly Start { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 经营结束时间
|
|
||||||
/// </summary>
|
|
||||||
public TimeOnly End { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,6 +1,56 @@
|
|||||||
namespace Dlhis.Basic.Dishes.Response;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using SqlSugar.DbConvert;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
public class DishesMenuPageResponse
|
public class DishesMenuPageResponse
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单编码
|
||||||
|
/// </summary>
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单类型
|
||||||
|
/// </summary>
|
||||||
|
public CanteenMenuEnumType Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次
|
||||||
|
/// </summary>
|
||||||
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品编码
|
||||||
|
/// </summary>
|
||||||
|
public string DishesCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 剩余数量
|
||||||
|
/// </summary>
|
||||||
|
public int Number { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal? Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public bool Enable { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,5 +7,9 @@ namespace Dlhis.Basic.Dishes.Response
|
|||||||
public class GetDishesMenusBookingResponse
|
public class GetDishesMenusBookingResponse
|
||||||
{
|
{
|
||||||
public List<BusinessShiftMealRelationshipResponse> BusinessShiftMealRelationships { get; set; }
|
public List<BusinessShiftMealRelationshipResponse> BusinessShiftMealRelationships { get; set; }
|
||||||
|
|
||||||
|
public DateTime ServiceTime { get; set; }
|
||||||
|
|
||||||
|
public List<BalanceRecordSourceEnumType> PayType { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ public interface IDishesService : IScopeDependency
|
|||||||
|
|
||||||
Task SaveDishesAsync(DishesSaveRequest request);
|
Task SaveDishesAsync(DishesSaveRequest request);
|
||||||
|
|
||||||
Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(Guid PLaceCode);
|
Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,21 +2,25 @@
|
|||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
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.Collections.Generic;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
public class DishesService : IDishesService
|
public class DishesService : IDishesService
|
||||||
{
|
{
|
||||||
private readonly IDbContext _dbContext;
|
private readonly IDbContext _dbContext;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
public DishesService(IDbContext dbContext)
|
public DishesService(IDbContext dbContext, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
|
_configuration = configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Pagination<DishesResponse>> GetDishesPageAsync(DishesPageRequest request)
|
public async Task<Pagination<DishesResponse>> GetDishesPageAsync(DishesPageRequest request)
|
||||||
@@ -49,19 +53,33 @@ public class DishesService : IDishesService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(Guid PLaceCode)
|
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
||||||
{
|
{
|
||||||
var shift = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>()
|
var shift = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>()
|
||||||
.Where(x => x.PlaceCode == 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"];
|
||||||
|
DateTime.TryParseExact(eightThirtyPmStr, "HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out var dateTime);
|
||||||
|
|
||||||
|
var payTypes = new List<BalanceRecordSourceEnumType> { BalanceRecordSourceEnumType.Cash };
|
||||||
|
if (shift.TenantId == request.Factory)
|
||||||
|
{
|
||||||
|
payTypes.Add(BalanceRecordSourceEnumType.LocalTenantSubsidies);
|
||||||
|
}
|
||||||
|
|
||||||
var res = new GetDishesMenusBookingResponse
|
var res = new GetDishesMenusBookingResponse
|
||||||
{
|
{
|
||||||
BusinessShiftMealRelationships = BusinessShiftMealRelationships,
|
BusinessShiftMealRelationships = BusinessShiftMealRelationships,
|
||||||
|
ServiceTime = dateTime,
|
||||||
|
PayType = payTypes
|
||||||
};
|
};
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"EightThirtyPM": "20:30:00",
|
||||||
"InternalRequest": {
|
"InternalRequest": {
|
||||||
"CommonRequestUrl": "http://localhost:5001",
|
"CommonRequestUrl": "http://localhost:5001",
|
||||||
"SysRequestUrl": "http://localhost:5003"
|
"SysRequestUrl": "http://localhost:5003"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"EightThirtyPM": "20:30:00",
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"InternalRequest": {
|
"InternalRequest": {
|
||||||
"CommonRequestUrl": "http://common",
|
"CommonRequestUrl": "http://common",
|
||||||
|
|||||||
Reference in New Issue
Block a user