src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
@@ -72,7 +72,6 @@ ResponseBody responseBody = response.body(); if (responseBody != null) { String responseStr = responseBody.string(); System.out.println(responseStr); responseJSON = JSON.parseObject(responseStr); } }else { src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.conf.MediaConfig; import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.UserSetup; import com.genersoft.iot.vmp.gb28181.bean.Device; @@ -278,6 +279,7 @@ @Override public MediaServerItem getDefaultMediaServer() { return mediaServerMapper.queryDefault(); } src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.MediaConfig; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.dto.MediaItem; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; @@ -26,6 +27,10 @@ @Autowired private IMediaServerService mediaServerService; @Autowired private MediaConfig mediaConfig; @Autowired private ZLMRESTfulUtils zlmresTfulUtils; @@ -39,15 +44,12 @@ @Override public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, String addr) { StreamInfo streamInfo = null; MediaServerItem mediaInfo; if (mediaServerId == null) { mediaInfo = mediaServerService.getDefaultMediaServer(); }else { mediaInfo = mediaServerService.getOne(mediaServerId); mediaServerId = mediaConfig.getId(); } MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId);; if (mediaInfo == null) { return streamInfo; return null; } JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream); if (mediaList != null) { src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
@@ -41,7 +41,11 @@ int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel); @Delete("<script> "+ "DELETE FROM platform_gb_channel WHERE deviceId='${deviceId}' " + "DELETE FROM platform_gb_channel WHERE deviceChannelId in " + "( select temp.deviceChannelId from " + "(select pgc.deviceChannelId from platform_gb_channel pgc " + "left join device_channel dc on dc.id = pgc.deviceChannelId where dc.deviceId =#{deviceId} " + ") temp)" + "</script>") int delChannelForDeviceId(String deviceId); @@ -50,8 +54,7 @@ "</script>") int cleanChannelForGB(String platformId); @Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " + "platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'") @Select("SELECT dc.* FROM platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId WHERE dc.channelId='${channelId}' and pgc.platformId='${platformId}'") DeviceChannel queryChannelInParentPlatform(String platformId, String channelId); @Select("select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " +