|
@ -19,6 +19,7 @@ using Volo.Abp; |
|
|
using Win_in.Sfs.Shared.Application.Contracts; |
|
|
using Win_in.Sfs.Shared.Application.Contracts; |
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
|
|
using Win_in.Sfs.Wms.Inventory.Domain.Acl.ErpLocationItem; |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 库存初始化记录
|
|
|
/// 库存初始化记录
|
|
@ -32,17 +33,20 @@ public class InventoryInitialNoteAppService : |
|
|
private readonly IInventoryInitialNoteManager _inventoryInitialNoteManager; |
|
|
private readonly IInventoryInitialNoteManager _inventoryInitialNoteManager; |
|
|
private readonly IInventoryLabelAppService _inventoryLabelService; |
|
|
private readonly IInventoryLabelAppService _inventoryLabelService; |
|
|
private readonly IItemBasicAppService _itemBasicAppService; |
|
|
private readonly IItemBasicAppService _itemBasicAppService; |
|
|
|
|
|
private readonly IErpLocationItemAclService _erpLocationItemAclService; |
|
|
|
|
|
|
|
|
public InventoryInitialNoteAppService( |
|
|
public InventoryInitialNoteAppService( |
|
|
IInventoryInitialNoteRepository repository |
|
|
IInventoryInitialNoteRepository repository |
|
|
, IInventoryInitialNoteManager inventoryInitialNoteManager |
|
|
, IInventoryInitialNoteManager inventoryInitialNoteManager |
|
|
, IInventoryLabelAppService inventoryLabelService, |
|
|
, IInventoryLabelAppService inventoryLabelService, |
|
|
|
|
|
IErpLocationItemAclService erpLocationItemAclService, |
|
|
IItemBasicAppService itemBasicAppService |
|
|
IItemBasicAppService itemBasicAppService |
|
|
) : base(repository) |
|
|
) : base(repository) |
|
|
{ |
|
|
{ |
|
|
_inventoryInitialNoteManager = inventoryInitialNoteManager; |
|
|
_inventoryInitialNoteManager = inventoryInitialNoteManager; |
|
|
_inventoryLabelService = inventoryLabelService; |
|
|
_inventoryLabelService = inventoryLabelService; |
|
|
_itemBasicAppService = itemBasicAppService; |
|
|
_itemBasicAppService = itemBasicAppService; |
|
|
|
|
|
_erpLocationItemAclService= erpLocationItemAclService; |
|
|
} |
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 数据加工
|
|
|
/// 数据加工
|
|
@ -88,8 +92,8 @@ public class InventoryInitialNoteAppService : |
|
|
await CheckItemBasicAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckItemBasicAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
|
|
|
await CheckErpLocationItemAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static void CheckItemBasic(ItemBasicDTO itemcBasicDto, string itemCode) |
|
|
private static void CheckItemBasic(ItemBasicDTO itemcBasicDto, string itemCode) |
|
@ -130,6 +134,7 @@ public class InventoryInitialNoteAppService : |
|
|
await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private async Task CheckPackingAsync(InventoryInitialNoteImportInput importInput, List<ValidationResult> validationRresult) |
|
|
private async Task CheckPackingAsync(InventoryInitialNoteImportInput importInput, List<ValidationResult> validationRresult) |
|
@ -175,6 +180,23 @@ public class InventoryInitialNoteAppService : |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 校验开账信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="importInput"></param>
|
|
|
|
|
|
/// <param name="validationRresult"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
|
|
|
|
private async Task CheckErpLocationItemAsync(InventoryInitialNoteImportInput importInput, List<ValidationResult> validationRresult) |
|
|
|
|
|
{ |
|
|
|
|
|
var erpLocationItem = await _erpLocationItemAclService.GetFirstAsync(importInput.ItemCode, importInput.LocationErpCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
if (erpLocationItem == null) |
|
|
|
|
|
{ |
|
|
|
|
|
validationRresult.Add("ERP料号", $"未找到物品【{importInput.ItemCode}】与ERP储位【{importInput.LocationErpCode}】的开账信息"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected async Task CheckLocationAsync(InventoryInitialNoteImportInput importInput, List<ValidationResult> validationRresult) |
|
|
protected async Task CheckLocationAsync(InventoryInitialNoteImportInput importInput, List<ValidationResult> validationRresult) |
|
|
{ |
|
|
{ |
|
|
var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false); |
|
|
var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false); |
|
|