|
|
|
@ -1,10 +1,8 @@
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.WMS.Core.Application.Dtos;
|
|
|
|
|
using DS.WMS.Core.Application.Entity;
|
|
|
|
|
using DS.WMS.Core.Application.Interface;
|
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
|
|
using DS.WMS.Core.Fee.Entity;
|
|
|
|
|
using DS.WMS.Core.Fee.Method;
|
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
@ -188,11 +186,18 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
{
|
|
|
|
|
request.Application ??= new();
|
|
|
|
|
|
|
|
|
|
List<IConditionalModel> whereList = [];
|
|
|
|
|
if (!string.IsNullOrEmpty(request.QueryString))
|
|
|
|
|
whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryString);
|
|
|
|
|
request.Application.Details = await GetDetailsAsync(request);
|
|
|
|
|
if (!string.IsNullOrEmpty(request.Application.Currency) && request.Exchanges?.Count > 0) //非原币申请
|
|
|
|
|
{
|
|
|
|
|
var details = request.Application.Details.FindAll(x => x.Currency != request.Application.Currency);
|
|
|
|
|
foreach (var detail in details)
|
|
|
|
|
{
|
|
|
|
|
var exchange = request.Exchanges.Find(x => x.CurrencyFrom == detail.Currency && x.CurrencyTo == request.Application.Currency);
|
|
|
|
|
detail.ExchangeRate = exchange == null ? 1 : exchange.Rate;
|
|
|
|
|
detail.Currency = request.Application.Currency;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
request.Application.Details = await GetDetailsAsync(request.Items, whereList);
|
|
|
|
|
return await SaveAsync(request.Application);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -260,10 +265,9 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取业务所关联的申请明细
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="items"></param>
|
|
|
|
|
/// <param name="conditions"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected virtual Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items, List<IConditionalModel>? conditions)
|
|
|
|
|
protected virtual Task<List<ApplicationDetail>> GetDetailsAsync(ApplicationRequest<TEntity> request)
|
|
|
|
|
{
|
|
|
|
|
return Task.FromResult(new List<ApplicationDetail>());
|
|
|
|
|
}
|
|
|
|
|