提交代码

This commit is contained in:
2024-09-24 11:28:27 +08:00
parent 24de50cd30
commit 0865c7e41e
54 changed files with 5535 additions and 784 deletions
@@ -10,24 +10,27 @@ namespace FineUIPro.Web.ProjectData
{
public partial class ConstructionRiskMap : PageBase
{
public string Coordinate = "";
public string ProjectCode = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string strSql = @"SELECT b.[UnitWorkId],b.[Coordinate],b.[UnitWorkName],count(*) num
FROM [dbo].[HSSE_ConstructionRisk] a left join [dbo].[WBS_UnitWork] b on a.[WorkAreaId]=b.[UnitWorkId]
where a.ProjectId=@ProjectId
group by b.[UnitWorkId],b.[Coordinate],b.[UnitWorkName]";
string strSql = @"SELECT b.[MainItemId],b.[Coordinate],b.[MainItemName],count(*) num ,max(case when RiskLevel='低风险' then 1 when RiskLevel='一般风险' then 2 when RiskLevel='较大风险' then 3 else 4 end) RiskLevel
FROM [dbo].[HSSE_ConstructionRisk] a left join [dbo].[ProjectData_MainItem] b on a.[WorkAreaId]=b.[MainItemId]
where a.ProjectId=@ProjectId and a.States='4'
group by b.[MainItemId],b.[Coordinate],b.[MainItemName]";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
foreach(DataRow row in tb.Rows)
{
Coordinate += row["UnitWorkId"].ToString() + ";" + row["UnitWorkName"].ToString() + ";" + row["num"].ToString() + ";" + row["Coordinate"].ToString() + ",";
Coordinate += row["MainItemId"].ToString() + ";" + row["MainItemName"].ToString() + ";" + row["num"].ToString() + ";" + row["Coordinate"].ToString()+";"+ row["RiskLevel"].ToString() + ",";
}
Coordinate = Coordinate.TrimEnd(',');
ProjectCode = BLL.ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId);
}
}
@@ -36,7 +39,7 @@ namespace FineUIPro.Web.ProjectData
[WebMethod]
public static string getRisk(string WorkAreaId)
public static string getRisk(string WorkAreaId,string RiskLevel)
{
string res = "";
string strSql = @"SELECT [ConstructionRiskId]
@@ -52,23 +55,49 @@ namespace FineUIPro.Web.ProjectData
,[ProjectId]
,[Coordinate]
FROM [dbo].[HSSE_ConstructionRisk] a left join Base_Unit b on a.[UnitId] = b.[UnitId]
where a.WorkAreaId=@WorkAreaId
where a.WorkAreaId=@WorkAreaId and a.States='4'
";
if (!string.IsNullOrEmpty(RiskLevel))
{
strSql += " and RiskLevel='"+ RiskLevel + "'";
}
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@WorkAreaId", WorkAreaId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
foreach (DataRow row in tb.Rows)
{
res += row["ConstructionRiskId"].ToString() + ";" + row["UnitName"].ToString() + ";" + Funs.GetNewDateTimeOrNow( row["DateA"].ToString()).ToString("yyyy-MM-dd")+"至"+ Funs.GetNewDateTimeOrNow(row["DateZ"].ToString()).ToString("yyyy-MM-dd") + ";" + row["RiskLevel"].ToString() + ";" + row["LicenseDes"].ToString() + ";" + row["Coordinate"].ToString() + ",";
res += row["ConstructionRiskId"].ToString() + ";" + row["UnitName"].ToString() + ";" + Funs.GetNewDateTimeOrNow( row["DateA"].ToString()).ToString("yyyy-MM-dd")+"至"+ Funs.GetNewDateTimeOrNow(row["DateZ"].ToString()).ToString("yyyy-MM-dd") + ";" + row["RiskLevel"].ToString() + ";" + row["ConstructionContent"].ToString() + ";" + row["Coordinate"].ToString() + ",";
}
res = res.TrimEnd(',');
return res;
}
protected void drpRiskLevel_SelectedIndexChanged(object sender, EventArgs e)
{
string strSql = @"SELECT b.[MainItemId],b.[Coordinate],b.[MainItemName],count(*) num ,max(case when RiskLevel='低风险' then 1 when RiskLevel='一般风险' then 2 when RiskLevel='较大风险' then 3 else 4 end) RiskLevel
FROM [dbo].[HSSE_ConstructionRisk] a left join [dbo].[ProjectData_MainItem] b on a.[WorkAreaId]=b.[MainItemId]
where a.ProjectId=@ProjectId and a.States='4'
";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(drpRiskLevel.SelectedValue))
{
strSql += " and RiskLevel='" + drpRiskLevel.SelectedValue + "' ";
}
strSql += " group by b.[MainItemId],b.[Coordinate],b.[MainItemName] ";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
foreach (DataRow row in tb.Rows)
{
Coordinate += row["MainItemId"].ToString() + ";" + row["MainItemName"].ToString() + ";" + row["num"].ToString() + ";" + row["Coordinate"].ToString() + ";" + row["RiskLevel"].ToString() + ",";
}
Coordinate = Coordinate.TrimEnd(',');
PageContext.RegisterStartupScript(" setRiskLevel('" + drpRiskLevel.SelectedValue + "'); clearOverlays() ; drawMap('" + Coordinate + "') ");
}
}
}