|
@@ -3,13 +3,14 @@ package com.sckj.iron.socketio;
|
|
|
import com.corundumstudio.socketio.SocketIOClient;
|
|
|
import com.corundumstudio.socketio.annotation.OnEvent;
|
|
|
import com.google.common.eventbus.Subscribe;
|
|
|
-import com.sckj.iron.util.LocalDateUtils;
|
|
|
+import com.google.common.util.concurrent.AtomicDouble;
|
|
|
import com.sckj.common.config.GlobalConfig;
|
|
|
import com.sckj.common.eventbus.EventListener;
|
|
|
import com.sckj.common.manager.ScheduledTaskManager;
|
|
|
import com.sckj.common.socketio.SocketUtil;
|
|
|
import com.sckj.common.util.RedisUtils;
|
|
|
import com.sckj.iron.constant.L1TagConstants;
|
|
|
+import com.sckj.iron.constant.ParamsConstants;
|
|
|
import com.sckj.iron.constant.ScheduledTimeConstants;
|
|
|
import com.sckj.iron.constant.TaskNameConstants;
|
|
|
import com.sckj.iron.dto.IronStepDTO;
|
|
@@ -20,6 +21,7 @@ import com.sckj.iron.entity.TIronData;
|
|
|
import com.sckj.iron.entity.TIronModel;
|
|
|
import com.sckj.iron.entity.TIronParam;
|
|
|
import com.sckj.iron.service.impl.*;
|
|
|
+import com.sckj.iron.util.LocalDateUtils;
|
|
|
import com.sckj.iron.vo.IronStepVO;
|
|
|
import com.sckj.l2.dto.L2Data;
|
|
|
import com.sckj.l2.dto.L2Material;
|
|
@@ -41,9 +43,6 @@ import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.boot.autoconfigure.web.ServerProperties;
|
|
|
-import org.springframework.boot.context.event.ApplicationStartedEvent;
|
|
|
-import org.springframework.context.ApplicationListener;
|
|
|
import org.springframework.expression.Expression;
|
|
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
|
|
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
|
@@ -52,8 +51,8 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.net.InetAddress;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
@@ -61,7 +60,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Author feng
|
|
@@ -70,7 +68,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Component
|
|
|
@Slf4j
|
|
|
-public class DeviceEventListener extends EventListener implements ApplicationListener<ApplicationStartedEvent> { //
|
|
|
+public class DeviceEventListener extends EventListener { //
|
|
|
|
|
|
//步骤数据
|
|
|
@Resource
|
|
@@ -118,24 +116,23 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
@Resource
|
|
|
TIronModelServiceImpl ironModelService;
|
|
|
|
|
|
-
|
|
|
//炉前申请出铁
|
|
|
- private static final String STEP_LQCT = "lqct";
|
|
|
+ private static final String STEP_LQSQCT = "lqsqct";
|
|
|
|
|
|
//预判和确认出铁
|
|
|
- private static final String STEP_YPQRCT = "lnct";
|
|
|
+ private static final String STEP_YPQRCT = "ypqrct";
|
|
|
|
|
|
//铁量差计算
|
|
|
private static final String STEP_TLC = "tlc";
|
|
|
|
|
|
//铁水成分
|
|
|
- public static final String IRON_ELEMENT = "ironElement";
|
|
|
+ private static final String IRON_ELEMENT = "ironElement";
|
|
|
//铁水温度
|
|
|
- public static final String IRON_TEMP = "ironTemp";
|
|
|
+ private static final String IRON_TEMP = "ironTemp";
|
|
|
//铁水流速
|
|
|
- public static final String IRON_SPEED = "ironSpeed";
|
|
|
+ private static final String IRON_SPEED = "ironSpeed";
|
|
|
//重量
|
|
|
- public static final String IRON_WEIGHT = "ironWeight";
|
|
|
+ private static final String IRON_WEIGHT = "ironWeight";
|
|
|
//出铁状态
|
|
|
private static final String IRON_STATUS = "ironStatus";
|
|
|
//总干量
|
|
@@ -181,14 +178,14 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
private List<IronStepVO> mSteps;
|
|
|
|
|
|
//出铁参数
|
|
|
- private Map<String, TIronParam> mIronParamMap;
|
|
|
+// private Map<String, TIronParam> mIronParamMap;
|
|
|
|
|
|
//出铁参数
|
|
|
- private Map<String, TAudio> mIronAlarmMap;
|
|
|
+// private Map<String, TAudio> mIronAlarmMap;
|
|
|
|
|
|
private String alarmUrlOpen;
|
|
|
|
|
|
- private String alarmUrlClose;
|
|
|
+ private String alarmUrlClosure;
|
|
|
|
|
|
private String alramUrlTapping;
|
|
|
|
|
@@ -201,18 +198,20 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
//实时状态
|
|
|
Map<String, Object> mRealtimeStatus = new ConcurrentHashMap<>();
|
|
|
|
|
|
- //最近任一铁口出铁结束时间
|
|
|
- private Date mIronEndTimeRecently;
|
|
|
-
|
|
|
- private BigDecimal speed1 = BigDecimal.ZERO;
|
|
|
+ private AtomicDouble speed1 = new AtomicDouble(0);
|
|
|
|
|
|
- private BigDecimal speed2 = BigDecimal.ZERO;
|
|
|
+ private AtomicDouble speed2 = new AtomicDouble(0);
|
|
|
|
|
|
//标准流速
|
|
|
- private BigDecimal STANDARD_SPEED;
|
|
|
+ private AtomicDouble STANDARD_SPEED = new AtomicDouble(0);
|
|
|
|
|
|
//压差阈值
|
|
|
- private BigDecimal PRESSURE_DIFF_VALUE;
|
|
|
+ private AtomicDouble PRESSURE_DIFF_VALUE = new AtomicDouble(0);
|
|
|
+
|
|
|
+ //出铁时间
|
|
|
+ private AtomicDouble IRON_TIME = new AtomicDouble(0);
|
|
|
+
|
|
|
+ private String SERVER_URL = "";
|
|
|
|
|
|
//实时出铁总重量/总流量
|
|
|
private BigDecimal mTotalWeight = BigDecimal.ZERO;
|
|
@@ -224,48 +223,6 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
//redis保存最多数量数据
|
|
|
private static final int MAX_REDIS_COUNT = 50;
|
|
|
|
|
|
- @Resource
|
|
|
- private ServerProperties serverProperties;
|
|
|
-
|
|
|
- private String getSchema() {
|
|
|
- if (serverProperties.getSsl() != null && serverProperties.getSsl().isEnabled()) {
|
|
|
- return "https";
|
|
|
- }
|
|
|
- return "http";
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onApplicationEvent(ApplicationStartedEvent event) {
|
|
|
- try {
|
|
|
- // 获取服务器IP地址
|
|
|
- InetAddress localhost = InetAddress.getLocalHost();
|
|
|
-
|
|
|
- String ip = localhost.getHostAddress();
|
|
|
-
|
|
|
- String host = localhost.getHostName();
|
|
|
-
|
|
|
- // 获取服务器端口号
|
|
|
- int port = serverProperties.getPort() != null ? serverProperties.getPort() : 8080;
|
|
|
-
|
|
|
- // 获取 schema
|
|
|
- String schema = getSchema();
|
|
|
- // 获取服务器端口号
|
|
|
-
|
|
|
- System.out.println("Server IP: " + ip);
|
|
|
- System.out.println("Server Port: " + port);
|
|
|
- System.out.println("Server Schema: " + schema);
|
|
|
-
|
|
|
- String uploadUrl = GlobalConfig.publicPrefix;
|
|
|
-
|
|
|
- uploadUrl = schema + "://" + host + ":" + port + "/" + uploadUrl + "/";
|
|
|
-
|
|
|
- log.info("uploadUrl:{}", uploadUrl);
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
//程序启动后隔断时间启动订阅
|
|
@@ -274,9 +231,21 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
// opcdaService.subscribeAvailable();
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_OPCDASUBSCRIBE);
|
|
|
});
|
|
|
- mSteps = ironStepService.getTreeSteps();
|
|
|
- updateParams();
|
|
|
- updateModels();
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ mSteps = ironStepService.getTreeSteps();
|
|
|
+ });
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ getIronParams();
|
|
|
+ });
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ getModels();
|
|
|
+ });
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ TL2Data latestData = tl2DataService.getLatestData();
|
|
|
+ if (latestData != null) {
|
|
|
+ getIronTimeNo(latestData.getIronNo());
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -286,47 +255,86 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
/***
|
|
|
* 更新模型
|
|
|
*/
|
|
|
- private void updateModels() {
|
|
|
+ private void getModels() {
|
|
|
modelHitMud = ironModelService.getById(1);
|
|
|
+ }
|
|
|
|
|
|
+ private void getAudios() {
|
|
|
+ List<TAudio> list = audioService.lambdaQuery().eq(TAudio::getStatus, "1").eq(TAudio::getDelFlag, "1").list();
|
|
|
+ if (ObjectUtils.isNotEmpty(list)) {
|
|
|
+ for (TAudio tAudio : list) {
|
|
|
+ if (Objects.equals(tAudio.getExceptionType(), TaskNameConstants.TASKNAME_OPEN_WARN)) {
|
|
|
+ alarmUrlOpen = SERVER_URL + "/" + GlobalConfig.publicPrefix + File.separator + tAudio.getPath();
|
|
|
+ } else if (Objects.equals(tAudio.getExceptionType(), TaskNameConstants.TASKNAME_CLOSURE_WARN)) {
|
|
|
+ alarmUrlClosure = SERVER_URL + "/" + GlobalConfig.publicPrefix + File.separator + tAudio.getPath();
|
|
|
+ } else if (Objects.equals(tAudio.getExceptionType(), TaskNameConstants.TASKNAME_TAPPING_WARN)) {
|
|
|
+ alramUrlTapping = SERVER_URL + "/" + GlobalConfig.publicPrefix + File.separator + tAudio.getPath();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("alarmUrlOpen: " + alarmUrlOpen);
|
|
|
+ log.info("alarmUrlClose: " + alarmUrlClosure);
|
|
|
+ log.info("alramUrlTapping: " + alramUrlTapping);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
/***
|
|
|
* 更新参数
|
|
|
*/
|
|
|
- private void updateParams() {
|
|
|
- List<TIronParam> mIronParams = ironParamService.lambdaQuery().eq(TIronParam::getStatus, "1").in(TIronParam::getParamType, "iron_judge", "iron_judge2", "scheduledtime").orderByAsc(TIronParam::getSort).list();
|
|
|
+ private void getIronParams() {
|
|
|
+ List<TIronParam> mIronParams = ironParamService.lambdaQuery().eq(TIronParam::getStatus, "1").in(TIronParam::getParamType, "iron_judge", "iron_judge_extra", "scheduledtime", "server_info").orderByAsc(TIronParam::getSort).list();
|
|
|
if (ObjectUtils.isNotEmpty(mIronParams)) {
|
|
|
- mIronParamMap = mIronParams.stream()
|
|
|
- .collect(Collectors.toMap(TIronParam::getParamName, ironParam -> ironParam, (existing, replacement) -> existing));
|
|
|
- STANDARD_SPEED = new BigDecimal(mIronParamMap.get("iron_speed").getParamValue());
|
|
|
- PRESSURE_DIFF_VALUE = new BigDecimal(mIronParamMap.get("pressure_diff_value").getParamValue());
|
|
|
+ for (TIronParam mIronParam : mIronParams) {
|
|
|
+ if (Objects.equals(mIronParam.getParamName(), ParamsConstants.iron_speed)) {
|
|
|
+ STANDARD_SPEED = new AtomicDouble(Double.parseDouble(mIronParam.getParamValue()));
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.pressure_diff_value)) {
|
|
|
+ PRESSURE_DIFF_VALUE = new AtomicDouble(Double.parseDouble(mIronParam.getParamValue()));
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.iron_time)) {
|
|
|
+ IRON_TIME = new AtomicDouble(Double.parseDouble(mIronParam.getParamValue()));
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.server_url)) {
|
|
|
+ SERVER_URL = mIronParam.getParamValue();
|
|
|
+ if (ObjectUtils.isNotEmpty(SERVER_URL)) {
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ getAudios();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.open_warn_delay)) {
|
|
|
+ ScheduledTimeConstants.OPEN_WARN_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.open_warn_period)) {
|
|
|
+ ScheduledTimeConstants.OPEN_WARN_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.closure_warn_delay)) {
|
|
|
+ ScheduledTimeConstants.CLOSURE_WARN_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.closure_warn_period)) {
|
|
|
+ ScheduledTimeConstants.CLOSURE_WARN_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_warn_delay)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_WARN_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_warn_period)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_WARN_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_timeout_warn_delay)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_TIMEOUT_WARN_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_timeout_warn_period)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_TIMEOUT_WARN_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.hit_mud_delay)) {
|
|
|
+ ScheduledTimeConstants.HIT_MUD_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.hit_mud_period)) {
|
|
|
+ ScheduledTimeConstants.HIT_MUD_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_consttime_delay)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_CONSTTIME_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_consttime_period)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_CONSTTIME_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_test_delay)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_TEST_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.tapping_test_period)) {
|
|
|
+ ScheduledTimeConstants.TAPPING_TEST_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.opcdasubscribe_delay)) {
|
|
|
+ ScheduledTimeConstants.OPCDASUBSCRIBE_DELAY = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ } else if (Objects.equals(mIronParam.getParamName(), ParamsConstants.opcdasubscribe_period)) {
|
|
|
+ ScheduledTimeConstants.OPCDASUBSCRIBE_PERIOD = Long.parseLong(mIronParam.getParamValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
log.info("STANDARD_SPEED: {},PRESSURE_DIFF_VALUE:{}", STANDARD_SPEED, PRESSURE_DIFF_VALUE);
|
|
|
-
|
|
|
- ScheduledTimeConstants.CLOSE_WARN_DELAY = Long.parseLong(mIronParamMap.get("close_warn_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.CLOSE_WARN_PERIOD = Long.parseLong(mIronParamMap.get("close_warn_period").getParamValue());
|
|
|
-
|
|
|
- ScheduledTimeConstants.TAPPING_WARN_DELAY = Long.parseLong(mIronParamMap.get("tapping_warn_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.TAPPING_WARN_PERIOD = Long.parseLong(mIronParamMap.get("tapping_warn_period").getParamValue());
|
|
|
-
|
|
|
- ScheduledTimeConstants.TAPPING_TIMEOUT_WARN_DELAY = Long.parseLong(mIronParamMap.get("tapping_timeout_warn_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.TAPPING_TIMEOUT_WARN_PERIOD = Long.parseLong(mIronParamMap.get("tapping_timeout_warn_period").getParamValue());
|
|
|
-
|
|
|
- ScheduledTimeConstants.HIT_MUD_DELAY = Long.parseLong(mIronParamMap.get("hit_mud_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.HIT_MUD_PERIOD = Long.parseLong(mIronParamMap.get("hit_mud_period").getParamValue());
|
|
|
-
|
|
|
- ScheduledTimeConstants.TAPPING_CONSTTIME_DELAY = Long.parseLong(mIronParamMap.get("tapping_consttime_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.TAPPING_CONSTTIME_PERIOD = Long.parseLong(mIronParamMap.get("tapping_consttime_period").getParamValue());
|
|
|
-
|
|
|
- ScheduledTimeConstants.TAPPING_TEST_DELAY = Long.parseLong(mIronParamMap.get("tapping_test_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.TAPPING_TEST_PERIOD = Long.parseLong(mIronParamMap.get("tapping_test_period").getParamValue());
|
|
|
-
|
|
|
- ScheduledTimeConstants.OPCDASUBSCRIBE_DELAY = Long.parseLong(mIronParamMap.get("opcdasubscribe_delay").getParamValue());
|
|
|
- ScheduledTimeConstants.OPCDASUBSCRIBE_PERIOD = Long.parseLong(mIronParamMap.get("opcdasubscribe_period").getParamValue());
|
|
|
-
|
|
|
- log.info(">>>{}", mIronParamMap);
|
|
|
-
|
|
|
+ log.info("IRON_TIME: {},SERVER_URL:{}", IRON_TIME, SERVER_URL);
|
|
|
+ log.info("{}", ScheduledTimeConstants.getPrintString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -363,24 +371,39 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
//只要是新的出铁次数编号,后续都一直用这个编号,直到有新的出铁编号
|
|
|
mIronNo = l2Data.getIronNo();
|
|
|
}
|
|
|
- //记录出铁日期和次数,并返回给前端
|
|
|
- IronTimeNoDTO ironTimeNoDTO = new IronTimeNoDTO();
|
|
|
- String dateString = LocalDateUtils.formatDate(new Date(), DateTimeFormatter.ofPattern("MM月dd日"));
|
|
|
- ironTimeNoDTO.setDate(dateString);
|
|
|
- ironTimeNoDTO.setIronNo(mIronNo);
|
|
|
- ironTimeNoDTO.setDesc(String.format("%s第%s次出铁", dateString, ironTimeNoDTO.getIronNo()));
|
|
|
- PushData.send2IronTimeNo(ironTimeNoDTO);
|
|
|
+
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ TL2Data latestData = tl2DataService.getLatestData();
|
|
|
+ if (latestData != null) {
|
|
|
+ getIronTimeNo(latestData.getIronNo());
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
|
|
|
//推送实时数据
|
|
|
taskExecutor.submit(() -> {
|
|
|
setRealtimeDataAndStatus(null, l2Data);
|
|
|
});
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
+ /***
|
|
|
+ * 记录出铁日期和次数,并返回给前端
|
|
|
+ * @param mIronNo
|
|
|
+ */
|
|
|
+ private void getIronTimeNo(Long mIronNo) {
|
|
|
+ IronTimeNoDTO ironTimeNoDTO = new IronTimeNoDTO();
|
|
|
+ String dateString = LocalDateUtils.formatDate(new Date(), DateTimeFormatter.ofPattern("MM月dd日"));
|
|
|
+ ironTimeNoDTO.setDate(dateString);
|
|
|
+ ironTimeNoDTO.setIronNo(mIronNo);
|
|
|
+ ironTimeNoDTO.setDesc(String.format("%s第%s次出铁", dateString, ironTimeNoDTO.getIronNo()));
|
|
|
+ PushData.send2IronTimeNo(ironTimeNoDTO);
|
|
|
}
|
|
|
|
|
|
- private void showTheoryWeight(List<TL2Data> latest2DataList) {
|
|
|
+ /***
|
|
|
+ * 显示“铁量差在合理范围内”
|
|
|
+ * @param latest2DataList
|
|
|
+ */
|
|
|
+ private void getTheoryWeight(List<TL2Data> latest2DataList) {
|
|
|
taskExecutor.submit(() -> {
|
|
|
for (IronStepVO stepDTO : mSteps) {
|
|
|
if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
|
|
@@ -397,10 +420,10 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
BigDecimal ironWeightLast = new BigDecimal(tl2Data1Last.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal tlcLast = llLast.subtract(ironWeightLast).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
- TL2Data tl2Data1LastLast = latest2DataList.get(1);
|
|
|
- BigDecimal llLastLast = new BigDecimal(tl2Data1LastLast.getTheoryWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- BigDecimal ironWeightLastLast = new BigDecimal(tl2Data1LastLast.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- BigDecimal tlcLastLast = llLastLast.subtract(ironWeightLastLast).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ TL2Data tl2Data1GrandLast = latest2DataList.get(1);
|
|
|
+ BigDecimal llGrandLast = new BigDecimal(tl2Data1GrandLast.getTheoryWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal ironWeightGrandLast = new BigDecimal(tl2Data1GrandLast.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal tlcGrandLast = llGrandLast.subtract(ironWeightGrandLast).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
//铁量差在合理范围内
|
|
|
// 上一次铁量差:-30 上上次铁量差:20 t
|
|
@@ -418,19 +441,19 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
grandChild.setData(tlcLast);
|
|
|
grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
} else if (ssctlc.equals(grandChild.getIdentifier())) {
|
|
|
- grandChild.setData(tlcLastLast);
|
|
|
+ grandChild.setData(tlcGrandLast);
|
|
|
grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
} else if (scll.equals(grandChild.getIdentifier())) {
|
|
|
grandChild.setData(llLast);
|
|
|
grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
} else if (sscll.equals(grandChild.getIdentifier())) {
|
|
|
- grandChild.setData(llLastLast);
|
|
|
+ grandChild.setData(llGrandLast);
|
|
|
grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
} else if (scsj.equals(grandChild.getIdentifier())) {
|
|
|
grandChild.setData(ironWeightLast);
|
|
|
grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
} else if (sscsj.equals(grandChild.getIdentifier())) {
|
|
|
- grandChild.setData(ironWeightLastLast);
|
|
|
+ grandChild.setData(ironWeightGrandLast);
|
|
|
grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
}
|
|
|
}
|
|
@@ -467,47 +490,18 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
|
|
|
//1号铁口正在出铁的操作项目
|
|
|
private void taphole1Start() {
|
|
|
- //通过“预判和确认出铁”标记开始出铁
|
|
|
- boolean isReady = false;
|
|
|
-
|
|
|
- for (IronStepVO stepDTO : mSteps) {
|
|
|
- if (STEP_YPQRCT.equalsIgnoreCase(stepDTO.getIdentifier()) && 1 == stepDTO.getPassResult()) {
|
|
|
- isReady = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ //关闭定时任务:出铁预警、开口预警
|
|
|
+ //开启定时任务:出铁超时报警、堵口预警、打泥量选择计算、
|
|
|
|
|
|
- //炉前在接受到炉内出铁要求后,10分钟内打开铁口,未打开系统告警并记录
|
|
|
-// if (isReady) {
|
|
|
-// scheduledTaskManager.addTask(TASKNAME_OPEN_WARN, 0, OPEND_HOUR, TimeUnit.MINUTES, () -> {
|
|
|
-// log.info("堵口预警:{}", TASKNAME_OPEN_WARN);
|
|
|
-//
|
|
|
-// System.out.println("倒计时结束!10分钟已到。");
|
|
|
-// // 出铁预警,打开系统告警并记录
|
|
|
-// PushData.send2Warn("请立即打开铁口");
|
|
|
-// log.info("准备出铁但是未及时出铁口,此处数据库记录");
|
|
|
-// scheduledTaskManager.cancelTask(TASKNAME_OPEN_WARN); // 终止定时器
|
|
|
-// });
|
|
|
-// }
|
|
|
+ scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_WARN);
|
|
|
+ scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_OPEN_WARN);
|
|
|
|
|
|
+ //出铁计时
|
|
|
+ scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_TAPPING_CONSTTIME, ScheduledTimeConstants.TAPPING_CONSTTIME_DELAY, ScheduledTimeConstants.TAPPING_CONSTTIME_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
+ getIronTime();
|
|
|
+ mSecondsElapsed.incrementAndGet();
|
|
|
+ });
|
|
|
|
|
|
- //由 0 -> 1 表明1号铁口开始出铁
|
|
|
- //
|
|
|
- //根据理论铁量、实时铁水流速,推测距离出铁结束的剩余时间
|
|
|
-// Date ironTime = mOPCData.getServerTime();
|
|
|
-// lastIronEndTimeRecently
|
|
|
- //获取总干量
|
|
|
-// BigDecimal totalDry = new BigDecimal(ObjectUtils.defaultIfNull(mL2Data.getTotalDry(), "0"));
|
|
|
-// //计算出理论铁量
|
|
|
-// BigDecimal multiply = totalDry.multiply(new BigDecimal(1.0)).multiply(new BigDecimal(1.0));
|
|
|
-
|
|
|
-// float totalSpeed = speed1.add(speed2);
|
|
|
-// if (totalSpeed > 0) {
|
|
|
-// //理论时间
|
|
|
-// BigDecimal divide = multiply.divide(new BigDecimal(totalSpeed), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
-// String plainString = divide.toPlainString();
|
|
|
-// log.info("理论出铁时间:{}min", plainString);
|
|
|
-// }
|
|
|
|
|
|
//出铁超时报警
|
|
|
scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN, ScheduledTimeConstants.TAPPING_TIMEOUT_WARN_DELAY, ScheduledTimeConstants.TAPPING_TIMEOUT_WARN_PERIOD, TimeUnit.SECONDS, () -> {
|
|
@@ -515,27 +509,33 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
|
|
|
System.out.println("倒计时结束!10分钟已到。");
|
|
|
// 出铁预警,打开系统告警并记录
|
|
|
- PushData.send2Warn("请立即打开铁口");
|
|
|
+ PushData.send2Warn(WarnData.warnOpen("请立即打开铁口", alarmUrlOpen));
|
|
|
log.info("准备出铁但是未及时出铁口,此处数据库记录");
|
|
|
- scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN); // 终止定时器
|
|
|
+ //scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN); // 终止定时器
|
|
|
});
|
|
|
|
|
|
//堵口预警
|
|
|
- scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_CLOSE_WARN, ScheduledTimeConstants.CLOSE_WARN_DELAY, ScheduledTimeConstants.CLOSE_WARN_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
+ scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_CLOSURE_WARN, ScheduledTimeConstants.CLOSURE_WARN_DELAY, ScheduledTimeConstants.CLOSURE_WARN_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
//堵口预警
|
|
|
- log.info("堵口预警:{},speed1:{},speed2:{},STANDARD_SPEED:{}", speed1, speed2, TaskNameConstants.TASKNAME_CLOSE_WARN);
|
|
|
- if (speed1.compareTo(STANDARD_SPEED) > 0 || speed2.compareTo(STANDARD_SPEED) > 0) {
|
|
|
+ log.info("堵口预警:{},speed1:{},speed2:{},STANDARD_SPEED:{}", speed1.get(), speed2.get(), TaskNameConstants.TASKNAME_CLOSURE_WARN);
|
|
|
+ if (speed1.get() > STANDARD_SPEED.get() || speed2.get() > STANDARD_SPEED.get()) {
|
|
|
//流速过大可能是由于铁口深度不足或发生跑大流问题,则提示将当前铁口堵口
|
|
|
- PushData.send2Warn(WarnData.warnClose("流速过快,请将当前铁口堵口", alarmUrlClose));
|
|
|
- exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType(4).exceptionDesc("流速过快,请将当前铁口堵口").build());
|
|
|
- } else if ((speed1.compareTo(STANDARD_SPEED) < 0 || speed2.compareTo(STANDARD_SPEED) < 0) && (ironLoading2.get() || ironLoading3.get() || ironLoading4.get())) {
|
|
|
+ PushData.send2Warn(WarnData.warnClose("流速过快,请将当前铁口堵口", alarmUrlClosure));
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType(4).exceptionDesc("流速过快,请将当前铁口堵口").build());
|
|
|
+ });
|
|
|
+ } else if ((speed1.get() < STANDARD_SPEED.get() || speed2.get() < STANDARD_SPEED.get()) && (ironLoading2.get() || ironLoading3.get() || ironLoading4.get())) {
|
|
|
//若流速过小,但其它铁口正在出铁,则提示将当前铁口堵口
|
|
|
- PushData.send2Warn(WarnData.warnClose("流速过小,请将当前铁口堵口", alarmUrlClose));
|
|
|
- exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType(4).exceptionDesc("流速过小,请将当前铁口堵口").build());
|
|
|
- } else if ((speed1.compareTo(STANDARD_SPEED) < 0 || speed2.compareTo(STANDARD_SPEED) < 0) && (!ironLoading2.get() && !ironLoading3.get() && !ironLoading4.get())) {
|
|
|
+ PushData.send2Warn(WarnData.warnClose("流速过小,请将当前铁口堵口", alarmUrlClosure));
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType(4).exceptionDesc("流速过小,请将当前铁口堵口").build());
|
|
|
+ });
|
|
|
+ } else if ((speed1.get() < STANDARD_SPEED.get() || speed2.get() < STANDARD_SPEED.get()) && (!ironLoading2.get() && !ironLoading3.get() && !ironLoading4.get())) {
|
|
|
//若流速过小且其他铁口均未出铁,则提示先将其它铁口打开,再进行堵口
|
|
|
- PushData.send2Warn(WarnData.warnClose("请先打开其它铁口,再堵口", alarmUrlClose));
|
|
|
- exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType(4).exceptionDesc("请先打开其它铁口,再堵口").build());
|
|
|
+ PushData.send2Warn(WarnData.warnClose("请先打开其它铁口,再堵口", alarmUrlClosure));
|
|
|
+ taskExecutor.submit(() -> {
|
|
|
+ exceptionLogService.add(TExceptionLogCreateValidate.builder().exceptionType(4).exceptionDesc("请先打开其它铁口,再堵口").build());
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -543,12 +543,18 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
//打泥量公式关联因素:铁口深度、钻杆直径、
|
|
|
//调用打泥量模型,计算预计使用多少打泥量进行堵口
|
|
|
scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_HIT_MUD, ScheduledTimeConstants.HIT_MUD_DELAY, ScheduledTimeConstants.HIT_MUD_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
- log.info("堵口预警:{},speed1:{},speed2:{},", speed1, speed2);
|
|
|
+ log.info("堵口预警:speed1:{},speed2:{},", speed1.get(), speed2.get());
|
|
|
|
|
|
TL2Data tappingData = tl2DataService.getTappingData();
|
|
|
if (ObjectUtils.isNotEmpty(tappingData) && ObjectUtils.isNotEmpty(modelHitMud)) {
|
|
|
+ log.info("开口深度openDepth(mm):{}", tappingData.getOpenDepth());
|
|
|
+ log.info("Tap对应铁水估计铁量ironWeight(t): {}", tappingData.getTheoryWeight());
|
|
|
+ log.info("出铁时间ironCosttime(min): {}", mSecondsElapsed.get() / 60);
|
|
|
+ log.info("平均流速ironSpeed(t/s): {}", speed1.get() > speed2.get() ? speed1.get() : speed2.get());
|
|
|
+
|
|
|
try {
|
|
|
String modelExpression = modelHitMud.getModelExpression();
|
|
|
+ log.info("打泥量计算公式:{}", modelExpression);
|
|
|
SpelExpressionParser parser = new SpelExpressionParser();
|
|
|
Expression expression = parser.parseExpression(modelExpression);
|
|
|
StandardEvaluationContext context = new StandardEvaluationContext();
|
|
@@ -556,13 +562,14 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
context.setVariable("openDepth", tappingData.getOpenDepth());
|
|
|
context.setVariable("ironWeight", tappingData.getTheoryWeight());
|
|
|
context.setVariable("ironCosttime", mSecondsElapsed.get() / 60);
|
|
|
- context.setVariable("ironSpeed", speed1.compareTo(speed2) > 0 ? speed1 : speed2);
|
|
|
- String result = (String) expression.getValue(context);
|
|
|
- log.info("openDepth:{},ironWeight: {}", tappingData.getOpenDepth(), tappingData.getTheoryWeight());
|
|
|
- log.info("ironCosttime(min): {},ironSpeed: {}", mSecondsElapsed.get() / 60, speed1.compareTo(speed2) > 0 ? speed1 : speed2);
|
|
|
- log.info("打泥量计算公式:{},结果: {}", modelExpression, result);
|
|
|
+ context.setVariable("ironSpeed", speed1.get() > speed2.get() ? speed1.get() : speed2.get());
|
|
|
+ int result = (int) ((double) expression.getValue(context));
|
|
|
+ // 使用 DecimalFormat 保留两位小数
|
|
|
+// DecimalFormat decimalFormat = new DecimalFormat("#.00");
|
|
|
+// String formattedResult = decimalFormat.format(result);
|
|
|
+ log.info("计算结果: {}", result);
|
|
|
} catch (Exception e) {
|
|
|
-
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -571,14 +578,13 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_HIT_MUD);
|
|
|
});
|
|
|
|
|
|
- //出铁计时
|
|
|
- scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_TAPPING_CONSTTIME, ScheduledTimeConstants.TAPPING_CONSTTIME_DELAY, ScheduledTimeConstants.TAPPING_CONSTTIME_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
- pushIronTime();
|
|
|
- mSecondsElapsed.incrementAndGet();
|
|
|
- });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- private void pushIronTime() {
|
|
|
+ /***
|
|
|
+ * 出铁计时
|
|
|
+ */
|
|
|
+ private void getIronTime() {
|
|
|
int totalSeconds = mSecondsElapsed.get();
|
|
|
int hours = totalSeconds / 3600;
|
|
|
int minutes = (totalSeconds % 3600) / 60;
|
|
@@ -601,12 +607,21 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
mTotalWeight = BigDecimal.ZERO;
|
|
|
// mTotalDry = BigDecimal.ZERO;
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_OPEN_WARN);
|
|
|
- scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSE_WARN);
|
|
|
- scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_WARN);
|
|
|
+ scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSURE_WARN);
|
|
|
+
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_HIT_MUD);
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_CONSTTIME);
|
|
|
+ scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
|
|
|
mSecondsElapsed.set(0);
|
|
|
- pushIronTime();
|
|
|
+ getIronTime();
|
|
|
+ mSteps = ironStepService.getTreeSteps();
|
|
|
+
|
|
|
+ //开口
|
|
|
+ PushData.send2CancelWarn(WarnData.warnOpen("", ""));
|
|
|
+ //堵口
|
|
|
+ PushData.send2CancelWarn(WarnData.warnClose("", ""));
|
|
|
+ //出铁预警
|
|
|
+ PushData.send2CancelWarn(WarnData.warnTapping("", ""));
|
|
|
|
|
|
// recordAfter();
|
|
|
// recordBlock();
|
|
@@ -616,7 +631,7 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
//xxx分钟延迟
|
|
|
scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_TAPPING_TEST, ScheduledTimeConstants.TAPPING_TEST_DELAY, ScheduledTimeConstants.TAPPING_TEST_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
//堵口预警
|
|
|
- log.info("定时任务:{},出铁诊断", TaskNameConstants.TASKNAME_TAPPING_TEST);
|
|
|
+ log.info("出铁结束,定时任务:{},出铁诊断", TaskNameConstants.TASKNAME_TAPPING_TEST);
|
|
|
L2Data fixedLatestElement = (L2Data) RedisUtils.getFixedLatestElement(IRON_ELEMENT);
|
|
|
//平均温度
|
|
|
String mudWeight = fixedLatestElement.getAvgTemp();
|
|
@@ -685,11 +700,11 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
if (opcData.getPointName().contains(L1TagConstants.TAG_CAR11)) {
|
|
|
realtimeData.setDesc("1号车");
|
|
|
speeds[0] = realtimeData;
|
|
|
- speed1 = new BigDecimal(opcData.getData().toString());
|
|
|
+ speed1 = new AtomicDouble(Double.parseDouble(opcData.getData().toString()));
|
|
|
} else {
|
|
|
realtimeData.setDesc("2号车");
|
|
|
speeds[1] = realtimeData;
|
|
|
- speed2 = new BigDecimal(opcData.getData().toString());
|
|
|
+ speed2 = new AtomicDouble(Double.parseDouble(opcData.getData().toString()));
|
|
|
}
|
|
|
|
|
|
//只在两个都有数据的时候才添加
|
|
@@ -716,19 +731,13 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
|
|
|
} else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE2_STATUS)) {
|
|
|
ironLoading2.set("1".equals(opcData.getData().toString()));
|
|
|
- if (ironLoading2.get()) {
|
|
|
- mIronEndTimeRecently = opcData.getServerTime();
|
|
|
- }
|
|
|
+
|
|
|
} else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE3_STATUS)) {
|
|
|
ironLoading3.set("1".equals(opcData.getData().toString()));
|
|
|
- if (ironLoading3.get()) {
|
|
|
- mIronEndTimeRecently = opcData.getServerTime();
|
|
|
- }
|
|
|
+
|
|
|
} else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE4_STATUS)) {
|
|
|
ironLoading4.set("1".equals(opcData.getData().toString()));
|
|
|
- if (!ironLoading4.get()) {
|
|
|
- mIronEndTimeRecently = opcData.getServerTime();
|
|
|
- }
|
|
|
+
|
|
|
} else if (opcData.getPointName().contains(L1TagConstants.TAG_IRON_WEIGHT11) || opcData.getPointName().contains(L1TagConstants.TAG_IRON_WEIGHT12)) {
|
|
|
//铁水流量
|
|
|
RealtimeData ironWeight = new RealtimeData();
|
|
@@ -751,10 +760,10 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
}
|
|
|
|
|
|
|
|
|
- BigDecimal yc = new BigDecimal(ObjectUtils.defaultIfNull(mContext.lookupVariable("yc"), "0").toString());
|
|
|
- if (PRESSURE_DIFF_VALUE.compareTo(yc) < 0) {
|
|
|
+ double yc = Double.parseDouble(ObjectUtils.defaultIfNull(mContext.lookupVariable("yc"), "0").toString());
|
|
|
+ if (PRESSURE_DIFF_VALUE.get() < yc && !ironLoading1.get()) {
|
|
|
//xxx分钟延迟
|
|
|
- scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_TAPPING_WARN, 0, 3, TimeUnit.SECONDS, () -> {
|
|
|
+ scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_TAPPING_WARN, ScheduledTimeConstants.TAPPING_WARN_DELAY, ScheduledTimeConstants.TAPPING_WARN_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
//堵口预警
|
|
|
log.info("出铁预警:{}", TaskNameConstants.TASKNAME_TAPPING_WARN);
|
|
|
PushData.send2Warn(WarnData.warnTapping("压差超过阈值,请出铁", alramUrlTapping));
|
|
@@ -762,9 +771,9 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
});
|
|
|
} else {
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_WARN);
|
|
|
+ PushData.send2CancelWarn(WarnData.warnTapping("压差正常", alramUrlTapping));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
L2Data fixedLatestElement = (L2Data) RedisUtils.getFixedLatestElement(IRON_ELEMENT);
|
|
@@ -958,10 +967,20 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
PushData.send2Operation(mSteps, ironLoading1.get());
|
|
|
|
|
|
for (IronStepVO stepDTO : mSteps) {
|
|
|
- if (STEP_LQCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
|
+ if (STEP_LQSQCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
|
//
|
|
|
- List<TL2Data> tl2DataList = tl2DataService.getLatest2Data();
|
|
|
- showTheoryWeight(tl2DataList);
|
|
|
+ List<TL2Data> tl2DataList = tl2DataService.getTappedLatest2Datas();
|
|
|
+ getTheoryWeight(tl2DataList);
|
|
|
+ } else if (STEP_YPQRCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
|
+ //炉前在接受到炉内出铁要求后,10分钟内打开铁口,未打开系统告警并记录
|
|
|
+ scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_OPEN_WARN, ScheduledTimeConstants.OPEN_WARN_DELAY, ScheduledTimeConstants.OPEN_WARN_PERIOD, TimeUnit.SECONDS, () -> {
|
|
|
+ log.info("开口预警:{}", TaskNameConstants.TASKNAME_OPEN_WARN);
|
|
|
+
|
|
|
+ // 出铁预警,打开系统告警并记录
|
|
|
+ PushData.send2Warn(WarnData.warnOpen("请立即打开铁口", "xxxxxxxxxxxxxx"));
|
|
|
+ log.info("准备出铁但是未及时出铁口,此处数据库记录");
|
|
|
+// scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_OPEN_WARN); // 终止定时器
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
for (IronStepVO child : stepDTO.getChilds()) {
|
|
@@ -1039,10 +1058,16 @@ public class DeviceEventListener extends EventListener implements ApplicationLis
|
|
|
PushData.send2Operation(mSteps, ironLoading1.get());
|
|
|
break;
|
|
|
case "2":
|
|
|
- updateParams();
|
|
|
+ getIronParams();
|
|
|
+ log.info("参数数据刷新:{}", LocalDateTime.now());
|
|
|
break;
|
|
|
case "3":
|
|
|
- updateModels();
|
|
|
+ getModels();
|
|
|
+ log.info("模型数据刷新:{}", LocalDateTime.now());
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ getAudios();
|
|
|
+ log.info("音频数据刷新:{}", LocalDateTime.now());
|
|
|
break;
|
|
|
default:
|
|
|
break;
|