Browse Source

在线离线状态设置

lengfaqiang 2 years ago
parent
commit
5b282accb6

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDevice.java

@@ -100,7 +100,7 @@ public class KwsDevice implements Serializable {
     private Long updateBy;
 
     /**
-     * 在线离线状态 0离线  1  在线
+     * 在线离线状态 0在线  1  离线
      */
     private int online;
 

+ 5 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -442,6 +442,7 @@ public class ProjectService {
                     }
                     kwsDevice.setInstallTime(localDateTime);
                     kwsDevice.setRelated(1);
+                    kwsDevice.setOnline(0);
                     kwsDevice.setRelevanceLevel(level);
                     kwsDevice.setUpdateTime(LocalDateTime.now());
                     kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
@@ -456,7 +457,7 @@ public class ProjectService {
                         .set(KwsDevice::getRelated, 1)
                         .set(KwsDevice::getDeviceCode, deviceCode)
                         .set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
-                        .set(KwsDevice::getOnline, 1)
+                        .set(KwsDevice::getOnline, 0)
                         .set(KwsDevice::getAlias, bindDevice.getAlias() == null ? kwsDevice.getName() : bindDevice.getAlias())
                         .set(KwsDevice::getUpdateTime, LocalDateTime.now())
                         .set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()))
@@ -1339,6 +1340,7 @@ public class ProjectService {
                     .eq(KwsDevice::getDelFlag, 0)
                     .set(KwsDevice::getRelevanceLevel, 0)
                     .set(KwsDevice::getRelated, 0)
+                    .set(KwsDevice::getOnline, 0)
                     .set(KwsDevice::getInstallTime, null)
                     .set(KwsDevice::getLogicAlt, null)
                     .set(KwsDevice::getDeviceCode, null)
@@ -1814,6 +1816,7 @@ public class ProjectService {
                     kwsDevice.setRelated(1);
                     kwsDevice.setInstallTime(localDateTime);
                     kwsDevice.setRelevanceLevel(level);
+                    kwsDevice.setOnline(0);
                     kwsDevice.setUpdateTime(LocalDateTime.now());
                     kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
                     level = "2";
@@ -1825,7 +1828,7 @@ public class ProjectService {
                         .set(KwsDevice::getRelevanceLevel, level)
                         .set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
                         .set(KwsDevice::getInstallTime, localDateTime)
-                        .set(KwsDevice::getOnline, 1)
+                        .set(KwsDevice::getOnline, 0)
                         .set(KwsDevice::getRelated, 1)
                         .set(KwsDevice::getAlias, bindDevice.getAlias() == null ? kwsDevice.getName() : bindDevice.getAlias())
                         .set(KwsDevice::getUpdateTime, LocalDateTime.now())