Browse Source

提交

Agv分支2024-11-19
赵新宇 4 months ago
parent
commit
02f8833b4e
  1. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  2. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs
  4. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs
  5. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs
  6. 44
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs
  7. 216
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs

@ -942,7 +942,7 @@ public class AssembleIssueJobAppService
if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode)) if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode))
{ {
//库移的最终目标 挪到 推荐的目标 //库移的最终目标 挪到 推荐的目标
var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibFromLocationCode).ConfigureAwait(false); var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
var toloc =await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false); var toloc =await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false);
detailDto.InjectFrom(detail); detailDto.InjectFrom(detail);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs

@ -957,7 +957,7 @@ public class CoatingIssueJobAppService
if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode)) if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode))
{ {
//库移的最终目标 挪到 推荐的目标 //库移的最终目标 挪到 推荐的目标
var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibFromLocationCode).ConfigureAwait(false); var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false); var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false);
detailDto.InjectFrom(detail); detailDto.InjectFrom(detail);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs

@ -914,7 +914,7 @@ public class InjectionIssueJobAppService
if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode)) if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode))
{ {
//库移的最终目标 挪到 推荐的目标 //库移的最终目标 挪到 推荐的目标
var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibFromLocationCode).ConfigureAwait(false); var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false); var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false);
detailDto.InjectFrom(detail); detailDto.InjectFrom(detail);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs

@ -918,7 +918,7 @@ public class KittingIssueJobAppService
if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode)) if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode))
{ {
//库移的最终目标 挪到 推荐的目标 //库移的最终目标 挪到 推荐的目标
var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibFromLocationCode).ConfigureAwait(false); var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false); var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false);
detailDto.InjectFrom(detail); detailDto.InjectFrom(detail);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs

@ -914,7 +914,7 @@ public class SparePartIssueJobAppService
if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode)) if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode))
{ {
//库移的最终目标 挪到 推荐的目标 //库移的最终目标 挪到 推荐的目标
var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibFromLocationCode).ConfigureAwait(false); var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false); var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false);
detailDto.InjectFrom(detail); detailDto.InjectFrom(detail);

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

@ -1,7 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityServer4.Models;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -27,11 +31,49 @@ public class IntegrationPackingNoteAppService :
IIntegrationPackingNoteAppService IIntegrationPackingNoteAppService
{ {
private readonly IIntegrationPackingNoteManager _integrationPackingNoteManager; private readonly IIntegrationPackingNoteManager _integrationPackingNoteManager;
private readonly IBalanceAppService _balanceAppService;
public IntegrationPackingNoteAppService( public IntegrationPackingNoteAppService(
IIntegrationPackingNoteRepository repository, IIntegrationPackingNoteRepository repository,
IIntegrationPackingNoteManager integrationPackingNoteManager) : base(repository) IIntegrationPackingNoteManager integrationPackingNoteManager, IBalanceAppService balanceAppService) : base(repository)
{ {
_integrationPackingNoteManager = integrationPackingNoteManager; _integrationPackingNoteManager = integrationPackingNoteManager;
_balanceAppService = balanceAppService;
}
[HttpPost("")]
public override Task<IntegrationPackingNoteDTO> CreateAsync(IntegrationPackingNoteEditInput input)
{
//标签记录
//库存移动
//创建标签
return base.CreateAsync(input);
}
/// <summary>
/// 构造 库存转移日志实体
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
private List<TransferLogEditInput> BuildTransferLogs(IntegrationPackingNoteDTO dto)
{
var transferLogCreateInputs = new List<TransferLogEditInput>();
//foreach (var detail in dto.Details.Where(detail => detail.Qty != 0))
//{
// var transferLog = ObjectMapper.Map<DeliverNoteDetail, TransferLogEditInput>(detail);
// transferLog.TransType = TransType;
// transferLog.TransSubType = ConvertToTransSubType(deliverNote.DeliverRequestType);
// transferLog.Worker = deliverNote.Worker;
// transferLog.DocNumber = deliverNote.Number;
// transferLog.JobNumber = deliverNote.JobNumber;
// transferLogCreateInputs.Add(transferLog);
//}
return transferLogCreateInputs;
} }
} }

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

@ -1,19 +1,19 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
using System.Text;
using System.Text.Json; using System.Text.Json;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Omu.ValueInjecter; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Basedata.Application; using Volo.Abp.Uow;
using Win_in.Sfs.Basedata;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain.Shared; using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Basedata.SplitPackings.Commons; using Win_in.Sfs.Basedata.SplitPackings.Commons;
@ -21,17 +21,10 @@ using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs.proxy;
using Win_in.Sfs.Wms.Store.Options; using Win_in.Sfs.Wms.Store.Options;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp.ObjectMapping;
using NUglify.Helpers;
using Volo.Abp.Uow;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
@ -63,6 +56,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
private readonly ILogger<TransferNoteAppService> _logger; private readonly ILogger<TransferNoteAppService> _logger;
private readonly IPostionLocationAppService _postionLocationAppService; private readonly IPostionLocationAppService _postionLocationAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IProductionLineAppService _productionLineAppService; private readonly IProductionLineAppService _productionLineAppService;
@ -122,34 +116,36 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
{ {
if (transferNote.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) //储位内调拨 if (transferNote.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) //储位内调拨
{ {
transferNote.Type = EnumTransSubType.Transfer_Inside.ToString();//重点 需要转换 transferNote.Type = EnumTransSubType.Transfer_Inside.ToString(); //重点 需要转换
foreach (var detail in transferNote.Details) foreach (var detail in transferNote.Details)
{ {
var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode,
detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false);
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode)
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); .ConfigureAwait(false);
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode)
.ConfigureAwait(false);
CheckLocation(toLocationDto, detail); CheckLocation(toLocationDto, detail);
CheckFromLocation(fromLocationDto, detail); CheckFromLocation(fromLocationDto, detail);
await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false); await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false);
if (toLocationDto.Type != fromLocationDto.Type) if (toLocationDto.Type != fromLocationDto.Type)
{ {
throw new UserFriendlyException($"来源库位与目标库位类型不一致"); throw new UserFriendlyException("来源库位与目标库位类型不一致");
} }
detail.OnTheWayLocationCode = bool.FalseString; detail.OnTheWayLocationCode = bool.FalseString;
detail.ItemCode=balanceDto.ItemCode; detail.ItemCode = balanceDto.ItemCode;
detail.ArriveDate=balanceDto.ArriveDate; detail.ArriveDate = balanceDto.ArriveDate;
detail.ItemDesc1=balanceDto.ItemDesc1; detail.ItemDesc1 = balanceDto.ItemDesc1;
detail.ItemDesc2=balanceDto.ItemDesc2; detail.ItemDesc2 = balanceDto.ItemDesc2;
detail.ItemName=balanceDto.ItemName; detail.ItemName = balanceDto.ItemName;
detail.ProduceDate=balanceDto.ProduceDate; detail.ProduceDate = balanceDto.ProduceDate;
detail.Qty=balanceDto.Qty; detail.Qty = balanceDto.Qty;
detail.Uom=balanceDto.Uom; detail.Uom = balanceDto.Uom;
detail.ExpireDate=balanceDto.ExpireDate; detail.ExpireDate = balanceDto.ExpireDate;
detail.StdPackQty=balanceDto.StdPackQty; detail.StdPackQty = balanceDto.StdPackQty;
detail.SupplierBatch=balanceDto.SupplierBatch; detail.SupplierBatch = balanceDto.SupplierBatch;
detail.FromLocationArea = balanceDto.LocationArea; detail.FromLocationArea = balanceDto.LocationArea;
detail.FromContainerCode = balanceDto.ContainerCode; detail.FromContainerCode = balanceDto.ContainerCode;
@ -300,30 +296,34 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Inside, includeDetails, return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Inside, includeDetails,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);
} }
[HttpPost("get-Injection-list")] [HttpPost("get-Injection-list")]
public virtual async Task<PagedResultDto<TransferNoteDTO>> GetInjectionTransferListAsync( public virtual async Task<PagedResultDto<TransferNoteDTO>> GetInjectionTransferListAsync(
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Injection, includeDetails, return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Injection, includeDetails,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);
} }
[HttpPost("get-coating-list")] [HttpPost("get-coating-list")]
public virtual async Task<PagedResultDto<TransferNoteDTO>> GetCoatingTransferListAsync( public virtual async Task<PagedResultDto<TransferNoteDTO>> GetCoatingTransferListAsync(
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Coating, includeDetails, return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Coating, includeDetails,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);
} }
[HttpPost("get-assemble-list")] [HttpPost("get-assemble-list")]
public virtual async Task<PagedResultDto<TransferNoteDTO>> GetAssembleTransferListAsync( public virtual async Task<PagedResultDto<TransferNoteDTO>> GetAssembleTransferListAsync(
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Assemble, includeDetails, return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Assemble, includeDetails,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);
} }
/// <summary> /// <summary>
/// 按条件获取客户储位间调拨的分页列表 /// 按条件获取客户储位间调拨的分页列表
/// request sample /// request sample
@ -376,10 +376,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
{ {
sfsRequestDTO.Condition.Filters.Add(new Filter sfsRequestDTO.Condition.Filters.Add(new Filter
{ {
Action = "==", Action = "==", Column = "Type", Logic = EnumFilterLogic.And.ToString(), Value = type.ToString()
Column = "Type",
Logic = EnumFilterLogic.And.ToString(),
Value = type.ToString()
}); });
var expression = sfsRequestDTO.Condition.Filters?.Count > 0 var expression = sfsRequestDTO.Condition.Filters?.Count > 0
@ -399,7 +396,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
/// <returns></returns> /// <returns></returns>
[HttpPost("")] [HttpPost("")]
public override async Task<TransferNoteDTO> CreateAsync(TransferNoteEditInput input) public override async Task<TransferNoteDTO> CreateAsync(TransferNoteEditInput input)
{ {
var entity = ObjectMapper.Map<TransferNoteEditInput, TransferNote>(input); var entity = ObjectMapper.Map<TransferNoteEditInput, TransferNote>(input);
foreach (var detail in entity.Details) foreach (var detail in entity.Details)
@ -409,7 +406,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false); await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false);
} }
} }
entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
entity = await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity); var dto = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity);
@ -437,6 +435,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false); await CheckPackingCodeAsync(detail.FromPackingCode).ConfigureAwait(false);
} }
} }
resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false)); resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false));
_ = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity); _ = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity);
} }
@ -445,7 +444,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
} }
/// <summary> /// <summary>
/// 校验箱码 /// 校验箱码
/// </summary> /// </summary>
/// <param name="packingCode"></param> /// <param name="packingCode"></param>
/// <returns></returns> /// <returns></returns>
@ -463,8 +462,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
} }
/// <summary> /// <summary>
/// 确认对应的记录单 /// 确认对应的记录单
/// </summary> /// </summary>
@ -493,22 +490,25 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
/// <summary> /// <summary>
/// 插入拆箱记录表 /// 插入拆箱记录表
/// </summary> /// </summary>
/// <param name="transferNoteEditInput"></param> /// <param name="transferNoteEditInput"></param>
/// <returns></returns> /// <returns></returns>
private async Task<bool> WriteSplitPackingRec(TransferNoteEditInput transferNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput = null) private async Task<bool> WriteSplitPackingRec(TransferNoteEditInput transferNoteEditInput,
SplitPacking_UpdateJobDetailInput updateJobDetailInput = null)
{ {
var recLst = new List<SplitPackingRecEditInput>();
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>();
foreach (var inputDetail in transferNoteEditInput.Details) foreach (var inputDetail in transferNoteEditInput.Details)
{ {
bool qtyEnough = await _splitPackingRecAppService.CheckSplitNum(inputDetail.FromPackingCode, inputDetail.Qty).ConfigureAwait(false); var qtyEnough = await _splitPackingRecAppService.CheckSplitNum(inputDetail.FromPackingCode, inputDetail.Qty)
.ConfigureAwait(false);
if (qtyEnough == false) if (qtyEnough == false)
{ {
throw new UserFriendlyException($"[WriteSplitPackingRec]拆箱记录表数量不足:FromPackingCode={inputDetail.FromPackingCode},Qty={inputDetail.Qty}"); throw new UserFriendlyException(
$"[WriteSplitPackingRec]拆箱记录表数量不足:FromPackingCode={inputDetail.FromPackingCode},Qty={inputDetail.Qty}");
} }
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput();
var packRec = new SplitPackingRecEditInput();
packRec.OprType = OprTypeEnum.SplitBox; packRec.OprType = OprTypeEnum.SplitBox;
packRec.FromPackingCode = inputDetail.FromPackingCode; packRec.FromPackingCode = inputDetail.FromPackingCode;
@ -539,8 +539,10 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
packRec.FromQty = updateJobDetailInput.FromQty; packRec.FromQty = updateJobDetailInput.FromQty;
packRec.ToQty = updateJobDetailInput.ToQty; packRec.ToQty = updateJobDetailInput.ToQty;
} }
//根据箱码在inventoryLabel取采购订单、供应商发货单 //根据箱码在inventoryLabel取采购订单、供应商发货单
var inventoryLabelDto = await _inventoryLabelAppService.GetByCodeAsync(inputDetail.FromPackingCode).ConfigureAwait(false); var inventoryLabelDto = await _inventoryLabelAppService.GetByCodeAsync(inputDetail.FromPackingCode)
.ConfigureAwait(false);
if (inventoryLabelDto != null) if (inventoryLabelDto != null)
{ {
packRec.PurchaseInfo_PoNumber = inventoryLabelDto.PoNumber; packRec.PurchaseInfo_PoNumber = inventoryLabelDto.PoNumber;
@ -548,13 +550,14 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
//packRec.PurchaseInfo_SupplierCode = inventoryLabelDto.SupplierCode; //packRec.PurchaseInfo_SupplierCode = inventoryLabelDto.SupplierCode;
#region InventoryLabel兼容成员 #region InventoryLabel兼容成员
var inputObj = inventoryLabelDto; var inputObj = inventoryLabelDto;
packRec.FullBarcodeString = inputObj.FullBarcodeString; packRec.FullBarcodeString = inputObj.FullBarcodeString;
packRec.SupplierBatch = inputObj.SupplierBatch; packRec.SupplierBatch = inputObj.SupplierBatch;
packRec.ArriveDate = inputObj.ArriveDate; packRec.ArriveDate = inputObj.ArriveDate;
packRec.ProduceDate = inputObj.ProduceDate; packRec.ProduceDate = inputObj.ProduceDate;
packRec.ExpireDate = inputObj.ExpireDate; packRec.ExpireDate = inputObj.ExpireDate;
packRec.LabelStatus = (Win_in.Sfs.Basedata.LabelStatus)((int)inputObj.LabelStatus); packRec.LabelStatus = (LabelStatus)(int)inputObj.LabelStatus;
packRec.RecommendLocationCode = inputObj.RecommendLocationCode; packRec.RecommendLocationCode = inputObj.RecommendLocationCode;
packRec.LocationErpCode = inputObj.LocationErpCode; packRec.LocationErpCode = inputObj.LocationErpCode;
//packRec.ContainerCode = inputObj.ContainerCode; //packRec.ContainerCode = inputObj.ContainerCode;
@ -573,37 +576,46 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
packRec.SupplierItemCode = inputObj.SupplierItemCode; packRec.SupplierItemCode = inputObj.SupplierItemCode;
packRec.SupplierItemName = inputObj.SupplierItemName; packRec.SupplierItemName = inputObj.SupplierItemName;
packRec.PlanArriveDate = inputObj.PlanArriveDate; packRec.PlanArriveDate = inputObj.PlanArriveDate;
#endregion #endregion
} }
recLst.Add(packRec); recLst.Add(packRec);
} }
var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false);
return ret; return ret;
} }
/// <summary> /// <summary>
/// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表 /// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
/// </summary> /// </summary>
/// <param name="transferNoteEditInput"></param> /// <param name="transferNoteEditInput"></param>
/// <param name="updateJobDetailInput"></param> /// <param name="updateJobDetailInput"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("split-packing-purchase-receipt")] [HttpPost("split-packing-purchase-receipt")]
public async Task<bool> SplitPacking_PurchaseReceiptAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) public async Task<bool> SplitPacking_PurchaseReceiptAsync(TransferNoteEditInput transferNoteEditInput,
[FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
{ {
var jobRet = await _purchaseReceiptJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); var jobRet = await _purchaseReceiptJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput)
var requestRet = await _purchaseReceiptRequestAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput, jobRet.PurchaseReceiptRequestNumber).ConfigureAwait(false); .ConfigureAwait(false);
bool ret = await WriteSplitPackingRec(transferNoteEditInput, updateJobDetailInput).ConfigureAwait(false); //采购收货-目检-拆箱时,还没有入库,不涉及库存操作 var requestRet = await _purchaseReceiptRequestAppService
.SaveDetail_SplitPackingAsync(updateJobDetailInput, jobRet.PurchaseReceiptRequestNumber)
.ConfigureAwait(false);
var ret = await WriteSplitPackingRec(transferNoteEditInput, updateJobDetailInput)
.ConfigureAwait(false); //采购收货-目检-拆箱时,还没有入库,不涉及库存操作
return ret; return ret;
} }
/// <summary> /// <summary>
/// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表) /// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表)
/// </summary> /// </summary>
/// <param name="transferNoteEditInput"></param> /// <param name="transferNoteEditInput"></param>
/// <param name="updateJobDetailInput"></param> /// <param name="updateJobDetailInput"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("split-packing-inspect")] [HttpPost("split-packing-inspect")]
public async Task<TransferNoteDTO> SplitPacking_InspectAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) public async Task<TransferNoteDTO> SplitPacking_InspectAsync(TransferNoteEditInput transferNoteEditInput,
[FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
{ {
//SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput(); //SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
//newInput.Number = updateJobDetailInput.Number; //newInput.Number = updateJobDetailInput.Number;
@ -614,21 +626,23 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
//newInput.FromLocationCode = transferNoteEditInput.Details[0].FromLocationCode; //newInput.FromLocationCode = transferNoteEditInput.Details[0].FromLocationCode;
//newInput.ToLocationCode = transferNoteEditInput.Details[0].ToLocationCode; //newInput.ToLocationCode = transferNoteEditInput.Details[0].ToLocationCode;
//var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false); //var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false);
var jobRet = await _inspectJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); var jobRet = await _inspectJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput)
.ConfigureAwait(false);
var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false); //库存操作 var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false); //库存操作
return ret; return ret;
} }
/// <summary> /// <summary>
/// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??) /// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
/// </summary> /// </summary>
/// <param name="transferNoteEditInput"></param> /// <param name="transferNoteEditInput"></param>
/// <param name="updateJobDetailInput"></param> /// <param name="updateJobDetailInput"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("split-packing-issue")] [HttpPost("split-packing-issue")]
public async Task<TransferNoteDTO> SplitPacking_IssueAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) public async Task<TransferNoteDTO> SplitPacking_IssueAsync(TransferNoteEditInput transferNoteEditInput,
[FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
{ {
SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput(); var newInput = new SplitPacking_UpdateDetailInput();
newInput.Number = updateJobDetailInput.Number; newInput.Number = updateJobDetailInput.Number;
newInput.FromPackingCode = updateJobDetailInput.FromPackingCode; newInput.FromPackingCode = updateJobDetailInput.FromPackingCode;
newInput.FromQty = updateJobDetailInput.FromQty; newInput.FromQty = updateJobDetailInput.FromQty;
@ -643,16 +657,17 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
} }
/// <summary> /// <summary>
/// 拆箱,预计出表存在数据时不允许办理 /// 拆箱,预计出表存在数据时不允许办理
/// </summary> /// </summary>
/// <param name="transferNoteEditInput"></param> /// <param name="transferNoteEditInput"></param>
/// <param name="updateJobDetailInputBase"></param> /// <param name="updateJobDetailInputBase"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("split-packing-check-expect-out")] [HttpPost("split-packing-check-expect-out")]
public async Task<TransferNoteDTO> SplitPackingCheckExpectOutAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInputBase updateJobDetailInputBase) public async Task<TransferNoteDTO> SplitPackingCheckExpectOutAsync(TransferNoteEditInput transferNoteEditInput,
[FromQuery] SplitPacking_UpdateJobDetailInputBase updateJobDetailInputBase)
{ {
var detailObj = transferNoteEditInput.Details[0]; var detailObj = transferNoteEditInput.Details[0];
SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput(); var newInput = new SplitPacking_UpdateDetailInput();
newInput.Number = updateJobDetailInputBase.Number; newInput.Number = updateJobDetailInputBase.Number;
newInput.FromPackingCode = detailObj.FromPackingCode; newInput.FromPackingCode = detailObj.FromPackingCode;
newInput.FromQty = detailObj.Qty; newInput.FromQty = detailObj.Qty;
@ -663,21 +678,14 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
var expectOutLst = await _expectOutAppService.GetListByJobNumberAsync(newInput).ConfigureAwait(false); var expectOutLst = await _expectOutAppService.GetListByJobNumberAsync(newInput).ConfigureAwait(false);
if (expectOutLst.Count > 0) if (expectOutLst.Count > 0)
{ {
throw new UserFriendlyException($"预计出表存在数据,不允许办理拆箱:JobNumber={newInput.Number}|PackingCode={newInput.FromPackingCode}|Qty={newInput.FromQty}|LocationCode={newInput.FromLocationCode}"); throw new UserFriendlyException(
$"预计出表存在数据,不允许办理拆箱:JobNumber={newInput.Number}|PackingCode={newInput.FromPackingCode}|Qty={newInput.FromQty}|LocationCode={newInput.FromLocationCode}");
} }
var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false); var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false);
return ret; return ret;
} }
[HttpPost("call-back-agv")] [HttpPost("call-back-agv")]
public async Task<AgvResultObject> CallBackAgvAsync(AgvRequestDto request) public async Task<AgvResultObject> CallBackAgvAsync(AgvRequestDto request)
@ -685,15 +693,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
var json = JsonSerializer.Serialize(request); var json = JsonSerializer.Serialize(request);
var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); var flag = DateTime.Now.ToString("yyyyMMddHHmmss");
_logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json);
#if DEBUG
#endif
var errors = new List<string>(); var errors = new List<string>();
var ret = new AgvResultObject var ret = new AgvResultObject { Code = "0", Message = "OK", ReqCode = "" };
{
Code = "0",
Message = "OK",
ReqCode = "",
};
using var unitOfWork = _unitOfWorkManager.Begin(); using var unitOfWork = _unitOfWorkManager.Begin();
try try
{ {
@ -703,18 +704,18 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
foreach (var detail in notes) foreach (var detail in notes)
{ {
TransferNoteEditInput transfer = new TransferNoteEditInput(); var transfer = new TransferNoteEditInput();
transfer.CallJobNumber = detail.OrderNum; transfer.CallJobNumber = detail.OrderNum;
transfer.Worker = "Agv"; transfer.Worker = "Agv";
transfer.UseOnTheWayLocation = false; transfer.UseOnTheWayLocation = false;
List<TransferNoteDetailInput> transferNoteDetailInputs = new List<TransferNoteDetailInput>(); var transferNoteDetailInputs = new List<TransferNoteDetailInput>();
TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); var detailInput = new TransferNoteDetailInput();
LocationDTO fromlocation = await _locationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); var fromlocation =
await _locationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false);
if (fromlocation == null) if (fromlocation == null)
{ {
errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); errors.Add($"来源起始点{detail.BeginPosition}库位没查到");
@ -764,17 +765,17 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
detailInput.ItemCode = item.Code; detailInput.ItemCode = item.Code;
detailInput.Uom = item.BasicUom; detailInput.Uom = item.BasicUom;
detailInput.ItemName = item.Name; detailInput.ItemName = item.Name;
detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1:string.Empty; detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty;
} }
if (errors.Count > 0) if (errors.Count > 0)
{ {
return ret = new AgvResultObject() return ret = new AgvResultObject
{ {
Code = "-1", Code = "-1", ReqCode = "", Message = string.Join(",", errors.ToArray())
ReqCode = "",
Message = string.Join(",", errors.ToArray())
}; };
} }
detailInput.ToLocationCode = tolocation.Code; detailInput.ToLocationCode = tolocation.Code;
detailInput.ToLocationGroup = tolocation.LocationGroupCode; detailInput.ToLocationGroup = tolocation.LocationGroupCode;
detailInput.ToLocationArea = tolocation.AreaCode; detailInput.ToLocationArea = tolocation.AreaCode;
@ -783,7 +784,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
detailInput.FromStatus = tolocation.DefaultInventoryStatus; detailInput.FromStatus = tolocation.DefaultInventoryStatus;
detailInput.Qty = detail.MatQty; detailInput.Qty = detail.MatQty;
detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty;
detailInput.ToPackingCode = string.Empty; detailInput.ToPackingCode = string.Empty;
@ -796,7 +796,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
detailInput.Qty = detail.MatQty; detailInput.Qty = detail.MatQty;
detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty;
detailInput.FromPackingCode = string.Empty; detailInput.FromPackingCode = string.Empty;
transfer.Details.Add(detailInput); transfer.Details.Add(detailInput);
@ -810,34 +810,16 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
} }
catch (Exception ex) catch (Exception ex)
{ {
ret = new AgvResultObject ret = new AgvResultObject { Code = "-1", ReqCode = "", Message = ex.Message };
{
Code = "-1",
ReqCode = "",
Message = ex.Message
};
await unitOfWork.RollbackAsync().ConfigureAwait(false); await unitOfWork.RollbackAsync().ConfigureAwait(false);
} }
if (errors.Count > 0) if (errors.Count > 0)
{ {
ret = new AgvResultObject ret = new AgvResultObject { Code = "-1", Message = string.Join(",", errors.ToArray()), ReqCode = "" };
{
Code = "-1",
Message = string.Join(",", errors.ToArray()),
ReqCode = ""
};
await unitOfWork.RollbackAsync().ConfigureAwait(false); await unitOfWork.RollbackAsync().ConfigureAwait(false);
} }
return ret; return ret;
} }
} }

Loading…
Cancel
Save