diff --git a/DOAN.Service/MES/bigScreen/Product2BigScreenService.cs b/DOAN.Service/MES/bigScreen/Product2BigScreenService.cs index 8c65be3..40e8822 100644 --- a/DOAN.Service/MES/bigScreen/Product2BigScreenService.cs +++ b/DOAN.Service/MES/bigScreen/Product2BigScreenService.cs @@ -22,7 +22,35 @@ namespace DOAN.Service.MES.bigScreen .GroupBy(it => it.GroupCode).Count(); - + //今天产线 + productBigScreen.TodayLineQuantity=Context.Queryable().Where(it => it.WorkorderDate == DateTime.Today) + .GroupBy(it => it.LineCode).Count(); + + + //今日计划产量 + productBigScreen.TodayPlanQuantity = Context.Queryable() + .Where(it => it.WorkorderDate == DateTime.Today) + .Sum(it => it.DeliveryNum ?? 0); + + + //今日实际产量 + productBigScreen.TodayActionProductionQuantity = Context.Queryable() + .LeftJoin((p, r) => p.Workorder == r.FkWorkorder) + .Where((p, r) => p.WorkorderDate == DateTime.Today) + .Sum((p, r) => r.FinishedNum ?? 0); + + + //今日产成品种类 + productBigScreen.TodayProductTypeQuantity = Context.Queryable() + .Where(it => it.WorkorderDate == DateTime.Today) + .GroupBy(it => it.ProductionCode) + .Count(); + + + // 七日变更计划 + productBigScreen.SevenDaysPriorPlanQuantity = Context.Queryable() + .Where(it => it.ChangeTime <= DateTime.Today && it.ChangeTime >= DateTime.Today.AddDays(-7)) + .Count(); return productBigScreen; }