分页查询缺陷统计
This commit is contained in:
@@ -34,7 +34,7 @@ namespace DOAN.Model.MES.Quality.FQC.Dto
|
||||
}
|
||||
|
||||
|
||||
public class ResultFQCShowDto
|
||||
public class ResultFQCShowDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单号(一旦确定,不可更改)
|
||||
@@ -58,7 +58,7 @@ namespace DOAN.Model.MES.Quality.FQC.Dto
|
||||
/// 派发数量
|
||||
/// </summary>
|
||||
|
||||
public int? DispatchNum { get; set; }
|
||||
public int? PlanNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 完成数量
|
||||
@@ -80,7 +80,7 @@ namespace DOAN.Model.MES.Quality.FQC.Dto
|
||||
/// <summary>
|
||||
/// 缺陷详情
|
||||
/// </summary>
|
||||
public Dictionary<string,int> DefectDetailDictionary { get; set; }
|
||||
// public Dictionary<string,int> DefectDetailDictionary { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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<ProWorkorder>().RightJoin<ProReportwork01>((t1,t2)=>t1.Workorder==t2.Workorder)
|
||||
.RightJoin<QcFinishedproductDefectCollection>((t1,t2,t3)=>
|
||||
|
||||
|
||||
return Context.Queryable<ProWorkorder>()
|
||||
.RightJoin<ProReportwork01>((t1, t2) => t1.Workorder == t2.Workorder)
|
||||
.RightJoin<QcFinishedproductDefectCollection>((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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user