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,