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