| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.genersoft.iot.vmp.gb28181.bean.CatalogData; |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.common.VideoManagerConstants; |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | 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.transmit.cmd.ISIPCommanderForPlatform; |
| | |
| | | private final static Logger logger = LoggerFactory.getLogger(PlatformController.class); |
| | | |
| | | @Autowired |
| | | private UserSetup userSetup; |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorager storager; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private SipConfig sipConfig; |
| | | |
| | | @Autowired |
| | | private DynamicTask dynamicTask; |
| | | |
| | | /** |
| | | * 获取国标服务的配置 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取国标服务的配置") |
| | |
| | | result.put("password", sipConfig.getPassword()); |
| | | return new ResponseEntity<>(result, HttpStatus.OK); |
| | | } |
| | | |
| | | /** |
| | | * 获取级联服务器信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取国标服务的配置") |
| | |
| | | |
| | | /** |
| | | * 分页查询级联平台 |
| | | * |
| | | * @param page 当前页 |
| | | * @param count 每页条数 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 添加上级平台信息 |
| | | * |
| | | * @param parentPlatform |
| | | * @return |
| | | */ |
| | |
| | | if (updateResult) { |
| | | // 保存时启用就发送注册 |
| | | if (parentPlatform.isEnable()) { |
| | | if (parentPlatformOld.isStatus()) { |
| | | if (parentPlatformOld != null && parentPlatformOld.isStatus()) { |
| | | commanderForPlatform.unregister(parentPlatformOld, null, eventResult -> { |
| | | // 只要保存就发送注册 |
| | | commanderForPlatform.register(parentPlatform, null, null); |
| | |
| | | |
| | | /** |
| | | * 保存上级平台信息 |
| | | * |
| | | * @param parentPlatform |
| | | * @return |
| | | */ |
| | |
| | | if (updateResult) { |
| | | // 保存时启用就发送注册 |
| | | if (parentPlatform.isEnable()) { |
| | | if (parentPlatformOld.isStatus()) { |
| | | if (parentPlatformOld != null && parentPlatformOld.isStatus()) { |
| | | commanderForPlatform.unregister(parentPlatformOld, null, null); |
| | | try { |
| | | Thread.sleep(500); |
| | |
| | | |
| | | /** |
| | | * 删除上级平台 |
| | | * |
| | | * @param serverGBId 上级平台国标ID |
| | | * @return |
| | | */ |
| | |
| | | boolean deleteResult = storager.deleteParentPlatform(parentPlatform); |
| | | storager.delCatalogByPlatformId(parentPlatform.getServerGBId()); |
| | | storager.delRelationByPlatformId(parentPlatform.getServerGBId()); |
| | | |
| | | |
| | | // 停止发送位置订阅定时任务 |
| | | String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_MobilePosition_" + parentPlatform.getServerGBId(); |
| | | dynamicTask.stop(key); |
| | | if (deleteResult) { |
| | | return new ResponseEntity<>("success", HttpStatus.OK); |
| | | }else { |
| | |
| | | |
| | | /** |
| | | * 查询上级平台是否存在 |
| | | * |
| | | * @param serverGBId 上级平台国标ID |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询级联平台的所有所有通道 |
| | | * |
| | | * @param page 当前页 |
| | | * @param count 每页条数 |
| | | * @param platformId 上级平台ID |
| | |
| | | |
| | | /** |
| | | * 向上级平台添加国标通道 |
| | | * |
| | | * @param param 通道关联参数 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 从上级平台移除国标通道 |
| | | * |
| | | * @param param 通道关联参数 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取目录 |
| | | * |
| | | * @param platformId 平台ID |
| | | * @param parentId 目录父ID |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 添加目录 |
| | | * |
| | | * @param platformCatalog 目录 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编辑目录 |
| | | * |
| | | * @param platformCatalog 目录 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除目录 |
| | | * |
| | | * @param id 目录Id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除关联 |
| | | * |
| | | * @param platformCatalog 关联的信息 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改默认目录 |
| | | * |
| | | * @param platformId 平台Id |
| | | * @param catalogId 目录Id |
| | | * @return |