From 0c2c95c670373e1370e06d2b2096fe837a7b5930 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 17 Jun 2024 09:45:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=A1=91=E8=AE=A1=E5=88=92=E6=8C=89?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=90=8D=E7=A7=B0=E6=9F=A5=E6=89=BE=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Stores/InjectionPlanRequestController.cs | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs index 904a3f8ed..19010f161 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; @@ -52,16 +53,29 @@ public class InjectionPlanRequestController : AbpController } /// - /// 获取物品类别列表 + /// 获取物品类别名称 + /// + /// + [HttpGet("item-category-name")] + public virtual async Task> GetItemCategoryNameAsync() + { + var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false); + var categoryNames = entities.Select(p => p.Category).Distinct().ToList(); + + return categoryNames; + } + + /// + /// 根据类别名称获取物品类别列表 /// - /// + /// /// [HttpGet("list/item-category")] - public virtual async Task> GetItemCategoryListAsync() + public virtual async Task> GetItemCategoryListAsync(string categoryName) { - var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false); + var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false); - return entities; + return entities.Where(p=>p.Category== categoryName).ToList(); } }