20240102安全风险提交方法调整,数据修正

This commit is contained in:
2024-01-02 16:59:29 +08:00
parent 7f2be68951
commit 2e2118a813
8 changed files with 81 additions and 8 deletions
+1 -1
View File
@@ -522,7 +522,7 @@ namespace BLL
foreach (var item in getTrainingTasks)
{
item.States = "2";
db.SubmitChanges();
}
getTestPlan.States = "3";
db.SubmitChanges();
+2 -1
View File
@@ -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
}
}
+1 -1
View File
@@ -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>