diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java index 015bc872..6ac286f6 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java @@ -64,8 +64,11 @@ public class TWTempertureDataController extends BaseController if("温湿度".equals(energyName)){ emsIOTData.monitorTypeArr.add("温度"); emsIOTData.monitorTypeArr.add("湿度"); - } - else{ + }else if ("pm1".equals(energyName)){ + emsIOTData.monitorTypeArr.add("pm1"); + emsIOTData.monitorTypeArr.add("pm2"); + emsIOTData.monitorTypeArr.add("pm10"); + }else{ emsIOTData.monitorTypeArr.add(energyName); } emsIOTData.setType("line"); diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmRule.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmRule.java index 4673f8b2..58b5e1b6 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmRule.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmRule.java @@ -1,5 +1,6 @@ package com.hw.ems.record.domain; +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -72,6 +73,66 @@ public class RecordAlarmRule extends BaseEntity /** 权限标识(用户) */ @Excel(name = "权限标识", readConverterExp = "用=户") private Long userId; + private BigDecimal pm1; + private BigDecimal pm2; + private BigDecimal pm10; + private BigDecimal temperature; + private BigDecimal humidity; + private BigDecimal noise; + public void setPm1(BigDecimal pm1) + { + this.pm1 = pm1; + } + + public BigDecimal getPm1() + { + return pm1; + } + public void setPm2(BigDecimal pm2) + { + this.pm2 = pm2; + } + + public BigDecimal getPm2() + { + return pm2; + } + public void setPm10(BigDecimal pm10) + { + this.pm10 = pm10; + } + + public BigDecimal getPm10() + { + return pm10; + } + public void setTemperature(BigDecimal temperature) + { + this.temperature = temperature; + } + + public BigDecimal getTemperature() + { + return temperature; + } + public void setHumidity(BigDecimal humidity) + { + this.humidity = humidity; + } + + public BigDecimal getHumidity() + { + return humidity; + } + public void setNoise(BigDecimal noise) + { + this.noise = noise; + } + + public BigDecimal getNoise() + { + return noise; + } public void setObjId(Long objId) { diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java index add20bad..c5552b68 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java @@ -4,6 +4,7 @@ import com.hw.ems.record.domain.RecordAlarmData; import com.hw.ems.record.domain.RecordDnbInstant; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; @@ -93,9 +94,13 @@ public interface RecordDnbInstantMapper */ List offlineAlerts(RecordDnbInstant recordDnbInstant); - List selectNoiseCount(@Param("time") Date time,@Param("maxValue") int maxValue); + List selectNoiseCount(@Param("time") Date time,@Param("maxValue") BigDecimal maxValue); - List selectDustCount(@Param("time") Date time,@Param("maxValue") int maxValue); + List selectDustCount(@Param("time") Date time,@Param("maxValue") BigDecimal maxValue); + List selectDustCount2(@Param("time") Date time,@Param("maxValue") BigDecimal maxValue); + List selectDustCount10(@Param("time") Date time,@Param("maxValue") BigDecimal maxValue); - List selectTemAndHumCount(@Param("time") Date time,@Param("maxValue") int maxValue); + List selectTemAndHumCount(@Param("time") Date time,@Param("maxValue") BigDecimal maxValue); + + List selectTemAndHumCount1(@Param("time")Date time, @Param("maxValue") BigDecimal maxValue); } diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java index 9be2db6c..4beab83e 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java @@ -583,7 +583,7 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService { triggerNumber = 1L; } if (rule.getEnergyType() == 4){ - List records = recordDnbInstantMapper.selectNoiseCount(time,50); + List records = recordDnbInstantMapper.selectNoiseCount(time,rule.getNoise()); for (RecordAlarmData record : records) { if (record.getAlarmCount()>triggerNumber){ RecordAlarmData alarmData = new RecordAlarmData(); @@ -598,7 +598,7 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService { } } }else if (rule.getEnergyType() == 6){ - List records = recordDnbInstantMapper.selectDustCount(time,19); + List records = recordDnbInstantMapper.selectDustCount(time,rule.getPm1()); for (RecordAlarmData record : records) { if (record.getAlarmCount()>triggerNumber){ RecordAlarmData alarmData = new RecordAlarmData(); @@ -606,14 +606,42 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService { alarmData.setCollectTime(new Date()); alarmData.setAlarmType(3L); alarmData.setAlarmStatus(1L); - alarmData.setAlarmData("超过粉尘阈值"); + alarmData.setAlarmData("超过pm1阈值"); + recordAlarmDataMapper.insertRecordAlarmData(alarmData); + }else { + continue; + } + } + List records2 = recordDnbInstantMapper.selectDustCount2(time,rule.getPm2()); + for (RecordAlarmData record : records2) { + if (record.getAlarmCount()>triggerNumber){ + RecordAlarmData alarmData = new RecordAlarmData(); + alarmData.setMonitorId(record.getMonitorId()); + alarmData.setCollectTime(new Date()); + alarmData.setAlarmType(3L); + alarmData.setAlarmStatus(1L); + alarmData.setAlarmData("超过pm2阈值"); + recordAlarmDataMapper.insertRecordAlarmData(alarmData); + }else { + continue; + } + } + List records10 = recordDnbInstantMapper.selectDustCount10(time,rule.getPm10()); + for (RecordAlarmData record : records10) { + if (record.getAlarmCount()>triggerNumber){ + RecordAlarmData alarmData = new RecordAlarmData(); + alarmData.setMonitorId(record.getMonitorId()); + alarmData.setCollectTime(new Date()); + alarmData.setAlarmType(3L); + alarmData.setAlarmStatus(1L); + alarmData.setAlarmData("超过pm10阈值"); recordAlarmDataMapper.insertRecordAlarmData(alarmData); }else { continue; } } }else if (rule.getEnergyType() == 7){ - List records = recordDnbInstantMapper.selectTemAndHumCount(time,30); + List records = recordDnbInstantMapper.selectTemAndHumCount(time,rule.getTemperature()); for (RecordAlarmData record : records) { if (record.getAlarmCount()>triggerNumber){ RecordAlarmData alarmData = new RecordAlarmData(); @@ -621,7 +649,21 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService { alarmData.setCollectTime(new Date()); alarmData.setAlarmType(3L); alarmData.setAlarmStatus(1L); - alarmData.setAlarmData("超过温湿度阈值"); + alarmData.setAlarmData("超过温度阈值"); + recordAlarmDataMapper.insertRecordAlarmData(alarmData); + }else { + continue; + } + } + List records1 = recordDnbInstantMapper.selectTemAndHumCount1(time,rule.getHumidity()); + for (RecordAlarmData record : records1) { + if (record.getAlarmCount()>triggerNumber){ + RecordAlarmData alarmData = new RecordAlarmData(); + alarmData.setMonitorId(record.getMonitorId()); + alarmData.setCollectTime(new Date()); + alarmData.setAlarmType(3L); + alarmData.setAlarmStatus(1L); + alarmData.setAlarmData("超过湿度阈值"); recordAlarmDataMapper.insertRecordAlarmData(alarmData); }else { continue; diff --git a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmRuleMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmRuleMapper.xml index a68134b5..bdda610b 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmRuleMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmRuleMapper.xml @@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select objId, rule_id, rule_name, monitor_id, collect_time, energy_type, trigger_rule, trigger_number, time_range, device_offline_time, notify_user, cause, create_by, create_time, update_by, update_time, dept_id, user_id from record_alarm_rule + select objId, rule_id, rule_name, monitor_id, collect_time, energy_type, trigger_rule, trigger_number, time_range, device_offline_time, notify_user, cause, create_by, create_time, update_by, update_time, dept_id, user_id,pm1,pm2,pm10,temperature,humidity,noise from record_alarm_rule + + + + diff --git a/hw-ui/src/views/dms/suplier/index.vue b/hw-ui/src/views/dms/suplier/index.vue index 4272e560..028a9b8e 100644 --- a/hw-ui/src/views/dms/suplier/index.vue +++ b/hw-ui/src/views/dms/suplier/index.vue @@ -132,13 +132,13 @@ @click="handleUpdate(scope.row)" v-hasPermi="['dms:suplier:edit']" >修改 - 删除 + + + + + + + diff --git a/hw-ui/src/views/ems/base/exception/data/index.vue b/hw-ui/src/views/ems/base/exception/data/index.vue index 2c46d3e4..e13ebf9e 100644 --- a/hw-ui/src/views/ems/base/exception/data/index.vue +++ b/hw-ui/src/views/ems/base/exception/data/index.vue @@ -55,7 +55,7 @@ - + @@ -71,15 +71,15 @@ - - - - - - - - - + + + + + + + + + --> - - - - - + + + + + + + + + + + + + + + 搜索 重置 @@ -104,6 +104,12 @@ + + + + + + @@ -176,7 +182,24 @@ - + + + + + + + + + + + + + + + + + + diff --git a/hw-ui/src/views/ems/report/currentIOTCurve/index.vue b/hw-ui/src/views/ems/report/currentIOTCurve/index.vue index c6d656b8..22b48856 100644 --- a/hw-ui/src/views/ems/report/currentIOTCurve/index.vue +++ b/hw-ui/src/views/ems/report/currentIOTCurve/index.vue @@ -476,6 +476,48 @@ export default { // color: "rgba(5,140,255, 0.2)", // }, data: data.monitorTypeArr.includes('pm1') ? data.dataList.map(e => e.pm1) : [] + },{ + tooltip: { + show: data.monitorTypeArr.includes('pm2') ? true : false + }, + name: 'pm2', + type: data.type, + smooth: data.smooth, //平滑曲线显示 + showAllSymbol: data.showAllSymbol, //显示所有图形。 + symbol: data.symbol, //标记的图形为实心圆 + symbolSize: data.symbolSize, //标记的大小 + // itemStyle: { + // //折线拐点标志的样式 + // color: "#058cff", + // }, + // lineStyle: { + // color: "#058cff", + // }, + // areaStyle: { + // color: "rgba(5,140,255, 0.2)", + // }, + data: data.monitorTypeArr.includes('pm2') ? data.dataList.map(e => e.pm2) : [] + },{ + tooltip: { + show: data.monitorTypeArr.includes('pm10') ? true : false + }, + name: 'pm10', + type: data.type, + smooth: data.smooth, //平滑曲线显示 + showAllSymbol: data.showAllSymbol, //显示所有图形。 + symbol: data.symbol, //标记的图形为实心圆 + symbolSize: data.symbolSize, //标记的大小 + // itemStyle: { + // //折线拐点标志的样式 + // color: "#058cff", + // }, + // lineStyle: { + // color: "#058cff", + // }, + // areaStyle: { + // color: "rgba(5,140,255, 0.2)", + // }, + data: data.monitorTypeArr.includes('pm10') ? data.dataList.map(e => e.pm10) : [] } ] }