From 6240b94135e75c5352db36222ae6a5f66b95a8e4 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Fri, 17 May 2024 11:15:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E9=80=80=E5=BA=93?= =?UTF-8?q?=E5=8A=A0=E7=89=A9=E6=96=99=E5=BA=93=E4=BD=8D=E5=85=B3=E7=B3=BB?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionReturnNoteAppService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs index d7159cea3..0deef6c40 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs @@ -46,6 +46,15 @@ public class ProductionReturnNoteAppService : //[Authorize(ProductionReturnNotePermissions.Create)] public override async Task CreateAsync(ProductionReturnNoteEditInput input) { + //校验物料和库存关系 + foreach (var item in input.Details) + { + var obj = await _itemStoreRelationAppService.GetFirstAsync(item.ItemCode, item.ToLocationCode).ConfigureAwait(false); + if (obj == null) + { + throw new UserFriendlyException($"物料{item.ItemCode}不能存在目标库位{item.ToLocationCode},物料库存关系表不存在!"); + } + } var entity = ObjectMapper.Map(input); await _ProductionReturnNoteManager.CreateAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); From fa5bf45f05e70ec1f37c4e9f72ba2e545689c692 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 17 May 2024 11:21:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=9A=84bug=EF=BC=8C=E5=8C=85=E6=8B=AC?= =?UTF-8?q?=E5=BA=93=E4=BD=8D=E3=80=81=E4=BD=8D=E7=BD=AE=E7=A0=81=E3=80=81?= =?UTF-8?q?=E5=96=B7=E6=B6=82=E5=8F=91=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inputs/CoatingIssueJobEditInput.cs | 2 +- .../CoatingIssueJobAppService.cs | 20 +++++++++---------- .../ThirdLocationRequestAppService.cs | 16 ++++++++++++++- .../CoatingIssueRequestAutoMapperProfile.cs | 2 +- .../Issue/CoatingIssueRequestEventHandler.cs | 4 ++-- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/Inputs/CoatingIssueJobEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/Inputs/CoatingIssueJobEditInput.cs index fb3b69639..492464524 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/Inputs/CoatingIssueJobEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/Inputs/CoatingIssueJobEditInput.cs @@ -23,7 +23,7 @@ public class CoatingIssueJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCrea [Display(Name = "要货单号")] [Required(ErrorMessage = "{0}是必填项")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string KittingRequestNumber { get; set; } + public string CoatingRequestNumber { get; set; } /// /// 叫料类型 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index fff12a59c..6243dd37a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -99,23 +99,23 @@ public class CoatingIssueJobAppService [HttpPost("invalid")] public override async Task CancelAsync(Guid id) { - var kittingJob = await _repository.GetAsync(id).ConfigureAwait(false); - if (kittingJob == null) + var coatingJob = await _repository.GetAsync(id).ConfigureAwait(false); + if (coatingJob == null) { throw new UserFriendlyException($"未找到ID为 {id} 的任务"); } - if (kittingJob.JobStatus == EnumJobStatus.Open || kittingJob.JobStatus == EnumJobStatus.Partial || - kittingJob.JobStatus == EnumJobStatus.Wait) + if (coatingJob.JobStatus == EnumJobStatus.Open || coatingJob.JobStatus == EnumJobStatus.Partial || + coatingJob.JobStatus == EnumJobStatus.Wait) { - throw new UserFriendlyException($"任务状态不是{kittingJob.JobStatus == EnumJobStatus.Open}、" + - $"{kittingJob.JobStatus == EnumJobStatus.Partial}、" + - $"{kittingJob.JobStatus == EnumJobStatus.Wait}"); + throw new UserFriendlyException($"任务状态不是{coatingJob.JobStatus == EnumJobStatus.Open}、" + + $"{coatingJob.JobStatus == EnumJobStatus.Partial}、" + + $"{coatingJob.JobStatus == EnumJobStatus.Wait}"); } - await _expectOutAppService.RemoveByNumberAsync(kittingJob.Number).ConfigureAwait(false); - kittingJob.JobStatus = EnumJobStatus.Cancelled; - await _repository.UpdateAsync(kittingJob).ConfigureAwait(false); + await _expectOutAppService.RemoveByNumberAsync(coatingJob.Number).ConfigureAwait(false); + coatingJob.JobStatus = EnumJobStatus.Cancelled; + await _repository.UpdateAsync(coatingJob).ConfigureAwait(false); } [HttpPost("cancel-by-request/{requestNumber}")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs index a634810d0..ef13a5b7d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs @@ -88,13 +88,27 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase CreateAsync(ThirdLocationRequestEditInput input) - { + { + foreach (var item in input.Details) { if (item.Qty <= 0) { throw new UserFriendlyException($"{item.ItemCode} 物品的需求量必须大于0"); } + //校验来源库位 + if(string.IsNullOrEmpty(item.FromLocationCode)) + { + throw new UserFriendlyException($"{item.ItemCode} 来源库位不能为空"); + } + else + { + if(item.FromLocationCode == "HOLD" || item.FromLocationCode == "INSPECT" || item.FromLocationCode == "TRANSFERONTHEWAY") + { + throw new UserFriendlyException($"{item.ItemCode} 来源库位不允许扫待检库、在途库、隔离库"); + } + + } } foreach (var detailInput in input.Details) //赋值生产线 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/CoatingIssueRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/CoatingIssueRequestAutoMapperProfile.cs index b7e23ffd7..12561b673 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/CoatingIssueRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/CoatingIssueRequestAutoMapperProfile.cs @@ -12,7 +12,7 @@ public partial class StoreEventAutoMapperProfile : Profile private void CoatingIssueRequestAutoMapperProfile() { CreateMap() - .ForMember(x => x.KittingRequestNumber, y => y.MapFrom(d => d.Number)) + .ForMember(x => x.CoatingRequestNumber, y => y.MapFrom(d => d.Number)) .Ignore(x => x.WarehouseCode) .Ignore(x => x.UpStreamJobNumber) .Ignore(x => x.JobType) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/CoatingIssueRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/CoatingIssueRequestEventHandler.cs index 2202ae0f4..65acb90c1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/CoatingIssueRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/CoatingIssueRequestEventHandler.cs @@ -203,7 +203,7 @@ public class CoatingIssueRequestEventHandler job.WorkGroupCode = requestDetailInput.ToLocationGroup; job.WarehouseCode = requestDetailInput.ToWarehouseCode; job.Worker = coatingIssueRequest.Worker; - job.KittingRequestNumber = coatingIssueRequest.Number; + job.CoatingRequestNumber = coatingIssueRequest.Number; job.EnumIssueSendType = EnumIssueSendType.QtyType; await Task.CompletedTask.ConfigureAwait(false); @@ -412,7 +412,7 @@ public class CoatingIssueRequestEventHandler job.WorkGroupCode = coatingIssueRequestDetail.ToLocationGroup; job.WarehouseCode = coatingIssueRequestDetail.ToWarehouseCode; job.Worker = coatingIssueRequest.Worker; - job.KittingRequestNumber = coatingIssueRequest.Number; + job.CoatingRequestNumber = coatingIssueRequest.Number; job.EnumIssueSendType = EnumIssueSendType.BoxQtyType; job.Details.Add(await BuildCoatingIssueJobDetailWithBoxQtyTypeAsync(coatingIssueRequestDetail, balanceDtos)