Browse Source

添加 PDA接口

Agv分支2024-11-19
郑勃旭 4 months ago
parent
commit
d3cbd586aa
  1. 36
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/OperationPacking/ContainerRequestController.cs
  2. 37
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/OperationPacking/SeparationPackingNoteController.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/IIntegrationPackingNoteAppService.cs
  4. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/SeparationPackingNotes/ISeparationPackingNoteAppService.cs
  5. 102
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs
  6. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/SeparationPackingNotes/SeparationPackingNoteAppService.cs

36
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/OperationPacking/ContainerRequestController.cs

@ -0,0 +1,36 @@
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/integration-packing-note")]
public class IntegrationPackingNoteController : AbpController
{
private readonly IIntegrationPackingNoteAppService _integrationPackingNoteAppService;
/// <summary>
///
/// </summary>
/// <param name="integrationPackingNoteAppService"></param>
public IntegrationPackingNoteController(IIntegrationPackingNoteAppService integrationPackingNoteAppService)
{
_integrationPackingNoteAppService = integrationPackingNoteAppService;
}
/// <summary>
///
/// </summary>
/// <param name="input"></param>
[HttpPost("")]
public virtual async Task CreateAsync(IntegrationPackingNoteEditInput input)
{
await _integrationPackingNoteAppService.CreateAsync(input).ConfigureAwait(false);
}
}

37
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/OperationPacking/SeparationPackingNoteController.cs

@ -0,0 +1,37 @@
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/separation-packing-note")]
public class SeparationPackingNoteController : AbpController
{
private readonly ISeparationPackingNoteAppService _separationPackingNoteAppService;
/// <summary>
///
/// </summary>
/// <param name="separationPackingNoteAppService"></param>
public SeparationPackingNoteController(ISeparationPackingNoteAppService separationPackingNoteAppService)
{
_separationPackingNoteAppService = separationPackingNoteAppService;
}
/// <summary>
///
/// </summary>
/// <param name="input"></param>
[HttpPost("")]
public virtual async Task CreateAsync(SeparationPackingNoteEditInput input)
{
await _separationPackingNoteAppService.CreateAsync(input).ConfigureAwait(false);
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/IIntegrationPackingNoteAppService.cs

@ -9,5 +9,5 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IIntegrationPackingNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<IntegrationPackingNoteDTO, SfsStoreRequestInputBase, IntegrationPackingNoteDetailDTO, SfsStoreRequestInputBase> public interface IIntegrationPackingNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<IntegrationPackingNoteDTO, SfsStoreRequestInputBase, IntegrationPackingNoteDetailDTO, SfsStoreRequestInputBase>
{ {
Task<IntegrationPackingNoteDTO> CreateAsync(IntegrationPackingNoteEditInput input);
} }

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/SeparationPackingNotes/ISeparationPackingNoteAppService.cs

@ -9,5 +9,5 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface ISeparationPackingNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<SeparationPackingNoteDTO, SfsStoreRequestInputBase, SeparationPackingNoteDetailDTO, SfsStoreRequestInputBase> public interface ISeparationPackingNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<SeparationPackingNoteDTO, SfsStoreRequestInputBase, SeparationPackingNoteDetailDTO, SfsStoreRequestInputBase>
{ {
Task<SeparationPackingNoteDTO> CreateAsync(SeparationPackingNoteEditInput input);
} }

102
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs

@ -78,105 +78,20 @@ public class IntegrationPackingNoteAppService :
throw new UserFriendlyException($"此物料已经被【任务编号:{outDtos.First().JobNumber}】占用"); throw new UserFriendlyException($"此物料已经被【任务编号:{outDtos.First().JobNumber}】占用");
} }
if (input.Details.Any(p=>p.Qty<=0)) var dto = await base.CreateAsync(input).ConfigureAwait(false);
{
//标签记录
var splitPackingRecDtos = await _splitPackingRecAppService.GetListByToPackingCode(new List<string> { input.PackingCode }).ConfigureAwait(false);
var splitPackingRecDto = splitPackingRecDtos.First();
var inventoryLabelWithoutCodeCreateInput = new InventoryLabelWithoutCodeCreateInput
{
Qty = detailInput.Qty, ItemCode = detailInput.ItemCode,
SupplierCode = detailInput.SupplierCode,
Lot = detailInput.Lot,
Uom = detailInput.Uom,
LocationErpCode = detailInput.LocationErpCode,
ItemDesc1 = detailInput.ItemDesc1,
ArriveDate = detailInput.ArriveDate,
StdPackQty = detailInput.StdPackQty,
ProdLine = string.Empty,
AsnNumber = detailInput.PurchaseInfo_AsnNumber,
ContainerCode = detailInput.ContainerCode,
ExpireDate = detailInput.ExpireDate,
FullBarcodeString = string.Empty,
ItemDesc2 = detailInput.ItemDesc2,
ItemName = detailInput.ItemName,
SupplierName = detailInput.SupplierName,
Remark = detailInput.Remark,
LabelStatus = LabelStatus.Enable,
LabelType = detailInput.LabelType,
PlanArriveDate = detailInput.PlanArriveDate,
PoNumber = detailInput.PurchaseInfo_PoNumber,
ProduceDate = detailInput.ProduceDate,
QLevel = string.Empty,
QualityFile = string.Empty,
RecommendLocationCode = detailInput.RecommendLocationCode,
RpNumber = detailInput.RpNumber,
Shift = string.Empty,
Specifications = string.Empty,
SupplierBatch = detailInput.SupplierBatch,
SupplierItemCode = detailInput.ItemCode,
SupplierItemName = detailInput.SupplierItemName,
SupplierSimpleName = detailInput.SupplierSimpleName,
Team = string.Empty,
};
var inventoryLabelDto=await _inventoryLabelAppService.GenerateAndCreateAsync(inventoryLabelWithoutCodeCreateInput).ConfigureAwait(false);
var splitPackingRecEditInputs = new List<SplitPackingRecEditInput>()
{
new SplitPackingRecEditInput()
{
ItemCode = inventoryLabelDto.ItemCode,
SupplierCode = inventoryLabelDto.SupplierCode,
ToPackingCode = inventoryLabelDto.Code,
FromPackingCode = input.PackingCode,
LocationErpCode = inventoryLabelDto.LocationErpCode,
ItemDesc1 = inventoryLabelDto.ItemDesc1,
FromLot = input.Lot,
ToLot = inventoryLabelDto.Lot,
ArriveDate = inventoryLabelDto.ArriveDate,
ItemName = inventoryLabelDto.ItemName,
ItemDesc2 = inventoryLabelDto.ItemDesc2,
PurchaseInfo_PoNumber = inventoryLabelDto.PoNumber,
LabelType = (EnumLabelType)inventoryLabelDto.LabelType,
RecommendLocationCode = inventoryLabelDto.RecommendLocationCode,
RpNumber = inventoryLabelDto.RpNumber,
SupplierName = inventoryLabelDto.SupplierName,
Remark = inventoryLabelDto.Remark,
FromQty = input.Qty,
ToQty = inventoryLabelDto.Qty,
PurchaseInfo_AsnNumber = inventoryLabelDto.AsnNumber,
ExpireDate = inventoryLabelDto.ExpireDate,
FullBarcodeString = inventoryLabelDto.FullBarcodeString,
SupplierBatch = inventoryLabelDto.SupplierBatch,
ProduceDate = inventoryLabelDto.ProduceDate,
LabelStatus = Basedata.LabelStatus.Enable,
SupplierSimpleName = inventoryLabelDto.SupplierSimpleName,
SupplierItemCode = inventoryLabelDto.SupplierItemCode,
SupplierItemName = inventoryLabelDto.SupplierItemName,
PlanArriveDate = inventoryLabelDto.PlanArriveDate,
FromStdPackQty = input.StdPackQty,
FromUom = input.Uom,
OprType = OprTypeEnum.SplitBox,
ReceiptRecNumber = inventoryLabelDto.RpNumber,
ToStdPackQty = inventoryLabelDto.StdPackQty,
ToUom = inventoryLabelDto.Uom,
TaskOrderNumber = detailInput.TaskOrderNumber,
ArrivalNoticNumber = detailInput.ArrivalNoticNumber,
PutOnShelfNumber = detailInput.PutOnShelfNumber,
}
};
await _splitPackingRecAppService.BatchInsertAsync(splitPackingRecEditInputs).ConfigureAwait(false);
//创建标签
var dto= await base.CreateAsync(input).ConfigureAwait(false);
foreach (var detailInput in input.Details) foreach (var detailInput in input.Details)
{ {
//库存移动 //库存移动
var transferLogEditInput=await BuildTransferLogsAsync(dto, detailInput, splitPackingRecEditInputs.First()).ConfigureAwait(false); var transferLogEditInput =
await BuildTransferLogsAsync(dto, detailInput)
.ConfigureAwait(false);
transferLogEditInputs.Add(transferLogEditInput); transferLogEditInputs.Add(transferLogEditInput);
} }
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false); await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);
return dto;
} }
/// <summary> /// <summary>
@ -233,9 +148,4 @@ public class IntegrationPackingNoteAppService :
return transferLogEditInput; return transferLogEditInput;
} }
private async Task CreateLabelAsync()
{
var batchInsert=await _splitPackingRecAppService.BatchInsertAsync().ConfigureAwait(false);
}
} }

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/SeparationPackingNotes/SeparationPackingNoteAppService.cs

@ -76,7 +76,7 @@ public class SeparationPackingNoteAppService :
if (input.Qty <= 0) if (input.Qty <= 0)
{ {
throw new UserFriendlyException($"数量小于或等于0"); throw new UserFriendlyException($"被拆箱的数量小于或等于0");
} }
var entity = input.ToObject<SeparationPackingNote>(); var entity = input.ToObject<SeparationPackingNote>();
@ -88,8 +88,6 @@ public class SeparationPackingNoteAppService :
entity = await _repository.InsertAsync(entity).ConfigureAwait(false); entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
var dto = entity.ToObject<SeparationPackingNoteDTO>(); var dto = entity.ToObject<SeparationPackingNoteDTO>();
//var dto = await base.CreateAsync(input).ConfigureAwait(false);
foreach (var detailInput in input.Details) foreach (var detailInput in input.Details)
{ {
//创建标签 //创建标签

Loading…
Cancel
Save