|
@@ -1,6 +1,5 @@
|
|
|
package com.sckw.slope.detection.service;
|
|
package com.sckw.slope.detection.service;
|
|
|
|
|
|
|
|
-import cn.hutool.core.date.DateTime;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -46,7 +45,6 @@ import java.math.RoundingMode;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -1443,6 +1441,7 @@ public class ProjectService {
|
|
|
private Map<String, String> getAlarmStatus(String deviceId) {
|
|
private Map<String, String> getAlarmStatus(String deviceId) {
|
|
|
String alarmStatus = "0";
|
|
String alarmStatus = "0";
|
|
|
String thresholdId = null;
|
|
String thresholdId = null;
|
|
|
|
|
+ Map<String, String> returnMap = new HashMap<>();
|
|
|
List<KwsThreshold> kwsThresholds = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
|
|
List<KwsThreshold> kwsThresholds = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
|
|
|
.eq(KwsThreshold::getDeviceId, Long.parseLong(deviceId))
|
|
.eq(KwsThreshold::getDeviceId, Long.parseLong(deviceId))
|
|
|
.eq(KwsThreshold::getDelFlag, NumberConstant.ZERO)
|
|
.eq(KwsThreshold::getDelFlag, NumberConstant.ZERO)
|
|
@@ -1453,8 +1452,12 @@ public class ProjectService {
|
|
|
.eq(KwsAlarmDetail::getDelFlag, NumberConstant.ZERO)
|
|
.eq(KwsAlarmDetail::getDelFlag, NumberConstant.ZERO)
|
|
|
.eq(KwsAlarmDetail::getStatus, NumberConstant.ZERO)
|
|
.eq(KwsAlarmDetail::getStatus, NumberConstant.ZERO)
|
|
|
);
|
|
);
|
|
|
- if (!CollectionUtils.isEmpty(deviceDetails)) {
|
|
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(deviceDetails) && deviceDetails.size() > 0) {
|
|
|
alarmStatus = "1";
|
|
alarmStatus = "1";
|
|
|
|
|
+ thresholdId = deviceDetails.get(0).getAlarmId().toString();
|
|
|
|
|
+ returnMap.put("alarmStatus", alarmStatus);
|
|
|
|
|
+ returnMap.put("thresholdId", thresholdId);
|
|
|
|
|
+ return returnMap;
|
|
|
}
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(kwsThresholds)) {
|
|
if (!CollectionUtils.isEmpty(kwsThresholds)) {
|
|
|
List<Long> longList = kwsThresholds.stream().map(KwsThreshold::getId).distinct().collect(Collectors.toList());
|
|
List<Long> longList = kwsThresholds.stream().map(KwsThreshold::getId).distinct().collect(Collectors.toList());
|
|
@@ -1489,7 +1492,7 @@ public class ProjectService {
|
|
|
List<KwsAlarmDetail> alarmDetails = alarmDetailMapper.selectList(new LambdaQueryWrapper<KwsAlarmDetail>()
|
|
List<KwsAlarmDetail> alarmDetails = alarmDetailMapper.selectList(new LambdaQueryWrapper<KwsAlarmDetail>()
|
|
|
.eq(KwsAlarmDetail::getPid, threshold.getId()));
|
|
.eq(KwsAlarmDetail::getPid, threshold.getId()));
|
|
|
if (!CollectionUtils.isEmpty(alarmDetails) && alarmDetails.size() > 0) {
|
|
if (!CollectionUtils.isEmpty(alarmDetails) && alarmDetails.size() > 0) {
|
|
|
- thresholdId = alarmDetails.get(0).getPid().toString();
|
|
|
|
|
|
|
+ thresholdId = alarmDetails.get(0).getAlarmId().toString();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1499,7 +1502,6 @@ public class ProjectService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- Map<String, String> returnMap = new HashMap<>();
|
|
|
|
|
returnMap.put("alarmStatus", alarmStatus);
|
|
returnMap.put("alarmStatus", alarmStatus);
|
|
|
returnMap.put("thresholdId", thresholdId);
|
|
returnMap.put("thresholdId", thresholdId);
|
|
|
return returnMap;
|
|
return returnMap;
|