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 Omu.ValueInjecter;
using Volo.Abp;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -28,17 +29,20 @@ public class CustomerProductionReturnNoteAppService :
private readonly ICustomerItemAppService _customerItemAppService;
private readonly ISalePriceSheetAppService _salePriceSheetAppService;
public CustomerProductionReturnNoteAppService(
ICustomerProductionReturnNoteRepository repository
, ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager
, ICustomerItemAppService customerItemAppService
, ICustomerItemAppService customerItemAppService,
ISalePriceSheetAppService salePriceSheetAppService
) : base(repository)
{
_customerItemAppService = customerItemAppService;
_salePriceSheetAppService = salePriceSheetAppService;
_CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager;
}
@ -56,13 +60,19 @@ public class CustomerProductionReturnNoteAppService :
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)
{
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);
@ -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>();
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)
{
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.Application.Dtos;
using Volo.Abp.Data;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
@ -37,6 +38,8 @@ public class DeliverRequestFisAppService :
private readonly IBalanceAppService _balanceAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly ISalePriceSheetAppService _salePriceSheetAppService;
public DeliverRequestFisAppService(
IDeliverRequestRepository repository,
IDeliverRequestManager deliverRequestManager,
@ -45,7 +48,11 @@ public class DeliverRequestFisAppService :
ICustomerAddressAppService customerAddressApp,
ITransactionTypeAppService transactionTypeAppService,
IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService)
IItemBasicAppService itemBasicAppService,
ISalePriceSheetAppService salePriceSheetAppService
)
: base(repository, deliverRequestManager)
{
_deliverRequestManager = deliverRequestManager;
@ -55,6 +62,7 @@ public class DeliverRequestFisAppService :
_transactionTypeAppService = transactionTypeAppService;
_balanceAppService = balanceAppService;
_itemBasicAppService = itemBasicAppService;
_salePriceSheetAppService = salePriceSheetAppService;
}
/// <summary>
/// 删除
@ -105,6 +113,11 @@ public class DeliverRequestFisAppService :
await SetRequestAutoPropertiesAsync(itemTransformRequest).ConfigureAwait(false);
foreach (var detail in itemTransformRequest.Details)
{
//_salePriceSheetAppService.GetByItemCodeAndCustomerCode(detail.ItemCode,itemTransformRequest.CustomerCode)
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detail.ItemCode);
@ -133,6 +146,10 @@ public class DeliverRequestFisAppService :
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
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,
DeliverRequestDetail detail)
{

Loading…
Cancel
Save