|
@@ -64,36 +64,45 @@ public class GasTimer {
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(0);
|
|
}
|
|
}
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(1);
|
|
}
|
|
}
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(2);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(3);
|
|
}
|
|
}
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(4);
|
|
}
|
|
}
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(5);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(6);
|
|
}
|
|
}
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(7);
|
|
}
|
|
}
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(8);
|
|
}
|
|
}
|
|
- warningInfo.setWarningType(1);
|
|
|
|
|
|
+
|
|
warningInfo.setBuildLocation("屋顶");
|
|
warningInfo.setBuildLocation("屋顶");
|
|
warningInfo.setDate(new Date());
|
|
warningInfo.setDate(new Date());
|
|
- warningInfo.setFarmId(21);
|
|
|
|
- warningInfo.setUserIds("1,2");
|
|
|
|
|
|
+ warningInfo.setFarmId(gasThreshold.getFarmId());
|
|
|
|
+ warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
warningInfoMapper.insert(warningInfo);
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
|
|
|
} else if ("2".equals(type)) {
|
|
} else if ("2".equals(type)) {
|
|
@@ -101,108 +110,137 @@ public class GasTimer {
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(0);
|
|
}
|
|
}
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(1);
|
|
}
|
|
}
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(2);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(3);
|
|
}
|
|
}
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(4);
|
|
|
|
+
|
|
}
|
|
}
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(5);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(6);
|
|
}
|
|
}
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(7);
|
|
}
|
|
}
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(8);
|
|
}
|
|
}
|
|
- warningInfo.setWarningType(2);
|
|
|
|
|
|
+
|
|
warningInfo.setBuildLocation("厂界上");
|
|
warningInfo.setBuildLocation("厂界上");
|
|
warningInfo.setDate(new Date());
|
|
warningInfo.setDate(new Date());
|
|
- warningInfo.setFarmId(21);
|
|
|
|
- warningInfo.setUserIds("1,2");
|
|
|
|
|
|
+ warningInfo.setFarmId(gasThreshold.getFarmId());
|
|
|
|
+ warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
warningInfoMapper.insert(warningInfo);
|
|
warningInfoMapper.insert(warningInfo);
|
|
} else if ("3".equals(type)) {
|
|
} else if ("3".equals(type)) {
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 3);
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 3);
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(0);
|
|
}
|
|
}
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(1);
|
|
}
|
|
}
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(2);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(3);
|
|
}
|
|
}
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(4);
|
|
|
|
+
|
|
}
|
|
}
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(5);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(6);
|
|
}
|
|
}
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(7);
|
|
}
|
|
}
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(8);
|
|
}
|
|
}
|
|
- warningInfo.setWarningType(3);
|
|
|
|
|
|
+
|
|
warningInfo.setBuildLocation("厂界下");
|
|
warningInfo.setBuildLocation("厂界下");
|
|
warningInfo.setDate(new Date());
|
|
warningInfo.setDate(new Date());
|
|
- warningInfo.setFarmId(21);
|
|
|
|
- warningInfo.setUserIds("1,2");
|
|
|
|
|
|
+ warningInfo.setFarmId(gasThreshold.getFarmId());
|
|
|
|
+ warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
warningInfoMapper.insert(warningInfo);
|
|
warningInfoMapper.insert(warningInfo);
|
|
} else if ("4".equals(type)) {
|
|
} else if ("4".equals(type)) {
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 4);
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 4);
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(nh3n + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(0);
|
|
}
|
|
}
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(jlm + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(1);
|
|
}
|
|
}
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(elht + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(2);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ejel + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(3);
|
|
}
|
|
}
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(h2s + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(4);
|
|
}
|
|
}
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(byx + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(5);
|
|
}
|
|
}
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(ch3 + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(6);
|
|
}
|
|
}
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(sja + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(7);
|
|
}
|
|
}
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
warningInfo.setWarningContent(cq + "超过阈值,系统预警提醒");
|
|
|
|
+ warningInfo.setWarningType(8);
|
|
}
|
|
}
|
|
- warningInfo.setWarningType(4);
|
|
|
|
|
|
+
|
|
warningInfo.setBuildLocation("厂界居民");
|
|
warningInfo.setBuildLocation("厂界居民");
|
|
warningInfo.setDate(new Date());
|
|
warningInfo.setDate(new Date());
|
|
- warningInfo.setFarmId(21);
|
|
|
|
- warningInfo.setUserIds("1,2");
|
|
|
|
|
|
+ warningInfo.setFarmId(gasThreshold.getFarmId());
|
|
|
|
+ warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
warningInfoMapper.insert(warningInfo);
|
|
warningInfoMapper.insert(warningInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|