|
|
@ -96,44 +96,53 @@ 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<BizInvoiceApplication>>> GetBizListAsync(PageRequest<FeeRange?> request)
|
|
|
|
public async Task<DataResult<List<BizInvoiceApplication>>> GetBizListAsync(PageRequest<InvoiceApplicationQuery?> request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var query = CreateBizQuery(request.GetConditionalModels(Db));
|
|
|
|
var query = CreateBizQuery(request.GetConditionalModels(Db));
|
|
|
|
if (request.OtherQueryCondition.HasValue)
|
|
|
|
if (request.OtherQueryCondition != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FeeRange feeRange = request.OtherQueryCondition.Value;
|
|
|
|
if (request.OtherQueryCondition.FeeRange.HasValue)
|
|
|
|
switch (feeRange)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case FeeRange.Unsettled:
|
|
|
|
switch (request.OtherQueryCondition.FeeRange)
|
|
|
|
query = query.Where(x => x.SettlementAmount == 0);
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
case FeeRange.Unsettled:
|
|
|
|
case FeeRange.Settled:
|
|
|
|
query = query.Where(x => x.SettlementAmount == 0);
|
|
|
|
query = query.Where(x => x.SettlementAmount > 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.Settled:
|
|
|
|
case FeeRange.PaidNotReceived:
|
|
|
|
query = query.Where(x => x.SettlementAmount > 0);
|
|
|
|
query = query.Where(x => x.UnSettlementPaid == 0 && x.UnSettlementCharged > 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.PaidNotReceived:
|
|
|
|
case FeeRange.ReceivedNotPaid:
|
|
|
|
query = query.Where(x => x.UnSettlementPaid == 0 && x.UnSettlementCharged > 0);
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged == 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.ReceivedNotPaid:
|
|
|
|
case FeeRange.NotAppliedSettled:
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged == 0);
|
|
|
|
query = query.Where(x => x.OrderAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.NotAppliedSettled:
|
|
|
|
case FeeRange.UnreconciledSettled:
|
|
|
|
query = query.Where(x => x.OrderAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
query = query.Where(x => x.DebitNo == null && x.SettlementAmount == 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.UnreconciledSettled:
|
|
|
|
case FeeRange.NotIssuedSettled:
|
|
|
|
query = query.Where(x => x.DebitNo == null && x.SettlementAmount == 0);
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.NotIssuedSettled:
|
|
|
|
case FeeRange.ReconciledNotSettled:
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
query = query.Where(x => x.DebitNo != null && x.SettlementAmount == 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.ReconciledNotSettled:
|
|
|
|
case FeeRange.NotReceivedPaid:
|
|
|
|
query = query.Where(x => x.DebitNo != null && x.SettlementAmount == 0);
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged > 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.NotReceivedPaid:
|
|
|
|
case FeeRange.SettledNotIssued:
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged > 0);
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount > 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case FeeRange.SettledNotIssued:
|
|
|
|
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount > 0);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(request.OtherQueryCondition.Number))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
query = query.Where(x => x.MBLNO.Contains(request.OtherQueryCondition.Number) ||
|
|
|
|
|
|
|
|
x.CustomerNo.Contains(request.OtherQueryCondition.Number) ||
|
|
|
|
|
|
|
|
x.CustomerNum.Contains(request.OtherQueryCondition.Number) ||
|
|
|
|
|
|
|
|
x.BookingNo.Contains(request.OtherQueryCondition.Number));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -191,7 +200,7 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
SaleName = s.Sale,//揽货人
|
|
|
|
SaleName = s.Sale,//揽货人
|
|
|
|
Vessel = s.Vessel,//船名
|
|
|
|
Vessel = s.Vessel,//船名
|
|
|
|
Voyage = s.Voyage,//航次
|
|
|
|
Voyage = s.Voyage,//航次
|
|
|
|
BookingNO = s.BookingNo,
|
|
|
|
BookingNo = s.BookingNo,
|
|
|
|
StlName = s.StlName,
|
|
|
|
StlName = s.StlName,
|
|
|
|
OrderAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.OrderAmount),
|
|
|
|
OrderAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.OrderAmount),
|
|
|
|
InvoiceAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.InvoiceAmount),
|
|
|
|
InvoiceAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.InvoiceAmount),
|
|
|
|