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.
58 lines
1.6 KiB
58 lines
1.6 KiB
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Volo.Abp.AspNetCore.Mvc;
|
|
using Win_in.Sfs.Basedata.Application.Contracts;
|
|
|
|
namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route($"{PdaHostConst.ROOT_ROUTE}item")]
|
|
|
|
public class ItemController : AbpController
|
|
{
|
|
private readonly IItemBasicAppService _itemBasicAppService;
|
|
private readonly IItemPackAppService _itemPackAppService;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="itemBasicAppService"></param>
|
|
/// <param name="itemPackAppService"></param>
|
|
public ItemController(IItemBasicAppService itemBasicAppService
|
|
, IItemPackAppService itemPackAppService
|
|
)
|
|
{
|
|
_itemBasicAppService = itemBasicAppService;
|
|
_itemPackAppService = itemPackAppService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据code获取物品信息
|
|
/// </summary>
|
|
/// <param name="code"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("{code}")]
|
|
|
|
public virtual async Task<ItemBasicDTO> GetAsync(string code)
|
|
{
|
|
var dto = await _itemBasicAppService.GetByCodeAsync(code).ConfigureAwait(false);
|
|
return dto;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据名称获取物品
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("by-name")]
|
|
public virtual async Task<List<ItemBasicDTO>> GetListByNameAsync(string name)
|
|
{
|
|
var dtos = await _itemBasicAppService.GetListByNameAsync(name).ConfigureAwait(false);
|
|
|
|
return dtos;
|
|
}
|
|
}
|
|
|