|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Linq; |
|
|
@ -5,10 +6,12 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Caching; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Basedata.Domain; |
|
|
|
using Win_in.Sfs.Basedata.Domain.Shared; |
|
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Basedata.Application; |
|
|
|
|
|
|
@ -35,6 +38,26 @@ public class ErpLocationItemAppService |
|
|
|
_manager = manager; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 检查物料和储位对应关系是否存在
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="itemCode"></param>
|
|
|
|
/// <param name="erpLocationCode"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
|
|
[HttpGet("check-item-erplocation-is-available")] |
|
|
|
public virtual async Task<bool> CheckItemErpLocationIsAvailable(string itemCode,string erpLocationCode) |
|
|
|
{ |
|
|
|
var entity = await _repository.FindAsync(p => p.ItemCode == itemCode && p.ErpLocationCode== erpLocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
if (entity == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"未找到物料代码为 {itemCode} 和储位代码 {erpLocationCode} 的对应关系"); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("upsert")] |
|
|
|
public virtual async Task UpsertAsync(ErpLocationItemEditInput input) |
|
|
|
{ |
|
|
|