|
@@ -35,41 +35,43 @@ public class ProtTimer {
|
|
|
private void getShenChan() throws Exception {
|
|
|
|
|
|
|
|
|
+
|
|
|
for (int i = 1; i < 4; i++) {
|
|
|
|
|
|
//假设已经拿到了数据
|
|
|
- String num = NumberUtils.getNumFloat(6.4, 8.6);//ph
|
|
|
-
|
|
|
-
|
|
|
+ String num = NumberUtils.getNumFloat(4.0,6.0002);//ph
|
|
|
+ String num1 = NumberUtils.getNum(300, 361, 1);//cod
|
|
|
+ String num2 = NumberUtils.getNum(40, 61,1);//nh3n
|
|
|
+ String num3 = NumberUtils.getNumFloat(4.0, 6.5002);//tp
|
|
|
+ String num4 = NumberUtils.getNum(7000, 8001,0);//tn
|
|
|
+ String num5 = NumberUtils.getNum(220, 301,0);//flow
|
|
|
|
|
|
+ //排污口专用数据
|
|
|
+ String ph = NumberUtils.getNumFloat(5.0,5.9);//ph
|
|
|
+ String cod = NumberUtils.getNum(350, 360, 1);//cod
|
|
|
+ String nh3n = NumberUtils.getNum(55, 60, 1);//nh3n
|
|
|
+ String tp = NumberUtils.getNumFloat(5.0, 6.49);//tp
|
|
|
+ String tn = NumberUtils.getNum(7800, 8000, 1);//tn
|
|
|
+ String flow = NumberUtils.getNum(290, 300, 1);//flow
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
QueryWrapper<ProtThreshold> queryWrapper = new QueryWrapper<>();
|
|
|
if (i == 1) {
|
|
|
- String num1 = NumberUtils.getNum(8000, 20001,0);//cod
|
|
|
- String num2 = NumberUtils.getNumFloat(1000.0, 1501.0);//nh3n
|
|
|
- String num3 = NumberUtils.getNumFloat(100.0, 260.0);//tp
|
|
|
- String num4 = NumberUtils.getNum(1000, 1550, 0);//tn
|
|
|
- String num5 = NumberUtils.getNum(0, 51, 0);//flow
|
|
|
-
|
|
|
- protData.setCod(num1);
|
|
|
- protData.setNh3n(num2);
|
|
|
- protData.setTp(num3);
|
|
|
- protData.setTn(num4);
|
|
|
- protData.setFlow(num5);
|
|
|
- protDataMapper.insert(protData);
|
|
|
-
|
|
|
queryWrapper.eq("farm_id", 21).eq("prot_type", 1);
|
|
|
ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//进污口
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2()) || Double.parseDouble(num) < Double.parseDouble(protThreshold.getOther3())) {
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
protWarningInfo.setWarningContent("进污口ph值为" + num + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(1);
|
|
@@ -80,7 +82,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setBuildLocation("进污口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|
|
|
}
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1()) || Double.parseDouble(num) < Double.parseDouble(protThreshold.getOther2())) {
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
protWarningInfo.setWarningContent("进污口ph值为" + num + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(1);
|
|
@@ -201,40 +203,28 @@ public class ProtTimer {
|
|
|
protWarningInfo.setBuildLocation("进污口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
if (i == 2) {
|
|
|
- String num1 = NumberUtils.getNum(0, 310,0);//cod
|
|
|
- String num2 = NumberUtils.getNumFloat(0.0, 31.0);//nh3n
|
|
|
- String num3 = NumberUtils.getNumFloat(0.0, 3.6);//tp
|
|
|
- String num4 = NumberUtils.getNum(0, 32, 0);//tn
|
|
|
- String num5 = NumberUtils.getNum(0, 55, 0);//flow
|
|
|
-
|
|
|
- protData.setCod(num1);
|
|
|
- protData.setNh3n(num2);
|
|
|
- protData.setTp(num3);
|
|
|
- protData.setTn(num4);
|
|
|
- protData.setFlow(num5);
|
|
|
- protDataMapper.insert(protData);
|
|
|
-
|
|
|
queryWrapper.eq("farm_id", 21).eq("prot_type", 2);
|
|
|
ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//污口
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2()) || Double.parseDouble(num) < Double.parseDouble(protThreshold.getOther3())) {
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
protWarningInfo.setWarningContent("处理口ph值为" + num + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(1);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
|
protWarningInfo.setBuildLocation("处理口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|
|
|
}
|
|
|
- if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1()) || Double.parseDouble(num) < Double.parseDouble(protThreshold.getOther2())) {
|
|
|
+ if (Double.parseDouble(num) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
protWarningInfo.setWarningContent("处理口ph值为" + num + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(1);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -246,6 +236,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口cod值为" + num1 + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(0);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -257,6 +248,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口cod值为" + num1 + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(0);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -268,6 +260,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口NH3N值为" + num2 + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(2);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -279,6 +272,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口NH3N值为" + num2 + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(2);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -290,6 +284,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口TP值为" + num3 + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(3);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -301,6 +296,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口TP值为" + num3 + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(3);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -312,6 +308,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口TN值为" + num4 + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(4);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -323,6 +320,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口TN值为" + num4 + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(4);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -334,6 +332,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口累计流量值为" + num5 + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(5);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -345,6 +344,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("处理口累计流量值为" + num5 + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(5);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -354,42 +354,26 @@ public class ProtTimer {
|
|
|
|
|
|
}
|
|
|
if (i == 3) {
|
|
|
- //排污口专用数据
|
|
|
- String ph = NumberUtils.getNumFloat(6.6, 8.4);//ph
|
|
|
- String cod = NumberUtils.getNum(0, 380, 0);//cod
|
|
|
- String nh3n = NumberUtils.getNum(0, 50, 1);//nh3n
|
|
|
- String tp = NumberUtils.getNumFloat(0.0, 10.0);//tp
|
|
|
- String tn = NumberUtils.getNum(0, 150, 1);//tn
|
|
|
- String flow = NumberUtils.getNum(0, 100, 1);//flow
|
|
|
-
|
|
|
- protData.setPh(ph);
|
|
|
- protData.setFlow(flow);
|
|
|
- protData.setTp(tp);
|
|
|
- protData.setTn(tn);
|
|
|
- protData.setCod(cod);
|
|
|
- protData.setNh3n(nh3n);
|
|
|
-
|
|
|
- protDataMapper.insert(protData);
|
|
|
-
|
|
|
-
|
|
|
queryWrapper.eq("farm_id", 21).eq("prot_type", 3);
|
|
|
ProtThreshold protThreshold = protThresholdMapper.selectOne(queryWrapper);//进污口
|
|
|
- if (Double.parseDouble(ph) > Double.parseDouble(protThreshold.getPh2()) || Double.parseDouble(ph) < Double.parseDouble(protThreshold.getOther3())) {
|
|
|
+ if (Double.parseDouble(ph) > Double.parseDouble(protThreshold.getPh2())) {
|
|
|
ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
protWarningInfo.setWarningContent("排污口ph值为" + ph + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(1);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
|
protWarningInfo.setBuildLocation("排污口");
|
|
|
warningInfoMapper.insert(protWarningInfo);
|
|
|
}
|
|
|
- if (Double.parseDouble(ph) > Double.parseDouble(protThreshold.getPh1()) || Double.parseDouble(ph) < Double.parseDouble(protThreshold.getOther2())) {
|
|
|
+ if (Double.parseDouble(ph) > Double.parseDouble(protThreshold.getPh1())) {
|
|
|
ProtWarningInfo protWarningInfo = new ProtWarningInfo();
|
|
|
protWarningInfo.setWarningContent("排污口ph值为" + ph + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(1);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -401,6 +385,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口cod值为" + cod + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(0);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -412,6 +397,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口cod值为" + cod + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(0);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -423,6 +409,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口NH3N值为" + nh3n + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(2);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -434,6 +421,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口NH3N值为" + nh3n + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(2);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -445,6 +433,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口TP值为" + tp + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(3);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -456,6 +445,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口TP值为" + tp + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(3);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -467,6 +457,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口TN值为" + tn + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(4);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -478,6 +469,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口TN值为" + tn + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(4);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -489,6 +481,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口累计流量值为" + flow + "达到红色预警");
|
|
|
protWarningInfo.setWarningType(5);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|
|
@@ -500,6 +493,7 @@ public class ProtTimer {
|
|
|
protWarningInfo.setWarningContent("排污口累计流量值为" + flow + "达到橙色预警");
|
|
|
protWarningInfo.setWarningType(5);
|
|
|
protWarningInfo.setFarmId(protThreshold.getFarmId());
|
|
|
+ protWarningInfo.setWarningType(i);
|
|
|
protWarningInfo.setDate(new Date());
|
|
|
protWarningInfo.setUserIds(protThreshold.getUserIds());
|
|
|
protWarningInfo.setDeviceId(i);
|