20240102安全风险提交方法调整,数据修正
This commit is contained in:
parent
7f2be68951
commit
2e2118a813
|
|
@ -0,0 +1,24 @@
|
|||
INSERT INTO Base_RiskLevel (RiskLevelId,RiskLevel,RiskLevelName,MinValue,MaxValue,ControlMeasures,Days)
|
||||
VALUES('84e1d680-5bfe-48d2-a255-59f43aa3615a',1,'一级/低风险',0,120,'一般危险,需要控制',21)
|
||||
GO
|
||||
INSERT INTO Base_RiskLevel (RiskLevelId,RiskLevel,RiskLevelName,MinValue,MaxValue,ControlMeasures,Days)
|
||||
VALUES('01537cc5-e8d2-497c-ba53-1faca1faf495',2,'二级/一般风险',121,170,'显著危险,重点控制',7)
|
||||
GO
|
||||
INSERT INTO Base_RiskLevel (RiskLevelId,RiskLevel,RiskLevelName,MinValue,MaxValue,ControlMeasures,Days)
|
||||
VALUES('6baaf2bb-ee7c-410c-9a32-13208626c467',3,'三级/较大风险',171,320,'一般危险,需要控制',3)
|
||||
GO
|
||||
INSERT INTO Base_RiskLevel (RiskLevelId,RiskLevel,RiskLevelName,MinValue,MaxValue,ControlMeasures,Days)
|
||||
VALUES('c9e6285c-2da3-4997-8dc9-fb6ab404346e',4,'四级/重大风险',321,null,'极其危险,不能作业',1)
|
||||
GO
|
||||
update Hazard_HazardSelectedItem set HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel=1 )
|
||||
where HazardLevel is null or HazardLevel='1'
|
||||
go
|
||||
update Hazard_HazardSelectedItem set HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel=2 )
|
||||
where HazardLevel='2'
|
||||
go
|
||||
update Hazard_HazardSelectedItem set HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel=3 )
|
||||
where HazardLevel='3'
|
||||
go
|
||||
update Hazard_HazardSelectedItem set HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel=4)
|
||||
where HazardLevel='4'
|
||||
go
|
||||
|
|
@ -522,7 +522,7 @@ namespace BLL
|
|||
foreach (var item in getTrainingTasks)
|
||||
{
|
||||
item.States = "2";
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
getTestPlan.States = "3";
|
||||
db.SubmitChanges();
|
||||
|
|
|
|||
|
|
@ -188,9 +188,10 @@ namespace BLL
|
|||
{
|
||||
item.TestEndTime = item.TestStartTime.Value.AddMinutes(item.Duration);
|
||||
item.TestScores = db.Training_TestRecordItem.Where(x => x.TestRecordId == item.TestRecordId).Sum(x => x.SubjectScore) ?? 0;
|
||||
db.SubmitChanges();
|
||||
|
||||
icount++;
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
return icount;
|
||||
|
|
|
|||
|
|
@ -1355,7 +1355,7 @@ namespace BLL
|
|||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 2 && x.IsStart == true
|
||||
where x.ProjectId == projectid && y.RiskLevel == 2
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
|
@ -1368,7 +1368,7 @@ namespace BLL
|
|||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 1 && x.IsStart == true
|
||||
where x.ProjectId == projectid && y.RiskLevel == 1
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
|
@ -1381,7 +1381,7 @@ namespace BLL
|
|||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 3 && x.IsStart == true
|
||||
where x.ProjectId == projectid && y.RiskLevel == 3
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
|
@ -1394,7 +1394,7 @@ namespace BLL
|
|||
{
|
||||
var result = (from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId
|
||||
where x.ProjectId == projectid && y.RiskLevel == 4 && x.IsStart == true
|
||||
where x.ProjectId == projectid && y.RiskLevel == 4
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3392,6 +3392,7 @@
|
|||
<Compile Include="res\umeditor\net\Uploader.cs" />
|
||||
<Compile Include="ZHGL\Plan\ActionPlanListEdit.aspx.cs">
|
||||
<DependentUpon>ActionPlanListEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\Plan\ActionPlanListEdit.aspx.designer.cs">
|
||||
<DependentUpon>ActionPlanListEdit.aspx</DependentUpon>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
runat="server" BoxFlex="1" DataKeyNames="ProjectId" DataIDField="ProjectId" AllowSorting="true"
|
||||
SortField="ProjectName" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
|
||||
EnableSummary="true" SummaryPosition="Bottom">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -25,6 +26,9 @@ namespace FineUIPro.Web.DataShow
|
|||
BLL.ProjectService.InitCNCECShowProjectDropDownList(this.drpProject, true);
|
||||
// 绑定表格t
|
||||
BindGrid();
|
||||
// 合计
|
||||
OutputSummaryData();
|
||||
this.Panel1.Title = "安全风险数据(" + BLL.UnitService.GetUnitNameByUnitId(Const.UnitId_SEDIN) + ")";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
|
@ -244,5 +248,47 @@ namespace FineUIPro.Web.DataShow
|
|||
return count;
|
||||
|
||||
}
|
||||
|
||||
#region 合计
|
||||
private void OutputSummaryData()
|
||||
{
|
||||
string strSql = @"select ProjectId,ProjectCode, ProjectName ,
|
||||
isnull((select count(*) from Hazard_HazardSelectedItem as a
|
||||
LEFT JOIN Hazard_HazardList AS B ON A.HazardListId=B.HazardListId
|
||||
where B.ProjectId=p.ProjectId AND B.States = '2'
|
||||
and (a.HazardLevel='1' or a.HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel='1'))),0) as Count1,
|
||||
isnull((select count(*) from Hazard_HazardSelectedItem as a
|
||||
LEFT JOIN Hazard_HazardList AS B ON A.HazardListId=B.HazardListId
|
||||
where B.ProjectId=p.ProjectId AND B.States = '2'
|
||||
and (a.HazardLevel='2' or a.HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel='2'))),0) as Count2,
|
||||
isnull((select count(*) from Hazard_HazardSelectedItem as a
|
||||
LEFT JOIN Hazard_HazardList AS B ON A.HazardListId=B.HazardListId
|
||||
where B.ProjectId=p.ProjectId AND B.States = '2'
|
||||
and (a.HazardLevel='3' or a.HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel='3'))),0) as Count3,
|
||||
isnull((select count(*) from Hazard_HazardSelectedItem as a
|
||||
LEFT JOIN Hazard_HazardList AS B ON A.HazardListId=B.HazardListId
|
||||
where B.ProjectId=p.ProjectId AND B.States = '2'
|
||||
and (a.HazardLevel='4' or a.HazardLevel=(select top 1 RiskLevelId from Base_RiskLevel where RiskLevel='4'))),0) as Count4
|
||||
from Base_Project as P where ProjectState =1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
int Count1 = 0, Count2 = 0, Count3 = 0, Count4 = 0;
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
Count1 += Convert.ToInt32(row["Count1"]);
|
||||
Count2 += Convert.ToInt32(row["Count2"]);
|
||||
Count3 += Convert.ToInt32(row["Count3"]);
|
||||
Count4 += Convert.ToInt32(row["Count4"]);
|
||||
}
|
||||
JObject summary = new JObject();
|
||||
summary.Add("ProjectName", "合计:");
|
||||
summary.Add("Count1", Count1.ToString());
|
||||
summary.Add("Count2", Count2.ToString());
|
||||
summary.Add("Count3", Count3.ToString());
|
||||
summary.Add("Count4", Count4.ToString());
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -14411,7 +14411,7 @@
|
|||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>0</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:8736/</IISUrl>
|
||||
<IISUrl>http://localhost:2828/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
|
|
|||
Loading…
Reference in New Issue