diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index af3d7252e..40879dd96 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -83,8 +83,6 @@ public class AssembleIssueJobAppService [HttpPost("add-many")] public override async Task> CreateManyAsync(List inputs) { - - foreach (var input in inputs) { await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false); @@ -93,8 +91,11 @@ public class AssembleIssueJobAppService if (dimensionalStorehouseflag) { input.IsClaims = true; - input.ClaimsUserId = "LITK"; //todo - input.ClaimsUserName = "LITK"; //todo + input.ClaimsUserId = string.IsNullOrEmpty(_options.Value.StereosUser) ? "LYF" : _options.Value.StereosUser; + input.ClaimsUserName = string.IsNullOrEmpty(_options.Value.StereosPassword) ? "LYF" : _options.Value.StereosPassword; + + + } } var assembleIssueJobDtos = await base.CreateManyAsync(inputs).ConfigureAwait(false); @@ -102,9 +103,7 @@ public class AssembleIssueJobAppService { await CheckDimensionalStorehouseAsync(assembleIssueJobDto).ConfigureAwait(false); } - return assembleIssueJobDtos; - } @@ -304,9 +303,9 @@ public class AssembleIssueJobAppService var assembleIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); assembleIssueJob.JobStatus = EnumJobStatus.Doing; - assembleIssueJob.ClaimsUserId = "LITK"; - assembleIssueJob.ClaimsUserName = "LITK"; - + assembleIssueJob.ClaimsUserId = string.IsNullOrEmpty( _options.Value.StereosUser)? "LYF" : _options.Value.StereosUser; + assembleIssueJob.ClaimsUserName = string.IsNullOrEmpty(_options.Value.StereosPassword) ? "LYF" : _options.Value.StereosPassword; + //if (assembleIssueJob.IsClaims) //{ @@ -330,6 +329,8 @@ public class AssembleIssueJobAppService issueJobDetail.HandledFromQty = entityDetail.HandledFromQty; issueJobDetail.HandledToQty = entityDetail.HandledToQty; + + issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; assembleIssueJob.Details = new EditableList { issueJobDetail }; @@ -550,12 +551,18 @@ public class AssembleIssueJobAppService var ret = new ReusltObject { Code = int.Parse(GaoTongResultStatus.Success), OperateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Message = "操作成功" }; try { + + if (input.Jobs.Count > 0) { var jobs = input.Jobs; var numbers = jobs.Select(p => p.JobNumber); var query = _repository.WithDetails() - .Where(p => numbers.Contains(p.Number)); + .Where(p => numbers.Contains(p.Number) && p.JobStatus != EnumJobStatus.Done); + + + + var entities = query.ToList(); if (entities.Count == 0) { @@ -614,16 +621,24 @@ public class AssembleIssueJobAppService dto.HandledToLocationGroup = toloc.LocationGroupCode; dto.HandledToLocationArea = toloc.AreaCode; dto.HandledToLocationErpCode = toloc.ErpLocationCode; + dto.HandledToLot = string.Empty; + dto.HandledToWarehouseCode = toloc.WarehouseCode; + dto.HandledToQty = detail.Qty; + dto.HandledToLot = string.Empty; + dto.HandledToPackingCode = string.Empty; + dto.HandledFromWarehouseCode=fromloc.WarehouseCode; dto.HandledFromLocationCode = fromloc.Code; dto.HandledFromLocationGroup = fromloc.LocationGroupCode; dto.HandledFromLocationArea = fromloc.AreaCode; dto.HandledFromLocationErpCode = fromloc.ErpLocationCode; - - - - //dto.HandledFromPackingCode = ""; + dto.HandledFromQty = detail.Qty; + dto.HandledFromLot = string.Empty; + dto.HandledFromPackingCode = string.Empty; + + + details.Add(dto); await ExecuteDetailExtAsync(itm.Id, entity.Id, dto).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs index 6aaab4364..5eecd553e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs @@ -19,6 +19,7 @@ using Volo.Abp; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Wms.Inventory.Domain.Acl.ErpLocationItem; /// /// 库存初始化记录 @@ -32,17 +33,20 @@ public class InventoryInitialNoteAppService : private readonly IInventoryInitialNoteManager _inventoryInitialNoteManager; private readonly IInventoryLabelAppService _inventoryLabelService; private readonly IItemBasicAppService _itemBasicAppService; + private readonly IErpLocationItemAclService _erpLocationItemAclService; public InventoryInitialNoteAppService( IInventoryInitialNoteRepository repository , IInventoryInitialNoteManager inventoryInitialNoteManager , IInventoryLabelAppService inventoryLabelService, + IErpLocationItemAclService erpLocationItemAclService, IItemBasicAppService itemBasicAppService ) : base(repository) { _inventoryInitialNoteManager = inventoryInitialNoteManager; _inventoryLabelService = inventoryLabelService; _itemBasicAppService = itemBasicAppService; + _erpLocationItemAclService= erpLocationItemAclService; } /// /// 数据加工 @@ -88,8 +92,8 @@ public class InventoryInitialNoteAppService : await CheckItemBasicAsync(importInput, validationRresult).ConfigureAwait(false); await CheckLocationAsync(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) @@ -130,6 +134,7 @@ public class InventoryInitialNoteAppService : await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); + } private async Task CheckPackingAsync(InventoryInitialNoteImportInput importInput, List validationRresult) @@ -175,6 +180,23 @@ public class InventoryInitialNoteAppService : } } + /// + /// 校验开账信息 + /// + /// + /// + /// + /// + private async Task CheckErpLocationItemAsync(InventoryInitialNoteImportInput importInput, List 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 validationRresult) { var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Options/RestoOptions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Options/RestoOptions.cs index 95ecb71d4..e4fbb583f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Options/RestoOptions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Options/RestoOptions.cs @@ -15,9 +15,15 @@ public class RestoOptions public string Password { set; get; } // 令牌 public string Token { set; get; } - + // 路径 public string Path { set; get; } + //立体库用户名 + public string StereosUser { set; get; } + + //立体库密码 + public string StereosPassword { set; get; } + }