|
|
@ -123,7 +123,11 @@ public class PostionLocationAppService |
|
|
|
[HttpPost("")] |
|
|
|
public override async Task<PostionLocationDTO> 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}库位编码不存在,请查看库位信息!");
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|