|
|
@ -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 |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取物品类别列表
|
|
|
|
/// 获取物品类别名称
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("item-category-name")] |
|
|
|
public virtual async Task<List<string>> GetItemCategoryNameAsync() |
|
|
|
{ |
|
|
|
var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false); |
|
|
|
var categoryNames = entities.Select(p => p.Category).Distinct().ToList(); |
|
|
|
|
|
|
|
return categoryNames; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 根据类别名称获取物品类别列表
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="type"></param>
|
|
|
|
/// <param name="categoryName"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("list/item-category")] |
|
|
|
public virtual async Task<List<ItemBasicDTO>> GetItemCategoryListAsync() |
|
|
|
public virtual async Task<List<ItemBasicDTO>> 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(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|