|
@@ -31,7 +31,7 @@ public class ProtTimer {
|
|
|
private ProtWarningInfoMapper warningInfoMapper;
|
|
|
|
|
|
// 环保数据
|
|
|
- @Scheduled(cron = "0 0/10 * * * ? ")
|
|
|
+ @Scheduled(cron = "0 0 */1 * * ? ")
|
|
|
private void getShenChan() throws Exception {
|
|
|
|
|
|
//假设已经拿到了数据
|
|
@@ -43,161 +43,166 @@ public class ProtTimer {
|
|
|
String num5 = NumberUtils.getNum(90, 210, 0);//flow
|
|
|
String num6 = NumberUtils.getNum(1, 4, 0);//loc_type
|
|
|
|
|
|
- ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
|
|
|
- ProtData protData = new ProtData();
|
|
|
- protData.setLoctionType(Integer.parseInt(num6));
|
|
|
- protData.setCreateDate(new Date());
|
|
|
- protData.setFarmId(21);
|
|
|
- protData.setCod(num1);
|
|
|
- protData.setPh(num);
|
|
|
- protData.setNh3n(num2);
|
|
|
- protData.setTp(num3);
|
|
|
- protData.setTn(num4);
|
|
|
- protData.setFlow(num5);
|
|
|
- protDataMapper.insert(protData);
|
|
|
|
|
|
QueryWrapper<ProtThreshold> queryWrapper = new QueryWrapper<>();
|
|
|
- if ("1".equals(num6)) {
|
|
|
- queryWrapper.eq("farm_id", 21).eq("prot_type", 1);
|
|
|
- ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//进污口
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
- protWarningInfo.setWarningContent("进污口ph值为" + num + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(1);
|
|
|
- } else if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
- protWarningInfo.setWarningContent("进污口ph值为" + num + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(1);
|
|
|
- } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
- protWarningInfo.setWarningContent("进污口cod值为" + num1 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(0);
|
|
|
- } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod1())) {
|
|
|
- protWarningInfo.setWarningContent("进污口cod值为" + num1 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(0);
|
|
|
- } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
- protWarningInfo.setWarningContent("进污口NH3N值为" + num2 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(2);
|
|
|
- } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n1())) {
|
|
|
- protWarningInfo.setWarningContent("进污口NH3N值为" + num2 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(2);
|
|
|
- } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
- protWarningInfo.setWarningContent("进污口TP值为" + num3 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(3);
|
|
|
- } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp1())) {
|
|
|
- protWarningInfo.setWarningContent("进污口TP值为" + num3 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(3);
|
|
|
- } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
- protWarningInfo.setWarningContent("进污口TN值为" + num4 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(4);
|
|
|
- } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn1())) {
|
|
|
- protWarningInfo.setWarningContent("进污口TN值为" + num4 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(4);
|
|
|
- } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
- protWarningInfo.setWarningContent("进污口累计流量值为" + num5 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(5);
|
|
|
- } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow1())) {
|
|
|
- protWarningInfo.setWarningContent("进污口累计流量值为" + num5 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(5);
|
|
|
- }
|
|
|
- protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
- protWarningInfo.setDate(new Date());
|
|
|
- protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
- protWarningInfo.setDeviceId(Integer.parseInt(num6));
|
|
|
- protWarningInfo.setBuildLocation("进污口");
|
|
|
- warningInfoMapper.insert(protWarningInfo);
|
|
|
- } else if ("2".equals(num6)) {
|
|
|
- queryWrapper.eq("farm_id", 21).eq("prot_type", 2);
|
|
|
- ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//污口
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
- protWarningInfo.setWarningContent("处理口ph值为" + num + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(1);
|
|
|
- } else if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
- protWarningInfo.setWarningContent("处理口ph值为" + num + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(1);
|
|
|
- } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
- protWarningInfo.setWarningContent("处理口cod值为" + num1 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(0);
|
|
|
- } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod1())) {
|
|
|
- protWarningInfo.setWarningContent("处理口cod值为" + num1 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(0);
|
|
|
- } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
- protWarningInfo.setWarningContent("处理口NH3N值为" + num2 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(2);
|
|
|
- } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n1())) {
|
|
|
- protWarningInfo.setWarningContent("处理口NH3N值为" + num2 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(2);
|
|
|
- } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
- protWarningInfo.setWarningContent("处理口TP值为" + num3 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(3);
|
|
|
- } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp1())) {
|
|
|
- protWarningInfo.setWarningContent("处理口TP值为" + num3 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(3);
|
|
|
- } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
- protWarningInfo.setWarningContent("处理口TN值为" + num4 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(4);
|
|
|
- } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn1())) {
|
|
|
- protWarningInfo.setWarningContent("处理口TN值为" + num4 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(4);
|
|
|
- } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
- protWarningInfo.setWarningContent("处理口累计流量值为" + num5 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(5);
|
|
|
- } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow1())) {
|
|
|
- protWarningInfo.setWarningContent("处理口累计流量值为" + num5 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(5);
|
|
|
- }
|
|
|
- protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
- protWarningInfo.setWarningType(Integer.parseInt(num6));
|
|
|
- protWarningInfo.setDate(new Date());
|
|
|
- protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
- protWarningInfo.setDeviceId(Integer.parseInt(num6));
|
|
|
- protWarningInfo.setBuildLocation("处理口");
|
|
|
- warningInfoMapper.insert(protWarningInfo);
|
|
|
- } else if ("3".equals(num6)) {
|
|
|
- queryWrapper.eq("farm_id", 21).eq("prot_type", 3);
|
|
|
- ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//进污口
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
- protWarningInfo.setWarningContent("排污口ph值为" + num + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(1);
|
|
|
- } else if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
- protWarningInfo.setWarningContent("排污口ph值为" + num + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(1);
|
|
|
- } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
- protWarningInfo.setWarningContent("排污口cod值为" + num1 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(0);
|
|
|
- } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod1())) {
|
|
|
- protWarningInfo.setWarningContent("排污口cod值为" + num1 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(0);
|
|
|
- } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
- protWarningInfo.setWarningContent("排污口NH3N值为" + num2 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(2);
|
|
|
- } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n1())) {
|
|
|
- protWarningInfo.setWarningContent("排污口NH3N值为" + num2 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(2);
|
|
|
- } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
- protWarningInfo.setWarningContent("排污口TP值为" + num3 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(3);
|
|
|
- } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp1())) {
|
|
|
- protWarningInfo.setWarningContent("排污口TP值为" + num3 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(3);
|
|
|
- } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
- protWarningInfo.setWarningContent("排污口TN值为" + num4 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(4);
|
|
|
- } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn1())) {
|
|
|
- protWarningInfo.setWarningContent("排污口TN值为" + num4 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(4);
|
|
|
- } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
- protWarningInfo.setWarningContent("排污口累计流量值为" + num5 + "达到红色预警");
|
|
|
- protWarningInfo.setWarningType(5);
|
|
|
- } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow1())) {
|
|
|
- protWarningInfo.setWarningContent("排污口累计流量值为" + num5 + "达到橙色预警");
|
|
|
- protWarningInfo.setWarningType(5);
|
|
|
+ for (int i = 1; i < 4; i++) {
|
|
|
+
|
|
|
+ ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
+
|
|
|
+ ProtData protData = new ProtData();
|
|
|
+ protData.setLoctionType(i);
|
|
|
+ protData.setCreateDate(new Date());
|
|
|
+ protData.setFarmId(21);
|
|
|
+ protData.setCod(num1);
|
|
|
+ protData.setPh(num);
|
|
|
+ protData.setNh3n(num2);
|
|
|
+ protData.setTp(num3);
|
|
|
+ protData.setTn(num4);
|
|
|
+ protData.setFlow(num5);
|
|
|
+ protDataMapper.insert(protData);
|
|
|
+
|
|
|
+ if ("1".equals(i)) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("prot_type", 1);
|
|
|
+ ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//进污口
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口ph值为" + num + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(1);
|
|
|
+ } else if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口ph值为" + num + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(1);
|
|
|
+ } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口cod值为" + num1 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(0);
|
|
|
+ } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod1())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口cod值为" + num1 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(0);
|
|
|
+ } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口NH3N值为" + num2 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(2);
|
|
|
+ } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n1())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口NH3N值为" + num2 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(2);
|
|
|
+ } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口TP值为" + num3 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(3);
|
|
|
+ } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp1())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口TP值为" + num3 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(3);
|
|
|
+ } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口TN值为" + num4 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(4);
|
|
|
+ } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn1())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口TN值为" + num4 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(4);
|
|
|
+ } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口累计流量值为" + num5 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(5);
|
|
|
+ } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow1())) {
|
|
|
+ protWarningInfo.setWarningContent("进污口累计流量值为" + num5 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(5);
|
|
|
+ }
|
|
|
+ protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setDate(new Date());
|
|
|
+ protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
+ protWarningInfo.setDeviceId(i);
|
|
|
+ protWarningInfo.setBuildLocation("进污口");
|
|
|
+ warningInfoMapper.insert(protWarningInfo);
|
|
|
+ } else if ("2".equals(i)) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("prot_type", 2);
|
|
|
+ ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//污口
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口ph值为" + num + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(1);
|
|
|
+ } else if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口ph值为" + num + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(1);
|
|
|
+ } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口cod值为" + num1 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(0);
|
|
|
+ } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod1())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口cod值为" + num1 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(0);
|
|
|
+ } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口NH3N值为" + num2 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(2);
|
|
|
+ } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n1())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口NH3N值为" + num2 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(2);
|
|
|
+ } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口TP值为" + num3 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(3);
|
|
|
+ } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp1())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口TP值为" + num3 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(3);
|
|
|
+ } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口TN值为" + num4 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(4);
|
|
|
+ } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn1())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口TN值为" + num4 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(4);
|
|
|
+ } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口累计流量值为" + num5 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(5);
|
|
|
+ } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow1())) {
|
|
|
+ protWarningInfo.setWarningContent("处理口累计流量值为" + num5 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(5);
|
|
|
+ }
|
|
|
+ protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
+ protWarningInfo.setDate(new Date());
|
|
|
+ protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
+ protWarningInfo.setDeviceId(i);
|
|
|
+ protWarningInfo.setBuildLocation("处理口");
|
|
|
+ warningInfoMapper.insert(protWarningInfo);
|
|
|
+ } else if ("3".equals(i)) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("prot_type", 3);
|
|
|
+ ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//进污口
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口ph值为" + num + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(1);
|
|
|
+ } else if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口ph值为" + num + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(1);
|
|
|
+ } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口cod值为" + num1 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(0);
|
|
|
+ } else if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod1())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口cod值为" + num1 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(0);
|
|
|
+ } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口NH3N值为" + num2 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(2);
|
|
|
+ } else if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n1())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口NH3N值为" + num2 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(2);
|
|
|
+ } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口TP值为" + num3 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(3);
|
|
|
+ } else if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp1())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口TP值为" + num3 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(3);
|
|
|
+ } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口TN值为" + num4 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(4);
|
|
|
+ } else if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn1())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口TN值为" + num4 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(4);
|
|
|
+ } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口累计流量值为" + num5 + "达到红色预警");
|
|
|
+ protWarningInfo.setWarningType(5);
|
|
|
+ } else if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow1())) {
|
|
|
+ protWarningInfo.setWarningContent("排污口累计流量值为" + num5 + "达到橙色预警");
|
|
|
+ protWarningInfo.setWarningType(5);
|
|
|
+ }
|
|
|
+ protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
+ protWarningInfo.setDate(new Date());
|
|
|
+ protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
+ protWarningInfo.setDeviceId(i);
|
|
|
+ protWarningInfo.setBuildLocation("排污口");
|
|
|
+ warningInfoMapper.insert(protWarningInfo);
|
|
|
}
|
|
|
- protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
- protWarningInfo.setWarningType(Integer.parseInt(num6));
|
|
|
- protWarningInfo.setDate(new Date());
|
|
|
- protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
- protWarningInfo.setDeviceId(Integer.parseInt(num6));
|
|
|
- protWarningInfo.setBuildLocation("排污口");
|
|
|
- warningInfoMapper.insert(protWarningInfo);
|
|
|
}
|
|
|
}
|
|
|
}
|