diff --git a/ds-wms-service/DS.WMS.Core/Application/Dtos/BizApplication.cs b/ds-wms-service/DS.WMS.Core/Application/Dtos/BizApplication.cs index 9edcfcef..6bb6bae8 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Dtos/BizApplication.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Dtos/BizApplication.cs @@ -51,7 +51,13 @@ namespace DS.WMS.Core.Fee.Dtos /// /// 订舱编号 /// - public string? BookingNO { get; set; } + public string? BookingNo { get; set; } + + /// + /// 客户编号 + /// + public string? CustomerNum { get; set; } + /// /// 开船日期 diff --git a/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationQuery.cs b/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationQuery.cs new file mode 100644 index 00000000..d33c106e --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationQuery.cs @@ -0,0 +1,20 @@ +using DS.WMS.Core.Fee.Dtos; + +namespace DS.WMS.Core.Application.Dtos +{ + /// + /// 发票申请查询条件 + /// + public class InvoiceApplicationQuery + { + /// + /// 编号(主提单号、委托编号、客户编号、订舱编号) + /// + public string? Number { get; set; } + + /// + /// 费用范围 + /// + public FeeRange? FeeRange { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Application/Interface/IInvoiceApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Interface/IInvoiceApplicationService.cs index ccf15c5a..741904fd 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Interface/IInvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Interface/IInvoiceApplicationService.cs @@ -22,7 +22,7 @@ namespace DS.WMS.Core.Application.Interface /// /// /// - Task>> GetBizListAsync(PageRequest request); + Task>> GetBizListAsync(PageRequest request); /// /// 获取申请单详情 diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs index 26082a0f..666ffde0 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -96,44 +96,53 @@ namespace DS.WMS.Core.Application.Method /// /// /// - public async Task>> GetBizListAsync(PageRequest request) + public async Task>> GetBizListAsync(PageRequest 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().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.OrderAmount), InvoiceAmount = SqlFunc.Subqueryable().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.InvoiceAmount), diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs index fe926db2..58c872e8 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs @@ -196,7 +196,7 @@ namespace DS.WMS.Core.Application.Method CustomerId = f.CustomerId, CustomerName = f.CustomerName, //结费单位 AccountDate = s.AccountDate, - BookingNO = s.BookingNo, //订舱编号 + BookingNo = s.BookingNo, //订舱编号 CntrTotal = s.CntrTotal, CreateBy = s.CreateBy, ETD = s.ETD, diff --git a/ds-wms-service/DS.WMS.Core/Fee/Dtos/BusinessDto.cs b/ds-wms-service/DS.WMS.Core/Fee/Dtos/BusinessDto.cs index e0e1e4e9..afa667a9 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Dtos/BusinessDto.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Dtos/BusinessDto.cs @@ -1,7 +1,6 @@ using DS.Module.Core; using DS.WMS.Core.Op.Entity; using Masuit.Tools.Systems; -using SqlSugar; namespace DS.WMS.Core.Fee.Dtos { @@ -90,6 +89,11 @@ namespace DS.WMS.Core.Fee.Dtos /// public string CustomerNo { get; set; } + /// + /// 客户编号 + /// + public string? CustomerNum { get; set; } + /// /// 报关单号 /// diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs index d0430633..6693b791 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs @@ -61,6 +61,7 @@ namespace DS.WMS.Core.Fee.Method Vessel = s.Vessel,//船名 Voyage = s.Voyno,//航次 BookingNo = s.BookingNo, + CustomerNum = s.CustomerNum, StlName = s.StlName, InvoiceNo = s.InvoiceNo, diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/FreeInvoiceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/FreeInvoiceService.cs index e3df871a..588bbb09 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/FreeInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/FreeInvoiceService.cs @@ -83,7 +83,7 @@ namespace DS.WMS.Core.Invoice.Method SaleName = x.Sale, Vessel = x.Vessel, Voyage = x.Voyage, - BookingNO = x.BookingNo, + BookingNo = x.BookingNo, //未开票金额=金额-已开票金额-申请开票金额+申请开票金额已开票 UnBilledRMB = SqlFunc.Subqueryable().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)), diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs index f96fac85..7915db77 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs @@ -90,7 +90,8 @@ namespace DS.WMS.Core.Settlement.Method { SettlementTypeName = x.SettlementType.StlName, //结算方式 CustomerBankName = x.CustomerBank.BankName, - CustomerAccount = x.CustomerBank.Account + CustomerAccount = x.CustomerBank.Account, + CreateByName = x.CreateUserName }, true).FirstAsync(x => x.Id == id); if (model != null) diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs index f23e9e8a..9ef38119 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs @@ -229,8 +229,9 @@ namespace DS.WMS.Core.Settlement.Method { SettlementTypeName = x.SettlementType.StlName, //结算方式 CustomerBankName = x.CustomerBank.BankName, - CustomerAccount = x.CustomerBank.Account - }, true).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement); + CustomerAccount = x.CustomerBank.Account, + CreateByName = x.CreateUserName + }, true).FirstAsync(x => x.Id == id); if (model != null) { diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/InvoiceSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/InvoiceSettlementService.cs index 87f4f4fa..99ac842f 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/InvoiceSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/InvoiceSettlementService.cs @@ -39,7 +39,8 @@ namespace DS.WMS.Core.Settlement.Method { SettlementTypeName = x.SettlementType.StlName, //结算方式 CustomerBankName = x.CustomerBank.BankName, - CustomerAccount = x.CustomerBank.Account + CustomerAccount = x.CustomerBank.Account, + CreateByName = x.CreateUserName }, true).FirstAsync(x => x.Id == id); if (model != null)