|
@@ -13,6 +13,7 @@ import com.sckj.common.eventbus.AbstractEventListener;
|
|
|
import com.sckj.common.eventbus.RefreshItem;
|
|
|
import com.sckj.common.manager.ScheduledTaskManager;
|
|
|
import com.sckj.common.socketio.SocketUtil;
|
|
|
+import com.sckj.common.util.GsonUtils;
|
|
|
import com.sckj.common.util.RedisUtils;
|
|
|
import com.sckj.common.util.ToolUtils;
|
|
|
import com.sckj.iron.constant.*;
|
|
@@ -1150,7 +1151,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
|
|
|
final String ironTimeTip = "出铁时间";
|
|
|
final String ironWeightTip = "出铁量";
|
|
|
- final String ironSpeedTip = "出铁平均流速";
|
|
|
+ final String ironSpeedTip = "铁水平均流速";
|
|
|
final String ironTempTip = "铁水平均温度";
|
|
|
|
|
|
IronTestItem.IronTestItemBuilder ironTime = IronTestItem.builder().unit("min").typeName(ironTimeTip).status(1).value(getIronElapsedMinute()).desc(ironTimeTip + "正常");
|
|
@@ -1164,7 +1165,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
ironTime.status(0).desc(ironTimeTip + "过短");
|
|
|
} else if (getIronElapsedMinute() > stdIronTimeMax) {
|
|
|
sb.append(ironTimeTip + "过长,");
|
|
|
- ironTime.status(0).desc(ironTimeTip + "出铁时间过长");
|
|
|
+ ironTime.status(0).desc(ironTimeTip + "过长");
|
|
|
} else {
|
|
|
sb.append(ironTimeTip + "正常,");
|
|
|
ironTime.status(1).desc(ironTimeTip + "正常");
|
|
@@ -1184,7 +1185,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
}
|
|
|
|
|
|
|
|
|
- double avgIronSpeed = getIronElapsedMinute() == 0 ? 0 : (mTotalWeight.get().doubleValue() / getIronElapsedMinute());
|
|
|
+ double avgIronSpeed = getIronElapsedMinute() == 0 ? 0 : (mTotalWeight.get().divide(new BigDecimal(getIronElapsedMinute())).setScale(2, RoundingMode.DOWN)).doubleValue();
|
|
|
|
|
|
if (avgIronSpeed < stdIronSpeedMin) {
|
|
|
sb.append(ironSpeedTip + "过慢,");
|
|
@@ -1226,25 +1227,12 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
ironNormalCount++;
|
|
|
}
|
|
|
|
|
|
-// if (tempHightCount == 0 && tempLowCount == 0) {
|
|
|
-// //没有出现铁水高温或者低温情况
|
|
|
-// sb.append("铁水温度正常。");
|
|
|
-// ironNormalCount++;
|
|
|
-// ironWeight.status(1).desc("铁水温度正常");
|
|
|
-// } else if (tempHightCount > tempLowCount) {
|
|
|
-// sb.append("铁水温度过高。");
|
|
|
-// ironWeight.status(0).desc("铁水温度过高");
|
|
|
-// } else if (tempHightCount < tempHightCount) {
|
|
|
-// sb.append("铁水温度过低。");
|
|
|
-// ironWeight.status(0).desc("铁水温度过低");
|
|
|
-// } else {
|
|
|
-// sb.append("铁水温度异常。");
|
|
|
-// ironWeight.status(0).desc("铁水温度异常");
|
|
|
-// }
|
|
|
|
|
|
TL2Data latestData = tl2DataService.getLatestData();
|
|
|
|
|
|
TIronTest ironTest = new TIronTest();
|
|
|
+ //铁口编号
|
|
|
+ ironTest.setTapholeId("1");
|
|
|
String testStatus = (ironNormalCount >= 4) ? "1" : "0";
|
|
|
ironTest.setTestStatus(testStatus);
|
|
|
ironTest.setTestDesc(sb.toString());
|
|
@@ -1257,8 +1245,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
ironTestList.add(ironTime.build());
|
|
|
ironTestList.add(ironSpeed.build());
|
|
|
ironTestList.add(ironTemp.build());
|
|
|
- Gson gson = new Gson();
|
|
|
- ironTest.setIronDetail(gson.toJson(ironTestList));
|
|
|
+ ironTest.setIronDetail(GsonUtils.toJson(ironTestList));
|
|
|
|
|
|
iTIronTestService.save(ironTest);
|
|
|
log.info("出铁诊断结果:{}", sb.toString());
|
|
@@ -1933,7 +1920,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
if (getIronChart != null && "1".equals(getIronChart.getStatus())) {
|
|
|
scheduledTaskManager.addTask(getIronChart.getName(), getIronChart.getDelay(), getIronChart.getPeriod(), TimeUnit.SECONDS, () -> {
|
|
|
Map<String, Object> ironChart = tIronVisualScreenService.getIronChart(new TrendRequest());
|
|
|
- Map<String, Object> ironLegend = tIronVisualScreenService.getIronLegend(ironChart, getIronElapsedMinute());
|
|
|
+ Map<String, Object> ironLegend = tIronVisualScreenService.getIronLegend(ironChart, ironLoading1.get() > 0 ? getIronElapsedMinute() : 0);
|
|
|
PushData.send2Legend(ironLegend);
|
|
|
PushData.send2Chart(ironChart);
|
|
|
});
|