|
|
|
@ -7,7 +7,6 @@ using DS.WMS.Core.Application.Entity;
|
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
|
using DS.WMS.Core.Fee.Entity;
|
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
|
using DS.WMS.Core.Invoice.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
using DS.WMS.Core.Settlement.Dtos;
|
|
|
|
|
using DS.WMS.Core.Settlement.Entity;
|
|
|
|
@ -187,7 +186,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
FeeId = f.FeeId,
|
|
|
|
|
FeeName = f.FeeName,
|
|
|
|
|
FeeType = f.FeeType,
|
|
|
|
|
TotalAmount = f.Amount,
|
|
|
|
|
Amount = f.Amount,
|
|
|
|
|
Currency = f.Currency,
|
|
|
|
|
OriginalRate = f.ExchangeRate,
|
|
|
|
|
RestAmount = f.Amount - f.SettlementAmount,
|
|
|
|
@ -209,17 +208,18 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据业务编号及类型获取该票业务的币别
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="items">业务ID与业务类型</param>
|
|
|
|
|
/// <param name="inquiry">业务ID与业务类型</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(List<FeeClient> items)
|
|
|
|
|
public async Task<DataResult<List<FeeClient>>> GetCurrenciesAsync(DetailInquiry inquiry)
|
|
|
|
|
{
|
|
|
|
|
var bizIds = items.Select(x => x.Id).Distinct();
|
|
|
|
|
var types = items.Select(x => x.BusinessType).Distinct();
|
|
|
|
|
var cIds = items.Select(x => x.CustomerId).Distinct();
|
|
|
|
|
var bizIds = inquiry.Items.Select(x => x.Id).Distinct();
|
|
|
|
|
var types = inquiry.Items.Select(x => x.BusinessType).Distinct();
|
|
|
|
|
var cIds = inquiry.Items.Select(x => x.CustomerId).Distinct();
|
|
|
|
|
|
|
|
|
|
var list = await TenantDb.Queryable<FeeRecord>()
|
|
|
|
|
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId)
|
|
|
|
|
&& (f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement))
|
|
|
|
|
.Where(inquiry.GetConditionalModels(Db))
|
|
|
|
|
.Select(f => new
|
|
|
|
|
{
|
|
|
|
|
f.BusinessId,
|
|
|
|
@ -229,7 +229,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
f.ExchangeRate
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
foreach (var item in items)
|
|
|
|
|
foreach (var item in inquiry.Items)
|
|
|
|
|
{
|
|
|
|
|
item.ExchangeRates = list.Where(x => x.BusinessId == item.Id && x.BusinessType == item.BusinessType && x.CustomerId == item.CustomerId)
|
|
|
|
|
.GroupBy(x => x.Currency).Select(x => new CurrencyExchangeRate
|
|
|
|
@ -239,7 +239,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult<List<FeeClient>>.Success(items);
|
|
|
|
|
return DataResult<List<FeeClient>>.Success(inquiry.Items);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|