|
@ -32,6 +32,7 @@ public class PurchaseOrderAppService : |
|
|
private readonly IItemBasicAppService _itemBasicAppService; |
|
|
private readonly IItemBasicAppService _itemBasicAppService; |
|
|
private readonly ILocationAppService _locationAppService; |
|
|
private readonly ILocationAppService _locationAppService; |
|
|
public readonly IPurchasePriceSheetAppService _purchasePriceSheetAppService; |
|
|
public readonly IPurchasePriceSheetAppService _purchasePriceSheetAppService; |
|
|
|
|
|
public readonly ISupplierItemAppService _supplierItemAppService; |
|
|
|
|
|
|
|
|
public PurchaseOrderAppService( |
|
|
public PurchaseOrderAppService( |
|
|
IPurchaseOrderRepository repository, |
|
|
IPurchaseOrderRepository repository, |
|
@ -39,7 +40,8 @@ public class PurchaseOrderAppService : |
|
|
ISupplierAppService supplierAppService, |
|
|
ISupplierAppService supplierAppService, |
|
|
IItemBasicAppService itemBasicAppService |
|
|
IItemBasicAppService itemBasicAppService |
|
|
, ILocationAppService locationAppService, |
|
|
, ILocationAppService locationAppService, |
|
|
IPurchasePriceSheetAppService purchasePriceSheetAppService) : base(repository) |
|
|
IPurchasePriceSheetAppService purchasePriceSheetAppService, |
|
|
|
|
|
ISupplierItemAppService supplierItemAppService) : base(repository) |
|
|
{ |
|
|
{ |
|
|
_repository = repository; |
|
|
_repository = repository; |
|
|
_purchaseOrderManager = purchaseOrderManager; |
|
|
_purchaseOrderManager = purchaseOrderManager; |
|
@ -50,6 +52,7 @@ IPurchasePriceSheetAppService purchasePriceSheetAppService) : base(repository) |
|
|
base.UpdatePolicyName = PurchaseOrderPermissions.Update; |
|
|
base.UpdatePolicyName = PurchaseOrderPermissions.Update; |
|
|
base.DeletePolicyName = PurchaseOrderPermissions.Delete; |
|
|
base.DeletePolicyName = PurchaseOrderPermissions.Delete; |
|
|
_purchasePriceSheetAppService = purchasePriceSheetAppService; |
|
|
_purchasePriceSheetAppService = purchasePriceSheetAppService; |
|
|
|
|
|
_supplierItemAppService = supplierItemAppService; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region 东阳使用
|
|
|
#region 东阳使用
|
|
@ -126,8 +129,20 @@ IPurchasePriceSheetAppService purchasePriceSheetAppService) : base(repository) |
|
|
|
|
|
|
|
|
return dictionary; |
|
|
return dictionary; |
|
|
} |
|
|
} |
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 检验重写
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="model"></param>
|
|
|
|
|
|
/// <param name="validationRresult"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
protected override async Task ValidateImportModelAsync(PurchaseOrderImportInput model, List<ValidationResult> validationRresult) |
|
|
|
|
|
{ |
|
|
|
|
|
var item = await _supplierItemAppService.GetBySupplierCodeAndItemCodeAsync(model.SupplierCode,model.ItemCode).ConfigureAwait(false); |
|
|
|
|
|
if (item == null) |
|
|
|
|
|
{ |
|
|
|
|
|
validationRresult.Add(new ValidationResult($"供应商代码【{model.SupplierCode}】与明细-ERP料号【{model.ItemCode}】对应关系不存在")); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 【创建】采购订单
|
|
|
/// 【创建】采购订单
|
|
@ -232,7 +247,7 @@ IPurchasePriceSheetAppService purchasePriceSheetAppService) : base(repository) |
|
|
var isprice = await _purchasePriceSheetAppService.CheckPurPriceAsync(supplierCode, itemCode).ConfigureAwait(false); |
|
|
var isprice = await _purchasePriceSheetAppService.CheckPurPriceAsync(supplierCode, itemCode).ConfigureAwait(false); |
|
|
if (isprice) |
|
|
if (isprice) |
|
|
{ |
|
|
{ |
|
|
throw new UserFriendlyException($"供应商【{supplierCode}】物品名称【{itemCode}】无采购价格无法执行采购上架!"); |
|
|
throw new UserFriendlyException($"供应商【{supplierCode}】物品名称【{itemCode}】无采购价格无法导入采购订单!"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
private async Task<List<LocationDTO>> CheckErpLocationCodeAsync(List<string> erpLocationCodes) |
|
|
private async Task<List<LocationDTO>> CheckErpLocationCodeAsync(List<string> erpLocationCodes) |
|
|