This commit is contained in:
高飞 2023-06-21 14:56:43 +08:00
commit a38c6dfe22
1 changed files with 13 additions and 7 deletions

View File

@ -244,16 +244,22 @@ namespace FineUIPro.Web
List<string> listType = new List<string>(); List<string> listType = new List<string>();
List<int> listTAll = new List<int>(); List<int> listTAll = new List<int>();
List<int> listTNo = new List<int>(); List<int> listTNo = new List<int>();
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"); 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); listType.Add(item["RegisterTypesName"].ToString());
var unitHazardRegisters = getHazardRegisterLists.Where(x => x.RegisterTypesId == item.RegisterTypesId); //var unitHazardRegisters = getHazardRegisterLists.Where(x => x.RegisterTypesId == item.RegisterTypesId);
var noW = unitHazardRegisters.Where(x => x.States == "3"); //var noW = unitHazardRegisters.Where(x => x.States == "3");
listTAll.Add(unitHazardRegisters.Count()); listTAll.Add(int.Parse(item["allr"].ToString()));
listTNo.Add(unitHazardRegisters.Count() - noW.Count()); listTNo.Add(int.Parse(item["allr"].ToString()) - int.Parse(item["finish"].ToString()));
} }
CheckTypeALLCount = JsonConvert.SerializeObject(listTAll); CheckTypeALLCount = JsonConvert.SerializeObject(listTAll);
CheckTypeNoCount = JsonConvert.SerializeObject(listTNo); CheckTypeNoCount = JsonConvert.SerializeObject(listTNo);