修复设备删除
parent
7400ace65d
commit
0cd86a79c2
|
@ -72,7 +72,6 @@ public class ZLMRESTfulUtils {
|
||||||
ResponseBody responseBody = response.body();
|
ResponseBody responseBody = response.body();
|
||||||
if (responseBody != null) {
|
if (responseBody != null) {
|
||||||
String responseStr = responseBody.string();
|
String responseStr = responseBody.string();
|
||||||
System.out.println(responseStr);
|
|
||||||
responseJSON = JSON.parseObject(responseStr);
|
responseJSON = JSON.parseObject(responseStr);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
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.SipConfig;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetup;
|
import com.genersoft.iot.vmp.conf.UserSetup;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
|
@ -278,6 +279,7 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MediaServerItem getDefaultMediaServer() {
|
public MediaServerItem getDefaultMediaServer() {
|
||||||
|
|
||||||
return mediaServerMapper.queryDefault();
|
return mediaServerMapper.queryDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
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.ZLMRESTfulUtils;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
|
@ -26,6 +27,10 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMediaServerService mediaServerService;
|
private IMediaServerService mediaServerService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MediaConfig mediaConfig;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ZLMRESTfulUtils zlmresTfulUtils;
|
private ZLMRESTfulUtils zlmresTfulUtils;
|
||||||
|
|
||||||
|
@ -39,15 +44,12 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
@Override
|
@Override
|
||||||
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, String addr) {
|
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, String addr) {
|
||||||
StreamInfo streamInfo = null;
|
StreamInfo streamInfo = null;
|
||||||
|
|
||||||
MediaServerItem mediaInfo;
|
|
||||||
if (mediaServerId == null) {
|
if (mediaServerId == null) {
|
||||||
mediaInfo = mediaServerService.getDefaultMediaServer();
|
mediaServerId = mediaConfig.getId();
|
||||||
}else {
|
|
||||||
mediaInfo = mediaServerService.getOne(mediaServerId);
|
|
||||||
}
|
}
|
||||||
|
MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId);;
|
||||||
if (mediaInfo == null) {
|
if (mediaInfo == null) {
|
||||||
return streamInfo;
|
return null;
|
||||||
}
|
}
|
||||||
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream);
|
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream);
|
||||||
if (mediaList != null) {
|
if (mediaList != null) {
|
||||||
|
|
|
@ -41,7 +41,11 @@ public interface PlatformChannelMapper {
|
||||||
int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel);
|
int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel);
|
||||||
|
|
||||||
@Delete("<script> "+
|
@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>")
|
"</script>")
|
||||||
int delChannelForDeviceId(String deviceId);
|
int delChannelForDeviceId(String deviceId);
|
||||||
|
|
||||||
|
@ -50,8 +54,7 @@ public interface PlatformChannelMapper {
|
||||||
"</script>")
|
"</script>")
|
||||||
int cleanChannelForGB(String platformId);
|
int cleanChannelForGB(String platformId);
|
||||||
|
|
||||||
@Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " +
|
@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}'")
|
||||||
"platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'")
|
|
||||||
DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
|
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 " +
|
@Select("select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " +
|
||||||
|
|
Loading…
Reference in New Issue