Prechádzať zdrojové kódy

增加盘头剩余圈数小于200圈

wukai 6 mesiacov pred
rodič
commit
67935db07c

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/biz/domain/IndexDevice.java

@@ -27,5 +27,7 @@ public class IndexDevice {
     private int stop6;
     @ApiModelProperty("故障告警数")
     private int alarm;
+    @ApiModelProperty("盘头小于200圈数量")
+    private int stopPan;
 
 }

+ 10 - 2
ruoyi-admin/src/main/java/com/ruoyi/biz/service/impl/ApiServiceImpl.java

@@ -128,7 +128,7 @@ public class ApiServiceImpl implements IApiService {
             TwinDevice twinDevice = list.get(i);
             futureList.add(asyncService.currData(twinDevice));
         }
-        int stop1 = 0, stop2 = 0, stop6 = 0, stop8 = 0, onlineNum = 0, otherStop = 0;
+        int stop1 = 0, stop2 = 0, stop6 = 0, stop8 = 0, onlineNum = 0, otherStop = 0, stopPan = 0;
         //停机明细
         List<StopDetailVO> stopList = new ArrayList<>();
         try {
@@ -231,9 +231,14 @@ public class ApiServiceImpl implements IApiService {
                 int[] curr = new int[5];
                 int[] max = new int[5];
                 float[] panPercent = new float[5];
+                boolean panFlag = false;
                 for (int i = 0; i < curr.length; i++) {
                     int pos = 15 + i;
                     curr[i] = (int) map.get("Capacity_data_" + pos);
+                    if (curr[i] < 200) {
+                        //盘头小于200圈
+                        panFlag = true;
+                    }
                     String key = device.getDeviceId() + "_" + (i + 1);
                     max[i] = 15000;
                     if (panMap.get(key) != null) {
@@ -245,7 +250,9 @@ public class ApiServiceImpl implements IApiService {
                         panPercent[i] = 100;
                     }
                 }
-
+                if (panFlag) {
+                    stopPan++;
+                }
                 IndexPan pan = new IndexPan();
                 pan.setCode(device.getDeviceCode());
                 pan.setName(device.getDeviceName());
@@ -266,6 +273,7 @@ public class ApiServiceImpl implements IApiService {
         device.setStop2(stop2);
         device.setStop6(stop6);
         device.setStop8(stop8);
+        device.setStopPan(stopPan);
 //        2024-11-18 告警数改为其他停机数
 //        device.setAlarm(alarmList.size());
         device.setAlarm(otherStop);