增加编号搜索

dev
嵇文龙 3 weeks ago
parent 8f5f920810
commit 7a0dc9921f

@ -51,7 +51,13 @@ namespace DS.WMS.Core.Fee.Dtos
/// <summary> /// <summary>
/// 订舱编号 /// 订舱编号
/// </summary> /// </summary>
public string? BookingNO { get; set; } public string? BookingNo { get; set; }
/// <summary>
/// 客户编号
/// </summary>
public string? CustomerNum { get; set; }
/// <summary> /// <summary>
/// 开船日期 /// 开船日期

@ -0,0 +1,20 @@
using DS.WMS.Core.Fee.Dtos;
namespace DS.WMS.Core.Application.Dtos
{
/// <summary>
/// 发票申请查询条件
/// </summary>
public class InvoiceApplicationQuery
{
/// <summary>
/// 编号(主提单号、委托编号、客户编号、订舱编号)
/// </summary>
public string? Number { get; set; }
/// <summary>
/// 费用范围
/// </summary>
public FeeRange? FeeRange { get; set; }
}
}

@ -22,7 +22,7 @@ namespace DS.WMS.Core.Application.Interface
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<List<BizInvoiceApplication>>> GetBizListAsync(PageRequest<FeeRange?> request); Task<DataResult<List<BizInvoiceApplication>>> GetBizListAsync(PageRequest<InvoiceApplicationQuery?> request);
/// <summary> /// <summary>
/// 获取申请单详情 /// 获取申请单详情

@ -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),

@ -196,7 +196,7 @@ namespace DS.WMS.Core.Application.Method
CustomerId = f.CustomerId, CustomerId = f.CustomerId,
CustomerName = f.CustomerName, //结费单位 CustomerName = f.CustomerName, //结费单位
AccountDate = s.AccountDate, AccountDate = s.AccountDate,
BookingNO = s.BookingNo, //订舱编号 BookingNo = s.BookingNo, //订舱编号
CntrTotal = s.CntrTotal, CntrTotal = s.CntrTotal,
CreateBy = s.CreateBy, CreateBy = s.CreateBy,
ETD = s.ETD, ETD = s.ETD,

@ -1,7 +1,6 @@
using DS.Module.Core; using DS.Module.Core;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
using Masuit.Tools.Systems; using Masuit.Tools.Systems;
using SqlSugar;
namespace DS.WMS.Core.Fee.Dtos namespace DS.WMS.Core.Fee.Dtos
{ {
@ -90,6 +89,11 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary> /// </summary>
public string CustomerNo { get; set; } public string CustomerNo { get; set; }
/// <summary>
/// 客户编号
/// </summary>
public string? CustomerNum { get; set; }
/// <summary> /// <summary>
/// 报关单号 /// 报关单号
/// </summary> /// </summary>

@ -61,6 +61,7 @@ namespace DS.WMS.Core.Fee.Method
Vessel = s.Vessel,//船名 Vessel = s.Vessel,//船名
Voyage = s.Voyno,//航次 Voyage = s.Voyno,//航次
BookingNo = s.BookingNo, BookingNo = s.BookingNo,
CustomerNum = s.CustomerNum,
StlName = s.StlName, StlName = s.StlName,
InvoiceNo = s.InvoiceNo, InvoiceNo = s.InvoiceNo,

@ -83,7 +83,7 @@ namespace DS.WMS.Core.Invoice.Method
SaleName = x.Sale, SaleName = x.Sale,
Vessel = x.Vessel, Vessel = x.Vessel,
Voyage = x.Voyage, Voyage = x.Voyage,
BookingNO = x.BookingNo, BookingNo = x.BookingNo,
//未开票金额=金额-已开票金额-申请开票金额+申请开票金额已开票 //未开票金额=金额-已开票金额-申请开票金额+申请开票金额已开票
UnBilledRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == x.BusinessId && f.FeeStatus == FeeStatus.AuditPassed UnBilledRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == x.BusinessId && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency == FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)), && f.Currency == FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),

@ -90,7 +90,8 @@ namespace DS.WMS.Core.Settlement.Method
{ {
SettlementTypeName = x.SettlementType.StlName, //结算方式 SettlementTypeName = x.SettlementType.StlName, //结算方式
CustomerBankName = x.CustomerBank.BankName, CustomerBankName = x.CustomerBank.BankName,
CustomerAccount = x.CustomerBank.Account CustomerAccount = x.CustomerBank.Account,
CreateByName = x.CreateUserName
}, true).FirstAsync(x => x.Id == id); }, true).FirstAsync(x => x.Id == id);
if (model != null) if (model != null)

@ -229,8 +229,9 @@ namespace DS.WMS.Core.Settlement.Method
{ {
SettlementTypeName = x.SettlementType.StlName, //结算方式 SettlementTypeName = x.SettlementType.StlName, //结算方式
CustomerBankName = x.CustomerBank.BankName, CustomerBankName = x.CustomerBank.BankName,
CustomerAccount = x.CustomerBank.Account CustomerAccount = x.CustomerBank.Account,
}, true).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement); CreateByName = x.CreateUserName
}, true).FirstAsync(x => x.Id == id);
if (model != null) if (model != null)
{ {

@ -39,7 +39,8 @@ namespace DS.WMS.Core.Settlement.Method
{ {
SettlementTypeName = x.SettlementType.StlName, //结算方式 SettlementTypeName = x.SettlementType.StlName, //结算方式
CustomerBankName = x.CustomerBank.BankName, CustomerBankName = x.CustomerBank.BankName,
CustomerAccount = x.CustomerBank.Account CustomerAccount = x.CustomerBank.Account,
CreateByName = x.CreateUserName
}, true).FirstAsync(x => x.Id == id); }, true).FirstAsync(x => x.Id == id);
if (model != null) if (model != null)

Loading…
Cancel
Save