jiang
2022-07-13 fc89b7b517e191fb6c9b66fa86dd05ebab0f54c5
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -11,6 +11,7 @@
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam;
@@ -169,6 +170,8 @@
            wvpResult.setMsg("平台 " + parentPlatform.getServerGBId() + " 已存在");
            return new ResponseEntity<>(wvpResult, HttpStatus.OK);
        }
        parentPlatform.setCreateTime(DateUtil.getNow());
        parentPlatform.setUpdateTime(DateUtil.getNow());
        boolean updateResult = storager.updateParentPlatform(parentPlatform);
        if (updateResult) {
@@ -232,7 +235,7 @@
        }
        parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
        ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
        parentPlatform.setUpdateTime(DateUtil.getNow());
        boolean updateResult = storager.updateParentPlatform(parentPlatform);
        if (updateResult) {
@@ -286,7 +289,9 @@
            return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST);
        }
        ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId);
        if (parentPlatform == null) return new ResponseEntity<>("fail", HttpStatus.OK);
        if (parentPlatform == null) {
            return new ResponseEntity<>("fail", HttpStatus.OK);
        }
        // 发送离线消息,无论是否成功都删除缓存
        commanderForPlatform.unregister(parentPlatform, (event -> {
            // 清空redis缓存