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/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); 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)