From 17ba645e2cae1d37ea6956acf5cdf312e651f95c Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Fri, 27 Dec 2024 16:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MES/Quality/FQC/Dto/QueryFQCShowDto.cs | 6 +++--- .../FQC/QcFinishedproductDefectService.cs | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/DOAN.Model/MES/Quality/FQC/Dto/QueryFQCShowDto.cs b/DOAN.Model/MES/Quality/FQC/Dto/QueryFQCShowDto.cs index c8140fb..fd8d243 100644 --- a/DOAN.Model/MES/Quality/FQC/Dto/QueryFQCShowDto.cs +++ b/DOAN.Model/MES/Quality/FQC/Dto/QueryFQCShowDto.cs @@ -34,7 +34,7 @@ namespace DOAN.Model.MES.Quality.FQC.Dto } - public class ResultFQCShowDto + public class ResultFQCShowDto { /// /// 工单号(一旦确定,不可更改) @@ -58,7 +58,7 @@ namespace DOAN.Model.MES.Quality.FQC.Dto /// 派发数量 /// - public int? DispatchNum { get; set; } + public int? PlanNum { get; set; } /// /// 完成数量 @@ -80,7 +80,7 @@ namespace DOAN.Model.MES.Quality.FQC.Dto /// /// 缺陷详情 /// - public Dictionary DefectDetailDictionary { get; set; } + // public Dictionary DefectDetailDictionary { get; set; } } diff --git a/DOAN.Service/MES/Quality/FQC/QcFinishedproductDefectService.cs b/DOAN.Service/MES/Quality/FQC/QcFinishedproductDefectService.cs index a743a8a..e2ffdd9 100644 --- a/DOAN.Service/MES/Quality/FQC/QcFinishedproductDefectService.cs +++ b/DOAN.Service/MES/Quality/FQC/QcFinishedproductDefectService.cs @@ -130,10 +130,21 @@ namespace DOAN.Service.MES.quality.FQC .AndIF(queryFQCShow.SearchDateTime != null && queryFQCShow.SearchDateTime.Length >= 2 && queryFQCShow.SearchDateTime[0] > DateTime.MinValue, (t1, t2, t3) => t3.CheckDatetime > queryFQCShow.SearchDateTime[0]) .AndIF(queryFQCShow.SearchDateTime != null && queryFQCShow.SearchDateTime.Length >= 2 && queryFQCShow.SearchDateTime[1] > DateTime.MinValue, (t1, t2, t3) => t3.CheckDatetime > queryFQCShow.SearchDateTime[1]); - Context.Queryable().RightJoin((t1,t2)=>t1.Workorder==t2.Workorder) - .RightJoin((t1,t2,t3)=> - - + return Context.Queryable() + .RightJoin((t1, t2) => t1.Workorder == t2.Workorder) + .RightJoin((t1, t2, t3) => t2.Workorder == t3.Workorder) + .Where(predicate.ToExpression()) + .GroupBy((t1,t2,t3)=>new { t3.Workorder, t1.productionName, t1.productionCode, t2.PlanNum, t2.FinishNum }) + .Select((t1, t2, t3) => new ResultFQCShowDto + { + Workorder = t3.Workorder, + productionName = t1.productionName, + productionCode = t1.productionCode, + PlanNum = t2.PlanNum, + FinishedNum = t2.FinishNum, + DefectAllNum = SqlFunc.AggregateSum(t3.Number), + QualifiedNum = t2.FinishNum- SqlFunc.AggregateSum(t3.Number) + }).ToPage_NO_Convert(queryFQCShow); }