diff --git a/Src/Dlhis.Basic/Dishes/Controller/DishesCategoriesController.cs b/Src/Dlhis.Basic/Dishes/Controller/DishesCategoriesController.cs
index 7370ebe9..12e48ba9 100644
--- a/Src/Dlhis.Basic/Dishes/Controller/DishesCategoriesController.cs
+++ b/Src/Dlhis.Basic/Dishes/Controller/DishesCategoriesController.cs
@@ -1,6 +1,7 @@
using Dlhis.Basic.Dishes.Request;
using Dlhis.Basic.Dishes.Response;
using Dlhis.Basic.Dishes.Services;
+using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -31,6 +32,19 @@ public class DishesCategoriesController : ControllerBase
return await _dishesCategoryService.TreeAsync();
}
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpGet("tree-all")]
+ [IgnoreTenant]
+ public async Task> TreeAllAsync(Guid businessPlaceCode)
+ {
+ return await _dishesCategoryService.TreeAllAsync(businessPlaceCode);
+ }
+
///
/// 保存分类
///
diff --git a/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs b/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs
index de956b28..867d0e4e 100644
--- a/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs
+++ b/Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs
@@ -60,6 +60,7 @@ public class DishesMenusController : ControllerBase
///
///
[HttpGet("dishes-selections")]
+ [IgnoreTenant]
public async Task> GetDishesUnderCurrentMenuAsync(Guid businessPlaceCode,
DateTime date,
ShiftEnumType? shiftType,
diff --git a/Src/Dlhis.Basic/Dishes/Services/IDishesCategoryService.cs b/Src/Dlhis.Basic/Dishes/Services/IDishesCategoryService.cs
index 2164e5e0..637c93ed 100644
--- a/Src/Dlhis.Basic/Dishes/Services/IDishesCategoryService.cs
+++ b/Src/Dlhis.Basic/Dishes/Services/IDishesCategoryService.cs
@@ -7,5 +7,9 @@ public interface IDishesCategoryService : IScopeDependency
{
Task> TreeAsync();
+
+ Task> TreeAllAsync(Guid businessPlaceCode);
+
+
Task SaveAsync(DishesCategorySaveRequest request);
}
diff --git a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs
index 58e2b6b2..528c33d6 100644
--- a/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs
+++ b/Src/Dlhis.Basic/Dishes/Services/Implements/DishesCategoryService.cs
@@ -46,6 +46,32 @@ public class DishesCategoryService : IDishesCategoryService
return tops;
}
+ public async Task> TreeAllAsync(Guid businessPlaceCode)
+ {
+ var categories = await _dbContext.Queryable()
+ .LeftJoin((x, bplace) => x.BusinessPlaceCode == bplace.Code)
+ .Where(x => x.BusinessPlaceCode == businessPlaceCode)
+ .Select((x, bplace) => new DishesCategoryTreeResponse
+ {
+ BusinessPlaceCode = bplace.Code,
+ Code = x.Code,
+ Name = x.Name,
+ PCode = x.PCode,
+ })
+ .ToListAsync();
+
+ var tops = categories.Where(x => !x.PCode.HasValue).ToList();
+
+ tops.ForEach(x =>
+ {
+ RecursionGetNext(x, categories);
+ });
+
+ return tops;
+ }
+
+
+
public async Task SaveAsync(DishesCategorySaveRequest request)
{
await CheckBusinessPlacePermissionAsync(request.BusinessPlaceCode);