diff --git a/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx b/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx
index 31d19120..9def8d24 100644
--- a/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx
@@ -22,6 +22,7 @@
+
@@ -46,7 +47,8 @@
-
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.cs b/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.cs
index 42701c40..41348d82 100644
--- a/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.cs
@@ -103,7 +103,10 @@ namespace FineUIPro.Web.HSSE.TowerCrane
List listStr = new List();
strSql += " TowerCraneId = @TowerCraneId";
listStr.Add(new SqlParameter("@TowerCraneId", TowerCraneId));
-
+ if (ckIsWarnOnly.Checked)
+ {
+ strSql += " and AlarmType is not null ";
+ }
strSql += " order by Date desc";
SqlParameter[] parameter = listStr.ToArray();
diff --git a/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.designer.cs
index d75f087c..854721c0 100644
--- a/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx.designer.cs
@@ -113,6 +113,15 @@ namespace FineUIPro.Web.HSSE.TowerCrane
///
protected global::FineUIPro.Toolbar Toolbar2;
+ ///
+ /// ckIsWarnOnly 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.CheckBox ckIsWarnOnly;
+
///
/// txtStartTime 控件。
///
diff --git a/SGGL/WebAPI/Controllers/HSSE/TowerCraneController.cs b/SGGL/WebAPI/Controllers/HSSE/TowerCraneController.cs
index f8e8d5d8..52f943c5 100644
--- a/SGGL/WebAPI/Controllers/HSSE/TowerCraneController.cs
+++ b/SGGL/WebAPI/Controllers/HSSE/TowerCraneController.cs
@@ -2,6 +2,8 @@
using Model;
using Model.APIItem.HSSE;
using System;
+using System.Collections.Generic;
+using System.Data;
using System.Linq;
using System.Web.Http;
@@ -40,14 +42,53 @@ namespace WebAPI.Controllers
record.Range = recordItem.Range;
record.RotationAngle = recordItem.RotationAngle;
record.WindSpeed = recordItem.WindSpeed;
- record.Hoist = recordItem.Hoist;
-
-
-
- record.Date = DateTime.Now;
-
+ record.Hoist = recordItem.Hoist;
+ record.Date = DateTime.Now;
db.HSSE_TowerCraneRecord.InsertOnSubmit(record);
db.SubmitChanges();
+
+
+ if (!string.IsNullOrEmpty(record.AlarmType))
+ {
+ try
+ {
+ Dictionary alarmMap = new Dictionary();
+
+ alarmMap.Add("111", "重量预警");
+ alarmMap.Add("112", "重量报警");
+ alarmMap.Add("121", "风速预警");
+ alarmMap.Add("122", "风速报警");
+ alarmMap.Add("131", "内限位报警");
+ alarmMap.Add("132", "内限位预警");
+ alarmMap.Add("133", "外限位预警");
+ alarmMap.Add("134", "外限位报警");
+ alarmMap.Add("141", "倾角预警");
+ alarmMap.Add("142", "倾角报警");
+ alarmMap.Add("151", "上限位预警");
+ alarmMap.Add("152", "上限位报警");
+ alarmMap.Add("201", "障碍物碰撞报警");
+ alarmMap.Add("202", "塔机群碰撞报警");
+
+ var alarms = record.AlarmType.Replace("[", "").Replace("]", "").Split(',');
+ string res = "";
+ foreach (string alarm in alarms)
+ {
+ if (alarmMap.ContainsKey(alarm))
+ {
+ res += alarmMap[alarm] + ",";
+ }
+ }
+ res = res.TrimEnd(',');
+
+ var user = db.Project_ProjectUser.FirstOrDefault(x => x.ProjectId == towerCrane.ProjectId && x.UnitId == Const.UnitId_CWCEC && x.RoleName == "安全总监");
+
+ APICommonService.SendSubscribeMessage(user.UserId, "塔吊预警", towerCrane.TowerCraneName + ":" + res, string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now));
+ }
+ catch (Exception e)
+ {
+ }
+
+ }
}
}
}