|
@@ -1,8 +1,10 @@
|
|
|
package com.yunfeiyun.agmp.iots.warn.service;
|
|
package com.yunfeiyun.agmp.iots.warn.service;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
|
|
+import com.yunfeiyun.agmp.iot.common.constant.IotEnumOnlineStatus;
|
|
|
import com.yunfeiyun.agmp.iot.common.constant.device.ElementFormatUtil;
|
|
import com.yunfeiyun.agmp.iot.common.constant.device.ElementFormatUtil;
|
|
|
import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictEnum;
|
|
import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictEnum;
|
|
|
import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceTypeLv1Enum;
|
|
import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceTypeLv1Enum;
|
|
@@ -47,25 +49,67 @@ public class WarnService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IIotDevicefactorService iotDevicefactorService;
|
|
private IIotDevicefactorService iotDevicefactorService;
|
|
|
|
|
|
|
|
- private Map<String, IotDevicefactor> getDevicefactorMap(String devBid){
|
|
|
|
|
- IotDevicefactor param = new IotDevicefactor();
|
|
|
|
|
- param.setDevBid(devBid);
|
|
|
|
|
- List<IotDevicefactor> factorList = iotDevicefactorService.selectIotDevicefactorList(param);
|
|
|
|
|
- Map<String, IotDevicefactor> factorMap = new HashMap<>();
|
|
|
|
|
- for(IotDevicefactor factor : factorList){
|
|
|
|
|
- String dfCode = factor.getDfCode();
|
|
|
|
|
- String dfAddress = factor.getDfAddress();
|
|
|
|
|
- String key = dfAddress + dfCode;
|
|
|
|
|
- factorMap.put(key, factor);
|
|
|
|
|
- }
|
|
|
|
|
- return factorMap;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 统一处理上报数据
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param data 上报的数据对象
|
|
|
|
|
+ * param ext 上报的原始数据
|
|
|
|
|
+ */
|
|
|
|
|
+ public void processWarningOfflineData(IotDevice iotDevice, JSONObject data) {
|
|
|
|
|
+ //转异步处理
|
|
|
|
|
+ processWarningReportDataSyn(iotDevice, data);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理离线数据:针对主动上报的的离线消息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param iotDevice
|
|
|
|
|
+ * @param data
|
|
|
|
|
+ */
|
|
|
|
|
+ public void processWarningOfflineDataSyn(IotDevice iotDevice, JSONObject data) {
|
|
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
|
|
+ // 获取该设备有哪些告警配置
|
|
|
|
|
+ IotWarnconfig warnConfigInfo = iotWarnBussinessService.selectIotWarnOfflineConfigInfo(iotDevice.getTid());
|
|
|
|
|
+ //存在离线配置,且开启
|
|
|
|
|
+ if (warnConfigInfo != null && "0".equals(warnConfigInfo.getWcStatus())) {
|
|
|
|
|
+ //离线
|
|
|
|
|
+ if (IotEnumOnlineStatus.OFFLINE.getStatus().equals(iotDevice.getDevStatus())) {
|
|
|
|
|
+ WarnResult warnResult = new WarnResult();
|
|
|
|
|
+ warnResult.setMessageId(warnResult.getUUId());
|
|
|
|
|
+ warnResult.setDevId(iotDevice.getDevBid());
|
|
|
|
|
+ warnResult.setTid(iotDevice.getTid());
|
|
|
|
|
+ warnResult.setConfigId(warnConfigInfo.getWcBid());
|
|
|
|
|
+ warnResult.setReportData(data.toJSONString());
|
|
|
|
|
+ warnResult.setTargetReCount(warnConfigInfo.getWcRepeatnum());
|
|
|
|
|
+ warnResult.setDevtypeBid(iotDevice.getDevtypeBid());
|
|
|
|
|
+ warnResult.setConfig(warnConfigInfo);
|
|
|
|
|
+ warnResult.setOffline(true);
|
|
|
|
|
+ warnResult.setTriggered(true);
|
|
|
|
|
+ warnResult.setMessage(WarnMessageBuilderUtil.buildWarningOfflineMessage(iotDevice.getDevtypeBid(), iotDevice.getDevCode(), iotDevice.getDevName()));
|
|
|
|
|
+ handleWarnRecord(warnResult);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.error("[设备告警] tid{},没有离线告警配置或者已经关闭:{}", iotDevice.getTid(), warnConfigInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }, threadPoolTaskExecutor);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理离线数据:针对定时检查的离线
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param iotDevice
|
|
|
|
|
+ */
|
|
|
|
|
+ public void processWarningOfflineDataSyn(IotDevice iotDevice) {
|
|
|
|
|
+ processWarningOfflineDataSyn(iotDevice, JSONObject.from(iotDevice));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 统一处理上报数据
|
|
* 统一处理上报数据
|
|
|
*
|
|
*
|
|
|
- * @param data 上报的数据对象
|
|
|
|
|
- * param ext 上报的原始数据
|
|
|
|
|
|
|
+ * @param data 上报的数据对象
|
|
|
|
|
+ * param ext 上报的原始数据
|
|
|
*/
|
|
*/
|
|
|
public void processWarningReportData(IotDevice iotDevice, JSONObject data) {
|
|
public void processWarningReportData(IotDevice iotDevice, JSONObject data) {
|
|
|
//转异步处理
|
|
//转异步处理
|
|
@@ -76,12 +120,12 @@ public class WarnService {
|
|
|
/**
|
|
/**
|
|
|
* 统一处理上报数据:异步处理
|
|
* 统一处理上报数据:异步处理
|
|
|
*
|
|
*
|
|
|
- * @param data 上报的数据对象
|
|
|
|
|
|
|
+ * @param data 上报的数据对象
|
|
|
*/
|
|
*/
|
|
|
private void processWarningReportDataSyn(IotDevice iotDevice, JSONObject data) {
|
|
private void processWarningReportDataSyn(IotDevice iotDevice, JSONObject data) {
|
|
|
String devBid = iotDevice.getDevBid();
|
|
String devBid = iotDevice.getDevBid();
|
|
|
String devtypeBid = iotDevice.getDevtypeBid();
|
|
String devtypeBid = iotDevice.getDevtypeBid();
|
|
|
- String devClass = IotDeviceDictEnum.getLv1CodeByCode(devtypeBid);
|
|
|
|
|
|
|
+ String devClass = IotDeviceDictEnum.getLv1CodeByCode(devtypeBid);
|
|
|
IotDeviceTypeLv1Enum iotDeviceTypeLv1Enum = IotDeviceTypeLv1Enum.findEnumByCode(devClass);
|
|
IotDeviceTypeLv1Enum iotDeviceTypeLv1Enum = IotDeviceTypeLv1Enum.findEnumByCode(devClass);
|
|
|
if (iotDeviceTypeLv1Enum == null) {
|
|
if (iotDeviceTypeLv1Enum == null) {
|
|
|
log.error("[设备告警] 设备大类不存在,devBid:{}, devtypeBid:{}", devBid, devtypeBid);
|
|
log.error("[设备告警] 设备大类不存在,devBid:{}, devtypeBid:{}", devBid, devtypeBid);
|
|
@@ -103,7 +147,7 @@ public class WarnService {
|
|
|
Map<String, IotDevicefactor> factorMap = getDevicefactorMap(devBid);
|
|
Map<String, IotDevicefactor> factorMap = getDevicefactorMap(devBid);
|
|
|
|
|
|
|
|
//配置一个个检查
|
|
//配置一个个检查
|
|
|
- for(Map.Entry<String, List<WarnConfigInfo>> entry : configMap.entrySet()) {
|
|
|
|
|
|
|
+ for (Map.Entry<String, List<WarnConfigInfo>> entry : configMap.entrySet()) {
|
|
|
List<WarnConfigInfo> configList = entry.getValue();
|
|
List<WarnConfigInfo> configList = entry.getValue();
|
|
|
WarnResult warnResult = null;
|
|
WarnResult warnResult = null;
|
|
|
|
|
|
|
@@ -114,7 +158,7 @@ public class WarnService {
|
|
|
warnInfoDto.setFactorMap(factorMap);
|
|
warnInfoDto.setFactorMap(factorMap);
|
|
|
warnInfoDto.setIotDeviceTypeLv1Enum(iotDeviceTypeLv1Enum);
|
|
warnInfoDto.setIotDeviceTypeLv1Enum(iotDeviceTypeLv1Enum);
|
|
|
|
|
|
|
|
- try{
|
|
|
|
|
|
|
+ try {
|
|
|
switch (iotDeviceTypeLv1Enum) {
|
|
switch (iotDeviceTypeLv1Enum) {
|
|
|
case QXZ: {
|
|
case QXZ: {
|
|
|
warnResult = comparableQxzReportData(warnInfoDto);
|
|
warnResult = comparableQxzReportData(warnInfoDto);
|
|
@@ -135,7 +179,7 @@ public class WarnService {
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
log.error("[设备告警] 设备上报数据 异常,devBid:{}, config:{}, data:{}", devBid, configList, data, e);
|
|
log.error("[设备告警] 设备上报数据 异常,devBid:{}, config:{}, data:{}", devBid, configList, data, e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -156,6 +200,20 @@ public class WarnService {
|
|
|
reCountService.handlerMessage(warnResult);
|
|
reCountService.handlerMessage(warnResult);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private Map<String, IotDevicefactor> getDevicefactorMap(String devBid) {
|
|
|
|
|
+ IotDevicefactor param = new IotDevicefactor();
|
|
|
|
|
+ param.setDevBid(devBid);
|
|
|
|
|
+ List<IotDevicefactor> factorList = iotDevicefactorService.selectIotDevicefactorList(param);
|
|
|
|
|
+ Map<String, IotDevicefactor> factorMap = new HashMap<>();
|
|
|
|
|
+ for (IotDevicefactor factor : factorList) {
|
|
|
|
|
+ String dfCode = factor.getDfCode();
|
|
|
|
|
+ String dfAddress = factor.getDfAddress();
|
|
|
|
|
+ String key = dfAddress + dfCode;
|
|
|
|
|
+ factorMap.put(key, factor);
|
|
|
|
|
+ }
|
|
|
|
|
+ return factorMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据设备id获取策略,可能有多个
|
|
* 根据设备id获取策略,可能有多个
|
|
|
*
|
|
*
|
|
@@ -171,7 +229,7 @@ public class WarnService {
|
|
|
String devCode = iotDevice.getDevCode();
|
|
String devCode = iotDevice.getDevCode();
|
|
|
BigDecimal errorValue = new BigDecimal("-99");
|
|
BigDecimal errorValue = new BigDecimal("-99");
|
|
|
Map<String, String> currentValueMap = new HashMap<>();
|
|
Map<String, String> currentValueMap = new HashMap<>();
|
|
|
- for(Object obj : jsonArray) {
|
|
|
|
|
|
|
+ for (Object obj : jsonArray) {
|
|
|
JSONObject ob;
|
|
JSONObject ob;
|
|
|
try {
|
|
try {
|
|
|
ob = JSONObject.from(obj);
|
|
ob = JSONObject.from(obj);
|
|
@@ -201,16 +259,16 @@ public class WarnService {
|
|
|
return currentValueMap;
|
|
return currentValueMap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private String getDisplayName(String key, Map<String, IotDevicefactor> factorMap){
|
|
|
|
|
|
|
+ private String getDisplayName(String key, Map<String, IotDevicefactor> factorMap) {
|
|
|
String wiName = "";
|
|
String wiName = "";
|
|
|
- if(factorMap.containsKey(key)){
|
|
|
|
|
|
|
+ if (factorMap.containsKey(key)) {
|
|
|
IotDevicefactor iotDevicefactor = factorMap.get(key);
|
|
IotDevicefactor iotDevicefactor = factorMap.get(key);
|
|
|
// 如果禁用,直接返回null,不进行预警判断
|
|
// 如果禁用,直接返回null,不进行预警判断
|
|
|
- if(Objects.equals(iotDevicefactor.getDfDisable(), "1")){
|
|
|
|
|
|
|
+ if (Objects.equals(iotDevicefactor.getDfDisable(), "1")) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
String displayname = iotDevicefactor.getDfDisplayname();
|
|
String displayname = iotDevicefactor.getDfDisplayname();
|
|
|
- if(StringUtils.isNotEmpty(displayname)){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(displayname)) {
|
|
|
wiName = displayname;
|
|
wiName = displayname;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -235,7 +293,7 @@ public class WarnService {
|
|
|
|
|
|
|
|
// 如果配置禁用,或者要素禁用,直接返回null,不进行预警判断
|
|
// 如果配置禁用,或者要素禁用,直接返回null,不进行预警判断
|
|
|
boolean status = "0".equals(wcStatus) && "0".equals(wiStatus);
|
|
boolean status = "0".equals(wcStatus) && "0".equals(wiStatus);
|
|
|
- if(!status){
|
|
|
|
|
|
|
+ if (!status) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -245,25 +303,25 @@ public class WarnService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 如果没有配置预警条件和值,直接返回null,不进行预警判断
|
|
// 如果没有配置预警条件和值,直接返回null,不进行预警判断
|
|
|
- if(StringUtils.isEmpty(expression) || StringUtils.isEmpty(targetValue)){
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(expression) || StringUtils.isEmpty(targetValue)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String wiName = config.getWiName();
|
|
String wiName = config.getWiName();
|
|
|
// 如果禁用,直接返回null,不进行预警判断
|
|
// 如果禁用,直接返回null,不进行预警判断
|
|
|
String displayname = getDisplayName(key, factorMap);
|
|
String displayname = getDisplayName(key, factorMap);
|
|
|
- if(displayname == null){
|
|
|
|
|
|
|
+ if (displayname == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(StringUtils.isNotEmpty(displayname)){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(displayname)) {
|
|
|
wiName = displayname;
|
|
wiName = displayname;
|
|
|
}
|
|
}
|
|
|
String wiUnit = config.getWiUnit();
|
|
String wiUnit = config.getWiUnit();
|
|
|
String currentValue = currentValueMap.get(key);
|
|
String currentValue = currentValueMap.get(key);
|
|
|
|
|
|
|
|
EnumWarnRuleOp warnRuleOp = EnumWarnRuleOp.findEnumByCode(expression);
|
|
EnumWarnRuleOp warnRuleOp = EnumWarnRuleOp.findEnumByCode(expression);
|
|
|
- if(warnRuleOp == null){
|
|
|
|
|
|
|
+ if (warnRuleOp == null) {
|
|
|
log.error("[设备告警] 表达式不正确,devCode:{}, wiAddress:{}, config:{}", devCode, wiAddress, config);
|
|
log.error("[设备告警] 表达式不正确,devCode:{}, wiAddress:{}, config:{}", devCode, wiAddress, config);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -285,11 +343,9 @@ public class WarnService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 【气象站】比较该设备上报的任一要素否达到预警条件
|
|
* 【气象站】比较该设备上报的任一要素否达到预警条件
|
|
|
|
|
+ *
|
|
|
* @param warnResult
|
|
* @param warnResult
|
|
|
- * @param configList
|
|
|
|
|
- * @param factorMap
|
|
|
|
|
- * @param currentValueMap
|
|
|
|
|
- * @param devCode
|
|
|
|
|
|
|
+ * @param warnInfoDto
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public WarnResult comparableQxzSingleIndicator(WarnResult warnResult, WarnInfoDto warnInfoDto) {
|
|
public WarnResult comparableQxzSingleIndicator(WarnResult warnResult, WarnInfoDto warnInfoDto) {
|
|
@@ -298,14 +354,14 @@ public class WarnService {
|
|
|
for (WarnConfigInfo config : configList) {
|
|
for (WarnConfigInfo config : configList) {
|
|
|
warnStatusDto = getQxzWarnStatusDto(config, warnInfoDto);
|
|
warnStatusDto = getQxzWarnStatusDto(config, warnInfoDto);
|
|
|
// 如果没有预警配置,直接返回null,不进行预警判断
|
|
// 如果没有预警配置,直接返回null,不进行预警判断
|
|
|
- if(warnStatusDto == null){
|
|
|
|
|
|
|
+ if (warnStatusDto == null) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- if(warnStatusDto.isWarn()){
|
|
|
|
|
|
|
+ if (warnStatusDto.isWarn()) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(warnStatusDto != null && warnStatusDto.isWarn()){
|
|
|
|
|
|
|
+ if (warnStatusDto != null && warnStatusDto.isWarn()) {
|
|
|
String message = WarnMessageBuilderUtil.buildQxzWarningMessage(
|
|
String message = WarnMessageBuilderUtil.buildQxzWarningMessage(
|
|
|
warnStatusDto.getDevType(),
|
|
warnStatusDto.getDevType(),
|
|
|
warnStatusDto.getDevCode(),
|
|
warnStatusDto.getDevCode(),
|
|
@@ -325,9 +381,8 @@ public class WarnService {
|
|
|
/**
|
|
/**
|
|
|
* 处理多个指标是否同时满足预警条件。
|
|
* 处理多个指标是否同时满足预警条件。
|
|
|
*
|
|
*
|
|
|
- * @param devId 设备ID
|
|
|
|
|
- * @param config 告警规则
|
|
|
|
|
- * @param jsonObject 上报的数据
|
|
|
|
|
|
|
+ * @param warnResult
|
|
|
|
|
+ * @param warnInfoDto
|
|
|
* @return WarnResult 包含是否触发告警的信息
|
|
* @return WarnResult 包含是否触发告警的信息
|
|
|
*/
|
|
*/
|
|
|
public WarnResult comparableQxzMultipleIndicators(WarnResult warnResult, WarnInfoDto warnInfoDto) {
|
|
public WarnResult comparableQxzMultipleIndicators(WarnResult warnResult, WarnInfoDto warnInfoDto) {
|
|
@@ -337,24 +392,24 @@ public class WarnService {
|
|
|
for (WarnConfigInfo config : configList) {
|
|
for (WarnConfigInfo config : configList) {
|
|
|
warnStatusDto = getQxzWarnStatusDto(config, warnInfoDto);
|
|
warnStatusDto = getQxzWarnStatusDto(config, warnInfoDto);
|
|
|
// 如果没有预警配置,直接返回null,不进行预警判断
|
|
// 如果没有预警配置,直接返回null,不进行预警判断
|
|
|
- if(warnStatusDto == null){
|
|
|
|
|
|
|
+ if (warnStatusDto == null) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- if(!warnStatusDto.isWarn()){
|
|
|
|
|
|
|
+ if (!warnStatusDto.isWarn()) {
|
|
|
return warnResult;
|
|
return warnResult;
|
|
|
}
|
|
}
|
|
|
warnStatusDtos.add(warnStatusDto);
|
|
warnStatusDtos.add(warnStatusDto);
|
|
|
}
|
|
}
|
|
|
- if(warnStatusDtos.isEmpty()){
|
|
|
|
|
|
|
+ if (warnStatusDtos.isEmpty()) {
|
|
|
return warnResult;
|
|
return warnResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
StringBuilder messageBuilder = new StringBuilder();
|
|
StringBuilder messageBuilder = new StringBuilder();
|
|
|
- for(int i = 0; i < warnStatusDtos.size(); i++){
|
|
|
|
|
|
|
+ for (int i = 0; i < warnStatusDtos.size(); i++) {
|
|
|
warnStatusDto = warnStatusDtos.get(i);
|
|
warnStatusDto = warnStatusDtos.get(i);
|
|
|
String devType = null;
|
|
String devType = null;
|
|
|
String dCode = null;
|
|
String dCode = null;
|
|
|
- if(i == 0){
|
|
|
|
|
|
|
+ if (i == 0) {
|
|
|
devType = warnStatusDto.getDevType();
|
|
devType = warnStatusDto.getDevType();
|
|
|
dCode = warnStatusDto.getDevCode();
|
|
dCode = warnStatusDto.getDevCode();
|
|
|
}
|
|
}
|
|
@@ -378,9 +433,8 @@ public class WarnService {
|
|
|
/**
|
|
/**
|
|
|
* 【气象站】比较该设备上报的要素和配置是否达到预警条件
|
|
* 【气象站】比较该设备上报的要素和配置是否达到预警条件
|
|
|
*
|
|
*
|
|
|
- * @param devBid 设备id
|
|
|
|
|
- * @param config 对应的配置
|
|
|
|
|
- * @param jsonObject 上报的数据
|
|
|
|
|
|
|
+ * @param warnInfoDto
|
|
|
|
|
+ * @return
|
|
|
*/
|
|
*/
|
|
|
private WarnResult comparableQxzReportData(WarnInfoDto warnInfoDto) {
|
|
private WarnResult comparableQxzReportData(WarnInfoDto warnInfoDto) {
|
|
|
IotDevice iotDevice = warnInfoDto.getIotDevice();
|
|
IotDevice iotDevice = warnInfoDto.getIotDevice();
|
|
@@ -409,7 +463,7 @@ public class WarnService {
|
|
|
warnResult.setConfig(iotWarnconfig);
|
|
warnResult.setConfig(iotWarnconfig);
|
|
|
warnResult.setTriggered(false);
|
|
warnResult.setTriggered(false);
|
|
|
|
|
|
|
|
- if("0".equals(wcCondition)){
|
|
|
|
|
|
|
+ if ("0".equals(wcCondition)) {
|
|
|
warnResult = comparableQxzSingleIndicator(warnResult, warnInfoDto);
|
|
warnResult = comparableQxzSingleIndicator(warnResult, warnInfoDto);
|
|
|
} else {
|
|
} else {
|
|
|
warnResult = comparableQxzMultipleIndicators(warnResult, warnInfoDto);
|
|
warnResult = comparableQxzMultipleIndicators(warnResult, warnInfoDto);
|
|
@@ -420,7 +474,6 @@ public class WarnService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 【墒情站】比较该设备上报的要素和配置是否达到预警条件
|
|
* 【墒情站】比较该设备上报的要素和配置是否达到预警条件
|
|
|
- *
|
|
|
|
|
*/
|
|
*/
|
|
|
WarnResult comparableSqzReportData(WarnInfoDto warnInfoDto) {
|
|
WarnResult comparableSqzReportData(WarnInfoDto warnInfoDto) {
|
|
|
return comparableQxzReportData(warnInfoDto);
|
|
return comparableQxzReportData(warnInfoDto);
|
|
@@ -429,7 +482,6 @@ public class WarnService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 【管式墒情】比较该设备上报的要素和配置是否达到预警条件
|
|
* 【管式墒情】比较该设备上报的要素和配置是否达到预警条件
|
|
|
- *
|
|
|
|
|
*/
|
|
*/
|
|
|
WarnResult comparableGssqReportData(WarnInfoDto warnInfoDto) {
|
|
WarnResult comparableGssqReportData(WarnInfoDto warnInfoDto) {
|
|
|
return comparableQxzReportData(warnInfoDto);
|
|
return comparableQxzReportData(warnInfoDto);
|