|
@@ -63,38 +63,44 @@ public class ProtTimer {
|
|
|
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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
+ 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+ "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
+ 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(21);
|
|
|
- protWarningInfo.setWarningType(Integer.parseInt(num6));
|
|
|
+ protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
- protWarningInfo.setUserIds("1,2");
|
|
|
+ protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(Integer.parseInt(num6));
|
|
|
protWarningInfo.setBuildLocation("进污口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|
|
@@ -103,38 +109,45 @@ public class ProtTimer {
|
|
|
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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
+ 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+ "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
+ 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(21);
|
|
|
+ protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
protWarningInfo.setWarningType(Integer.parseInt(num6));
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
- protWarningInfo.setUserIds("1,2");
|
|
|
+ protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(Integer.parseInt(num6));
|
|
|
protWarningInfo.setBuildLocation("处理口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|
|
@@ -143,38 +156,45 @@ public class ProtTimer {
|
|
|
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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num1) > Double.parseDouble(protThreshold.getCod2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num2) > Double.parseDouble(protThreshold.getNh3n2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num3) > Double.parseDouble(protThreshold.getTp2())) {
|
|
|
+ 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 + "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num4) > Double.parseDouble(protThreshold.getTn2())) {
|
|
|
+ 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+ "达到橙色预警");
|
|
|
- }
|
|
|
- if (Double.parseDouble(num5) > Double.parseDouble(protThreshold.getFlow2())) {
|
|
|
+ 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(21);
|
|
|
+ protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
protWarningInfo.setWarningType(Integer.parseInt(num6));
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
- protWarningInfo.setUserIds("1,2");
|
|
|
+ protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(Integer.parseInt(num6));
|
|
|
protWarningInfo.setBuildLocation("排污口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|