|
|
@ -34,18 +34,18 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDto>>> GetListAsync(PageRequest request)
|
|
|
|
public async Task<DataResult<PaymentApplicationModel>> GetListAsync(PageRequest request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var query = CreateListQuery();
|
|
|
|
var query = CreateListQuery();
|
|
|
|
|
|
|
|
|
|
|
|
if (!request.QueryCondition.IsNullOrEmpty())
|
|
|
|
if (!request.QueryCondition.IsNullOrEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
|
|
|
|
var whereList = request.GetConditionalModels(Db);
|
|
|
|
query = query.Where(whereList);
|
|
|
|
query = query.Where(whereList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var result = await query.GroupBy(x => x.Id).ToQueryPageAsync(request.PageCondition);
|
|
|
|
var result = await query.GroupBy(x => x.Id).ToQueryPageAsync(request.PageCondition);
|
|
|
|
if (result.Data.Count > 0)
|
|
|
|
if (result.Data?.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//关联用户名称
|
|
|
|
//关联用户名称
|
|
|
|
var userIds = result.Data.Select(x => x.CreateBy).Distinct();
|
|
|
|
var userIds = result.Data.Select(x => x.CreateBy).Distinct();
|
|
|
@ -61,7 +61,30 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
var ids = result.Data.Select(x => x.Id);
|
|
|
|
|
|
|
|
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.ApplicationId))
|
|
|
|
|
|
|
|
.Select(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.Currency,
|
|
|
|
|
|
|
|
x.ApplyAmount,
|
|
|
|
|
|
|
|
x.SettlementAmount,
|
|
|
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PaymentApplicationModel model = new()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List = result.Data,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TotalCNY = details.Where(x => x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.ApplyAmount),
|
|
|
|
|
|
|
|
TotalUSD = details.Where(x => x.Currency == FeeCurrency.USD_CODE).Sum(x => x.ApplyAmount),
|
|
|
|
|
|
|
|
TotalOther = details.Where(x => x.Currency != FeeCurrency.RMB_CODE && x.Currency != FeeCurrency.USD_CODE).Sum(x => x.ApplyAmount),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SettlementCNY = details.Where(x => x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.SettlementAmount),
|
|
|
|
|
|
|
|
SettlementUSD = details.Where(x => x.Currency == FeeCurrency.USD_CODE).Sum(x => x.SettlementAmount),
|
|
|
|
|
|
|
|
SettlementOther = details.Where(x => x.Currency != FeeCurrency.RMB_CODE && x.Currency != FeeCurrency.USD_CODE).Sum(x => x.SettlementAmount)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
var result2 = DataResult<PaymentApplicationModel>.Success(model);
|
|
|
|
|
|
|
|
result2.Count = result.Count;
|
|
|
|
|
|
|
|
return result2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal ISugarQueryable<PaymentApplicationDto> CreateListQuery()
|
|
|
|
internal ISugarQueryable<PaymentApplicationDto> CreateListQuery()
|
|
|
@ -115,6 +138,7 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
return TenantDb.UnionAll(new List<ISugarQueryable<PaymentApplicationDto>> { query1 });
|
|
|
|
return TenantDb.UnionAll(new List<ISugarQueryable<PaymentApplicationDto>> { query1 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取待付费的业务列表(编辑用)
|
|
|
|
/// 获取待付费的业务列表(编辑用)
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -158,7 +182,7 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
//海运出口
|
|
|
|
//海运出口
|
|
|
|
var query1 = TenantDb.Queryable<SeaExport>()
|
|
|
|
var query1 = TenantDb.Queryable<SeaExport>()
|
|
|
|
.InnerJoin<FeeRecord>((s, f) => s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport)
|
|
|
|
.InnerJoin<FeeRecord>((s, f) => s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport)
|
|
|
|
.Where((s, f) => f.FeeStatus == FeeStatus.AuditPassed)
|
|
|
|
.Where((s, f) => f.FeeStatus == FeeStatus.AuditPassed && f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount != 0)
|
|
|
|
.GroupBy((s, f) => new { s.Id, f.CustomerId })
|
|
|
|
.GroupBy((s, f) => new { s.Id, f.CustomerId })
|
|
|
|
.Select((s, f) => new BizPaymentApplication
|
|
|
|
.Select((s, f) => new BizPaymentApplication
|
|
|
|
{
|
|
|
|
{
|
|
|
|