소스 검색

设备同步 修改逻辑增加

jingyuanchao 11 달 전
부모
커밋
6064ab976c

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

@@ -407,10 +407,6 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
     }
 
     private void handleIncrementDevices(DvsBaseInfo baseInfo, IotServerInfo serverInfo) {
-        //添加通道类设备集合
-        List<IotDeviceInfo> addChnnelList = new ArrayList<>();
-        //更新通道类设备集合
-        List<IotDeviceInfo> updateChnnelList = new ArrayList<>();
         baseMapper.updateDvsAndChannelDeleted(serverInfo.getIotCode(), baseInfo.getDeviceCode());
         String code = BaseDeviceTypeEnum.valueOf(baseInfo.getType()).getCode();
         IotDeviceInfo hostInfo = selectByTypeAndCode(serverInfo.getIotCode(), code, baseInfo.getProductName(), baseInfo.getDeviceCode());
@@ -438,7 +434,8 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
         if (ObjectUtil.isEmpty(subDeviceList)) {
             return;
         }
-
+        List<IotDeviceInfo> addChnnelList = new ArrayList<>();
+        List<IotDeviceInfo> updateChnnelList = new ArrayList<>();
         //处理通道信息
         for (SubDeviceInfo subDeviceInfo : subDeviceList) {
             IotDeviceInfo channelInfo = selectByTypeAndHostAndCode(serverInfo.getIotCode(), subDeviceInfo.getParentCode(), baseInfo.getProductName(), subDeviceInfo.getDeviceCode());

+ 0 - 21
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/websocket/dto/dvs/DvsBaseInfo.java

@@ -15,27 +15,6 @@ public class DvsBaseInfo implements Serializable {
     private static final long serialVersionUID = 1L;
 
     /**
-     * {
-     *       "type":""
-     *       "productName":"VGSII_HIK",
-     *       "deviceCode":"ZM_142739493892989382",
-     *       "deviceName":"海康录像机001",
-     *       "netAddress":"",  //预留,本期不实现
-     *       "username":"", //预留,本期不实现
-     *       "password":"", //预留,本期不实现
-     *       "subDevices":[
-     *         {
-     *           "deviceCode":"1",
-     *           "deviceName":"海康录像机001",
-     *           "type":"camera", //camera、subsystem、sensor、FSU_Smoke、FSU_Infrared、FSU_Infrared、FSU_Infrared、FSU_Gas、DVS、alarmHost、FSU
-     *   FSU_RollingShutterDoor、FSU_Water、FSU_SmartMeter、FSU_AirConditioner、FSU_Ups、FSU_DoPowerControl、FSU_ThreePhaseACVoltage
-     *           "parentCode":"ZM_142739493892989382",  //直属父级设备编号
-     *         }
-     *       ]
-     *     }
-     */
-
-    /**
      * @see com.xunmei.common.core.enums.iot.BaseDeviceTypeEnum
      */
     private String type;