You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.6 KiB
81 lines
2.6 KiB
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Volo.Abp.AspNetCore.Mvc;
|
|
using Win_in.Sfs.Basedata.Application.Contracts;
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts;
|
|
|
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
|
|
|
|
/// <summary>
|
|
/// 注塑计划请求
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route($"{PdaHostConst.ROOT_ROUTE}store/injection-plan-request")]
|
|
|
|
public class InjectionPlanRequestController : AbpController
|
|
{
|
|
private readonly IInjectionPlanRequestAppService _injectionRequestAppService;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="InjectionPlanRequestAppService"></param>
|
|
public InjectionPlanRequestController(IInjectionPlanRequestAppService InjectionPlanRequestAppService)
|
|
{
|
|
_injectionRequestAppService = InjectionPlanRequestAppService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 注塑叫料申请
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("")]
|
|
public virtual async Task<ActionResult<InjectionPlanRequestDTO>> CreateAsync(InjectionPlanRequestEditInput input)
|
|
{
|
|
var result = await _injectionRequestAppService.CreateAndHandleAsync(input).ConfigureAwait(false);
|
|
return Ok(result);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据number获取注塑叫料申请详情
|
|
/// </summary>
|
|
/// <param name="number"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("{number}")]
|
|
|
|
public virtual async Task<ActionResult<InjectionPlanRequestDTO>> GetAsync(string number)
|
|
{
|
|
var result = await _injectionRequestAppService.GetByNumberAsync(number).ConfigureAwait(false);
|
|
return Ok(result);
|
|
}
|
|
|
|
/// <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="categoryName"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("list/item-category")]
|
|
public virtual async Task<List<ItemBasicDTO>> GetItemCategoryListAsync(string categoryName)
|
|
{
|
|
var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false);
|
|
|
|
return entities.Where(p=>p.Category== categoryName).ToList();
|
|
}
|
|
|
|
}
|
|
|