From 0b6b10621a943e17cdef008fc5dcc7f8a2de5558 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Mon, 18 Nov 2024 14:41:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E5=AD=97=E7=BF=BB=E7=89=8C=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MES/bigScreen/Product2BigScreenService.cs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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; }