Pārlūkot izejas kodu

设备基础信息同步代码提交

jingyuanchao 1 gadu atpakaļ
vecāks
revīzija
6e91b82c2c

+ 5 - 7
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/iot/service/impl/IotDeviceInfoServiceImpl.java

@@ -80,8 +80,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
                     .eq(IotDeviceInfo::getIotToken, token)
                     .eq(IotDeviceInfo::getDeviceProduct, product)
                     .eq(IotDeviceInfo::getDeviceType, deviceType)
-                    .eq(IotDeviceInfo::getDeviceCode, deviceCode)
-                    .eq(IotDeviceInfo::getDeleted, 0);
+                    .eq(IotDeviceInfo::getDeviceCode, deviceCode);
             IotDeviceInfo one = getOne(qw);
             if (one != null) {
                 updateCache(one, 1);
@@ -107,8 +106,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
             qw.lambda().eq(IotDeviceInfo::getIotToken, token)
                     .eq(IotDeviceInfo::getHostCode, hostCode)
                     .eq(IotDeviceInfo::getDeviceProduct, product)
-                    .eq(IotDeviceInfo::getDeviceCode, deviceCode)
-                    .eq(IotDeviceInfo::getDeleted, 0);
+                    .eq(IotDeviceInfo::getDeviceCode, deviceCode);
             IotDeviceInfo one = getOne(qw);
             if (one != null) {
                 updateCache(one, 2);
@@ -356,7 +354,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
         for (DvsBaseInfo dvsBaseInfo : alarmHostList) {
 
             //处理报警主机信息
-            IotDeviceInfo hostInfo = selectByTypeAndCode(serverInfo.getIotCode(), BaseDeviceTypeEnum.AlarmHost.getCode(), dvsBaseInfo.getProductName(), dvsBaseInfo.getDeviceName());
+            IotDeviceInfo hostInfo = selectByTypeAndCode(serverInfo.getIotCode(), BaseDeviceTypeEnum.AlarmHost.getCode(), dvsBaseInfo.getProductName(), dvsBaseInfo.getDeviceCode());
 
             if (ObjectUtil.isNull(hostInfo)) {
                 hostInfo = createHostInfo(dvsBaseInfo, serverInfo, BaseDeviceTypeEnum.AlarmHost.getCode());
@@ -367,7 +365,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
             }
 
             //处理报警主机扩展信息
-            IotDeviceInfoExtend extend = iIotDeviceInfoExtendService.selectByProductDeviceNameAndToken(serverInfo.getIotCode(), BaseDeviceTypeEnum.Dvs.getCode(), dvsBaseInfo.getDeviceCode());
+            IotDeviceInfoExtend extend = iIotDeviceInfoExtendService.selectByProductDeviceNameAndToken(serverInfo.getIotCode(), BaseDeviceTypeEnum.AlarmHost.getCode(), dvsBaseInfo.getDeviceCode());
             if (extend == null) {
                 addExtendList.add(createIotDeviceInfoExtend(dvsBaseInfo, hostInfo.getId(), serverInfo.getIotCode()));
             } else {
@@ -466,7 +464,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
         for (DvsBaseInfo dvsBaseInfo : dvsBaseInfoList) {
             String code = BaseDeviceTypeEnum.valueOf(dvsBaseInfo.getType()).getCode();
             //处理主机信息
-            IotDeviceInfo hostInfo = selectByTypeAndCode(serverInfo.getIotCode(), code, dvsBaseInfo.getProductName(), dvsBaseInfo.getDeviceName());
+            IotDeviceInfo hostInfo = selectByTypeAndCode(serverInfo.getIotCode(), code, dvsBaseInfo.getProductName(), dvsBaseInfo.getDeviceCode());
 
             if (ObjectUtil.isNull(hostInfo)) {
                 hostInfo = createHostInfo(dvsBaseInfo, serverInfo, code);

+ 2 - 1
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/websocket/handler/SocWebSocketHandler.java

@@ -133,7 +133,8 @@ public class SocWebSocketHandler extends AbstractWebSocketHandler {
     @Override
     protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
         // 从WebSocket会话中获取登录用户信息
-        String token = WebSocketSessionHolder.updateToken(session);
+        //String token = WebSocketSessionHolder.updateToken(session);
+        String token ="9e08595b-868e-4eac-ab44-45bdeec51185";
         String payload = message.getPayload();
         final String ip = WebSocketUtils.getIp(session);
         LogUtils.WEBSOCKET_MSG.info("ip:{},接收到消息:{}", ip, message.getPayload());