提交代码

This commit is contained in:
2024-11-07 14:24:59 +08:00
parent 5a52c54522
commit c5cecce547
20 changed files with 64 additions and 53 deletions
@@ -10,7 +10,7 @@ namespace FineUIPro.Web.ProjectData
{
public partial class ConstructionRiskMap : PageBase
{
public string Coordinate = "";
public string ProjectCode = "";
protected void Page_Load(object sender, EventArgs e)
@@ -25,9 +25,9 @@ namespace FineUIPro.Web.ProjectData
listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
foreach(DataRow row in tb.Rows)
foreach (DataRow row in tb.Rows)
{
Coordinate += row["MainItemId"].ToString() + ";" + row["MainItemName"].ToString() + ";" + row["num"].ToString() + ";" + row["Coordinate"].ToString()+";"+ row["RiskLevel"].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);
@@ -39,7 +39,7 @@ namespace FineUIPro.Web.ProjectData
[WebMethod]
public static string getRisk(string WorkAreaId,string RiskLevel)
public static string getRisk(string WorkAreaId, string RiskLevel)
{
string res = "";
string strSql = @"SELECT [ConstructionRiskId]
@@ -58,9 +58,14 @@ namespace FineUIPro.Web.ProjectData
where a.WorkAreaId=@WorkAreaId and a.States='4'
";
//if (!string.IsNullOrEmpty(RiskLevel))
//{
// strSql += " and RiskLevel='" + RiskLevel + "'";
//}
if (!string.IsNullOrEmpty(RiskLevel))
{
strSql += " and RiskLevel='"+ RiskLevel + "'";
//strSql += " and RiskLevel='" + drpRiskLevel.SelectedValue + "' ";
strSql += " and '" + RiskLevel + "' like '%'+RiskLevel+'%' ";
}
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@WorkAreaId", WorkAreaId));
@@ -68,7 +73,7 @@ namespace FineUIPro.Web.ProjectData
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["ConstructionContent"].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(',');
@@ -77,15 +82,25 @@ namespace FineUIPro.Web.ProjectData
protected void drpRiskLevel_SelectedIndexChanged(object sender, EventArgs e)
{
string riskLevel = "";
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))
if (drpRiskLevel.SelectedItemArray.Length == 1 && this.drpRiskLevel.SelectedValue == string.Empty)
{
strSql += " and RiskLevel='" + drpRiskLevel.SelectedValue + "' ";
}
else
{
foreach (var item in this.drpRiskLevel.SelectedValueArray)
{
riskLevel += item + ",";
}
//strSql += " and RiskLevel='" + drpRiskLevel.SelectedValue + "' ";
strSql += " and '"+riskLevel+"' like '%'+RiskLevel+'%' ";
}
strSql += " group by b.[MainItemId],b.[Coordinate],b.[MainItemName] ";
SqlParameter[] parameter = listStr.ToArray();
@@ -96,7 +111,7 @@ namespace FineUIPro.Web.ProjectData
}
Coordinate = Coordinate.TrimEnd(',');
PageContext.RegisterStartupScript(" setRiskLevel('" + drpRiskLevel.SelectedValue + "'); clearOverlays() ; drawMap('" + Coordinate + "') ");
PageContext.RegisterStartupScript(" setRiskLevel('" + riskLevel + "'); clearOverlays() ; drawMap('" + Coordinate + "') ");
}
}