|
@@ -37,7 +37,7 @@ public class GasTimer {
|
|
|
|
|
|
|
|
|
|
|
|
- QueryWrapper<GasThreshold> queryWrapper = new QueryWrapper<>();
|
|
|
+
|
|
|
for (int i = 1; i < 5; i++) {
|
|
|
|
|
|
String nh3n = NumberUtils.getNum(10, 20, 1);//NH3N
|
|
@@ -66,8 +66,9 @@ public class GasTimer {
|
|
|
gasData.setCreateTime(new Date());
|
|
|
gasDataMapper.insert(gasData);
|
|
|
|
|
|
+ QueryWrapper<GasThreshold> queryWrapper = new QueryWrapper<>();
|
|
|
GasWarningInfo warningInfo = new GasWarningInfo();
|
|
|
- if ("1".equals(i)) {
|
|
|
+ if (i==1) {
|
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 1);
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
@@ -113,7 +114,7 @@ public class GasTimer {
|
|
|
warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
|
|
|
- } else if ("2".equals(i)) {
|
|
|
+ } else if (i==2) {
|
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 2);
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
@@ -159,7 +160,7 @@ public class GasTimer {
|
|
|
warningInfo.setFarmId(gasThreshold.getFarmId());
|
|
|
warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
- } else if ("3".equals(i)) {
|
|
|
+ } else if (i==3) {
|
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 3);
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|
|
@@ -205,7 +206,7 @@ public class GasTimer {
|
|
|
warningInfo.setFarmId(gasThreshold.getFarmId());
|
|
|
warningInfo.setUserIds(gasThreshold.getUserIds());
|
|
|
warningInfoMapper.insert(warningInfo);
|
|
|
- } else if ("4".equals(i)) {
|
|
|
+ } else if (i==4) {
|
|
|
queryWrapper.eq("farm_id", 21).eq("gas_type", 4);
|
|
|
GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
|
|
|
if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
|