|
@@ -31,6 +31,7 @@ import com.sckj.warn.entity.TAudio;
|
|
|
import com.sckj.warn.service.impl.TAudioServiceImpl;
|
|
|
import com.sckj.warn.service.impl.TExceptionLogServiceImpl;
|
|
|
import com.sckj.warn.validate.TExceptionLogCreateValidate;
|
|
|
+import com.sckj.warn.vo.TExceptionLogBigScreenVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -132,8 +133,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
|
|
|
//鱼雷罐车
|
|
|
private static final String YLGC_STATUS = "ylgc";
|
|
|
- //泥炮机
|
|
|
- private static final String NPJ_STATUS = "npj";
|
|
|
+ //泥炮堵口状态
|
|
|
+ private static final String NPDK_STATUS = "npj";
|
|
|
//开口机状态
|
|
|
private static final String KKJ_STATUS = "kkj";
|
|
|
//摆动溜咀
|
|
@@ -143,6 +144,9 @@ public class DeviceEventListener extends EventListener { //
|
|
|
//出渣状态
|
|
|
private static final String CHUZ_STATUS = "chuz";
|
|
|
|
|
|
+ //存储出渣温度,3个点的温度明显升高即为正在出渣
|
|
|
+ private LinkedList<Double> lastChuzTemps = new LinkedList<>();
|
|
|
+
|
|
|
// 1.创建表达式解析器
|
|
|
private static final SpelExpressionParser mParser = new SpelExpressionParser();
|
|
|
|
|
@@ -188,6 +192,9 @@ public class DeviceEventListener extends EventListener { //
|
|
|
private Map<String, Object> mRealtimeData = new ConcurrentHashMap<>();
|
|
|
|
|
|
//实时状态
|
|
|
+ //开口机开口状态
|
|
|
+ //泥炮堵口状态
|
|
|
+ //
|
|
|
private Map<String, Object> mRealtimeStatus = new ConcurrentHashMap<>();
|
|
|
|
|
|
private AtomicDouble speed1 = new AtomicDouble(0);
|
|
@@ -274,6 +281,12 @@ public class DeviceEventListener extends EventListener { //
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
+ scheduledTaskManager.addTask("warnList", 0, 60, TimeUnit.SECONDS, () -> {
|
|
|
+ getExceptionList();
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -540,6 +553,11 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2CloseTime(realtimeData);
|
|
|
}
|
|
|
|
|
|
+ private void getExceptionList(){
|
|
|
+ List<TExceptionLogBigScreenVo> list = exceptionLogService.getExceptionLogList();
|
|
|
+ PushData.send2Exception(list);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 1号铁口正在出铁的操作项目(由 0-> 1 表明1号铁口开始出铁)
|
|
|
* 处理出铁开始事件
|
|
@@ -587,6 +605,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2Warn(WarnData.warnClose("铁水流速过快告警", closureAlarmUrl));
|
|
|
taskExecutor.submit(() -> {
|
|
|
exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType("7000").exceptionDesc("铁水流速过快告警").build());
|
|
|
+ //推送预警列表
|
|
|
+ getExceptionList();
|
|
|
});
|
|
|
closureWarnCountMap.put(modelKey1, 0);
|
|
|
return;
|
|
@@ -607,6 +627,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2Warn(WarnData.warnClose("铁水流速过慢告警", closureAlarmUrl));
|
|
|
taskExecutor.submit(() -> {
|
|
|
exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType("8000").exceptionDesc("铁水流速过慢告警").build());
|
|
|
+ //推送预警列表
|
|
|
+ getExceptionList();
|
|
|
});
|
|
|
closureWarnCountMap.put(modelKey2, 0);
|
|
|
return;
|
|
@@ -627,6 +649,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2Warn(WarnData.warnClose("铁水流速过慢告警", closureAlarmUrl));
|
|
|
taskExecutor.submit(() -> {
|
|
|
exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType("8000").exceptionDesc("铁水流速过慢告警").build());
|
|
|
+ //推送预警列表
|
|
|
+ getExceptionList();
|
|
|
});
|
|
|
closureWarnCountMap.put(modelKey3, 0);
|
|
|
}
|
|
@@ -679,6 +703,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2Warn(WarnData.warnTappingTimeout("出铁时间过长告警", tappingTimeoutAlramUrl));
|
|
|
taskExecutor.submit(() -> {
|
|
|
exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType("3000").exceptionDesc("出铁时间过长告警").build());
|
|
|
+ //推送预警列表
|
|
|
+ getExceptionList();
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -828,6 +854,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2Warn(WarnData.warnTapping("急需出铁告警", tappingAlramUrl));
|
|
|
exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType("10000").exceptionDesc("急需出铁告警").build());
|
|
|
tappingWarnCountMap.put(modelKey, 0);
|
|
|
+ //推送预警列表
|
|
|
+ getExceptionList();
|
|
|
}
|
|
|
} else {
|
|
|
tappingWarnCountMap.put(modelKey, 0);
|
|
@@ -982,6 +1010,17 @@ public class DeviceEventListener extends EventListener { //
|
|
|
if (bigDecimalNew.compareTo(ironWeight11Max) > 0) {
|
|
|
ironWeight11Max = bigDecimalNew;
|
|
|
}
|
|
|
+ if (ironLoading1.get() > 0) {
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
+ realtimeData.setValue(1);
|
|
|
+ realtimeData.setDesc("摆动溜嘴的摆动方向");
|
|
|
+ mRealtimeStatus.put(CHONGZ_STATUS, realtimeData);
|
|
|
+ } else {
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
+ realtimeData.setValue(0);
|
|
|
+ realtimeData.setDesc("摆动溜嘴的摆动方向");
|
|
|
+ mRealtimeStatus.put(CHONGZ_STATUS, realtimeData);
|
|
|
+ }
|
|
|
} else {
|
|
|
// 罐车卸载,累计最大值到总量
|
|
|
mTotalWeight = mTotalWeight.add(ironWeight11Max);
|
|
@@ -996,14 +1035,42 @@ public class DeviceEventListener extends EventListener { //
|
|
|
if (bigDecimalNew.compareTo(ironWeight12Max) > 0) {
|
|
|
ironWeight12Max = bigDecimalNew;
|
|
|
}
|
|
|
+ if (ironLoading1.get() > 0) {
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
+ realtimeData.setValue(2);
|
|
|
+ realtimeData.setDesc("摆动溜嘴的摆动方向");
|
|
|
+ mRealtimeStatus.put(CHONGZ_STATUS, realtimeData);
|
|
|
+ } else {
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
+ realtimeData.setValue(0);
|
|
|
+ realtimeData.setDesc("摆动溜嘴的摆动方向");
|
|
|
+ mRealtimeStatus.put(CHONGZ_STATUS, realtimeData);
|
|
|
+ }
|
|
|
} else {
|
|
|
mTotalWeight = mTotalWeight.add(ironWeight12Max);
|
|
|
ironWeight12Max = BigDecimal.ZERO;
|
|
|
ironWeight12Current = BigDecimal.ZERO;
|
|
|
}
|
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_CHUZ_STATUS(opcData.getServerType()))) {
|
|
|
+ double temp = Double.parseDouble(opcData.getData().toString());
|
|
|
+ if (lastChuzTemps.size() >= 3) {
|
|
|
+ lastChuzTemps.removeFirst();
|
|
|
+ }
|
|
|
+ lastChuzTemps.add(temp);
|
|
|
+
|
|
|
+ boolean isRising = false;
|
|
|
+ if (lastChuzTemps.size() == 3) {
|
|
|
+ double t1 = lastChuzTemps.get(0);
|
|
|
+ double t2 = lastChuzTemps.get(1);
|
|
|
+ double t3 = lastChuzTemps.get(2);
|
|
|
+ // 设定“明显升高”阈值,比如每次升高10度
|
|
|
+ if (t2 - t1 > 10 && t3 - t2 > 10) {
|
|
|
+ isRising = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
|
- realtimeData.setValue(opcData.getData());
|
|
|
+ realtimeData.setValue(isRising ? 1 : 0);
|
|
|
realtimeData.setDesc("出渣状态");
|
|
|
mRealtimeStatus.put(CHUZ_STATUS, realtimeData);
|
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_SZB_STATUS(opcData.getServerType()))
|
|
@@ -1011,9 +1078,21 @@ public class DeviceEventListener extends EventListener { //
|
|
|
) {
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
|
Boolean value = mParser.parseExpression("#szxt999 > 0 and #szb999 > 0").getValue(mContext, Boolean.class);
|
|
|
- realtimeData.setValue(Boolean.TRUE.equals(value) ? "1" : "0");
|
|
|
+ realtimeData.setValue(Boolean.TRUE.equals(value) ? 1 : 0);
|
|
|
realtimeData.setDesc("冲渣状态");
|
|
|
mRealtimeStatus.put(CHONGZ_STATUS, realtimeData);
|
|
|
+ }else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_KKJ_STATUS(opcData.getServerType()))) {
|
|
|
+ //开口机状态
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
+ realtimeData.setValue(opcData.getData());
|
|
|
+ realtimeData.setDesc("开口机状态");
|
|
|
+ mRealtimeStatus.put(KKJ_STATUS, realtimeData);
|
|
|
+ }else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_NPXZYY(opcData.getServerType()))) {
|
|
|
+ //泥炮堵口状态
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
+ realtimeData.setValue(opcData.getData());
|
|
|
+ realtimeData.setDesc("泥炮堵口状态");
|
|
|
+ mRealtimeStatus.put(NPDK_STATUS, realtimeData);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1301,6 +1380,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
PushData.send2Warn(WarnData.warnOpen("急需开口告警", openAlarmUrl));
|
|
|
taskExecutor.submit(() -> {
|
|
|
exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType("12000").exceptionDesc("急需开口告警").build());
|
|
|
+ //推送预警列表
|
|
|
+ getExceptionList();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
@@ -1316,19 +1397,6 @@ public class DeviceEventListener extends EventListener { //
|
|
|
mRealtimeStatus.put(YLGC_STATUS, realtimeData);
|
|
|
}
|
|
|
|
|
|
-// if (Objects.equals(child.getIdentifier(), NPJ_STATUS)) {
|
|
|
-// RealtimeData realtimeData = new RealtimeData();
|
|
|
-// realtimeData.setValue(child.getPassResult());
|
|
|
-// realtimeData.setDesc("拔炮状态");
|
|
|
-// mRealtimeStatus.put(NPJ_STATUS, realtimeData);
|
|
|
-// }
|
|
|
-// if (Objects.equals(child.getIdentifier(), BDLZ_STATUS)) {
|
|
|
-// RealtimeData realtimeData = new RealtimeData();
|
|
|
-// realtimeData.setValue(child.getPassResult());
|
|
|
-// realtimeData.setDesc("摆动溜嘴状态");
|
|
|
-// mRealtimeStatus.put(BDLZ_STATUS, realtimeData);
|
|
|
-// }
|
|
|
-
|
|
|
PushData.send2RealtimeStatus(mRealtimeStatus);
|
|
|
}
|
|
|
}
|