648540858
2022-03-29 1553b39b4547418774ab2bd6da72f75bfd14b972
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -7,6 +7,7 @@
import com.genersoft.iot.vmp.conf.UserSetup;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
@@ -28,6 +29,7 @@
import com.genersoft.iot.vmp.conf.SipConfig;
import java.util.List;
import java.util.Locale;
/**
 * 级联平台管理
@@ -48,6 +50,9 @@
    @Autowired
    private IRedisCatchStorage redisCatchStorage;
    @Autowired
    private SubscribeHolder subscribeHolder;
    @Autowired
    private ISIPCommanderForPlatform commanderForPlatform;
@@ -110,10 +115,14 @@
    })
    public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) {
//        if (logger.isDebugEnabled()) {
//            logger.debug("查询所有上级设备API调用");
//        }
        return storager.queryParentPlatformList(page, count);
        PageInfo<ParentPlatform> parentPlatformPageInfo = storager.queryParentPlatformList(page, count);
        if (parentPlatformPageInfo.getList().size() > 0) {
            for (ParentPlatform platform : parentPlatformPageInfo.getList()) {
                platform.setGpsSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null);
                platform.setCatalogSubscribe(subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) != null);
            }
        }
        return parentPlatformPageInfo;
    }
    /**
@@ -222,6 +231,7 @@
            wvpResult.setMsg("missing parameters");
            return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST);
        }
        parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
        ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
        boolean updateResult = storager.updateParentPlatform(parentPlatform);
@@ -297,6 +307,8 @@
        // 停止发送位置订阅定时任务
        String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() +  "_MobilePosition_" + parentPlatform.getServerGBId();
        dynamicTask.stop(key);
        // 删除缓存的订阅信息
        subscribeHolder.removeAllSubscribe(parentPlatform.getServerGBId());
        if (deleteResult) {
            return new ResponseEntity<>("success", HttpStatus.OK);
        } else {
@@ -333,7 +345,6 @@
     * @param platformId  上级平台ID
     * @param query       查询内容
     * @param online      是否在线
     * @param choosed     是否已选中
     * @param channelType 通道类型
     * @return
     */