From 02c3e00a89a4b010797394988c330246e9873223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Wed, 17 Jul 2024 16:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E5=87=86=E5=8F=91=E7=A5=A8=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=BC=80=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 3 + .../Application/Dtos/ApplicationDetailDto.cs | 50 +++++- .../Application/Dtos/InvoiceApplicationDto.cs | 8 +- .../Application/Entity/InvoiceApplication.cs | 2 +- .../Method/ApplicationServiceBase.cs | 94 ++++++++++ .../Method/ApplicationService`1.cs | 1 + .../Method/InvoiceApplicationService.cs | 6 +- .../DS.WMS.Core/Fee/Entity/FeeRecord.cs | 2 +- .../DS.WMS.Core/Fee/Method/FeeServiceBase.cs | 67 +------ .../Invoice/Dtos/InvoiceRequest.cs | 9 +- .../DS.WMS.Core/Invoice/Dtos/RequestItem.cs | 23 +++ .../DS.WMS.Core/Invoice/Entity/Invoice.cs | 2 +- .../Interface/IGeneralInvoiceService.cs | 17 +- .../Invoice/Method/FreeInvoiceService.cs | 4 - .../Invoice/Method/GeneralInvoiceService.cs | 122 ++++++++++++- .../Invoice/Method/InvoiceService`1.cs | 168 ++++++++++++++---- .../Method/PaymentSettlementService.cs | 5 +- .../Controllers/GeneralInvoiceController.cs | 39 +++- .../Controllers/InvoiceController.cs | 99 ----------- .../DS.WMS.FeeApi/Logs/internal-nlog.txt | 140 +++++++++++++++ 20 files changed, 637 insertions(+), 224 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/Application/Method/ApplicationServiceBase.cs create mode 100644 ds-wms-service/DS.WMS.Core/Invoice/Dtos/RequestItem.cs delete mode 100644 ds-wms-service/DS.WMS.FeeApi/Controllers/InvoiceController.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 62deee99..cc45f9fd 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -637,6 +637,9 @@ public static class MultiLanguageConst [Description("发票币别与费用明细币别不一致,需要进行汇率转换")] public const string NeedExchangeRate = "Need_ExchangeRate"; + + [Description("开票单位有且只能有一个")] + public const string InvoiceCustomerOnlyOne = "Invoice_Customer_OnlyOne"; #endregion #region 预订舱API diff --git a/ds-wms-service/DS.WMS.Core/Application/Dtos/ApplicationDetailDto.cs b/ds-wms-service/DS.WMS.Core/Application/Dtos/ApplicationDetailDto.cs index 9cdd2f72..1379a411 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Dtos/ApplicationDetailDto.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Dtos/ApplicationDetailDto.cs @@ -20,10 +20,15 @@ namespace DS.WMS.Core.Application.Dtos public long ApplicationId { get; set; } /// - /// 引用的明细ID(付费申请明细ID) + /// 引用的明细ID(申请明细ID) /// public long? DetailId { get; set; } + /// + /// 引用的ID(申请ID) + /// + public long? RefId { get; set; } + /// /// 费用记录ID /// @@ -74,11 +79,21 @@ namespace DS.WMS.Core.Application.Dtos /// public decimal ApplyAmount { get; set; } + /// + /// 已处理金额 + /// + public decimal ProcessedAmount { get; set; } + /// /// 原始金额 /// public decimal OriginalAmount { get; set; } + /// + /// 已处理原始金额 + /// + public decimal OriginalProcessedAmount { get; set; } + /// /// 币别 /// @@ -104,10 +119,36 @@ namespace DS.WMS.Core.Application.Dtos /// public decimal AccTaxRate { get; set; } + /// + /// 已申请金额 + /// + public decimal OrderAmount { get; set; } + + /// + /// 已结算金额 + /// + public decimal SettlementAmount { get; set; } + + /// + /// 已开票金额 + /// + public decimal InvoiceAmount { get; set; } + + /// + /// 申请金额已结算 + /// + public decimal OrderSettlementAmount { get; set; } + + /// + /// 申请发票金额已开票 + /// + public decimal OrderInvSettlementAmount { get; set; } + + /// /// 剩余金额 /// - public decimal RestAmount { get; set; } + public decimal? RestAmount { get; set; } /// /// 备注 @@ -254,6 +295,11 @@ namespace DS.WMS.Core.Application.Dtos /// 录入方式 /// public string? InputMethod { get; set; } + + /// + /// 审核日期 + /// + public DateTime? AuditTime { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationDto.cs b/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationDto.cs index 184f1469..ae733698 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationDto.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Dtos/InvoiceApplicationDto.cs @@ -143,20 +143,20 @@ namespace DS.WMS.Core.Application.Dtos public List? InvoiceDetails { get; set; } [IgnoreDataMember] - public List OriginalAmountList { get; set; } + public List? OriginalAmountList { get; set; } /// /// 原币金额 /// - public string OriginalAmount => string.Join(" ", OriginalAmountList); + public string OriginalAmount => OriginalAmountList == null ? string.Empty : string.Join(" ", OriginalAmountList); [IgnoreDataMember] - public List UnsettledList { get; set; } + public List? UnsettledList { get; set; } /// /// 未结算金额 /// - public string UnsettledAmount => string.Join(" ", UnsettledList); + public string UnsettledAmount => UnsettledList == null ? string.Empty : string.Join(" ", UnsettledList); /// /// 是否已审核(仅用于查询) diff --git a/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceApplication.cs b/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceApplication.cs index c3c82b7f..9ded2595 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceApplication.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceApplication.cs @@ -37,7 +37,7 @@ namespace DS.WMS.Core.Application.Entity /// 开票币别 /// [SugarColumn(ColumnDescription = "开票币别", Length = 3, IsNullable = false)] - public string InvoiceCurrency { get; set; } + public string? InvoiceCurrency { 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 new file mode 100644 index 00000000..4a096dbb --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationServiceBase.cs @@ -0,0 +1,94 @@ +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; + +namespace DS.WMS.Core.Application.Method +{ + /// + /// 申请单相关服务基类 + /// + public abstract class ApplicationServiceBase : FeeServiceBase + { + /// + /// 初始化 + /// + /// 服务提供程序 + protected ApplicationServiceBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + /// + /// 返回针对费用申请明细及其关联业务的查询对象 + /// + /// 关联条件1 + /// 查询对象 + public ISugarQueryable CreateApplicationDetailQuery( + Expression>? expr1 = null) + { + //海运出口 + var query1 = TenantDb.Queryable() + .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 + { + //---------------明细表-------------- + Id = d.Id, + ApplicationId = d.ApplicationId, + DetailId = d.DetailId, + RecordId = d.RecordId, + FeeType = d.FeeType, + CustomerName = d.CustomerName, + FeeId = d.FeeId, + FeeName = d.FeeName, + Currency = d.Currency, + ApplyAmount = d.ApplyAmount, + ExchangeRate = d.ExchangeRate, + OriginalAmount = d.OriginalAmount, + OriginalCurrency = d.OriginalCurrency, + ProcessedAmount = d.ProcessedAmount, + OriginalProcessedAmount = d.OriginalProcessedAmount, + //---------------费用表-------------- + OriginalRate = f.ExchangeRate, + Amount = f.Amount, + AccTaxRate = f.AccTaxRate, + CustomerId = f.CustomerId,//费用对象ID + OrderAmount = f.OrderAmount, + InvoiceAmount = f.InvoiceAmount, + SettlementAmount = f.SettlementAmount, + OrderSettlementAmount = f.OrderSettlementAmount, + OrderInvSettlementAmount = f.OrderInvSettlementAmount, + //---------------业务表-------------- + 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, + MBLNO = s.MBLNO, + SaleDeptId = s.SaleDeptId, + SaleName = s.Sale,//揽货人 + Vessel = s.Vessel,//船名 + Voyage = s.Voyno,//航次 + BookingNo = s.BookingNo, + //---------------附加表-------------- + SourceName = cs.SourceName + }); + + //海运进口 + + + return TenantDb.UnionAll(new List> { query1 }); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs index f1b72fc0..cfe59893 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs @@ -226,6 +226,7 @@ namespace DS.WMS.Core.Application.Method await TenantDb.Updateable(application).IgnoreColumns(x => new { x.ApplicationNO, + x.Status, x.CreateBy, x.CreateTime, x.Deleted, 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 57c2345e..49262b32 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -8,7 +8,6 @@ using DS.WMS.Core.Application.Interface; using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Info.Entity; -using DS.WMS.Core.Invoice.Entity; using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Sys.Entity; using SqlSugar; @@ -495,7 +494,7 @@ namespace DS.WMS.Core.Application.Method await TenantDb.Deleteable().Where(x => x.ApplicationId == application.Id).ExecuteCommandAsync(); //然后根据申请单明细重新生成 - CreateInvoiceDetailsAsync([application]); + await CreateInvoiceDetailsAsync([application]); if (application.InvoiceDetails?.Count > 0) { @@ -509,6 +508,9 @@ namespace DS.WMS.Core.Application.Method .UpdateColumns(x => new { x.OrderInvoiceAmount }) .ExecuteCommandAsync(); + //if (application.InvoiceCurrency.IsNullOrEmpty()) + // application.InvoiceCurrency = RMB_CODE; + await base.OnSaveAsync(application, fees); } diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs index 83b537d7..6487610a 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs @@ -166,7 +166,7 @@ namespace DS.WMS.Core.Fee.Entity ///已申请金额 /// [SugarColumn(ColumnDescription = "已申请金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] - public decimal OrderAmount { get; set; } = 0; + public decimal OrderAmount { get; set; } /// /// Desc:申请开票金额 /// 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 d09a9fbf..560dd731 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs @@ -3,9 +3,6 @@ using DS.Module.Core; using DS.Module.Core.Extensions; using DS.Module.SqlSugar; using DS.Module.UserModule; -using DS.WMS.Core.Application.Dtos; -using DS.WMS.Core.Application.Entity; -using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Flow.Entity; @@ -139,68 +136,6 @@ namespace DS.WMS.Core.Fee.Method return TenantDb.UnionAll(new List> { query1 }); } - /// - /// 返回针对费用申请明细及其关联业务的查询对象 - /// - /// 关联条件1 - /// 查询对象 - public ISugarQueryable CreateApplicationDetailQuery( - Expression>? expr1 = null) - { - //海运出口 - var query1 = TenantDb.Queryable() - .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 - { - //---------------明细表-------------- - Id = d.Id, - ApplicationId = d.ApplicationId, - DetailId = d.DetailId, - RecordId = d.RecordId, - FeeType = d.FeeType, - CustomerName = d.CustomerName, - FeeId = d.FeeId, - FeeName = d.FeeName, - Currency = d.Currency, - ApplyAmount = d.ApplyAmount, - ExchangeRate = d.ExchangeRate, - OriginalAmount = d.OriginalAmount, - OriginalCurrency = d.OriginalCurrency, - //---------------费用表-------------- - OriginalRate = f.ExchangeRate, - Amount = f.Amount, - AccTaxRate = f.AccTaxRate, - CustomerId = f.CustomerId,//费用对象ID - //---------------业务表-------------- - 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, - MBLNO = s.MBLNO, - SaleDeptId = s.SaleDeptId, - SaleName = s.Sale,//揽货人 - Vessel = s.Vessel,//船名 - Voyage = s.Voyno,//航次 - BookingNo = s.BookingNo, - //---------------附加表-------------- - SourceName = cs.SourceName - }); - - //海运进口 - - - return TenantDb.UnionAll(new List> { query1 }); - } - /// /// 更新费用及其业务的费用状态 /// @@ -209,7 +144,7 @@ namespace DS.WMS.Core.Fee.Method protected internal void UpdateFeeStatus(IEnumerable ids) { var task1 = Task.Factory.StartNew(UpdateFeeStatusCore, ids, CancellationToken.None); - var task2 = task1.ContinueWith(t => UpdateBizStatusCore(t.Result), TaskContinuationOptions.OnlyOnRanToCompletion); + task1.ContinueWith(t => UpdateBizStatusCore(t.Result), TaskContinuationOptions.OnlyOnRanToCompletion); } private List UpdateFeeStatusCore(object? state) diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceRequest.cs b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceRequest.cs index 198f02f0..abd55f48 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceRequest.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceRequest.cs @@ -3,7 +3,7 @@ namespace DS.WMS.Core.Invoice.Dtos { /// - /// 提交结算单请求参数 + /// 提交开票请求参数 /// public class InvoiceRequest where TEntity : Entity.Invoice { @@ -13,7 +13,12 @@ namespace DS.WMS.Core.Invoice.Dtos public TEntity Invoice { get; set; } /// - /// 结算费用明细 + /// 发票申请 + /// + public List? Applications { get; set; } + + /// + /// 发票费用明细 /// public List? Details { get; set; } diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/RequestItem.cs b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/RequestItem.cs new file mode 100644 index 00000000..35f58d22 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/RequestItem.cs @@ -0,0 +1,23 @@ +namespace DS.WMS.Core.Invoice.Dtos +{ + /// + /// 按发票申请开票的请求项 + /// + public class RequestItem + { + /// + /// 发票申请ID + /// + public long ApplicationId { get; set; } + + /// + /// 发票申请币别 + /// + public string Currency { get; set; } + + /// + /// 折算汇率 + /// + public decimal? ExchangeRate { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Entity/Invoice.cs b/ds-wms-service/DS.WMS.Core/Invoice/Entity/Invoice.cs index f62c277c..7fa94d41 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Entity/Invoice.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Entity/Invoice.cs @@ -10,7 +10,7 @@ namespace DS.WMS.Core.Invoice.Entity /// /// 发票相关基类 /// - [SugarTable("invoice_form", TableDescription = "发票主表")] + [SugarTable("application_invoice_form", TableDescription = "发票主表")] public class Invoice : BaseModelV2 { /// diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Interface/IGeneralInvoiceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Interface/IGeneralInvoiceService.cs index 0d108cbc..4d971d29 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Interface/IGeneralInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Interface/IGeneralInvoiceService.cs @@ -1,10 +1,25 @@ -namespace DS.WMS.Core.Invoice.Interface +using DS.Module.Core; +using DS.WMS.Core.Application.Dtos; + +namespace DS.WMS.Core.Invoice.Interface { /// /// 标准开票 /// public interface IGeneralInvoiceService : IInvoiceService { + /// + /// 获取发票申请分页列表 + /// + /// + /// + Task>> GetApplicationListAsync(PageRequest request); + /// + /// 获取发票申请明细 + /// + /// 申请单ID + /// + Task>> GetApplicationDetailsAsync(params long[] ids); } } 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 23c777f2..62150790 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/FreeInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/FreeInvoiceService.cs @@ -3,10 +3,8 @@ using DS.Module.Core; using DS.Module.Core.Enums; using DS.Module.Core.Extensions; using DS.WMS.Core.Application.Dtos; -using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Entity; -using DS.WMS.Core.Invoice.Dto; using DS.WMS.Core.Invoice.Interface; using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Sys.Entity; @@ -190,8 +188,6 @@ namespace DS.WMS.Core.Invoice.Method sb.Append(";"); continue; } - - detail.Category = DetailCategory.InvoiceIssuance; } return sb.Length > 0 ? DataResult.Failed(sb.ToString()) : DataResult.Success; 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 38aea391..04b8b7bf 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/GeneralInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/GeneralInvoiceService.cs @@ -23,14 +23,15 @@ namespace DS.WMS.Core.Invoice.Method } /// - /// 获取付费申请分页列表 + /// 获取发票申请分页列表 /// /// /// public async Task>> GetApplicationListAsync(PageRequest request) { - var query = TenantDb.Queryable().Where(x => x.Status == InvoiceApplicationStatus.AuditPassed || x.Status == InvoiceApplicationStatus.PartialInvoiced) - .InnerJoin((a, d) => a.Id == d.ApplicationId && (d.OriginalAmount - d.OriginalProcessedAmount) != 0) + var query = TenantDb.Queryable() + .Where(a => (a.Status == InvoiceApplicationStatus.AuditPassed || a.Status == InvoiceApplicationStatus.PartialInvoiced) && + SqlFunc.Subqueryable().Where(d => d.ApplicationId == a.Id && (d.OriginalAmount - d.OriginalProcessedAmount) != 0).Any()) .Select(a => new InvoiceApplicationDto { Id = a.Id, @@ -78,5 +79,120 @@ namespace DS.WMS.Core.Invoice.Method return result; } + + /// + /// 获取发票申请明细 + /// + /// 申请单ID + /// + public async Task>> GetApplicationDetailsAsync(params long[] ids) + { + var query = CreateApplicationDetailQuery((d, f, s) => ids.Contains(d.ApplicationId) && d.Category == DetailCategory.InvoiceApplication && (d.OriginalAmount - d.OriginalProcessedAmount) != 0); + + var details = await TenantDb.Queryable(query).LeftJoin((x, y) => x.ApplicationId == y.Id) + .Select((x, y) => new InvoiceApplicationDetailDto + { + Id = x.Id, + ApplicationId = x.ApplicationId, + BusinessId = x.BusinessId, + BusinessType = x.BusinessType, + RecordId = x.RecordId, + FeeName = x.FeeName, + FeeType = x.FeeType, + ApplyAmount = x.ApplyAmount, + RestAmount = x.ApplyAmount - x.ProcessedAmount, + OriginalCurrency = x.OriginalCurrency, //原始币别 + ExchangeRate = x.ExchangeRate, //折算汇率 + OriginalAmount = x.OriginalAmount, //原始金额 + SaleName = x.SaleName, + CustomerNo = x.CustomerNo, + MBLNO = x.MBLNO, + ClientName = x.ClientName, + ETD = x.ETD, + SourceName = x.SourceName, + AuditTime = y.AuditTime + }).ToListAsync(); + + return DataResult>.Success(details); + } + + protected override Task PreSaveAsync(Entity.Invoice invoice) + { + invoice.Type = InvoiceType.Applcation; + + return Task.FromResult(DataResult.Success); + } + + protected override Task PostSaveAsync(Entity.Invoice invoice) + { + return Task.Factory.StartNew(UpdateInvoiceApplications, new List { invoice }); + } + + protected override async Task OnDeleteDetailAsync(List invoices, DeleteOption deleteOption) + { + var list = invoices.SelectMany(x => x.Details).Where(x => x.DetailId.HasValue).Select(x => new ApplicationDetail + { + Id = x.DetailId.GetValueOrDefault(), + ProcessedAmount = x.ApplyAmount, + OriginalProcessedAmount = x.OriginalAmount + }).ToList(); + //恢复发票申请明细的已处理金额 + await TenantDb.Updateable(list) + .PublicSetColumns(x => x.ProcessedAmount, "-").PublicSetColumns(x => x.OriginalProcessedAmount, "-") + .UpdateColumns(x => new { x.ProcessedAmount, x.OriginalProcessedAmount }) + .ExecuteCommandAsync(); + + await base.OnDeleteDetailAsync(invoices, deleteOption); + } + + protected override Task PostDeleteAsync(List invoices, DeleteOption deleteOption) + { + return Task.Factory.StartNew(UpdateInvoiceApplications, invoices); + } + + //更新发票申请的状态 + void UpdateInvoiceApplications(object? state) + { + var list = state as IEnumerable; + if (list == null || !list.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)) + .Select(d => new ApplicationDetail + { + Id = d.Id, + ApplicationId = d.ApplicationId, + OriginalAmount = d.OriginalAmount, + OriginalProcessedAmount = d.OriginalProcessedAmount + }).ToList(); + + 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; + list2.Add(entity); + } + else if (details.All(x => x.OriginalAmount - x.OriginalProcessedAmount == 0)) + { + entity.Status = InvoiceApplicationStatus.AuditPassed; + list2.Add(entity); + } + else if (details.Exists(x => x.OriginalAmount != x.OriginalAmount - x.OriginalProcessedAmount)) + { + entity.Status = InvoiceApplicationStatus.PartialInvoiced; + list2.Add(entity); + } + } + + TenantDb.Updateable(list2).UpdateColumns(x => new { x.Status, x.AcutalInvoiceNO }).ExecuteCommand(); + } } } 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 8417d6be..2beb6fd8 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 @@ -3,8 +3,8 @@ using DS.Module.Core.Enums; using DS.Module.Core.Extensions; using DS.WMS.Core.Application.Dtos; using DS.WMS.Core.Application.Entity; +using DS.WMS.Core.Application.Method; using DS.WMS.Core.Fee.Entity; -using DS.WMS.Core.Fee.Method; using DS.WMS.Core.Invoice.Dto; using DS.WMS.Core.Invoice.Dtos; using DS.WMS.Core.Invoice.Interface; @@ -19,10 +19,9 @@ namespace DS.WMS.Core.Invoice.Method /// 发票服务基类 /// /// - public class InvoiceService : FeeServiceBase, IInvoiceService + public class InvoiceService : ApplicationServiceBase, IInvoiceService where TEntity : Entity.Invoice, new() { - readonly Lazy CommonService; /// @@ -162,6 +161,8 @@ namespace DS.WMS.Core.Invoice.Method return DataResult.Success(invoice); } + +#pragma warning disable CS4014 /// /// 提交发票开票 /// @@ -193,6 +194,75 @@ namespace DS.WMS.Core.Invoice.Method if (!result.Succeeded) return DataResult.Failed(result.Message, result.MultiCode); + //按发票申请 + if (request.Applications != null && request.Applications.Count > 0) + { + var ids = request.Applications.Select(x => x.ApplicationId); + var details = await TenantDb.Queryable() + .InnerJoin((x, y) => x.ApplicationId == y.Id) + .Where((x, y) => ids.Contains(x.ApplicationId) && x.Category == DetailCategory.InvoiceApplication) + .Select((x, y) => new + { + x.Id, + x.ApplicationId, + x.RecordId, + x.CustomerName, + x.FeeId, + x.FeeType, + x.FeeName, + x.ApplyAmount, + x.OriginalAmount, + x.Currency, + x.OriginalCurrency, + x.ProcessedAmount, + x.OriginalProcessedAmount, + y.CustomerId + }).ToListAsync(); + invoice.Details = new List(details.Count); + + foreach (var item in details) + { + if (request.Invoice.CustomerId == 0) + { + request.Invoice.CustomerId = item.CustomerId; + request.Invoice.CustomerName = item.CustomerName; + } + else if (request.Invoice.CustomerId != item.CustomerId) //校验开票单位是否一致 + { + return DataResult.FailedWithDesc(nameof(MultiLanguageConst.InvoiceCustomerOnlyOne)); + } + //需转换为费用明细 + var detail = new ApplicationDetail + { + ApplicationId = request.Invoice.Id, + RefId = item.ApplicationId, + DetailId = item.Id, + RecordId = item.RecordId, + Category = DetailCategory.InvoiceIssuance, + CustomerName = item.CustomerName, + FeeId = item.FeeId, + FeeName = item.FeeName, + FeeType = item.FeeType, + Currency = RMB_CODE, + OriginalCurrency = item.Currency, + ApplyAmount = item.ApplyAmount - item.ProcessedAmount, + OriginalAmount = item.OriginalAmount - item.OriginalProcessedAmount + }; + + var app = request.Applications.Find(x => x.ApplicationId == item.ApplicationId); + if (app != null && app.Currency != invoice.Currency) + detail.ExchangeRate = app.ExchangeRate; + else + detail.ExchangeRate = 1m; + + if (detail.ExchangeRate.HasValue) + detail.ApplyAmount = detail.ApplyAmount * detail.ExchangeRate.Value; + + invoice.Details.Add(detail); + } + } + + //自由申请 if (request.Details?.Count > 0) { if (invoice.Id == 0 && invoice.CustomerId == 0) @@ -202,11 +272,14 @@ namespace DS.WMS.Core.Invoice.Method invoice.CustomerName = first.CustomerName; } + //将请求明细转换为数据库的费用明细 invoice.Details = request.Details.Select(x => new ApplicationDetail { ApplicationId = x.ApplicationId, + RefId = x.RefId, DetailId = x.Id == 0 ? null : x.Id, RecordId = x.RecordId, + Category = DetailCategory.InvoiceIssuance, CustomerName = x.CustomerName ?? invoice.CustomerName, FeeId = x.FeeId, FeeName = x.FeeName, @@ -217,7 +290,10 @@ namespace DS.WMS.Core.Invoice.Method OriginalAmount = x.OriginalAmount, OriginalCurrency = x.OriginalCurrency ?? (invoice.Currency.IsNullOrEmpty() ? x.Currency : invoice.Currency), }).ToList(); + } + if (invoice.Details?.Count > 0) + { //金额禁止为0 if (invoice.Details.Any(x => x.ApplyAmount == 0 || x.OriginalAmount == 0)) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.AmountCannotBeZero)); @@ -233,16 +309,15 @@ namespace DS.WMS.Core.Invoice.Method return DataResult.Failed(result.Message, result.MultiCode); invoice.ApplyAmount = invoice.Details.Sum(x => x.ApplyAmount); - invoice.AmountUppercase = new Money(invoice.InvoiceAmount).ToString(); + invoice.AmountUppercase = new Money(invoice.ApplyAmount).ToString(); invoice.OriginalAmount = invoice.Details.Sum(x => x.OriginalAmount); - invoice.OtherInvoiceAmount = invoice.Details.Where(x => x.Currency != RMB_CODE).Sum(x => x.OriginalAmount); + invoice.OtherInvoiceAmount = invoice.Details.Where(x => x.Currency != RMB_CODE).Sum(x => x.OriginalAmount); } await TenantDb.Ado.BeginTranAsync(); try { - //关联导航属性插入 - if (invoice.Id == 0) + if (invoice.Id == 0)//新增 { //创建时需要生成申请单编号 var sequence = CommonService.Value.GetSequenceNext(); @@ -251,10 +326,10 @@ namespace DS.WMS.Core.Invoice.Method return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist); } invoice.BillNO = sequence.Data; - + //关联导航属性插入 await TenantDb.InsertNav(invoice).Include(x => x.Details).ExecuteCommandAsync(); } - else + else//编辑 { if (invoice.Details?.Count > 0) { @@ -262,11 +337,26 @@ namespace DS.WMS.Core.Invoice.Method //因需要重新生成明细,所以要先清空现有发票明细 await TenantDb.Deleteable().Where(x => x.ApplicationId == invoice.Id).ExecuteCommandAsync(); } + else if (invoice.InvoiceDetails?.Count > 0) + { + await TenantDb.Updateable(invoice.InvoiceDetails).UpdateColumns(x => new + { + x.Name, + x.Specification, + x.Unit, + x.UnitPrice, + x.TaxRate, + x.TaxAmount, + x.UpdateTime, + x.UpdateBy + }).ExecuteCommandAsync(); + } await TenantDb.Updateable(invoice).IgnoreColumns(x => new { x.BillNO, x.IsLocked, + x.CreateBy, x.CreateTime, x.Deleted, @@ -295,7 +385,10 @@ namespace DS.WMS.Core.Invoice.Method await OnSaveAsync(invoice); await TenantDb.Ado.CommitTranAsync(); - return DataResult.Success(await PostSaveAsync(invoice)); + + PostSaveAsync(invoice); + + return DataResult.Success(invoice); } catch (Exception ex) { @@ -311,40 +404,27 @@ namespace DS.WMS.Core.Invoice.Method /// 提交的发票 /// 数据库值,新增时为null /// - protected virtual DataResult EnsureSettlement(TEntity invoice, TEntity? dbValue) - { - return DataResult.Success; - } + protected virtual DataResult EnsureSettlement(TEntity invoice, TEntity? dbValue) => DataResult.Success; /// /// 在保存前调用 /// /// 发票 /// - protected virtual Task PreSaveAsync(TEntity invoice) - { - return Task.FromResult(DataResult.Success); - } + protected virtual Task PreSaveAsync(TEntity invoice) => Task.FromResult(DataResult.Success); /// /// 在保存时调用 /// /// 要保存的发票 /// - protected virtual Task OnSaveAsync(TEntity invoice) - { - return Task.CompletedTask; - } + protected virtual Task OnSaveAsync(TEntity invoice) => Task.CompletedTask; /// /// 在保存完成后调用 /// /// 发票 - protected virtual Task PostSaveAsync(TEntity invoice) - { - return Task.FromResult(invoice); - } - + protected virtual Task PostSaveAsync(TEntity invoice) => Task.CompletedTask; /// @@ -364,7 +444,10 @@ namespace DS.WMS.Core.Invoice.Method { Id = x.Id, ApplicationId = x.ApplicationId, + DetailId = x.DetailId, + RefId = x.RefId, RecordId = x.RecordId, + ApplyAmount = x.ApplyAmount, OriginalAmount = x.OriginalAmount }).ToListAsync(); @@ -379,8 +462,10 @@ namespace DS.WMS.Core.Invoice.Method { await OnDeleteDetailAsync(apps, DeleteOption.Entire); await TenantDb.DeleteNav(x => ids.Contains(x.Id)).Include(x => x.Details).ExecuteCommandAsync(); - await TenantDb.Ado.CommitTranAsync(); + + PostDeleteAsync(apps, DeleteOption.Entire); + return DataResult.Success; } catch (Exception ex) @@ -403,7 +488,10 @@ namespace DS.WMS.Core.Invoice.Method { Id = x.Id, ApplicationId = x.ApplicationId, + DetailId = x.DetailId, + RefId = x.RefId, RecordId = x.RecordId, + ApplyAmount = x.ApplyAmount, OriginalAmount = x.OriginalAmount }).ToListAsync(); var appIds = details.Select(x => x.ApplicationId).Distinct().ToList(); @@ -425,8 +513,10 @@ namespace DS.WMS.Core.Invoice.Method { await OnDeleteDetailAsync(apps, DeleteOption.DetailOnly); await TenantDb.Deleteable(details).ExecuteCommandAsync(); - await TenantDb.Ado.CommitTranAsync(); + + PostDeleteAsync(apps, DeleteOption.Entire); + return DataResult.Success; } catch (Exception ex) @@ -458,11 +548,13 @@ namespace DS.WMS.Core.Invoice.Method /// protected virtual async Task OnDeleteDetailAsync(List invoices, DeleteOption deleteOption) { + var excludeIds = invoices.SelectMany(x => x.Details).Select(x => x.Id).ToList(); + await TenantDb.Deleteable().Where(x => excludeIds.Contains(x.Id)).ExecuteCommandAsync(); + if (deleteOption == DeleteOption.DetailOnly) { - //删除明细需要同时变更发票明细 var appIds = invoices.Select(x => x.Id).ToList(); - var excludeIds = invoices.SelectMany(x => x.Details).Select(x => x.Id).ToList(); + //删除明细需要同时变更发票明细 var details = await TenantDb.Queryable().Where(x => appIds.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id)) .Select(x => new ApplicationDetail { @@ -474,12 +566,12 @@ namespace DS.WMS.Core.Invoice.Method }).ToListAsync(); foreach (var item in invoices) { - //重新设置申请明细 + //重新设置申请明细与总金额 item.Details = details.FindAll(x => x.ApplicationId == item.Id); + item.ApplyAmount = item.Details.Sum(x => x.ApplyAmount); + item.AmountUppercase = new Money(item.ApplyAmount).ToString(); } - await TenantDb.Deleteable().Where(x => appIds.Contains(x.ApplicationId)).ExecuteCommandAsync(); - await CreateInvoiceDetailsAsync(invoices); var invDetails = invoices.SelectMany(x => x.InvoiceDetails).ToList(); if (invDetails.Count > 0) @@ -499,6 +591,13 @@ namespace DS.WMS.Core.Invoice.Method .ExecuteCommandAsync(); } + /// + /// 在删除完成后调用 + /// + /// 发票及其明细 + /// 发票删除选项 + protected virtual Task PostDeleteAsync(List invoices, DeleteOption deleteOption) => Task.CompletedTask; + /// /// 生成发票明细 /// @@ -591,4 +690,5 @@ namespace DS.WMS.Core.Invoice.Method return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed)); } } + } diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/PaymentSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/PaymentSettlementService.cs index b062d180..ac0f67ca 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/PaymentSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/PaymentSettlementService.cs @@ -319,7 +319,7 @@ namespace DS.WMS.Core.Settlement.Method } /// - /// 获取费用明细 + /// 获取费用申请明细 /// /// 申请单ID /// @@ -327,8 +327,7 @@ namespace DS.WMS.Core.Settlement.Method { var details = await TenantDb.Queryable().Where(d => d.ApplicationId == id && d.Category == DetailCategory.PaidApplication && (d.ApplyAmount - d.ProcessedAmount) != 0) .LeftJoin((d, f) => d.RecordId == f.Id) - .LeftJoin((d, f, b) => f.BusinessId == b.BusinessId && f.BusinessType == b.BusinessType) - .Select((d, f, b) => new PaymentApplicationDetailDto + .Select((d, f) => new PaymentApplicationDetailDto { Id = d.Id, ApplicationId = d.ApplicationId, diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/GeneralInvoiceController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/GeneralInvoiceController.cs index 79265a00..873ab4d1 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Controllers/GeneralInvoiceController.cs +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/GeneralInvoiceController.cs @@ -1,5 +1,6 @@ using DS.Module.Core; using DS.Module.Core.Data; +using DS.WMS.Core.Application.Dtos; using DS.WMS.Core.Invoice.Dto; using DS.WMS.Core.Invoice.Dtos; using DS.WMS.Core.Invoice.Entity; @@ -24,6 +25,42 @@ namespace DS.WMS.FeeApi.Controllers _service = service; } + /// + /// 获取发票申请分页列表 + /// + /// + /// + [HttpPost, Route("GetApplicationList")] + public async Task>> GetApplicationListAsync([FromBody]PageRequest request) + { + return await _service.GetApplicationListAsync(request); + } + + /// + /// 获取发票申请明细 + /// + /// 申请单ID + /// + [HttpGet, Route("GetApplicationDetails")] + public async Task>> GetApplicationDetailsAsync([FromQuery]long id) + { + return await _service.GetApplicationDetailsAsync(id); + } + + /// + /// 获取发票申请明细 + /// + /// 一组申请单ID + /// + [HttpPost, Route("GetApplicationDetails")] + public async Task>> GetApplicationDetailsAsync([FromBody] IdModel model) + { + if (!ModelState.IsValid) + return DataResult>.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); + + return await _service.GetApplicationDetailsAsync(model.Ids); + } + /// /// 获取发票详情 /// @@ -41,7 +78,7 @@ namespace DS.WMS.FeeApi.Controllers /// 请求参数 /// [HttpPost, Route("Save")] - public async Task> SaveAsync(InvoiceRequest request) + public async Task> SaveAsync([FromBody]InvoiceRequest request) { if (!ModelState.IsValid) return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/InvoiceController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/InvoiceController.cs deleted file mode 100644 index 0339ae14..00000000 --- a/ds-wms-service/DS.WMS.FeeApi/Controllers/InvoiceController.cs +++ /dev/null @@ -1,99 +0,0 @@ -using DS.Module.Core; -using DS.Module.Core.Data; -using DS.WMS.Core.Invoice.Dto; -using DS.WMS.Core.Invoice.Dtos; -using DS.WMS.Core.Invoice.Entity; -using DS.WMS.Core.Invoice.Interface; -using Microsoft.AspNetCore.Mvc; - -namespace DS.WMS.FeeApi.Controllers -{ - /// - /// 发票开具API - /// - public class InvoiceController : ApiController - { - readonly IInvoiceService _service; - - /// - /// 初始化 - /// - /// - public InvoiceController(IInvoiceService service) - { - _service = service; - } - - /// - /// 获取列表 - /// - /// - /// - /// 注意!!【申请编号】OtherQueryCondition 属性传入 - [HttpPost, Route("GetList")] - public async Task>> ListAsync([FromBody] PageRequest request) - { - return await _service.GetListAsync(request); - } - - - - - /// - /// 提交发票开票 - /// - /// 请求参数 - /// - [HttpPost, Route("Save")] - public async Task> SaveAsync(InvoiceRequest request) - { - if (!ModelState.IsValid) - return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); - - return await _service.SaveAsync(request); - } - - /// - /// 删除发票明细 - /// - /// 发票明细ID - /// - [HttpPost, Route("DeleteDetail")] - public async Task DeleteDetailAsync([FromBody] IdModel model) - { - if (!ModelState.IsValid) - return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); - - return await _service.DeleteDetailAsync(model.Ids); - } - - /// - /// 删除发票 - /// - /// 发票ID - /// - [HttpPost, Route("Delete")] - public async Task DeleteAsync([FromBody] IdModel model) - { - if (!ModelState.IsValid) - return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); - - return await _service.DeleteAsync(model.Ids); - } - - /// - /// 设置发票的锁定状态 - /// - /// 发票ID - /// - [HttpPost, Route("SetLock")] - public async Task SetLockAsync([FromBody] IdModel model) - { - if (!ModelState.IsValid) - return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest); - - bool isLocked = Convert.ToBoolean(model.Value); - return await _service.SetLockAsync(isLocked, model.Ids); - } - } -} diff --git a/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt index eacf544c..74d142b7 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt @@ -2805,3 +2805,143 @@ 2024-07-16 14:04:36.3120 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config 2024-07-16 14:04:36.3120 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-16 14:04:36.3280 Info Configuration initialized. +2024-07-16 15:16:41.3055 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 15:16:41.3820 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 15:16:41.3820 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 15:16:41.4080 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 15:16:41.4080 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 15:16:41.4080 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 15:16:41.4301 Info Configuration initialized. +2024-07-16 16:08:38.1338 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 16:08:38.1871 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 16:08:38.1871 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 16:08:38.2151 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 16:08:38.2236 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 16:08:38.2236 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 16:08:38.2236 Info Configuration initialized. +2024-07-16 16:09:53.2111 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 16:09:53.2540 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 16:09:53.2540 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 16:09:53.2709 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 16:09:53.2709 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 16:09:53.2838 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 16:09:53.2838 Info Configuration initialized. +2024-07-16 16:15:41.1311 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 16:15:41.1732 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 16:15:41.1732 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 16:15:41.1922 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 16:15:41.1922 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 16:15:41.1922 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 16:15:41.2058 Info Configuration initialized. +2024-07-16 16:19:26.3527 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 16:19:26.3883 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 16:19:26.3920 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 16:19:26.4069 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 16:19:26.4069 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 16:19:26.4069 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 16:19:26.4275 Info Configuration initialized. +2024-07-16 16:21:34.0963 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 16:21:34.1862 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 16:21:34.1941 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 16:21:34.2173 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 16:21:34.2301 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 16:21:34.2356 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 16:21:34.2356 Info Configuration initialized. +2024-07-16 16:28:31.2423 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 16:28:31.2794 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 16:28:31.2843 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 16:28:31.3002 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 16:28:31.3002 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 16:28:31.3002 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 16:28:31.3181 Info Configuration initialized. +2024-07-16 17:13:13.4236 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 17:13:13.4789 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 17:13:13.4859 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 17:13:13.4997 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 17:13:13.4997 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 17:13:13.4997 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 17:13:13.4997 Info Configuration initialized. +2024-07-16 17:19:08.0729 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-16 17:19:08.1226 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-16 17:19:08.1262 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-16 17:19:08.1399 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-16 17:19:08.1399 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-16 17:19:08.1399 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-16 17:19:08.1399 Info Configuration initialized. +2024-07-17 08:59:01.8820 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 08:59:01.9023 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 08:59:01.9023 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 08:59:01.9403 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 08:59:01.9403 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 08:59:01.9403 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 08:59:01.9533 Info Configuration initialized. +2024-07-17 14:08:02.0324 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 14:08:02.0839 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 14:08:02.0839 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 14:08:02.0974 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 14:08:02.0974 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 14:08:02.1046 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 14:08:02.1046 Info Configuration initialized. +2024-07-17 14:31:00.1996 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 14:31:00.2399 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 14:31:00.2482 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 14:31:00.2640 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 14:31:00.2640 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 14:31:00.2766 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 14:31:00.2766 Info Configuration initialized. +2024-07-17 14:35:33.6868 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 14:35:33.7210 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 14:35:33.7210 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 14:35:33.7391 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 14:35:33.7455 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 14:35:33.7455 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 14:35:33.7455 Info Configuration initialized. +2024-07-17 14:39:05.6869 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 14:39:05.7174 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 14:39:05.7174 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 14:39:05.7347 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 14:39:05.7347 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 14:39:05.7347 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 14:39:05.7471 Info Configuration initialized. +2024-07-17 14:45:27.4998 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 14:45:27.5320 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 14:45:27.5457 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 14:45:27.5622 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 14:45:27.5622 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 14:45:27.5728 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 14:45:27.5728 Info Configuration initialized. +2024-07-17 14:47:07.0131 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 14:47:07.0528 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 14:47:07.0591 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 14:47:07.0768 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 14:47:07.0768 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 14:47:07.0768 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 14:47:07.0948 Info Configuration initialized. +2024-07-17 15:08:51.5487 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 15:08:51.5803 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 15:08:51.5803 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 15:08:51.5951 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 15:08:51.5951 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 15:08:51.5951 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 15:08:51.6071 Info Configuration initialized. +2024-07-17 15:19:31.1678 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 15:19:31.2347 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 15:19:31.2347 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 15:19:31.2591 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 15:19:31.2664 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 15:19:31.2664 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 15:19:31.2780 Info Configuration initialized. +2024-07-17 15:25:29.9213 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 15:25:29.9612 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 15:25:29.9681 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 15:25:29.9842 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 15:25:29.9842 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 15:25:29.9842 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 15:25:29.9990 Info Configuration initialized. +2024-07-17 15:41:56.3877 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 15:41:56.4227 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 15:41:56.4227 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 15:41:56.4414 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 15:41:56.4414 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-07-17 15:41:56.4498 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 15:41:56.4498 Info Configuration initialized.