|
|
|
@ -96,44 +96,53 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <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));
|
|
|
|
|
if (request.OtherQueryCondition.HasValue)
|
|
|
|
|
if (request.OtherQueryCondition != null)
|
|
|
|
|
{
|
|
|
|
|
FeeRange feeRange = request.OtherQueryCondition.Value;
|
|
|
|
|
switch (feeRange)
|
|
|
|
|
if (request.OtherQueryCondition.FeeRange.HasValue)
|
|
|
|
|
{
|
|
|
|
|
case FeeRange.Unsettled:
|
|
|
|
|
query = query.Where(x => x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.Settled:
|
|
|
|
|
query = query.Where(x => x.SettlementAmount > 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.PaidNotReceived:
|
|
|
|
|
query = query.Where(x => x.UnSettlementPaid == 0 && x.UnSettlementCharged > 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.ReceivedNotPaid:
|
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.NotAppliedSettled:
|
|
|
|
|
query = query.Where(x => x.OrderAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.UnreconciledSettled:
|
|
|
|
|
query = query.Where(x => x.DebitNo == null && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.NotIssuedSettled:
|
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.ReconciledNotSettled:
|
|
|
|
|
query = query.Where(x => x.DebitNo != null && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.NotReceivedPaid:
|
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged > 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.SettledNotIssued:
|
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount > 0);
|
|
|
|
|
break;
|
|
|
|
|
switch (request.OtherQueryCondition.FeeRange)
|
|
|
|
|
{
|
|
|
|
|
case FeeRange.Unsettled:
|
|
|
|
|
query = query.Where(x => x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.Settled:
|
|
|
|
|
query = query.Where(x => x.SettlementAmount > 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.PaidNotReceived:
|
|
|
|
|
query = query.Where(x => x.UnSettlementPaid == 0 && x.UnSettlementCharged > 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.ReceivedNotPaid:
|
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.NotAppliedSettled:
|
|
|
|
|
query = query.Where(x => x.OrderAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.UnreconciledSettled:
|
|
|
|
|
query = query.Where(x => x.DebitNo == null && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.NotIssuedSettled:
|
|
|
|
|
query = query.Where(x => x.InvoiceAmount == 0 && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.ReconciledNotSettled:
|
|
|
|
|
query = query.Where(x => x.DebitNo != null && x.SettlementAmount == 0);
|
|
|
|
|
break;
|
|
|
|
|
case FeeRange.NotReceivedPaid:
|
|
|
|
|
query = query.Where(x => x.UnSettlementPaid > 0 && x.UnSettlementCharged > 0);
|
|
|
|
|
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,//揽货人
|
|
|
|
|
Vessel = s.Vessel,//船名
|
|
|
|
|
Voyage = s.Voyage,//航次
|
|
|
|
|
BookingNO = s.BookingNo,
|
|
|
|
|
BookingNo = s.BookingNo,
|
|
|
|
|
StlName = s.StlName,
|
|
|
|
|
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),
|
|
|
|
|