wwh 1 gadu atpakaļ
vecāks
revīzija
54cac1fe74

+ 16 - 14
huimv-env-admin/src/main/java/com/huimv/env/admin/service/impl/BasePigpenServiceImpl.java

@@ -175,22 +175,24 @@ public class BasePigpenServiceImpl extends ServiceImpl<BasePigpenMapper, BasePig
         });
 
         QueryWrapper<TerminalPort> queryWrapper2 = new QueryWrapper<>();
-        queryWrapper2.in("terminal_id", idList2).ne("location_id",null);
+        queryWrapper2.in("terminal_id", idList2);
         List<TerminalPort> terminalPorts = portMapper.selectList(queryWrapper2);
         for (TerminalPort terminal : terminalPorts) {
-            if (terminal.getStatus() == 0) {
-                offPort++;
-            } else {
-                onPort++;
-            }
-            if (terminal.getHeightTempWarning() == 1) {
-                tempCount++;
-            }
-            if (terminal.getChargingWarning() == 1) {
-                chargingCount++;
-            }
-            if (terminal.getLeakageWarning() == 1) {
-                leakageCount++;
+            if (terminal.getLocationId() != null) {
+                if (terminal.getStatus() == 0) {
+                    offPort++;
+                } else {
+                    onPort++;
+                }
+                if (terminal.getHeightTempWarning() == 1) {
+                    tempCount++;
+                }
+                if (terminal.getChargingWarning() == 1) {
+                    chargingCount++;
+                }
+                if (terminal.getLeakageWarning() == 1) {
+                    leakageCount++;
+                }
             }
         }
         JSONObject jsonObject = new JSONObject();