From 6240b94135e75c5352db36222ae6a5f66b95a8e4 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Fri, 17 May 2024 11:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E9=80=80=E5=BA=93=E5=8A=A0?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=BA=93=E4=BD=8D=E5=85=B3=E7=B3=BB=E6=A0=A1?= =?UTF-8?q?=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);