Browse Source

更新版本

dev_DY_CC
赵新宇 6 months ago
parent
commit
e6e0e9594e
  1. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs
  2. 37
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Omu.ValueInjecter; using Omu.ValueInjecter;
using Volo.Abp; using Volo.Abp;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -28,17 +29,20 @@ public class CustomerProductionReturnNoteAppService :
private readonly ICustomerItemAppService _customerItemAppService; private readonly ICustomerItemAppService _customerItemAppService;
private readonly ISalePriceSheetAppService _salePriceSheetAppService;
public CustomerProductionReturnNoteAppService( public CustomerProductionReturnNoteAppService(
ICustomerProductionReturnNoteRepository repository ICustomerProductionReturnNoteRepository repository
, ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager , ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager
, ICustomerItemAppService customerItemAppService , ICustomerItemAppService customerItemAppService,
ISalePriceSheetAppService salePriceSheetAppService
) : base(repository) ) : base(repository)
{ {
_customerItemAppService = customerItemAppService; _customerItemAppService = customerItemAppService;
_salePriceSheetAppService = salePriceSheetAppService;
_CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager; _CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager;
} }
@ -56,13 +60,19 @@ public class CustomerProductionReturnNoteAppService :
var parts= input.Details.Select(itm => itm.ItemCode).Distinct(); var parts= input.Details.Select(itm => itm.ItemCode).Distinct();
var ls=await IsExistCustomerItemRelationShip(parts.ToList(),input.CustomerCode).ConfigureAwait(false); var ls=await IsExistCustomerItemPrice(parts.ToList(),input.CustomerCode).ConfigureAwait(false);
if (ls.Count > 0) if (ls.Count > 0)
{ {
throw new UserFriendlyException($"客户零件关系表中没有查到客户为{input.CustomerCode}零件号为{string.Join(",", ls.ToArray())}的零件"); throw new UserFriendlyException($"销售价格表中没有查到客户为{input.CustomerCode}零件号为{string.Join(",", ls.ToArray())}的零件关系和价格");
} }
var errlist= await CheckCustomerItem(parts.ToList(), input.CustomerCode).ConfigureAwait(false);
if (errlist.Count > 0)
{
throw new UserFriendlyException($"客户零件关系表中没有查到客户为{input.CustomerCode}零件号为{string.Join(",", ls.ToArray())}的零件关系");
}
var custitmDetail = await _customerItemAppService.GetListByPartsAsync(parts.ToList()).ConfigureAwait(false); var custitmDetail = await _customerItemAppService.GetListByPartsAsync(parts.ToList()).ConfigureAwait(false);
@ -113,12 +123,12 @@ public class CustomerProductionReturnNoteAppService :
} }
private async Task<List<string>> IsExistCustomerItemRelationShip(List<string> partlist, string customerCode) private async Task<List<string>> IsExistCustomerItemPrice(List<string> partlist, string customerCode)
{ {
List<string> errorlist = new List<string>(); List<string> errorlist = new List<string>();
foreach (var itm in partlist) foreach (var itm in partlist)
{ {
var result = await _customerItemAppService.GetByCustomerAndItemAsync(itm, customerCode).ConfigureAwait(false); var result = await _salePriceSheetAppService.GetByItemCodeAndCustomerCode(itm, customerCode).ConfigureAwait(false);
if (result == null) if (result == null)
{ {
errorlist.Add(itm); errorlist.Add(itm);
@ -128,6 +138,20 @@ public class CustomerProductionReturnNoteAppService :
} }
private async Task<List<string>> CheckCustomerItem(List<string> partlist, string customerCode)
{
List<string> errorlist = new List<string>();
foreach (var itm in partlist)
{
var result = await _salePriceSheetAppService.GetByItemCodeAndCustomerCode(itm, customerCode).ConfigureAwait(false);
if (result == null)
{
errorlist.Add(itm);
}
}
return errorlist;
}

37
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs

@ -11,6 +11,7 @@ using Microsoft.EntityFrameworkCore;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Data; using Volo.Abp.Data;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
@ -37,6 +38,8 @@ public class DeliverRequestFisAppService :
private readonly IBalanceAppService _balanceAppService; private readonly IBalanceAppService _balanceAppService;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly ISalePriceSheetAppService _salePriceSheetAppService;
public DeliverRequestFisAppService( public DeliverRequestFisAppService(
IDeliverRequestRepository repository, IDeliverRequestRepository repository,
IDeliverRequestManager deliverRequestManager, IDeliverRequestManager deliverRequestManager,
@ -45,7 +48,11 @@ public class DeliverRequestFisAppService :
ICustomerAddressAppService customerAddressApp, ICustomerAddressAppService customerAddressApp,
ITransactionTypeAppService transactionTypeAppService, ITransactionTypeAppService transactionTypeAppService,
IBalanceAppService balanceAppService, IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService) IItemBasicAppService itemBasicAppService,
ISalePriceSheetAppService salePriceSheetAppService
)
: base(repository, deliverRequestManager) : base(repository, deliverRequestManager)
{ {
_deliverRequestManager = deliverRequestManager; _deliverRequestManager = deliverRequestManager;
@ -55,6 +62,7 @@ public class DeliverRequestFisAppService :
_transactionTypeAppService = transactionTypeAppService; _transactionTypeAppService = transactionTypeAppService;
_balanceAppService = balanceAppService; _balanceAppService = balanceAppService;
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
_salePriceSheetAppService = salePriceSheetAppService;
} }
/// <summary> /// <summary>
/// 删除 /// 删除
@ -105,6 +113,11 @@ public class DeliverRequestFisAppService :
await SetRequestAutoPropertiesAsync(itemTransformRequest).ConfigureAwait(false); await SetRequestAutoPropertiesAsync(itemTransformRequest).ConfigureAwait(false);
foreach (var detail in itemTransformRequest.Details) foreach (var detail in itemTransformRequest.Details)
{ {
//_salePriceSheetAppService.GetByItemCodeAndCustomerCode(detail.ItemCode,itemTransformRequest.CustomerCode)
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detail.ItemCode); CheckItemBasic(itemBasicDto, detail.ItemCode);
@ -133,6 +146,10 @@ public class DeliverRequestFisAppService :
detail.ItemName = itemBasicDto.Name; detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom; detail.Uom = itemBasicDto.BasicUom;
detail.StdPackQty=itemBasicDto.StdPackQty; detail.StdPackQty=itemBasicDto.StdPackQty;
// CheckPrice(detail);
} }
} }
@ -154,6 +171,24 @@ public class DeliverRequestFisAppService :
} }
} }
//private static void CheckPrice(DeliverRequestDetail detail
// )
//{
//}
private static void CheckBalances(List<BalanceDTO> balances, TransactionTypeDTO transactionType, ItemBasicDTO itemBasicDto, private static void CheckBalances(List<BalanceDTO> balances, TransactionTypeDTO transactionType, ItemBasicDTO itemBasicDto,
DeliverRequestDetail detail) DeliverRequestDetail detail)
{ {

Loading…
Cancel
Save