|
@@ -31,7 +31,7 @@ public class GasTimer {
|
|
|
private void getShenChan() throws Exception {
|
|
|
|
|
|
String type = NumberUtils.getNum(1, 5, 0);//loc_type
|
|
|
- for (int i = 1; i < 5; i++) {
|
|
|
+ for (int i = 1; i < 9; i++) {
|
|
|
|
|
|
String nh3n = NumberUtils.getNumFloat(0.0, 10.5);//NH3N
|
|
|
String jlm = NumberUtils.getNumFloat(0.0, 10.5);//jlm
|
|
@@ -44,7 +44,6 @@ public class GasTimer {
|
|
|
|
|
|
|
|
|
GasData gasData = new GasData();
|
|
|
- gasData.setLoctionType(i);
|
|
|
gasData.setNh3N(nh3n);
|
|
|
gasData.setJlm(jlm);
|
|
|
gasData.setElht(elht);
|
|
@@ -53,17 +52,26 @@ public class GasTimer {
|
|
|
gasData.setByx(byx);
|
|
|
gasData.setCh3sh(ch3);
|
|
|
gasData.setSja(sja);
|
|
|
- gasData.setFarmId(21);
|
|
|
+ if (i > 4) {
|
|
|
+ gasData.setLoctionType(i-4);
|
|
|
+ gasData.setFarmId(24);
|
|
|
+ } else {
|
|
|
+ gasData.setLoctionType(i);
|
|
|
+ gasData.setFarmId(21);
|
|
|
+ }
|
|
|
gasData.setCreateTime(new Date());
|
|
|
|
|
|
|
|
|
QueryWrapper<GasThreshold> queryWrapper = new QueryWrapper<>();
|
|
|
GasWarningInfo warningInfo = new GasWarningInfo();
|
|
|
- if (i==1) {
|
|
|
+ if (i==1||i==5) {
|
|
|
String cq = NumberUtils.getNumFloat(0.0, 1000.5);//cq
|
|
|
gasData.setCq(cq);
|
|
|
-
|
|
|
- queryWrapper.eq("farm_id", 21).eq("gas_type", 1);
|
|
|
+ if (i == 1) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("gas_type", 1);
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq("farm_id", 24).eq("gas_type", 1);
|
|
|
+ }
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
|
warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
|
|
@@ -147,11 +155,15 @@ public class GasTimer {
|
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
}
|
|
|
|
|
|
- } else if (i==2) {
|
|
|
+ } else if (i==2||i==6) {
|
|
|
String cq = NumberUtils.getNumFloat(0.0, 5000.5);//cq
|
|
|
gasData.setCq(cq);
|
|
|
|
|
|
- queryWrapper.eq("farm_id", 21).eq("gas_type", 2);
|
|
|
+ if (i == 2) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("gas_type", 2);
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq("farm_id", 24).eq("gas_type", 2);
|
|
|
+ }
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
|
warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
|
|
@@ -236,11 +248,16 @@ public class GasTimer {
|
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
}
|
|
|
|
|
|
- } else if (i==3) {
|
|
|
+ } else if (i==3||i==7) {
|
|
|
String cq = NumberUtils.getNumFloat(0.0, 1000.5);//cq
|
|
|
gasData.setCq(cq);
|
|
|
|
|
|
- queryWrapper.eq("farm_id", 21).eq("gas_type", 3);
|
|
|
+ if (i == 3) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("gas_type", 3);
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq("farm_id", 24).eq("gas_type", 3);
|
|
|
+ }
|
|
|
+
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
|
warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
|
|
@@ -325,11 +342,15 @@ public class GasTimer {
|
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
}
|
|
|
|
|
|
- } else if (i==4) {
|
|
|
+ } else if (i==4||i==8) {
|
|
|
String cq = NumberUtils.getNumFloat(0.0, 10000.5);//cq
|
|
|
gasData.setCq(cq);
|
|
|
|
|
|
- queryWrapper.eq("farm_id", 21).eq("gas_type", 4);
|
|
|
+ if (i == 4) {
|
|
|
+ queryWrapper.eq("farm_id", 21).eq("gas_type", 4);
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq("farm_id", 24).eq("gas_type", 4);
|
|
|
+ }
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
|
warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
|