fix 解决dishersservice冲突
This commit is contained in:
@@ -7,7 +7,6 @@ using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Org.BouncyCastle.Asn1.Ocsp;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Controller;
|
namespace Dlhis.Basic.Dishes.Controller;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ public class DishesSaveRequest
|
|||||||
[Required]
|
[Required]
|
||||||
public Guid CategoryCode { get; set; }
|
public Guid CategoryCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜品名称
|
/// 菜品名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -40,6 +46,12 @@ public class DishesSaveRequest
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ImageUrl { get; set; }
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
[MinLength(1)]
|
||||||
|
public List<string> Units { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用
|
/// 是否启用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Response;
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
@@ -11,11 +9,6 @@ public class DishesMenuPageResponse
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string CustomCode { get; set; }
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单类型
|
|
||||||
/// </summary>
|
|
||||||
public CanteenMenuEnumType Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属营业点
|
/// 所属营业点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,40 +1,35 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Response;
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
public class DishesResponse
|
public class DishesResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 大类
|
/// 分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Categories { get; set; }
|
public Guid CategoryCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 小类
|
/// 分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SubCategories { get; set; }
|
public string CategoryName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜品编码
|
/// 菜品编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Code { get; set; }
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜品名称
|
/// 菜品名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品类型
|
|
||||||
/// </summary>
|
|
||||||
public CanteenMenuEnumType Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品类型描述
|
|
||||||
/// </summary>
|
|
||||||
public string TypeDescription => Type.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述
|
/// 描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -43,25 +38,23 @@ public class DishesResponse
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单价
|
/// 单价
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal Amount { get; set; }
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单位
|
/// 单位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Unit { get; set; }
|
public List<string> Units => CurrnetUnits.ToObject<List<string>>();
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public string CurrnetUnits { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图片
|
/// 图片
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Image { get; set; }
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用
|
/// 是否启用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 限售份数
|
|
||||||
/// </summary>
|
|
||||||
public int? RestrictedNum { get; set; } = null;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
Number = number,
|
Number = number,
|
||||||
Price = price,
|
Price = price,
|
||||||
|
|
||||||
Type = CanteenMenuEnumType.Booking,
|
Type = CanteenApplicaitonTypeEnumType.Booking,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
Enable = false,
|
Enable = false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ 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;
|
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
@@ -29,9 +27,15 @@ public class DishesService : IDishesService
|
|||||||
//todo 营业点权限
|
//todo 营业点权限
|
||||||
|
|
||||||
return await _dbContext.Queryable<DishesEntity>()
|
return await _dbContext.Queryable<DishesEntity>()
|
||||||
|
.LeftJoin<DishesCategoryEntity>((x, category) => x.CategoryCode == category.Code)
|
||||||
.WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search))
|
.WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search))
|
||||||
.OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc)
|
.OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc)
|
||||||
.Select<DishesResponse>()
|
.Select((x, category) => new DishesResponse
|
||||||
|
{
|
||||||
|
CurrnetUnits = x.Units.ToString(),
|
||||||
|
CategoryName = category.Name,
|
||||||
|
|
||||||
|
}, true)
|
||||||
.ToPageListAsync(request);
|
.ToPageListAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +65,7 @@ public class DishesService : IDishesService
|
|||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
shift.ThrowIfNull($"营业点{request.PlaceCode}吗,没有餐别!");
|
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();
|
||||||
@@ -75,7 +79,7 @@ public class DishesService : IDishesService
|
|||||||
{
|
{
|
||||||
payTypes.Add(BalanceRecordSourceEnumType.LocalTenantSubsidies);
|
payTypes.Add(BalanceRecordSourceEnumType.LocalTenantSubsidies);
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = new GetDishesMenusBookingResponse
|
var res = new GetDishesMenusBookingResponse
|
||||||
{
|
{
|
||||||
BusinessShiftMealRelationships = BusinessShiftMealRelationships,
|
BusinessShiftMealRelationships = BusinessShiftMealRelationships,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using Dlhis.Common.Response;
|
|||||||
using Dlhis.Common.Services.Implements;
|
using Dlhis.Common.Services.Implements;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Common.ApiLog
|
namespace Dlhis.Common.ApiLog
|
||||||
@@ -27,6 +26,7 @@ namespace Dlhis.Common.ApiLog
|
|||||||
/// 获取api日志
|
/// 获取api日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[Authorize(Roles = "admin")]
|
||||||
[HttpGet("logs")]
|
[HttpGet("logs")]
|
||||||
public async Task<Pagination<ApiLogResponse>> GetLogsAsync([FromQuery] ApiLogRequest request)
|
public async Task<Pagination<ApiLogResponse>> GetLogsAsync([FromQuery] ApiLogRequest request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
//服务器IP
|
//服务器IP
|
||||||
"Endpoint": "http://192.168.199.124:9000",
|
"Endpoint": "http://192.168.199.124:9000",
|
||||||
//账号
|
//账号
|
||||||
"AccessKey": "oQ7tD55EVNElIoO3D43r",
|
"AccessKey": "bmQOlK0COe5nL56kzGd3",
|
||||||
//密码
|
//密码
|
||||||
"SecretKey": "3eWLaAFQ9fnFx8pOp5SgJogoF47ecAH6dcCWlyAp",
|
"SecretKey": "Udc5uBrGcT2yukfGXQtHKpqLQ27L1FmbrLyYunBr",
|
||||||
//默认存储桶
|
//默认存储桶
|
||||||
"DefaultBucket": "apk"
|
"DefaultBucket": "apk"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,9 +43,9 @@
|
|||||||
//服务器IP
|
//服务器IP
|
||||||
"Endpoint": "http://192.168.199.124:9000",
|
"Endpoint": "http://192.168.199.124:9000",
|
||||||
//账号
|
//账号
|
||||||
"AccessKey": "Zbjj05OFtR19e5TJopQU",
|
"AccessKey": "bmQOlK0COe5nL56kzGd3",
|
||||||
//密码
|
//密码
|
||||||
"SecretKey": "UMXtNdZhufhAAyYJ3XND4cEgZNUsgOWtbUzksizK",
|
"SecretKey": "Udc5uBrGcT2yukfGXQtHKpqLQ27L1FmbrLyYunBr",
|
||||||
//apk默认存储桶
|
//apk默认存储桶
|
||||||
"DefaultBucket": "apk"
|
"DefaultBucket": "apk"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -139,5 +139,12 @@ public class BalanceRecordEntity : SugarBaseEntity, ITenantId
|
|||||||
[SugarColumn(ColumnDescription = "备注")]
|
[SugarColumn(ColumnDescription = "备注")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐饮应用类型
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "餐饮应用类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
|
public CanteenApplicaitonTypeEnumType ApplicationType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ namespace Dlhis.Entity.Canteen.Entities;
|
|||||||
/// 菜品表
|
/// 菜品表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable(TableName = "Dishes", TableDescription = "菜品表")]
|
[SugarTable(TableName = "Dishes", TableDescription = "菜品表")]
|
||||||
public class DishesEntity : SugarBaseEntity, ITenantId
|
public class DishesEntity : SugarBaseEntity, IImageUrl, ITenantId
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分类
|
/// 分类
|
||||||
@@ -20,6 +20,7 @@ public class DishesEntity : SugarBaseEntity, ITenantId
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业点
|
/// 营业点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "营业点", IsNullable = false)]
|
||||||
public Guid BusinessPlaceCode { get; set; }
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,6 +48,12 @@ public class DishesEntity : SugarBaseEntity, ITenantId
|
|||||||
[SugarColumn(ColumnDescription = "单价")]
|
[SugarColumn(ColumnDescription = "单价")]
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "单位", IsJson = true, DefaultValue = "[]")]
|
||||||
|
public List<string> Units { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图片
|
/// 图片
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class DishesMenuEntity : SugarBaseEntity, ITenantId, IVersion
|
|||||||
/// 菜单类型
|
/// 菜单类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public CanteenMenuEnumType Type { get; set; }
|
public CanteenApplicaitonTypeEnumType Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属营业点
|
/// 所属营业点
|
||||||
|
|||||||
@@ -3,26 +3,23 @@
|
|||||||
namespace Dlhis.Entity.Canteen.Enums;
|
namespace Dlhis.Entity.Canteen.Enums;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜品类型 CanteenMenuEnumType
|
/// 餐饮应用类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("菜品类型")]
|
[Description("餐饮应用类型")]
|
||||||
public enum CanteenMenuEnumType
|
public enum CanteenApplicaitonTypeEnumType
|
||||||
{
|
{
|
||||||
|
[Description("设备消费")]
|
||||||
|
Device = 100,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订餐
|
/// 订餐
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("订餐")]
|
[Description("订餐")]
|
||||||
Booking = 1,
|
Booking = 200,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 扫码点餐
|
/// 扫码点餐
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("扫码点餐")]
|
[Description("扫码点餐")]
|
||||||
QrCode=2,
|
QrCode = 300,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 通用
|
|
||||||
/// </summary>
|
|
||||||
[Description("通用")]
|
|
||||||
General = 3,
|
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,11 @@ public enum CanteenOrderStatusEnumType
|
|||||||
[Description("成功")]
|
[Description("成功")]
|
||||||
Successful = 1,
|
Successful = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 取消
|
||||||
|
/// </summary>
|
||||||
|
[Description("取消")]
|
||||||
|
Cancel = 95,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 失败
|
/// 失败
|
||||||
|
|||||||
6
Src/Dlhis.Entity/IImageUrl.cs
Normal file
6
Src/Dlhis.Entity/IImageUrl.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Dlhis.Entity;
|
||||||
|
|
||||||
|
public interface IImageUrl
|
||||||
|
{
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user