|
|
@ -26,6 +26,9 @@ using Win_in.Sfs.Wms.Store.Domain; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Store.Application; |
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Http.Metadata; |
|
|
|
|
|
|
|
[Authorize] |
|
|
|
[Route($"{StoreConsts.RootPath}deliver-request")] |
|
|
|
|
|
|
@ -40,7 +43,8 @@ public class DeliverRequestAppService : |
|
|
|
private readonly ICustomerAddressAppService _customerAddressApp; |
|
|
|
private readonly IItemBasicAppService _itemBasicAppService; |
|
|
|
private readonly ICustomerItemAppService _customerItemAppService; |
|
|
|
private readonly ISalePriceSheetRepository _salePriceSheetRepository; |
|
|
|
|
|
|
|
private readonly ISalePriceSheetAppService _salePriceSheetAppService; |
|
|
|
|
|
|
|
public DeliverRequestAppService( |
|
|
|
IDeliverRequestRepository repository |
|
|
@ -50,13 +54,11 @@ public class DeliverRequestAppService : |
|
|
|
, ICustomerAddressAppService customerAddressApp |
|
|
|
, IItemBasicAppService itemBasicAppService, |
|
|
|
ICustomerItemAppService customerItemAppService, |
|
|
|
|
|
|
|
ISalePriceSheetRepository salePriceSheetRepository |
|
|
|
|
|
|
|
) |
|
|
|
ISalePriceSheetAppService salePriceSheetAppService) |
|
|
|
: base(repository, deliverRequestManager) |
|
|
|
{ |
|
|
|
_customerItemAppService = customerItemAppService; |
|
|
|
_salePriceSheetAppService = salePriceSheetAppService; |
|
|
|
|
|
|
|
_deliverRequestManager = deliverRequestManager; |
|
|
|
_areaApp = areaApp; |
|
|
@ -64,7 +66,6 @@ public class DeliverRequestAppService : |
|
|
|
_customerAddressApp = customerAddressApp; |
|
|
|
_itemBasicAppService = itemBasicAppService; |
|
|
|
_customerItemAppService = customerItemAppService; |
|
|
|
_salePriceSheetRepository = salePriceSheetRepository; |
|
|
|
} |
|
|
|
|
|
|
|
protected override async Task<Dictionary<DeliverRequest, EntityState>> ImportProcessingEntityAsync(Dictionary<DeliverRequest, EntityState> dictionary) |
|
|
@ -139,7 +140,7 @@ public class DeliverRequestAppService : |
|
|
|
{ |
|
|
|
foreach (var itm in request.Details) |
|
|
|
{ |
|
|
|
var price = await _salePriceSheetRepository.FindAsync(p => p.ItemCode == itm.ItemCode && p.CustomerCode == request.CustomerCode).ConfigureAwait(false); |
|
|
|
var price = await _salePriceSheetAppService.GetByItemCodeAndCustomerCode(itm.ItemCode,request.CustomerCode).ConfigureAwait(false); |
|
|
|
if (price == null) |
|
|
|
{ |
|
|
|
errors.Add($"请求单号:{request.Number}零件编号:{itm.ItemCode}客户编号:{request.CustomerCode}"); |
|
|
|