From b3a89e02d989a5537f867e3b93451290e27cd296 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Wed, 23 Jul 2025 09:57:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A1=94=E5=90=8A=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/FineUIPro.Web/HSSE/TowerCrane/TowerCraneRecord.aspx | 4 +++- .../HSSE/TowerCrane/TowerCraneRecord.aspx.cs | 5 ++++- .../HSSE/TowerCrane/TowerCraneRecord.aspx.designer.cs | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) 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 控件。 /// From 6dd2db482412415c666488398fa44364c436c25c Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Wed, 23 Jul 2025 10:26:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A1=94=E5=90=8A=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HSSE/TowerCraneController.cs | 53 ++++++++++++++++--- 1 file changed, 47 insertions(+), 6 deletions(-) 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) + { + } + + } } } }