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.
69 lines
2.2 KiB
69 lines
2.2 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.Wms.Store.Application.Contracts;
|
|
|
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route($"{PdaHostConst.ROOT_ROUTE}store/purchase-receipt")]
|
|
|
|
public class PurchaseReceiptNoteController : AbpController
|
|
{
|
|
private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="purchaseReceiptNoteAppService"></param>
|
|
public PurchaseReceiptNoteController(IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService)
|
|
{
|
|
_purchaseReceiptNoteAppService = purchaseReceiptNoteAppService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建采购收货记录
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("")]
|
|
public virtual async Task CreateAsync(PurchaseReceiptNoteEditInput input)
|
|
{
|
|
await _purchaseReceiptNoteAppService.CreateAsync(input).ConfigureAwait(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据 物品 箱 获取收货记录
|
|
/// </summary>
|
|
/// <param name="itemCode"></param>
|
|
/// <param name="packingCode"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("detail-by-item-and-packing")]
|
|
public virtual async Task<PurchaseReceiptNoteDetailDTO> GetDetailByItemAndPackingAsync(string itemCode,
|
|
string packingCode)
|
|
{
|
|
return await _purchaseReceiptNoteAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取收货记录下所有箱码
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost("get-packing-by-purchase-recepit-note")]
|
|
public virtual async Task<List<string>> GetPackingCodeByPurchaseRecepitNote(string poNumber)
|
|
{
|
|
var dtos = await _purchaseReceiptNoteAppService.GetListByPoNumberAsync(poNumber).ConfigureAwait(false);
|
|
var packingCodes=new List<string>();
|
|
foreach (var dto in dtos)
|
|
{
|
|
packingCodes.AddRange(dto.Details.Select(p=>p.PackingCode));
|
|
}
|
|
|
|
return packingCodes.Distinct().ToList();
|
|
}
|
|
}
|
|
|