From 839a10cc52a364c6a4c10b11d46fbe7f2274687f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Wed, 16 Oct 2024 11:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=A2=9E=E5=8A=A0=E6=9C=BA?= =?UTF-8?q?=E6=9E=84=E9=93=B6=E8=A1=8CID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 3 + .../Application/Dtos/BizOperation.cs | 5 + .../Method/ApplicationServiceBase.cs | 19 ++-- .../Invoice/Method/GeneralInvoiceService.cs | 51 +++++++--- .../Invoice/Method/InvoiceService`1.cs | 98 +++++++++++-------- .../Settlement/Dtos/SettlementDto.cs | 4 +- .../Entity/ApplicationSettlement.cs | 2 +- .../Settlement/Entity/SettlementBase.cs | 6 +- .../Interface/IFreeSettlementService.cs | 2 +- .../Method/FreeSettlementService.cs | 66 +++---------- .../PaymentFreeSettlementController.cs | 2 +- 11 files changed, 132 insertions(+), 126 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 8c660154..90d8556c 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -705,6 +705,9 @@ public static class MultiLanguageConst [Description("税率不一致,禁止提交")] public const string InconsistentTaxRates= "Inconsistent_Tax_Rates"; + + [Description("发票或其明细已进入结算流程,请先取消结算后再删除")] + public const string InvoiceIsSettled = "Invoice_Is_Settled"; #endregion #region 预订舱API diff --git a/ds-wms-service/DS.WMS.Core/Application/Dtos/BizOperation.cs b/ds-wms-service/DS.WMS.Core/Application/Dtos/BizOperation.cs index bc2bc811..679644f4 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Dtos/BizOperation.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Dtos/BizOperation.cs @@ -51,6 +51,11 @@ namespace DS.WMS.Core.Application.Dtos /// public long CustomerId { get; set; } + /// + /// 费用对象名称 + /// + public string? CustomerName { get; set; } + /// /// 汇率信息 /// diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationServiceBase.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationServiceBase.cs index 7e58c1bb..263cf16d 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationServiceBase.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationServiceBase.cs @@ -1,8 +1,7 @@ -using DS.WMS.Core.Application.Dtos; +using System.Linq.Expressions; +using DS.WMS.Core.Application.Dtos; using DS.WMS.Core.Application.Entity; -using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Fee.Entity; -using System.Linq.Expressions; using DS.WMS.Core.Fee.Method; using DS.WMS.Core.Op.Entity; using SqlSugar; @@ -35,8 +34,7 @@ namespace DS.WMS.Core.Application.Method .InnerJoin((d, f) => d.RecordId == f.Id) .LeftJoin((d, f, s) => f.BusinessId == s.Id && f.BusinessType == BusinessType.OceanShippingExport) .WhereIF(expr1 != null, expr1) - .LeftJoin((d, f, s, cs) => s.SourceId == cs.Id) - .Select((d, f, s, cs) => new ApplicationDetailDto + .Select((d, f, s) => new ApplicationDetailDto { //---------------明细表-------------- Id = d.Id, @@ -45,7 +43,6 @@ namespace DS.WMS.Core.Application.Method RefId = d.RefId, RecordId = d.RecordId, FeeType = d.FeeType, - CustomerName = d.CustomerName, FeeId = d.FeeId, FeeName = d.FeeName, Currency = d.Currency, @@ -60,30 +57,30 @@ namespace DS.WMS.Core.Application.Method Amount = f.Amount, AccTaxRate = f.AccTaxRate, CustomerId = f.CustomerId,//费用对象ID + CustomerName = f.CustomerName, OrderAmount = f.OrderAmount, InvoiceAmount = f.InvoiceAmount, SettlementAmount = f.SettlementAmount, OrderSettlementAmount = f.OrderSettlementAmount, OrderInvSettlementAmount = f.OrderInvSettlementAmount, + BusinessId = f.BusinessId, + BusinessType = f.BusinessType, //---------------业务表-------------- - BusinessId = s.Id, - BusinessType = BusinessType.OceanShippingExport, AccountDate = s.AccountDate, CntrTotal = s.CntrTotal, CustomerNo = s.CustomerNo, ClientName = s.CustomerName, //委托单位 - //DischargePort = s.DischargePort, ETD = s.ETD, HBLNO = s.HBLNO, LoadPort = s.LoadPort, + //DischargePort = s.DischargePort, MBLNO = s.MBLNO, SaleDeptId = s.SaleDeptId, SaleName = s.Sale,//揽货人 Vessel = s.Vessel,//船名 Voyage = s.Voyno,//航次 BookingNo = s.BookingNo, - //---------------附加表-------------- - SourceName = cs.SourceName + SourceName = s.SourceName }); //海运进口 diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/GeneralInvoiceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/GeneralInvoiceService.cs index 5415fbbf..680a549b 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/GeneralInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/GeneralInvoiceService.cs @@ -105,12 +105,15 @@ namespace DS.WMS.Core.Invoice.Method OriginalCurrency = x.OriginalCurrency, //原始币别 ExchangeRate = x.ExchangeRate, //折算汇率 OriginalAmount = x.OriginalAmount, //原始金额 - SaleName = x.SaleName, + CustomerNo = x.CustomerNo, MBLNO = x.MBLNO, + HBLNO = x.HBLNO, + SaleName = x.SaleName, ClientName = x.ClientName, ETD = x.ETD, SourceName = x.SourceName, + AuditTime = y.AuditTime }).ToListAsync(); @@ -146,7 +149,7 @@ namespace DS.WMS.Core.Invoice.Method protected override Task PostSaveAsync(Entity.Invoice invoice) { - return Task.Factory.StartNew(UpdateInvoiceApplications, new List { invoice }); + return RefreshApplicationStatus([invoice], null); } protected override async Task OnDeleteDetailAsync(List invoices, DeleteOption deleteOption) @@ -205,42 +208,59 @@ namespace DS.WMS.Core.Invoice.Method protected override Task PostDeleteAsync(List invoices, DeleteOption deleteOption) { - return Task.Factory.StartNew(UpdateInvoiceApplications, invoices); + ////获取关联的发票申请的ID + //var ids = invoices.SelectMany(x => x.Details).Where(x => x.RefId.HasValue).Select(x => x.RefId.GetValueOrDefault()).Distinct(); + //if (deleteOption == DeleteOption.Entire) + //{ + // return TenantDb.Updateable() + // .SetColumns(x => x.Status == InvoiceApplicationStatus.AuditPassed) + // .Where(x => ids.Contains(x.Id)) + // .ExecuteCommandAsync(); + //} + //else if (deleteOption == DeleteOption.DetailOnly) + //{ + // //获取关联的发票申请的明细ID + // var ids2 = invoices.SelectMany(x => x.Details).Where(x => x.DetailId.HasValue).Select(x => x.DetailId.GetValueOrDefault()).Distinct(); + + //} + + //return Task.CompletedTask; + + return RefreshApplicationStatus(invoices, deleteOption); } //更新发票申请的状态 - void UpdateInvoiceApplications(object? state) + private async Task RefreshApplicationStatus(List invoices, DeleteOption? deleteOption) { - var list = state as IEnumerable; - if (list == null || !list.Any()) + if (invoices == null || !invoices.Any()) return; - var ids = list.SelectMany(x => x.Details).Where(x => x.RefId.HasValue).Select(x => x.RefId.GetValueOrDefault()).Distinct().ToList(); - var appDetails = TenantDb.Queryable().Where(d => ids.Contains(d.ApplicationId)) + //获取关联的发票申请的ID + var ids = invoices.SelectMany(x => x.Details).Where(x => x.RefId.HasValue).Select(x => x.RefId.GetValueOrDefault()).Distinct().ToList(); + var appDetails = await TenantDb.Queryable().Where(d => ids.Contains(d.ApplicationId)) .Select(d => new ApplicationDetail { Id = d.Id, + Category = d.Category, ApplicationId = d.ApplicationId, OriginalAmount = d.OriginalAmount, OriginalProcessedAmount = d.OriginalProcessedAmount - }).ToList(); + }).ToListAsync(); List list2 = new(ids.Count); foreach (var id in ids) { var entity = new InvoiceApplication { Id = id }; - var inv = list.FirstOrDefault(x => x.Details.Any(y => y.RefId == id)); - entity.AcutalInvoiceNO = inv?.InvoiceNO; - var details = appDetails.FindAll(x => x.ApplicationId == id); + if (details.All(x => x.OriginalAmount == x.OriginalAmount - x.OriginalProcessedAmount)) { - entity.Status = InvoiceApplicationStatus.Invoiced; + entity.Status = deleteOption.HasValue ? InvoiceApplicationStatus.AuditPassed : InvoiceApplicationStatus.Invoiced; list2.Add(entity); } else if (details.All(x => x.OriginalAmount - x.OriginalProcessedAmount == 0)) { - entity.Status = InvoiceApplicationStatus.AuditPassed; + entity.Status = deleteOption == null ? InvoiceApplicationStatus.Invoiced : InvoiceApplicationStatus.AuditPassed; list2.Add(entity); } else if (details.Exists(x => x.OriginalAmount != x.OriginalAmount - x.OriginalProcessedAmount)) @@ -250,7 +270,8 @@ namespace DS.WMS.Core.Invoice.Method } } - TenantDb.Updateable(list2).UpdateColumns(x => new { x.Status, x.AcutalInvoiceNO }).ExecuteCommand(); + await TenantDb.Updateable(list2).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); } + } } diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs index 57513e11..934eaeb2 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs @@ -9,13 +9,11 @@ using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Info.Entity; using DS.WMS.Core.Invoice.Dtos; using DS.WMS.Core.Invoice.Interface; +using DS.WMS.Core.Settlement.Entity; using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Interface; -using LanguageExt.Pretty; using Mapster; -using Masuit.Tools.Models; using Microsoft.Extensions.DependencyInjection; -using Org.BouncyCastle.Asn1.Cmp; using SqlSugar; namespace DS.WMS.Core.Invoice.Method @@ -227,7 +225,8 @@ namespace DS.WMS.Core.Invoice.Method if (invoice.PushModeValues.Length > 0) invoice.PushMode = string.Join(",", invoice.PushModeValues.Select(x => (int)x)); - if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications != null && request.Applications.Count > 0) //按发票申请开出 + //按申请开票 + if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications?.Count > 0) { var ids = request.Applications.Select(x => x.ApplicationId); var details = await TenantDb.Queryable() @@ -339,21 +338,36 @@ namespace DS.WMS.Core.Invoice.Method invoice.Details.Add(detail); } + DataResult result2; + //执行开票金额分配 + foreach (var app in request.Applications) + { + var details2 = invoice.Details.Where(x => x.RefId == app.ApplicationId).OrderBy(x => x.ApplyAmount).ToList(); + if (app.AmountRMB.HasValue) + { + result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency == FeeCurrency.RMB_CODE), app.AmountRMB.Value); + if (!result2.Succeeded) + return DataResult.Failed(result2.Message, result2.MultiCode); + } + + if (app.AmountUSD.HasValue) + { + result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency == FeeCurrency.USD_CODE), app.AmountUSD.Value); + if (!result2.Succeeded) + return DataResult.Failed(result2.Message, result2.MultiCode); + } - ////执行开票金额分配 - //foreach (var app in request.Applications) - //{ - // var details2 = invoice.Details.Where(x => x.RefId == app.ApplicationId).OrderBy(x => x.ApplyAmount).ToList(); - // if (app.AmountRMB.HasValue) - // { - // var result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency == FeeCurrency.RMB_CODE), app.AmountRMB.Value); - // if (!result2.Succeeded) - // return DataResult.Failed(result2.Message, result2.MultiCode); - // } + if (app.AmountOther.HasValue) + { + result2 = AssignAmount(details2.FindAll(x => x.OriginalCurrency != FeeCurrency.RMB_CODE && x.OriginalCurrency != FeeCurrency.USD_CODE), app.AmountOther.Value); + if (!result2.Succeeded) + return DataResult.Failed(result2.Message, result2.MultiCode); + } - //} + } } - else if (request.Invoice.Mode == InvoiceMode.Free) //自由开票 + //自由开票 + else if (request.Invoice.Mode == InvoiceMode.Free) { if (request.BizList?.Count > 0) { @@ -409,32 +423,32 @@ namespace DS.WMS.Core.Invoice.Method OriginalAmount = x.OriginalAmount, OriginalCurrency = x.OriginalCurrency ?? (invoice.Currency.IsNullOrEmpty() ? x.Currency : invoice.Currency), }).ToList(); - - //补充购方信息 - invoice.CustomerTaxID = await TenantDb.Queryable().Where(x => x.Id == invoice.CustomerId).Select(x => x.TaxNo).FirstAsync(); - var header = await TenantDb.Queryable().Where(x => x.RelativeId == invoice.CustomerId) - .OrderByDescending(x => x.Id).FirstAsync(); - if (header != null) - { - invoice.InvoiceHeader = header.Header; - invoice.CustomerAddressTel = header.AddressTel; - } - var clientBank = await TenantDb.Queryable().Where(x => x.ClientId == invoice.CustomerId && x.Currency == invoice.Currency) - .OrderByDescending(x => x.IsInvoiceDefault).Select(x => new - { - x.Account, - x.BankName - }).FirstAsync(); - if (clientBank != null) - { - invoice.CustomerAccount = clientBank.Account; - invoice.CustomerBankName = clientBank.BankName; - } } } if (invoice.Id == 0) { + //补充购方信息 + invoice.CustomerTaxID = await TenantDb.Queryable().Where(x => x.Id == invoice.CustomerId).Select(x => x.TaxNo).FirstAsync(); + var header = await TenantDb.Queryable().Where(x => x.RelativeId == invoice.CustomerId) + .OrderByDescending(x => x.Id).FirstAsync(); + if (header != null) + { + invoice.InvoiceHeader = header.Header; + invoice.CustomerAddressTel = header.AddressTel; + } + var clientBank = await TenantDb.Queryable().Where(x => x.ClientId == invoice.CustomerId && x.Currency == invoice.Currency) + .OrderByDescending(x => x.IsInvoiceDefault).Select(x => new + { + x.Account, + x.BankName + }).FirstAsync(); + if (clientBank != null) + { + invoice.CustomerAccount = clientBank.Account; + invoice.CustomerBankName = clientBank.BankName; + } + //补充销方信息 var org = await Db.Queryable().Where(x => x.Id == User.OrgId).Select(x => new { x.OrgFullName, x.LicenseCode }).FirstAsync(); if (org != null) @@ -877,6 +891,10 @@ namespace DS.WMS.Core.Invoice.Method if (invoices.Any(x => !string.IsNullOrEmpty(x.ApiCode))) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.InvoiceIsIssued)); + var ids = invoices.Select(x => x.Id); + if (TenantDb.Queryable().Any(x => ids.Contains(x.RefId.Value) && x.Category == DetailCategory.InvoiceSettlement)) + return DataResult.FailedWithDesc(nameof(MultiLanguageConst.InvoiceIsSettled)); + return DataResult.Success; } @@ -888,12 +906,12 @@ namespace DS.WMS.Core.Invoice.Method /// protected virtual async Task OnDeleteDetailAsync(List invoices, DeleteOption deleteOption) { - var appIds = invoices.Select(x => x.Id); + var ids = invoices.Select(x => x.Id); if (deleteOption == DeleteOption.DetailOnly) { var excludeIds = invoices.SelectMany(x => x.Details).Select(x => x.Id); - var details = await TenantDb.Queryable().Where(x => appIds.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id)) + var details = await TenantDb.Queryable().Where(x => ids.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id)) .Select(x => new ApplicationDetail { Id = x.Id, @@ -919,7 +937,7 @@ namespace DS.WMS.Core.Invoice.Method else if (deleteOption == DeleteOption.Entire) { //删除发票主表则同时删除对应发票明细 - await TenantDb.Deleteable().Where(x => appIds.Contains(x.ApplicationId)).ExecuteCommandAsync(); + await TenantDb.Deleteable().Where(x => ids.Contains(x.ApplicationId)).ExecuteCommandAsync(); } foreach (var item in invoices) diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Dtos/SettlementDto.cs b/ds-wms-service/DS.WMS.Core/Settlement/Dtos/SettlementDto.cs index 42c1af40..f3969623 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Dtos/SettlementDto.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Dtos/SettlementDto.cs @@ -89,9 +89,9 @@ namespace DS.WMS.Core.Settlement.Dtos public string BillTypeText => BillType.GetDescription(); /// - /// 结算银行账户 + /// 机构银行ID /// - public string? Account { get; set; } + public long? OrgBankId { get; set; } /// /// 结算业务类别 diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Entity/ApplicationSettlement.cs b/ds-wms-service/DS.WMS.Core/Settlement/Entity/ApplicationSettlement.cs index b5752784..585739e4 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Entity/ApplicationSettlement.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Entity/ApplicationSettlement.cs @@ -6,7 +6,7 @@ namespace DS.WMS.Core.Settlement.Entity /// /// 结算表 /// - [SugarTable("application_payment_settlement", TableDescription = "结算表")] + [SugarTable("application_settlement", TableDescription = "结算表")] public class ApplicationSettlement : SettlementBase { /// diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Entity/SettlementBase.cs b/ds-wms-service/DS.WMS.Core/Settlement/Entity/SettlementBase.cs index 464202b1..a38a633f 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Entity/SettlementBase.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Entity/SettlementBase.cs @@ -53,10 +53,10 @@ namespace DS.WMS.Core.Settlement.Entity public decimal Amount { get; set; } /// - /// 结算银行账户 + /// 机构银行账户ID /// - [SugarColumn(ColumnDescription = "结算银行账户", Length = 50, IsNullable = true)] - public string? Account { get; set; } + [SugarColumn(ColumnDescription = "机构银行账户ID", IsNullable = true)] + public long? OrgBankId { get; set; } /// /// 结算业务类别 diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs index 06977c33..1082b7f0 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs @@ -44,6 +44,6 @@ namespace DS.WMS.Core.Settlement.Interface /// /// 业务ID与业务类型 /// - Task>> GetCurrenciesAsync(params FeeClient[] items); + Task>> GetCurrenciesAsync(List items); } } 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 f1c2b5c9..a6bae38c 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs @@ -187,7 +187,7 @@ namespace DS.WMS.Core.Settlement.Method /// /// 业务ID与业务类型 /// - public async Task>> GetCurrenciesAsync(params FeeClient[] items) + public async Task>> GetCurrenciesAsync(List items) { var bizIds = items.Select(x => x.Id).Distinct(); var types = items.Select(x => x.BusinessType).Distinct(); @@ -205,19 +205,17 @@ namespace DS.WMS.Core.Settlement.Method f.ExchangeRate }).ToListAsync(); - var currencies = list.GroupBy(x => new { x.BusinessId, x.BusinessType, x.CustomerId }).Select(x => new FeeClient + foreach (var item in items) { - Id = x.Key.BusinessId, - BusinessType = x.Key.BusinessType, - CustomerId = x.Key.CustomerId, - ExchangeRates = x.GroupBy(y => y.Currency).Select(y => new CurrencyExchangeRate - { - Currency = y.Key, - ExchangeRate = x.Where(z => z.Currency == y.Key).Select(z => z.ExchangeRate).FirstOrDefault() - }).ToList() - }).ToList(); + item.ExchangeRates = list.Where(x => x.BusinessId == item.Id && x.BusinessType == item.BusinessType && x.CustomerId == item.CustomerId) + .GroupBy(x => x.Currency).Select(x => new CurrencyExchangeRate + { + Currency = x.Key, + ExchangeRate = x.First().ExchangeRate + }).ToList(); + } - return DataResult>.Success(currencies); + return DataResult>.Success(items); } /// @@ -229,46 +227,10 @@ namespace DS.WMS.Core.Settlement.Method { var model = await TenantDb.Queryable().Select(x => new ApplicationSettlementDto { - Id = x.Id, - ApplicationNO = x.ApplicationNO, //申请编号 - SettlementNO = x.SettlementNO, //结算单号 - CustomerId = x.CustomerId, //结算单位 - CustomerName = x.CustomerName, - Mode = x.Mode, //结算类型 - SettlementDate = x.SettlementDate, //结算日期 - SettlementTypeId = x.SettlementTypeId, //结算方式 - CustomerBankId = x.CustomerBankId, //客户银行 - Account = x.Account, //客户账户 - Currency = x.Currency, //币别 - Amount = x.Amount, //金额 - ExchangeRate = x.ExchangeRate, //汇率 - IsLocked = x.IsLocked, //锁定状态 - SaleDeptId = x.SaleDeptId, //所属分部 - BillType = x.BillType, //单据类型 - Category = x.Category, //业务类别 - LedgerVoucherNO = x.LedgerVoucherNO, //总账凭证号 - RelativeNO = x.RelativeNO, //相关号码 - InvoiceAmount = x.InvoiceAmount, - InvoiceDate = x.InvoiceDate, - InvoiceNO = x.InvoiceNO, - Note = x.Note, //备注 - - AccountAmount = x.AccountAmount, //记账资料 - AccountCurrency = x.AccountCurrency, - AccountRate = x.AccountRate, - PrePayAmount = x.PrePayAmount, //预付支资料 - PrePayCurrency = x.PrePayCurrency, - PrePayRate = x.PrePayRate, - AHSRAmount = x.AHSRAmount, //实收支资料 - AHSRCurrency = x.AHSRCurrency, - AHSRRate = x.AHSRRate, - FinancialAmount = x.FinancialAmount,//财务费用 - FinancialCurrency = x.FinancialCurrency, - FinancialRate = x.FinancialRate, - AdvanceAmount = x.AdvanceAmount, //预收支资料 - AdvanceCurrency = x.AdvanceCurrency, - AdvanceRate = x.AdvanceRate, - }).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement); + SettlementTypeName = x.SettlementType.StlName, //结算方式 + CustomerBankName = x.CustomerBank.BankName, + CustomerAccount = x.CustomerBank.Account + }, true).FirstAsync(x => x.Id == id && x.Mode == SettlementMode.FreeSettlement); var templist = await TenantDb.Queryable().Where(x => x.ApplicationId == id).ToListAsync(); diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs index 40db7b12..a4efe31a 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs @@ -88,7 +88,7 @@ namespace DS.WMS.FeeApi.Controllers /// 业务ID与业务类型 /// [HttpPost, Route("GetCurrencies")] - public async Task>> GetCurrenciesAsync([FromBody] FeeClient[] items) + public async Task>> GetCurrenciesAsync([FromBody] List items) { return await _service.GetCurrenciesAsync(items); }