|
|
@ -31,6 +31,7 @@ public class PutawayNoteAppService : |
|
|
|
public readonly IInspectJobAppService _inspectJobAppService; |
|
|
|
public readonly IPurchaseOrderManager _purchaseOrderManager; |
|
|
|
public readonly IPurchasePriceSheetAppService _purchasePriceSheetAppService; |
|
|
|
public readonly IErpLocationItemAppService _erpLocationItemAppService; |
|
|
|
|
|
|
|
public PutawayNoteAppService( |
|
|
|
IPutawayNoteRepository repository, |
|
|
@ -38,13 +39,15 @@ public class PutawayNoteAppService : |
|
|
|
IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, |
|
|
|
IInspectJobAppService inspectJobAppService, |
|
|
|
IPurchaseOrderManager purchaseOrderManager, |
|
|
|
IPurchasePriceSheetAppService purchasePriceSheetAppService ) : base(repository) |
|
|
|
IPurchasePriceSheetAppService purchasePriceSheetAppService, |
|
|
|
IErpLocationItemAppService erpLocationItemAppService) : base(repository) |
|
|
|
{ |
|
|
|
_putawayNoteManager = putawayNoteManager; |
|
|
|
_purchaseReceiptNoteAppService = purchaseReceiptNoteAppService; |
|
|
|
_inspectJobAppService = inspectJobAppService; |
|
|
|
_purchaseOrderManager = purchaseOrderManager; |
|
|
|
_purchasePriceSheetAppService = purchasePriceSheetAppService; |
|
|
|
_erpLocationItemAppService= erpLocationItemAppService; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -58,8 +61,6 @@ public class PutawayNoteAppService : |
|
|
|
{ |
|
|
|
foreach (var detail in input.Details) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var isClosed = await _purchaseOrderManager.CheckIsCloseAsync(input.Number,input.SupplierCode, detail.ItemCode).ConfigureAwait(false); |
|
|
|
if (isClosed) |
|
|
|
{ |
|
|
@ -70,6 +71,12 @@ public class PutawayNoteAppService : |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"供应商【{input.SupplierCode}】零件名称【{detail.ItemCode}】无采购价格无法执行采购上架!"); |
|
|
|
} |
|
|
|
var erpLocationItem = await _erpLocationItemAppService.CheckItemErpLocationIsAvailable(detail.ItemCode, detail.ToLocationErpCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
if (erpLocationItem == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"未找到零件【{detail.ItemCode}】与ERP储位【{detail.ToLocationErpCode}】的开账信息"); |
|
|
|
} |
|
|
|
var purchasereDetail = await _purchaseReceiptNoteAppService |
|
|
|
.GetDetailByItemAndPackingAsync(detail.ItemCode, detail.ToPackingCode).ConfigureAwait(false); |
|
|
|
if (purchasereDetail != null) |
|
|
@ -81,10 +88,6 @@ public class PutawayNoteAppService : |
|
|
|
throw new UserFriendlyException($"包含【{detail.ToPackingCode}】箱码的报检单,尚未完成质检"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var entity = ObjectMapper.Map<PutawayNoteEditInput, PutawayNote>(input); |
|
|
|