From 365ce12cd5ede4d1135c5c762b14553f20dee8e4 Mon Sep 17 00:00:00 2001 From: yinq Date: Sun, 28 Apr 2024 14:27:33 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=8C=AF=E5=8A=A8=E4=BC=A0?= =?UTF-8?q?=E6=84=9F=E5=99=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/T_MonitorController.java | 30 ++- .../system/Monitor/vibrationSensorAdd.html | 192 +++++++++++++++++ .../system/Monitor/vibrationSensorEdit.html | 196 ++++++++++++++++++ .../Monitor/vibrationSensorMonitor.html | 186 +++++++++++++++++ .../system/Monitor/vibrationSensorTree.html | 49 +++++ .../TVibrationsensorData.html | 109 +++++++++- .../system/domain/TVibrationsensorData.java | 68 +++--- .../service/impl/T_MonitorServiceImpl.java | 14 +- 8 files changed, 787 insertions(+), 57 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorAdd.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorEdit.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorMonitor.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorTree.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_MonitorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_MonitorController.java index 0cbc3fe..f553224 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_MonitorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_MonitorController.java @@ -73,6 +73,8 @@ public class T_MonitorController extends BaseController { break; case 17: url = "/monitor_tw"; + case 20: + url = "/vibrationSensorMonitor"; break; } @@ -137,13 +139,15 @@ public class T_MonitorController extends BaseController { case 6: url = "/lng/add"; break; - case 5: url = "/GasAdd"; break; case 16: url = "/TempAdd"; break; + case 20: + url = "/vibrationSensorAdd"; + break; default: break; } @@ -154,6 +158,17 @@ public class T_MonitorController extends BaseController { return prefix + url; } + @GetMapping(value = {"/vibrationSensorAdd/{objid}", "/vibrationSensorAdd/"}) + public String vibrationSensorAdd(@PathVariable(value = "objid", required = false) Integer objid, ModelMap mmap) { + String url = ""; + if (StringUtils.isNotNull(objid)) { + T_Monitor t_monitor = t_MonitorService.selectT_MonitorById(objid); + mmap.put("t_Monitor", t_monitor); + } + url = "/vibrationSensorAdd"; + return prefix + url; + } + /** * 新增保存测控点信息 */ @@ -204,6 +219,9 @@ public class T_MonitorController extends BaseController { case 17: url = "/edit_tm"; break; + case 20: + url = "/vibrationSensorEdit"; + break; default: break; } @@ -259,11 +277,8 @@ public class T_MonitorController extends BaseController { url = "/waterTree"; break; case "6": - url = "/lng/waterTree"; break; - - case "5": url = "/gasTree"; break; @@ -273,7 +288,9 @@ public class T_MonitorController extends BaseController { case "17": url = "/tmTree"; break; - + case "20": + url = "/vibrationSensorTree"; + break; default: T_Monitor t_monitor = new T_Monitor(); t_monitor.setMonitorId(objid); @@ -298,6 +315,9 @@ public class T_MonitorController extends BaseController { case 17: url = "/tmTree"; break; + case 20: + url = "/vibrationSensorTree"; + break; default: break; } diff --git a/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorAdd.html b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorAdd.html new file mode 100644 index 0000000..c0c05a2 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorAdd.html @@ -0,0 +1,192 @@ + + + + + + +
+
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+
+ + + + + + + + + + +
+ + + + + + + + +
+ +
+ +
+
+ +
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorEdit.html b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorEdit.html new file mode 100644 index 0000000..217f705 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorEdit.html @@ -0,0 +1,196 @@ + + + + + + +
+
+ +
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorMonitor.html b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorMonitor.html new file mode 100644 index 0000000..875d768 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorMonitor.html @@ -0,0 +1,186 @@ + + + + + + +
+
+
+
+
+
    + + + + + + + + +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorTree.html b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorTree.html new file mode 100644 index 0000000..73df01a --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/Monitor/vibrationSensorTree.html @@ -0,0 +1,49 @@ + + + + + + + + + + +
+ + +
+ +
+ 展开 / + 折叠 +
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html index f202d4f..0046fc3 100644 --- a/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html +++ b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html @@ -2,19 +2,48 @@ + + + + +
+
+
+
+ 测控点信息 +
+
+ + + + +
+
+
+
+
+
+
+ +
+
  • - + - - +
  • @@ -54,13 +83,27 @@
- +
+ + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java index b47cf46..e580f7a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java @@ -1,5 +1,6 @@ package com.ruoyi.system.domain; +import java.math.BigDecimal; import java.util.Date; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -31,31 +32,31 @@ public class TVibrationsensorData extends BaseEntity { * 振动传感器ID */ @Excel(name = "振动传感器ID") - private Long sensorId; + private String sensorId; /** * 速度(mm/s) */ @Excel(name = "速度(mm/s)") - private Long speed; + private BigDecimal speed; /** * 位移(um) */ @Excel(name = "位移(um)") - private Long displacement; + private BigDecimal displacement; /** * 加速度(g) */ @Excel(name = "加速度(g)") - private Long acceleration; + private BigDecimal acceleration; /** * 温度(℃) */ @Excel(name = "温度(℃)") - private Long temperature; + private BigDecimal temperature; /** * 记录时间 @@ -63,82 +64,67 @@ public class TVibrationsensorData extends BaseEntity { @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd") private Date recodeTime; - public void setObjId(Long objId) { - this.objId = objId; - } - public Long getObjId() { return objId; } - public void setCollectTime(Date collectTime) { - this.collectTime = collectTime; + public void setObjId(Long objId) { + this.objId = objId; } public Date getCollectTime() { return collectTime; } - public void setSensorId(Long sensorId) { - this.sensorId = sensorId; + public void setCollectTime(Date collectTime) { + this.collectTime = collectTime; } - public Long getSensorId() { + public String getSensorId() { return sensorId; } - public void setSpeed(Long speed) { - this.speed = speed; + public void setSensorId(String sensorId) { + this.sensorId = sensorId; } - public Long getSpeed() { + public BigDecimal getSpeed() { return speed; } - public void setDisplacement(Long displacement) { - this.displacement = displacement; + public void setSpeed(BigDecimal speed) { + this.speed = speed; } - public Long getDisplacement() { + public BigDecimal getDisplacement() { return displacement; } - public void setAcceleration(Long acceleration) { - this.acceleration = acceleration; + public void setDisplacement(BigDecimal displacement) { + this.displacement = displacement; } - public Long getAcceleration() { + public BigDecimal getAcceleration() { return acceleration; } - public void setTemperature(Long temperature) { - this.temperature = temperature; + public void setAcceleration(BigDecimal acceleration) { + this.acceleration = acceleration; } - public Long getTemperature() { + public BigDecimal getTemperature() { return temperature; } - public void setRecodeTime(Date recodeTime) { - this.recodeTime = recodeTime; + public void setTemperature(BigDecimal temperature) { + this.temperature = temperature; } public Date getRecodeTime() { return recodeTime; } - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("objId", getObjId()) - .append("collectTime", getCollectTime()) - .append("sensorId", getSensorId()) - .append("speed", getSpeed()) - .append("displacement", getDisplacement()) - .append("acceleration", getAcceleration()) - .append("temperature", getTemperature()) - .append("recodeTime", getRecodeTime()) - .append("remark", getRemark()) - .toString(); + public void setRecodeTime(Date recodeTime) { + this.recodeTime = recodeTime; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java index f8e6b6f..8521bb2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/T_MonitorServiceImpl.java @@ -75,13 +75,15 @@ public class T_MonitorServiceImpl implements IT_MonitorService @Override public int insertT_Monitor(T_Monitor t_Monitor) { - t_Monitor.setMonitorType(16); - t_Monitor.setSecondType(0); try { - TSetmonitorthresholdvalue tSetmonitorthresholdvalue = new TSetmonitorthresholdvalue(); - tSetmonitorthresholdvalue.setMonitorId(t_Monitor.getMonitorId()); - tSetmonitorthresholdvalue.setMonitorType(16); - tSetmonitorthresholdvalueService.insertTSetmonitorthresholdvalue(tSetmonitorthresholdvalue); + t_Monitor.setSecondType(0); + if (t_Monitor.getMonitorType() == null){ + t_Monitor.setMonitorType(16); + TSetmonitorthresholdvalue tSetmonitorthresholdvalue = new TSetmonitorthresholdvalue(); + tSetmonitorthresholdvalue.setMonitorId(t_Monitor.getMonitorId()); + tSetmonitorthresholdvalue.setMonitorType(16); + tSetmonitorthresholdvalueService.insertTSetmonitorthresholdvalue(tSetmonitorthresholdvalue); + } } catch (Exception e) { e.printStackTrace(); }