From 8d5dfaa469d4b69b71fe1a546800c2bbbe4063f6 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Tue, 20 Jun 2023 17:05:36 +0800 Subject: [PATCH] =?UTF-8?q?hse=E7=BB=9F=E8=AE=A1=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/mainMenu_HSSE.aspx.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HSSE.aspx.cs b/SGGL/FineUIPro.Web/common/mainMenu_HSSE.aspx.cs index bbc9f94e..b47823a4 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_HSSE.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainMenu_HSSE.aspx.cs @@ -244,16 +244,22 @@ namespace FineUIPro.Web List listType = new List(); List listTAll = new List(); List listTNo = new List(); + + string strSql = @"select b.RegisterTypesName ,count(*) allr ,sum(case when states=3 then 1 else 0 end) finish from HSSE_Hazard_HazardRegister a left join HSSE_Hazard_HazardRegisterTypes b on a.RegisterTypesId = b.RegisterTypesId + where a.ProjectId='" + this.ProjectId + @"' and b.RegisterTypesName is not null + group by b.RegisterTypesName"; + DataTable tb = SQLHelper.GetDataTableRunText(strSql, null); + var getTypes = HSSE_Hazard_HazardRegisterTypesService.GetHazardRegisterTypesList("1"); - if (getTypes.Count() > 0) + if (tb!=null && tb.Rows.Count>0) { - foreach (var item in getTypes) + foreach (DataRow item in tb.Rows) { - listType.Add(item.RegisterTypesName); - var unitHazardRegisters = getHazardRegisterLists.Where(x => x.RegisterTypesId == item.RegisterTypesId); - var noW = unitHazardRegisters.Where(x => x.States == "3"); - listTAll.Add(unitHazardRegisters.Count()); - listTNo.Add(unitHazardRegisters.Count() - noW.Count()); + listType.Add(item["RegisterTypesName"].ToString()); + //var unitHazardRegisters = getHazardRegisterLists.Where(x => x.RegisterTypesId == item.RegisterTypesId); + //var noW = unitHazardRegisters.Where(x => x.States == "3"); + listTAll.Add(int.Parse(item["allr"].ToString())); + listTNo.Add(int.Parse(item["allr"].ToString()) - int.Parse(item["finish"].ToString())); } CheckTypeALLCount = JsonConvert.SerializeObject(listTAll); CheckTypeNoCount = JsonConvert.SerializeObject(listTNo);