From 86621905a8bccce90d5fc514787f7ebe25a2c060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Tue, 3 Dec 2024 16:12:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PostionLocationAppService.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PostionLocations/PostionLocationAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PostionLocations/PostionLocationAppService.cs index da1721807..57a6d9a4a 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PostionLocations/PostionLocationAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PostionLocations/PostionLocationAppService.cs @@ -123,7 +123,11 @@ public class PostionLocationAppService [HttpPost("")] public override async Task CreateAsync(PostionLocationEditInput input) { - + var isexist= _repository.WithDetails().Where(p => p.Code == input.Code && p.LocationCode == input.LocationCode); + if (isexist.Any()) + { + throw new UserFriendlyException($"工作站编号{input.Code}库位编码{input.LocationCode}已存在!"); + } await CheckLocationCode(input.LocationCode).ConfigureAwait(false); return await base.CreateAsync(input).ConfigureAwait(false); @@ -175,5 +179,19 @@ public class PostionLocationAppService } + //private async Task CheckLocationCode(string p_location) + //{ + + // var list = await _locationAppService.GetByCodeAsync(p_location).ConfigureAwait(false); + // if (list == null) + // { + // throw new UserFriendlyException($"{p_location}库位编码不存在,请查看库位信息!"); + // } + + + //} + + + }