From 39ba70d00196a8937acae8590d997c70033f0f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Sat, 14 Sep 2024 11:17:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E5=AE=A1=E6=A0=B8=E5=88=97?= =?UTF-8?q?=E8=A1=A8bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Method/InvoiceApplicationAuditService.cs | 17 ++++++----------- .../Method/InvoiceApplicationService.cs | 3 ++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationAuditService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationAuditService.cs index 5745583c..a149aa08 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationAuditService.cs @@ -40,20 +40,14 @@ namespace DS.WMS.Core.Application.Method if (!request.QueryCondition.IsNullOrEmpty()) { - var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); - - //设置了状态筛选 - if (request.OtherQueryCondition.HasValue) - { - if (request.OtherQueryCondition.Value) - query = query.Where(x => x.Status == InvoiceApplicationStatus.AuditPassed || x.Status == InvoiceApplicationStatus.AuditRejected); - else - query = query.Where(x => x.Status == InvoiceApplicationStatus.AuditSubmittd); - } - + var whereList = request.GetConditionalModels(Db); query = query.Where(whereList); } + //设置了状态筛选 + if (request.OtherQueryCondition.GetValueOrDefault()) + query = query.Where(a => a.Status == InvoiceApplicationStatus.AuditSubmittd); + var result = await query.GroupBy(x => x.Id).ToQueryPageAsync(request.PageCondition); if (result.Data.Count > 0) { @@ -75,6 +69,7 @@ namespace DS.WMS.Core.Application.Method .InnerJoin((a, d, f) => d.RecordId == f.Id) .LeftJoin((a, d, f, s) => f.BusinessId == s.Id) .LeftJoin((a, d, f, s, b) => a.CustomerBankId == b.Id) + .GroupBy(a => a.Id) .Select((a, d, s, b) => new InvoiceApplicationDto { Id = a.Id, 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 ed1e260c..02fe98d6 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -238,7 +238,8 @@ namespace DS.WMS.Core.Application.Method var cIds = items.Select(x => x.CustomerId).Distinct(); var list = await TenantDb.Queryable() - .Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && f.FeeStatus == FeeStatus.AuditPassed) + .Where(f => f.FeeStatus == FeeStatus.AuditPassed && + bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId)) .Select(f => new FeeInvoiceDto { RecordId = f.Id,