Browse Source

添加库位判断完工转储类型

Agv分支2024-11-19
赵新宇 4 months ago
parent
commit
88fa0d0ef9
  1. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs
  2. 62
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs

@ -111,6 +111,7 @@ public class ProductionLineItemAppService :
{
validationRresult.Add(new ValidationResult("[来源]成品/半成品库位 或 [来源]原材料库位 或 [完工]线边库位 不能都为空"));
}
}
[HttpPost("get-by-product")]
public virtual async Task<List<ProductionLineItemDTO>> GetByProductLineCodeAsync(string productLineCode)
{

62
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

@ -129,6 +129,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
CheckLocation(toLocationDto, detail);
CheckFromLocation(fromLocationDto, detail);
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false);
if (toLocationDto.Type != fromLocationDto.Type)
{
throw new UserFriendlyException($"来源库位与目标库位类型不一致");
@ -398,7 +399,14 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
{
var entity = ObjectMapper.Map<TransferNoteEditInput, TransferNote>(input);
entity=await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
foreach (var detail in entity.Details)
{
if (!string.IsNullOrEmpty(detail.FromPackingCode))
{
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false);
}
}
entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity);
@ -419,6 +427,13 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
foreach (var entity in entitys)
{
foreach (var detail in entity.Details)
{
if (!string.IsNullOrEmpty(detail.FromPackingCode))
{
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false);
}
}
resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false));
_ = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity);
}
@ -426,6 +441,24 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
return ObjectMapper.Map<List<TransferNote>, List<TransferNoteDTO>>(resultEntity);
}
/// <summary>
/// 校验箱码
/// </summary>
/// <param name="packingCode"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task CheckPackingCode(string packingCode)
{
var packingcode = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false);
if (packingcode != null)
{
throw new UserFriendlyException($"箱码{packingCode}在预计出中已存在!");
}
}
/// <summary>
/// 确认对应的记录单
/// </summary>
@ -703,7 +736,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
{
TransferNoteEditInput transfer = new TransferNoteEditInput();
transfer.CallJobNumber = detail.OrderNum;
transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString();
transfer.Worker = "Agv";
transfer.UseOnTheWayLocation = false;
List<TransferNoteDetailInput> transferNoteDetailInputs = new List<TransferNoteDetailInput>();
@ -724,19 +757,18 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
{
errors.Add($"结束点{detail.EndPosition}库位没查到");
}
// if(tolocation.WorkGroupCode)
// tolocation.LocationGroupCode=
//APA-KWZ
//PPA-KWZ
//IPA-KWZ
switch (tolocation.WarehouseCode)
{
case "APA-KWZ":// 装配线边库位组
transfer.Type = EnumTransSubType.Transfer_Assemble.ToString();
break;
case "PPA-KWZ"://涂装线边库位组
transfer.Type = EnumTransSubType.Transfer_Coating.ToString();
break;
case "IPA-KWZ"://注塑线边库位组
transfer.Type = EnumTransSubType.Transfer_Injection.ToString();
break;
}
var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false);
if (item == null)

Loading…
Cancel
Save