临时提交
parent
bb609b7e09
commit
b843958ed7
|
@ -184,7 +184,7 @@ public class DeviceChannel extends CommonGBChannel {
|
||||||
private String streamId;
|
private String streamId;
|
||||||
|
|
||||||
@Schema(description = "是否含有音频")
|
@Schema(description = "是否含有音频")
|
||||||
private Boolean hasAudio;
|
private boolean hasAudio;
|
||||||
|
|
||||||
@Schema(description = "GPS的更新时间")
|
@Schema(description = "GPS的更新时间")
|
||||||
private String gpsTime;
|
private String gpsTime;
|
||||||
|
|
|
@ -162,13 +162,11 @@ public interface DeviceChannelMapper {
|
||||||
" coalesce(dc.gb_svc_time_support_mode,dc.svc_time_support_mode) as svc_time_support_mode\n" +
|
" coalesce(dc.gb_svc_time_support_mode,dc.svc_time_support_mode) as svc_time_support_mode\n" +
|
||||||
" from " +
|
" from " +
|
||||||
" wvp_device_channel dc " +
|
" wvp_device_channel dc " +
|
||||||
" left join wvp_device d on d.id=dc.device_db_id" +
|
|
||||||
" WHERE " +
|
" WHERE " +
|
||||||
" d.device_id = #{deviceId} " +
|
" dc.device_db_id = #{deviceDbId} " +
|
||||||
" <if test='query != null'> AND (" +
|
" <if test='query != null'> AND (" +
|
||||||
"dc.device_id LIKE concat('%',#{query},'%') " +
|
"coalesce(dc.gb_device_id, dc.device_id) LIKE concat('%',#{query},'%') " +
|
||||||
"OR dc.name LIKE concat('%',#{query},'%') " +
|
"OR coalesce(dc.gb_name, dc.name) LIKE concat('%',#{query},'%') " +
|
||||||
"OR dc.custom_name LIKE concat('%',#{query},'%')" +
|
|
||||||
")</if> " +
|
")</if> " +
|
||||||
" <if test='parentChannelId != null'> AND (dc.parent_id=#{parentChannelId} OR dc.civil_code = #{parentChannelId}) </if> " +
|
" <if test='parentChannelId != null'> AND (dc.parent_id=#{parentChannelId} OR dc.civil_code = #{parentChannelId}) </if> " +
|
||||||
" <if test='online == true' > AND dc.status= true</if>" +
|
" <if test='online == true' > AND dc.status= true</if>" +
|
||||||
|
@ -180,7 +178,7 @@ public interface DeviceChannelMapper {
|
||||||
"</foreach> </if>" +
|
"</foreach> </if>" +
|
||||||
"ORDER BY dc.device_id " +
|
"ORDER BY dc.device_id " +
|
||||||
" </script>"})
|
" </script>"})
|
||||||
List<DeviceChannel> queryChannels(@Param("deviceId") String deviceId, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("channelIds") List<String> channelIds);
|
List<DeviceChannel> queryChannels(@Param("deviceDbId") int deviceDbId, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("channelIds") List<String> channelIds);
|
||||||
|
|
||||||
|
|
||||||
@Select("select\n" +
|
@Select("select\n" +
|
||||||
|
@ -607,7 +605,7 @@ public interface DeviceChannelMapper {
|
||||||
" coalesce(gb_business_group_id, business_group_id) as business_group_id,\n" +
|
" coalesce(gb_business_group_id, business_group_id) as business_group_id,\n" +
|
||||||
" coalesce(gb_download_speed, download_speed) as download_speed,\n" +
|
" coalesce(gb_download_speed, download_speed) as download_speed,\n" +
|
||||||
" coalesce(gb_svc_space_support_mod, svc_space_support_mod) as svc_space_support_mod,\n" +
|
" coalesce(gb_svc_space_support_mod, svc_space_support_mod) as svc_space_support_mod,\n" +
|
||||||
" coalesce(gb_svc_time_support_mode svc_time_support_mode) as svc_time_support_mode\n" +
|
" coalesce(gb_svc_time_support_mode, svc_time_support_mode) as svc_time_support_mode\n" +
|
||||||
"from wvp_device_channel " +
|
"from wvp_device_channel " +
|
||||||
"where device_db_id=#{deviceDbId}" +
|
"where device_db_id=#{deviceDbId}" +
|
||||||
" <if test='parentId != null and parentId != deviceId'> and parent_id = #{parentId} </if>" +
|
" <if test='parentId != null and parentId != deviceId'> and parent_id = #{parentId} </if>" +
|
||||||
|
@ -636,4 +634,103 @@ public interface DeviceChannelMapper {
|
||||||
"</script>"})
|
"</script>"})
|
||||||
void batchUpdatePosition(List<DeviceChannel> channelList);
|
void batchUpdatePosition(List<DeviceChannel> channelList);
|
||||||
|
|
||||||
|
@Select(value = {" <script>" +
|
||||||
|
"SELECT " +
|
||||||
|
" id,\n" +
|
||||||
|
" device_db_id,\n" +
|
||||||
|
" create_time,\n" +
|
||||||
|
" update_time,\n" +
|
||||||
|
" sub_count,\n" +
|
||||||
|
" stream_id,\n" +
|
||||||
|
" has_audio,\n" +
|
||||||
|
" gps_time,\n" +
|
||||||
|
" stream_identification,\n" +
|
||||||
|
" coalesce(gb_device_id, device_id) as device_id,\n" +
|
||||||
|
" coalesce(gb_name, name) as name,\n" +
|
||||||
|
" coalesce(gb_manufacturer, manufacturer) as manufacturer,\n" +
|
||||||
|
" coalesce(gb_model, model) as model,\n" +
|
||||||
|
" coalesce(gb_owner, owner) as owner,\n" +
|
||||||
|
" coalesce(gb_civil_code, civil_code) as civil_code,\n" +
|
||||||
|
" coalesce(gb_block, block) as block,\n" +
|
||||||
|
" coalesce(gb_address, address) as address,\n" +
|
||||||
|
" coalesce(gb_parental, parental) as parental,\n" +
|
||||||
|
" coalesce(gb_parent_id, parent_id) as parent_id,\n" +
|
||||||
|
" coalesce(gb_safety_way, safety_way) as safety_way,\n" +
|
||||||
|
" coalesce(gb_register_way, register_way) as register_way,\n" +
|
||||||
|
" coalesce(gb_cert_num, cert_num) as cert_num,\n" +
|
||||||
|
" coalesce(gb_certifiable, certifiable) as certifiable,\n" +
|
||||||
|
" coalesce(gb_err_code, err_code) as err_code,\n" +
|
||||||
|
" coalesce(gb_end_time, end_time) as end_time,\n" +
|
||||||
|
" coalesce(gb_secrecy, secrecy) as secrecy,\n" +
|
||||||
|
" coalesce(gb_ip_address, ip_address) as ip_address,\n" +
|
||||||
|
" coalesce(gb_port, port) as port,\n" +
|
||||||
|
" coalesce(gb_password, password) as password,\n" +
|
||||||
|
" coalesce(gb_status, status) as status,\n" +
|
||||||
|
" coalesce(gb_longitude, longitude) as longitude,\n" +
|
||||||
|
" coalesce(gb_latitude, latitude) as latitude,\n" +
|
||||||
|
" coalesce(gb_ptz_type, ptz_type) as ptz_type,\n" +
|
||||||
|
" coalesce(gb_position_type, position_type) as position_type,\n" +
|
||||||
|
" coalesce(gb_room_type, room_type) as room_type,\n" +
|
||||||
|
" coalesce(gb_use_type, use_type) as use_type,\n" +
|
||||||
|
" coalesce(gb_supply_light_type, supply_light_type) as supply_light_type,\n" +
|
||||||
|
" coalesce(gb_direction_type, direction_type) as direction_type,\n" +
|
||||||
|
" coalesce(gb_resolution, resolution) as resolution,\n" +
|
||||||
|
" coalesce(gb_business_group_id, business_group_id) as business_group_id,\n" +
|
||||||
|
" coalesce(gb_download_speed, download_speed) as download_speed,\n" +
|
||||||
|
" coalesce(gb_svc_space_support_mod, svc_space_support_mod) as svc_space_support_mod,\n" +
|
||||||
|
" coalesce(gb_svc_time_support_mode, svc_time_support_mode) as svc_time_support_mode\n" +
|
||||||
|
"from wvp_device_channel " +
|
||||||
|
"where id=#{id}" +
|
||||||
|
" </script>"})
|
||||||
|
DeviceChannel getOne(@Param("id") int id);
|
||||||
|
|
||||||
|
@Select(value = {" <script>" +
|
||||||
|
"SELECT " +
|
||||||
|
" id,\n" +
|
||||||
|
" device_db_id,\n" +
|
||||||
|
" create_time,\n" +
|
||||||
|
" update_time,\n" +
|
||||||
|
" sub_count,\n" +
|
||||||
|
" stream_id,\n" +
|
||||||
|
" has_audio,\n" +
|
||||||
|
" gps_time,\n" +
|
||||||
|
" stream_identification,\n" +
|
||||||
|
" coalesce(gb_device_id, device_id) as device_id,\n" +
|
||||||
|
" coalesce(gb_name, name) as name,\n" +
|
||||||
|
" coalesce(gb_manufacturer, manufacturer) as manufacturer,\n" +
|
||||||
|
" coalesce(gb_model, model) as model,\n" +
|
||||||
|
" coalesce(gb_owner, owner) as owner,\n" +
|
||||||
|
" coalesce(gb_civil_code, civil_code) as civil_code,\n" +
|
||||||
|
" coalesce(gb_block, block) as block,\n" +
|
||||||
|
" coalesce(gb_address, address) as address,\n" +
|
||||||
|
" coalesce(gb_parental, parental) as parental,\n" +
|
||||||
|
" coalesce(gb_parent_id, parent_id) as parent_id,\n" +
|
||||||
|
" coalesce(gb_safety_way, safety_way) as safety_way,\n" +
|
||||||
|
" coalesce(gb_register_way, register_way) as register_way,\n" +
|
||||||
|
" coalesce(gb_cert_num, cert_num) as cert_num,\n" +
|
||||||
|
" coalesce(gb_certifiable, certifiable) as certifiable,\n" +
|
||||||
|
" coalesce(gb_err_code, err_code) as err_code,\n" +
|
||||||
|
" coalesce(gb_end_time, end_time) as end_time,\n" +
|
||||||
|
" coalesce(gb_secrecy, secrecy) as secrecy,\n" +
|
||||||
|
" coalesce(gb_ip_address, ip_address) as ip_address,\n" +
|
||||||
|
" coalesce(gb_port, port) as port,\n" +
|
||||||
|
" coalesce(gb_password, password) as password,\n" +
|
||||||
|
" coalesce(gb_status, status) as status,\n" +
|
||||||
|
" coalesce(gb_longitude, longitude) as longitude,\n" +
|
||||||
|
" coalesce(gb_latitude, latitude) as latitude,\n" +
|
||||||
|
" coalesce(gb_ptz_type, ptz_type) as ptz_type,\n" +
|
||||||
|
" coalesce(gb_position_type, position_type) as position_type,\n" +
|
||||||
|
" coalesce(gb_room_type, room_type) as room_type,\n" +
|
||||||
|
" coalesce(gb_use_type, use_type) as use_type,\n" +
|
||||||
|
" coalesce(gb_supply_light_type, supply_light_type) as supply_light_type,\n" +
|
||||||
|
" coalesce(gb_direction_type, direction_type) as direction_type,\n" +
|
||||||
|
" coalesce(gb_resolution, resolution) as resolution,\n" +
|
||||||
|
" coalesce(gb_business_group_id, business_group_id) as business_group_id,\n" +
|
||||||
|
" coalesce(gb_download_speed, download_speed) as download_speed,\n" +
|
||||||
|
" coalesce(gb_svc_space_support_mod, svc_space_support_mod) as svc_space_support_mod,\n" +
|
||||||
|
" coalesce(gb_svc_time_support_mode, svc_time_support_mode) as svc_time_support_mode\n" +
|
||||||
|
"from wvp_device_channel " +
|
||||||
|
"where device_db_id=#{deviceDbId} and coalesce(gb_device_id, device_id) = #{channelId}" +
|
||||||
|
" </script>"})
|
||||||
|
DeviceChannel getOneByDeviceId(@Param("deviceDbId") int deviceDbId, @Param("channelId") String channelId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.dao;
|
package com.genersoft.iot.vmp.gb28181.dao;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.apache.ibatis.annotations.*;
|
import org.apache.ibatis.annotations.*;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
@ -300,4 +301,45 @@ public interface DeviceMapper {
|
||||||
|
|
||||||
@Select("select * FROM wvp_device where as_message_channel = true")
|
@Select("select * FROM wvp_device where as_message_channel = true")
|
||||||
List<Device> queryDeviceWithAsMessageChannel();
|
List<Device> queryDeviceWithAsMessageChannel();
|
||||||
|
|
||||||
|
@Select(" <script>" +
|
||||||
|
"SELECT " +
|
||||||
|
"id, " +
|
||||||
|
"device_id, " +
|
||||||
|
"coalesce(custom_name, name) as name, " +
|
||||||
|
"password, " +
|
||||||
|
"manufacturer, " +
|
||||||
|
"model, " +
|
||||||
|
"firmware, " +
|
||||||
|
"transport," +
|
||||||
|
"stream_mode," +
|
||||||
|
"ip,"+
|
||||||
|
"sdp_ip,"+
|
||||||
|
"local_ip,"+
|
||||||
|
"port,"+
|
||||||
|
"host_address,"+
|
||||||
|
"expires,"+
|
||||||
|
"register_time,"+
|
||||||
|
"keepalive_time,"+
|
||||||
|
"create_time,"+
|
||||||
|
"update_time,"+
|
||||||
|
"charset,"+
|
||||||
|
"subscribe_cycle_for_catalog,"+
|
||||||
|
"subscribe_cycle_for_mobile_position,"+
|
||||||
|
"mobile_position_submission_interval,"+
|
||||||
|
"subscribe_cycle_for_alarm,"+
|
||||||
|
"ssrc_check,"+
|
||||||
|
"as_message_channel,"+
|
||||||
|
"broadcast_push_after_ack,"+
|
||||||
|
"geo_coord_sys,"+
|
||||||
|
"on_line,"+
|
||||||
|
"media_server_id,"+
|
||||||
|
"(SELECT count(0) FROM wvp_device_channel dc WHERE dc.device_db_id= de.id) as channel_count " +
|
||||||
|
" FROM wvp_device de" +
|
||||||
|
" where 1 = 1 "+
|
||||||
|
" <if test='status != null'> AND de.on_line=${status}</if>"+
|
||||||
|
" <if test='query != null'> AND coalesce(custom_name, name) as name LIKE '%${query}%'</if> " +
|
||||||
|
" order by create_time desc "+
|
||||||
|
" </script>")
|
||||||
|
List<Device> getDeviceList(@Param("query") String query, @Param("status") Boolean status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -491,7 +491,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
String stream = device.getDeviceId() + "_" + channelId + "_" + startTimeStr + "_" + endTimeStr;
|
String stream = device.getDeviceId() + "_" + channelId + "_" + startTimeStr + "_" + endTimeStr;
|
||||||
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, stream, null,
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, stream, null,
|
||||||
device.isSsrcCheck(), true, 0,false,!channel.getHasAudio(), false, tcpMode);
|
device.isSsrcCheck(), true, 0,false,!channel.isHasAudio(), false, tcpMode);
|
||||||
sendRtpItem.setStream(stream);
|
sendRtpItem.setStream(stream);
|
||||||
// 写入redis, 超时时回复
|
// 写入redis, 超时时回复
|
||||||
redisCatchStorage.updateSendRTPSever(sendRtpItem);
|
redisCatchStorage.updateSendRTPSever(sendRtpItem);
|
||||||
|
@ -522,7 +522,8 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
|
|
||||||
sendRtpItem.setPlayType(InviteStreamType.DOWNLOAD);
|
sendRtpItem.setPlayType(InviteStreamType.DOWNLOAD);
|
||||||
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, null, null, device.isSsrcCheck(), true, 0, false,!channel.getHasAudio(), false, tcpMode);
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, null, null,
|
||||||
|
device.isSsrcCheck(), true, 0, false,!channel.isHasAudio(), false, tcpMode);
|
||||||
sendRtpItem.setStream(ssrcInfo.getStream());
|
sendRtpItem.setStream(ssrcInfo.getStream());
|
||||||
// 写入redis, 超时时回复
|
// 写入redis, 超时时回复
|
||||||
redisCatchStorage.updateSendRTPSever(sendRtpItem);
|
redisCatchStorage.updateSendRTPSever(sendRtpItem);
|
||||||
|
|
|
@ -182,7 +182,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||||
log.info("[增加通道] 已存在,不发送通知只更新,设备: {}, 通道 {}", device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId());
|
log.info("[增加通道] 已存在,不发送通知只更新,设备: {}, 通道 {}", device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId());
|
||||||
DeviceChannel channel = catalogChannelEvent.getChannel();
|
DeviceChannel channel = catalogChannelEvent.getChannel();
|
||||||
channel.setId(deviceChannel.getId());
|
channel.setId(deviceChannel.getId());
|
||||||
channel.setHasAudio(deviceChannel.getHasAudio());
|
channel.setHasAudio(deviceChannel.isHasAudio());
|
||||||
channel.setUpdateTime(DateUtil.getNow());
|
channel.setUpdateTime(DateUtil.getNow());
|
||||||
updateChannelMap.put(catalogChannelEvent.getChannel().getDeviceId(), channel);
|
updateChannelMap.put(catalogChannelEvent.getChannel().getDeviceId(), channel);
|
||||||
} else {
|
} else {
|
||||||
|
@ -211,7 +211,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||||
if (deviceChannelForUpdate != null) {
|
if (deviceChannelForUpdate != null) {
|
||||||
DeviceChannel channel = catalogChannelEvent.getChannel();
|
DeviceChannel channel = catalogChannelEvent.getChannel();
|
||||||
channel.setId(deviceChannelForUpdate.getId());
|
channel.setId(deviceChannelForUpdate.getId());
|
||||||
channel.setHasAudio(deviceChannelForUpdate.getHasAudio());
|
channel.setHasAudio(deviceChannelForUpdate.isHasAudio());
|
||||||
channel.setUpdateTime(DateUtil.getNow());
|
channel.setUpdateTime(DateUtil.getNow());
|
||||||
updateChannelMap.put(catalogChannelEvent.getChannel().getDeviceId(), channel);
|
updateChannelMap.put(catalogChannelEvent.getChannel().getDeviceId(), channel);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
|
import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
|
@ -49,7 +50,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I
|
||||||
private IInviteStreamService inviteStreamService;
|
private IInviteStreamService inviteStreamService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SIPCommander cmder;
|
private SIPCommander cmder;
|
||||||
|
@ -113,7 +114,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I
|
||||||
responseAck(request, Response.NOT_FOUND, "stream " + streamId + " not found");
|
responseAck(request, Response.NOT_FOUND, "stream " + streamId + " not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Device device1 = storager.queryVideoDevice(inviteInfo.getDeviceId());
|
Device device1 = deviceService.getDevice(inviteInfo.getDeviceId());
|
||||||
if (inviteInfo.getStreamInfo() != null) {
|
if (inviteInfo.getStreamInfo() != null) {
|
||||||
cmder.playbackControlCmd(device1,inviteInfo.getStreamInfo(),new String(evt.getRequest().getRawContent()),eventResult -> {
|
cmder.playbackControlCmd(device1,inviteInfo.getStreamInfo(),new String(evt.getRequest().getRawContent()),eventResult -> {
|
||||||
// 失败的回复
|
// 失败的回复
|
||||||
|
|
|
@ -5,6 +5,8 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||||
|
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -40,6 +42,8 @@ public interface IDeviceChannelService {
|
||||||
*/
|
*/
|
||||||
List<ChannelReduce> queryAllChannelList(String platformId);
|
List<ChannelReduce> queryAllChannelList(String platformId);
|
||||||
|
|
||||||
|
PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online, Boolean channelType, String platformId, String catalogId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询通道所属的设备
|
* 查询通道所属的设备
|
||||||
*/
|
*/
|
||||||
|
@ -103,5 +107,12 @@ public interface IDeviceChannelService {
|
||||||
|
|
||||||
boolean resetChannels(String deviceId, List<DeviceChannel> deviceChannels);
|
boolean resetChannels(String deviceId, List<DeviceChannel> deviceChannels);
|
||||||
|
|
||||||
|
PageInfo<DeviceChannel> getSubChannels(int deviceDbId, String channelId, String query, Boolean channelType, Boolean online, int page, int count);
|
||||||
|
|
||||||
|
List<DeviceChannelExtend> queryChannelExtendsByDeviceId(String deviceId, List<String> channelIds, Boolean online);
|
||||||
|
|
||||||
|
PageInfo<DeviceChannel> queryChannelsByDeviceId(String deviceId, String query, Boolean channelType, Boolean online, int page, int count);
|
||||||
|
|
||||||
|
|
||||||
|
List<Device> queryDeviceWithAsMessageChannel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
|
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
|
import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -88,6 +89,8 @@ public interface IDeviceService {
|
||||||
*/
|
*/
|
||||||
List<Device> getAllOnlineDevice();
|
List<Device> getAllOnlineDevice();
|
||||||
|
|
||||||
|
List<Device> getAllByStatus(boolean status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否注册已经失效
|
* 判断是否注册已经失效
|
||||||
* @param device 设备信息
|
* @param device 设备信息
|
||||||
|
@ -159,4 +162,6 @@ public interface IDeviceService {
|
||||||
* 获取所有设备
|
* 获取所有设备
|
||||||
*/
|
*/
|
||||||
List<Device> getAll();
|
List<Device> getAll();
|
||||||
|
|
||||||
|
PageInfo<Device> getAll(int page, int count, String query, Boolean status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,9 @@ import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||||
|
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -74,7 +77,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
}
|
}
|
||||||
String now = DateUtil.getNow();
|
String now = DateUtil.getNow();
|
||||||
channel.setUpdateTime(now);
|
channel.setUpdateTime(now);
|
||||||
DeviceChannel deviceChannel = channelMapper.queryChannel(deviceId, channelId);
|
DeviceChannel deviceChannel = getOne(deviceId, channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
channel.setCreateTime(now);
|
channel.setCreateTime(now);
|
||||||
channelMapper.add(channel);
|
channelMapper.add(channel);
|
||||||
|
@ -170,6 +173,13 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
return channelMapper.queryChannelListInAll(null, null, null, platformId, null);
|
return channelMapper.queryChannelListInAll(null, null, null, platformId, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online, Boolean channelType, String platformId, String catalogId) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
List<ChannelReduce> all = channelMapper.queryChannelListInAll(query, online, channelType, platformId, catalogId);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Device> getDeviceByChannelId(String channelId) {
|
public List<Device> getDeviceByChannelId(String channelId) {
|
||||||
|
|
||||||
|
@ -209,7 +219,11 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeviceChannel getOne(String deviceId, String channelId){
|
public DeviceChannel getOne(String deviceId, String channelId){
|
||||||
return channelMapper.queryChannel(deviceId, channelId);
|
Device device = deviceMapper.getDeviceByDeviceId(deviceId);
|
||||||
|
if (device == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId);
|
||||||
|
}
|
||||||
|
return channelMapper.getOneByDeviceId(device.getId(), channelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -424,7 +438,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
DeviceChannel channelInDb = allChannelMap.get(deviceChannel.getDeviceDbId() + deviceChannel.getDeviceId());
|
DeviceChannel channelInDb = allChannelMap.get(deviceChannel.getDeviceDbId() + deviceChannel.getDeviceId());
|
||||||
if (channelInDb != null) {
|
if (channelInDb != null) {
|
||||||
deviceChannel.setStreamId(channelInDb.getStreamId());
|
deviceChannel.setStreamId(channelInDb.getStreamId());
|
||||||
deviceChannel.setHasAudio(channelInDb.getHasAudio());
|
deviceChannel.setHasAudio(channelInDb.isHasAudio());
|
||||||
deviceChannel.setId(channelInDb.getId());
|
deviceChannel.setId(channelInDb.getId());
|
||||||
if (channelInDb.getStatus().equalsIgnoreCase(deviceChannel.getStatus())){
|
if (channelInDb.getStatus().equalsIgnoreCase(deviceChannel.getStatus())){
|
||||||
List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getDeviceId());
|
List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getDeviceId());
|
||||||
|
@ -518,4 +532,33 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<DeviceChannel> getSubChannels(int deviceDbId, String channelId, String query, Boolean channelType, Boolean online, int page, int count) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
List<DeviceChannel> all = channelMapper.queryChannels(deviceDbId, channelId, query, channelType, online,null);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceChannelExtend> queryChannelExtendsByDeviceId(String deviceId, List<String> channelIds, Boolean online) {
|
||||||
|
return channelMapper.queryChannelsWithDeviceInfo(deviceId, null,null, null, online,channelIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count) {
|
||||||
|
Device device = deviceMapper.getDeviceByDeviceId(deviceId);
|
||||||
|
if (device == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId);
|
||||||
|
}
|
||||||
|
// 获取到所有正在播放的流
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
List<DeviceChannel> all = channelMapper.queryChannels(device.getId(), null, query, hasSubChannel, online,null);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Device> queryDeviceWithAsMessageChannel() {
|
||||||
|
return deviceMapper.queryDeviceWithAsMessageChannel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,9 @@ import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
|
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
|
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
|
||||||
|
@ -21,12 +24,11 @@ import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
||||||
import com.genersoft.iot.vmp.service.IDeviceService;
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
|
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||||
|
@ -39,7 +41,6 @@ import javax.sip.InvalidArgumentException;
|
||||||
import javax.sip.SipException;
|
import javax.sip.SipException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -366,6 +367,11 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||||
return deviceMapper.getOnlineDevices();
|
return deviceMapper.getOnlineDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Device> getAllByStatus(boolean status) {
|
||||||
|
return deviceMapper.getDevices(status);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean expire(Device device) {
|
public boolean expire(Device device) {
|
||||||
Instant registerTimeDate = Instant.from(DateUtil.formatter.parse(device.getRegisterTime()));
|
Instant registerTimeDate = Instant.from(DateUtil.formatter.parse(device.getRegisterTime()));
|
||||||
|
@ -568,5 +574,10 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||||
return deviceMapper.getAll();
|
return deviceMapper.getAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<Device> getAll(int page, int count, String query, Boolean status) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
List<Device> all = deviceMapper.getDeviceList(query, status);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,9 +170,9 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
|
|
||||||
String deviceId = ssrcTransactionForAll.get(0).getDeviceId();
|
String deviceId = ssrcTransactionForAll.get(0).getDeviceId();
|
||||||
String channelId = ssrcTransactionForAll.get(0).getChannelId();
|
String channelId = ssrcTransactionForAll.get(0).getChannelId();
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId);
|
DeviceChannel deviceChannel = deviceChannelService.getOne(deviceId, channelId);
|
||||||
if (deviceChannel != null) {
|
if (deviceChannel != null) {
|
||||||
result.setEnable_audio(deviceChannel.getHasAudio());
|
result.setEnable_audio(deviceChannel.isHasAudio());
|
||||||
}
|
}
|
||||||
// 如果是录像下载就设置视频间隔十秒
|
// 如果是录像下载就设置视频间隔十秒
|
||||||
if (ssrcTransactionForAll.get(0).getType() == InviteSessionType.DOWNLOAD) {
|
if (ssrcTransactionForAll.get(0).getType() == InviteSessionType.DOWNLOAD) {
|
||||||
|
|
|
@ -124,11 +124,11 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
|
|
||||||
private List<CommonGBChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
private List<CommonGBChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
||||||
List<CommonGBChannel> deviceChannelList = new ArrayList<>();
|
List<CommonGBChannel> deviceChannelList = new ArrayList<>();
|
||||||
if (channelReduces.size() > 0){
|
if (!channelReduces.isEmpty()){
|
||||||
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
|
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
|
||||||
if (catalog == null && catalogId.equals(platform.getDeviceGBId())) {
|
if (catalog == null && catalogId.equals(platform.getDeviceGBId())) {
|
||||||
for (ChannelReduce channelReduce : channelReduces) {
|
for (ChannelReduce channelReduce : channelReduces) {
|
||||||
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
|
DeviceChannel deviceChannel = deviceChannelMapper.getOne(channelReduce.getId());
|
||||||
deviceChannel.setParental(0);
|
deviceChannel.setParental(0);
|
||||||
deviceChannel.setCivilCode(platform.getServerGBDomain());
|
deviceChannel.setCivilCode(platform.getServerGBDomain());
|
||||||
deviceChannelList.add(deviceChannel);
|
deviceChannelList.add(deviceChannel);
|
||||||
|
@ -139,7 +139,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (ChannelReduce channelReduce : channelReduces) {
|
for (ChannelReduce channelReduce : channelReduces) {
|
||||||
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
|
DeviceChannel deviceChannel = deviceChannelMapper.getOne(channelReduce.getId());
|
||||||
deviceChannel.setParental(0);
|
deviceChannel.setParental(0);
|
||||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
deviceChannel.setCivilCode(catalog.getCivilCode());
|
||||||
deviceChannel.setParentId(catalog.getParentId());
|
deviceChannel.setParentId(catalog.getParentId());
|
||||||
|
|
|
@ -234,7 +234,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (device == null || !device.isOnLine()) {
|
if (device == null || !device.isOnLine()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId);
|
DeviceChannel deviceChannel = channelService.getOne(deviceId, channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
|
|
||||||
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(event.getMediaServer(), event.getStream(), null,
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(event.getMediaServer(), event.getStream(), null,
|
||||||
device.isSsrcCheck(), true, 0, false, !deviceChannel.getHasAudio(), false, tcpMode);
|
device.isSsrcCheck(), true, 0, false, !deviceChannel.isHasAudio(), false, tcpMode);
|
||||||
playBack(event.getMediaServer(), ssrcInfo, deviceId, channelId, startTime, endTime, null);
|
playBack(event.getMediaServer(), ssrcInfo, deviceId, channelId, startTime, endTime, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
}
|
}
|
||||||
String streamId = String.format("%s_%s", device.getDeviceId(), channelId);
|
String streamId = String.format("%s_%s", device.getDeviceId(), channelId);
|
||||||
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, ssrc, device.isSsrcCheck(), false, 0, false, !channel.getHasAudio(), false, tcpMode);
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, ssrc, device.isSsrcCheck(), false, 0, false, !channel.isHasAudio(), false, tcpMode);
|
||||||
if (ssrcInfo == null) {
|
if (ssrcInfo == null) {
|
||||||
callback.run(InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(), InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getMsg(), null);
|
callback.run(InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(), InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getMsg(), null);
|
||||||
inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channelId, null,
|
inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channelId, null,
|
||||||
|
@ -695,7 +695,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
Device device = redisCatchStorage.getDevice(deviceId);
|
Device device = redisCatchStorage.getDevice(deviceId);
|
||||||
streamInfo = onPublishHandler(mediaServerItem, mediaInfo, deviceId, channelId);
|
streamInfo = onPublishHandler(mediaServerItem, mediaInfo, deviceId, channelId);
|
||||||
if (streamInfo != null) {
|
if (streamInfo != null) {
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId);
|
DeviceChannel deviceChannel = channelService.getOne(deviceId, channelId);
|
||||||
if (deviceChannel != null) {
|
if (deviceChannel != null) {
|
||||||
deviceChannel.setStreamId(streamInfo.getStream());
|
deviceChannel.setStreamId(streamInfo.getStream());
|
||||||
channelService.startPlay(deviceId, channelId, streamInfo.getStream());
|
channelService.startPlay(deviceId, channelId, streamInfo.getStream());
|
||||||
|
@ -716,7 +716,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (streamInfo != null) {
|
if (streamInfo != null) {
|
||||||
streamInfo.setStartTime(startTime);
|
streamInfo.setStartTime(startTime);
|
||||||
streamInfo.setEndTime(endTime);
|
streamInfo.setEndTime(endTime);
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId);
|
DeviceChannel deviceChannel = channelService.getOne(deviceId, channelId);
|
||||||
if (deviceChannel != null) {
|
if (deviceChannel != null) {
|
||||||
deviceChannel.setStreamId(streamInfo.getStream());
|
deviceChannel.setStreamId(streamInfo.getStream());
|
||||||
channelService.startPlay(deviceId, channelId, streamInfo.getStream());
|
channelService.startPlay(deviceId, channelId, streamInfo.getStream());
|
||||||
|
@ -753,7 +753,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
@Override
|
@Override
|
||||||
public void playBack(String deviceId, String channelId, String startTime,
|
public void playBack(String deviceId, String channelId, String startTime,
|
||||||
String endTime, ErrorCallback<Object> callback) {
|
String endTime, ErrorCallback<Object> callback) {
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
log.warn("[录像回放] 未找到设备 deviceId: {},channelId:{}", deviceId, channelId);
|
log.warn("[录像回放] 未找到设备 deviceId: {},channelId:{}", deviceId, channelId);
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId);
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId);
|
||||||
|
@ -778,7 +778,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
.replace(" ", "");
|
.replace(" ", "");
|
||||||
String stream = deviceId + "_" + channelId + "_" + startTimeStr + "_" + endTimeTimeStr;
|
String stream = deviceId + "_" + channelId + "_" + startTimeStr + "_" + endTimeTimeStr;
|
||||||
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false, !channel.getHasAudio(), false, tcpMode);
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false, !channel.isHasAudio(), false, tcpMode);
|
||||||
playBack(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, callback);
|
playBack(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -793,7 +793,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "设备: " + deviceId + "不存在");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "设备: " + deviceId + "不存在");
|
||||||
}
|
}
|
||||||
|
@ -959,7 +959,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void download(String deviceId, String channelId, String startTime, String endTime, int downloadSpeed, ErrorCallback<Object> callback) {
|
public void download(String deviceId, String channelId, String startTime, String endTime, int downloadSpeed, ErrorCallback<Object> callback) {
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -976,7 +976,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
}
|
}
|
||||||
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
int tcpMode = device.getStreamMode().equals("TCP-ACTIVE")? 2: (device.getStreamMode().equals("TCP-PASSIVE")? 1:0);
|
||||||
// 录像下载不使用固定流地址,固定流地址会导致如果开始时间与结束时间一致时文件错误的叠加在一起
|
// 录像下载不使用固定流地址,固定流地址会导致如果开始时间与结束时间一致时文件错误的叠加在一起
|
||||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, null, null, device.isSsrcCheck(), true, 0, false,!channel.getHasAudio(), false, tcpMode);
|
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, null, null, device.isSsrcCheck(), true, 0, false,!channel.isHasAudio(), false, tcpMode);
|
||||||
download(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, downloadSpeed, callback);
|
download(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, downloadSpeed, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,7 +989,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
null);
|
null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
callback.run(InviteErrorCode.ERROR_FOR_PARAMETER_ERROR.getCode(),
|
callback.run(InviteErrorCode.ERROR_FOR_PARAMETER_ERROR.getCode(),
|
||||||
"设备:" + deviceId + "不存在",
|
"设备:" + deviceId + "不存在",
|
||||||
|
@ -1198,7 +1198,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
log.info("[语音喊话] device: {}, channel: {}", device.getDeviceId(), channelId);
|
log.info("[语音喊话] device: {}, channel: {}", device.getDeviceId(), channelId);
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(device.getDeviceId(), channelId);
|
DeviceChannel deviceChannel = channelService.getOne(device.getDeviceId(), channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
log.warn("开启语音广播的时候未找到通道: {}", channelId);
|
log.warn("开启语音广播的时候未找到通道: {}", channelId);
|
||||||
return null;
|
return null;
|
||||||
|
@ -1223,7 +1223,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
log.info("[语音喊话] device: {}, channel: {}", device.getDeviceId(), channelId);
|
log.info("[语音喊话] device: {}, channel: {}", device.getDeviceId(), channelId);
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(device.getDeviceId(), channelId);
|
DeviceChannel deviceChannel = channelService.getOne(device.getDeviceId(), channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
log.warn("开启语音广播的时候未找到通道: {}", channelId);
|
log.warn("开启语音广播的时候未找到通道: {}", channelId);
|
||||||
event.call("开启语音广播的时候未找到通道");
|
event.call("开启语音广播的时候未找到通道");
|
||||||
|
@ -1396,7 +1396,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new ServiceException("暂停RTP接收失败");
|
throw new ServiceException("暂停RTP接收失败");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(inviteInfo.getDeviceId());
|
Device device = deviceService.getDevice(inviteInfo.getDeviceId());
|
||||||
cmder.playPauseCmd(device, inviteInfo.getStreamInfo());
|
cmder.playPauseCmd(device, inviteInfo.getStreamInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1424,7 +1424,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new ServiceException("继续RTP接收失败");
|
throw new ServiceException("继续RTP接收失败");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(inviteInfo.getDeviceId());
|
Device device = deviceService.getDevice(inviteInfo.getDeviceId());
|
||||||
cmder.playResumeCmd(device, inviteInfo.getStreamInfo());
|
cmder.playResumeCmd(device, inviteInfo.getStreamInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1486,7 +1486,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
}
|
}
|
||||||
// TODO 必须多端口模式才支持语音喊话鹤语音对讲
|
// TODO 必须多端口模式才支持语音喊话鹤语音对讲
|
||||||
log.info("[语音对讲] device: {}, channel: {}", device.getDeviceId(), channelId);
|
log.info("[语音对讲] device: {}, channel: {}", device.getDeviceId(), channelId);
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(device.getDeviceId(), channelId);
|
DeviceChannel deviceChannel = channelService.getOne(device.getDeviceId(), channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
log.warn("开启语音对讲的时候未找到通道: {}", channelId);
|
log.warn("开启语音对讲的时候未找到通道: {}", channelId);
|
||||||
event.call("开启语音对讲的时候未找到通道");
|
event.call("开启语音对讲的时候未找到通道");
|
||||||
|
|
|
@ -8,6 +8,8 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -36,6 +38,12 @@ public class RedisAlarmMsgListener implements MessageListener {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISIPCommanderForPlatform commanderForPlatform;
|
private ISIPCommanderForPlatform commanderForPlatform;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceChannelService channelService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IVideoManagerStorage storage;
|
||||||
|
|
||||||
|
@ -108,7 +116,7 @@ public class RedisAlarmMsgListener implements MessageListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
// 获取开启了消息推送的设备和平台
|
// 获取开启了消息推送的设备和平台
|
||||||
List<Device> devices = storage.queryDeviceWithAsMessageChannel();
|
List<Device> devices = channelService.queryDeviceWithAsMessageChannel();
|
||||||
if (devices.size() > 0) {
|
if (devices.size() > 0) {
|
||||||
for (Device device : devices) {
|
for (Device device : devices) {
|
||||||
try {
|
try {
|
||||||
|
@ -121,7 +129,7 @@ public class RedisAlarmMsgListener implements MessageListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
Device device = storage.queryVideoDevice(gbId);
|
Device device = deviceService.getDevice(gbId);
|
||||||
ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId);
|
ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId);
|
||||||
if (device != null && platform == null) {
|
if (device != null && platform == null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -4,8 +4,6 @@ import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||||
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
||||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||||
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -17,66 +15,6 @@ import java.util.List;
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public interface IVideoManagerStorage {
|
public interface IVideoManagerStorage {
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据设备ID判断设备是否存在
|
|
||||||
*
|
|
||||||
* @param deviceId 设备ID
|
|
||||||
* @return true:存在 false:不存在
|
|
||||||
*/
|
|
||||||
public boolean exists(String deviceId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取设备
|
|
||||||
*
|
|
||||||
* @param deviceId 设备ID
|
|
||||||
* @return DShadow 设备对象
|
|
||||||
*/
|
|
||||||
public Device queryVideoDevice(String deviceId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取某个设备的通道列表
|
|
||||||
*
|
|
||||||
* @param deviceId 设备ID
|
|
||||||
* @param page 分页 当前页
|
|
||||||
* @param count 每页数量
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public PageInfo<DeviceChannel> queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取某个设备的通道
|
|
||||||
* @param deviceId 设备ID
|
|
||||||
* @param channelId 通道ID
|
|
||||||
*/
|
|
||||||
public DeviceChannel queryChannel(String deviceId, String channelId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取多个设备
|
|
||||||
* @param page 当前页数
|
|
||||||
* @param count 每页数量
|
|
||||||
* @return List<Device> 设备对象数组
|
|
||||||
*/
|
|
||||||
public PageInfo<Device> queryVideoDeviceList(int page, int count,Boolean online);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取多个设备
|
|
||||||
*
|
|
||||||
* @return List<Device> 设备对象数组
|
|
||||||
*/
|
|
||||||
public List<Device> queryVideoDeviceList(Boolean online);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询子设备
|
|
||||||
*
|
|
||||||
* @param deviceId
|
|
||||||
* @param channelId
|
|
||||||
* @param page
|
|
||||||
* @param count
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
PageInfo querySubChannels(String deviceId, String channelId, String query, Boolean hasSubChannel, Boolean online, int page, int count);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新上级平台
|
* 更新上级平台
|
||||||
|
@ -103,12 +41,6 @@ public interface IVideoManagerStorage {
|
||||||
*/
|
*/
|
||||||
ParentPlatform queryParentPlatByServerGBId(String platformGbId);
|
ParentPlatform queryParentPlatByServerGBId(String platformGbId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询通道信息,不区分设备(已关联平台或全部)
|
|
||||||
*/
|
|
||||||
PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online, Boolean channelType, String platformId, String catalogId);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除上级平台的通道信息
|
* 移除上级平台的通道信息
|
||||||
* @param platformId
|
* @param platformId
|
||||||
|
@ -191,9 +123,6 @@ public interface IVideoManagerStorage {
|
||||||
|
|
||||||
List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
|
List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
|
||||||
|
|
||||||
List<DeviceChannelExtend> queryChannelsByDeviceId(String serial, List<String> channelIds, Boolean online);
|
|
||||||
|
|
||||||
List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel();
|
List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel();
|
||||||
|
|
||||||
List<Device> queryDeviceWithAsMessageChannel();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.storager.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.*;
|
import com.genersoft.iot.vmp.gb28181.dao.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||||
|
@ -10,15 +9,10 @@ import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.storager.dao.*;
|
import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
|
||||||
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
||||||
import com.genersoft.iot.vmp.streamProxy.dao.StreamProxyMapper;
|
|
||||||
import com.genersoft.iot.vmp.streamPush.dao.StreamPushMapper;
|
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||||
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||||
|
@ -74,107 +68,17 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlatformCatalogMapper platformCatalogMapper;
|
private PlatformCatalogMapper platformCatalogMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StreamProxyMapper streamProxyMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StreamPushMapper streamPushMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private GbStreamMapper gbStreamMapper;
|
private GbStreamMapper gbStreamMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserSetting userSetting;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlatformCatalogMapper catalogMapper;
|
private PlatformCatalogMapper catalogMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlatformGbStreamMapper platformGbStreamMapper;
|
private PlatformGbStreamMapper platformGbStreamMapper;
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据设备ID判断设备是否存在
|
|
||||||
*
|
|
||||||
* @param deviceId 设备ID
|
|
||||||
* @return true:存在 false:不存在
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean exists(String deviceId) {
|
|
||||||
return deviceMapper.getDeviceByDeviceId(deviceId) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取设备
|
|
||||||
*
|
|
||||||
* @param deviceId 设备ID
|
|
||||||
* @return Device 设备对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Device queryVideoDevice(String deviceId) {
|
|
||||||
return deviceMapper.getDeviceByDeviceId(deviceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count) {
|
|
||||||
// 获取到所有正在播放的流
|
|
||||||
PageHelper.startPage(page, count);
|
|
||||||
List<DeviceChannel> all;
|
|
||||||
if (catalogUnderDevice != null && catalogUnderDevice) {
|
|
||||||
all = deviceChannelMapper.queryChannels(deviceId, deviceId, query, hasSubChannel, online,null);
|
|
||||||
// 海康设备的parentId是SIP id
|
|
||||||
List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, sipConfig.getId(), query, hasSubChannel, online,null);
|
|
||||||
all.addAll(deviceChannels);
|
|
||||||
}else {
|
|
||||||
all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online,null);
|
|
||||||
}
|
|
||||||
return new PageInfo<>(all);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DeviceChannelExtend> queryChannelsByDeviceId(String deviceId, List<String> channelIds, Boolean online) {
|
|
||||||
return deviceChannelMapper.queryChannelsWithDeviceInfo(deviceId, null,null, null, online,channelIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageInfo<DeviceChannel> querySubChannels(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, int page, int count) {
|
|
||||||
PageHelper.startPage(page, count);
|
|
||||||
List<DeviceChannel> all = deviceChannelMapper.queryChannels(deviceId, parentChannelId, query, hasSubChannel, online,null);
|
|
||||||
return new PageInfo<>(all);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DeviceChannel queryChannel(String deviceId, String channelId) {
|
|
||||||
return deviceChannelMapper.queryChannel(deviceId, channelId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取多个设备
|
|
||||||
*
|
|
||||||
* @param page 当前页数
|
|
||||||
* @param count 每页数量
|
|
||||||
* @return PageInfo<Device> 分页设备对象数组
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public PageInfo<Device> queryVideoDeviceList(int page, int count,Boolean online) {
|
|
||||||
PageHelper.startPage(page, count);
|
|
||||||
List<Device> all = deviceMapper.getDevices(online);
|
|
||||||
return new PageInfo<>(all);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取多个设备
|
|
||||||
*
|
|
||||||
* @return List<Device> 设备对象数组
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Device> queryVideoDeviceList(Boolean online) {
|
|
||||||
|
|
||||||
List<Device> deviceList = deviceMapper.getDevices(online);
|
|
||||||
return deviceList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询移动位置轨迹
|
* 查询移动位置轨迹
|
||||||
|
@ -246,19 +150,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
return platformMapper.queryEnablePlatformListWithAsMessageChannel();
|
return platformMapper.queryEnablePlatformListWithAsMessageChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Device> queryDeviceWithAsMessageChannel() {
|
|
||||||
return deviceMapper.queryDeviceWithAsMessageChannel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online,
|
|
||||||
Boolean channelType, String platformId, String catalogId) {
|
|
||||||
PageHelper.startPage(page, count);
|
|
||||||
List<ChannelReduce> all = deviceChannelMapper.queryChannelListInAll(query, online, channelType, platformId, catalogId);
|
|
||||||
return new PageInfo<>(all);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -147,6 +147,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StreamPush push = getPush(event.getApp(), event.getStream());
|
StreamPush push = getPush(event.getApp(), event.getStream());
|
||||||
|
if (push == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
push.setPushIng(false);
|
push.setPushIng(false);
|
||||||
if (push.getGbDeviceId() != null) {
|
if (push.getGbDeviceId() != null) {
|
||||||
if (userSetting.isUsePushingAsStatus()) {
|
if (userSetting.isUsePushingAsStatus()) {
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class MobilePositionController {
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||||
@GetMapping("/realtime/{deviceId}")
|
@GetMapping("/realtime/{deviceId}")
|
||||||
public DeferredResult<MobilePosition> realTimePosition(@PathVariable String deviceId) {
|
public DeferredResult<MobilePosition> realTimePosition(@PathVariable String deviceId) {
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_MOBILE_POSITION + deviceId;
|
String key = DeferredResultHolder.CALLBACK_CMD_MOBILE_POSITION + deviceId;
|
||||||
try {
|
try {
|
||||||
|
@ -147,7 +147,7 @@ public class MobilePositionController {
|
||||||
if (StringUtil.isEmpty(interval)) {
|
if (StringUtil.isEmpty(interval)) {
|
||||||
interval = "5";
|
interval = "5";
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
device.setSubscribeCycleForMobilePosition(Integer.parseInt(expires));
|
device.setSubscribeCycleForMobilePosition(Integer.parseInt(expires));
|
||||||
device.setMobilePositionSubmissionInterval(Integer.parseInt(interval));
|
device.setMobilePositionSubmissionInterval(Integer.parseInt(interval));
|
||||||
deviceService.updateCustomDevice(device);
|
deviceService.updateCustomDevice(device);
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.service.IDeviceAlarmService;
|
import com.genersoft.iot.vmp.service.IDeviceAlarmService;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
|
@ -45,6 +46,9 @@ public class AlarmController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IVideoManagerStorage storage;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除报警
|
* 删除报警
|
||||||
|
@ -95,7 +99,7 @@ public class AlarmController {
|
||||||
@Operation(summary = "测试向上级/设备发送模拟报警通知", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "测试向上级/设备发送模拟报警通知", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号")
|
@Parameter(name = "deviceId", description = "设备国标编号")
|
||||||
public void delete(@RequestParam String deviceId) {
|
public void delete(@RequestParam String deviceId) {
|
||||||
Device device = storage.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
ParentPlatform platform = storage.queryParentPlatByServerGBId(deviceId);
|
ParentPlatform platform = storage.queryParentPlatByServerGBId(deviceId);
|
||||||
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
||||||
deviceAlarm.setChannelId(deviceId);
|
deviceAlarm.setChannelId(deviceId);
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
@ -40,6 +41,9 @@ public class DeviceConfig {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IVideoManagerStorage storager;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SIPCommander cmder;
|
private SIPCommander cmder;
|
||||||
|
|
||||||
|
@ -73,7 +77,7 @@ public class DeviceConfig {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("报警复位API调用");
|
log.debug("报警复位API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONFIG + deviceId + channelId;
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONFIG + deviceId + channelId;
|
||||||
try {
|
try {
|
||||||
|
@ -126,7 +130,7 @@ public class DeviceConfig {
|
||||||
}
|
}
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_CONFIGDOWNLOAD + (ObjectUtils.isEmpty(channelId) ? deviceId : channelId);
|
String key = DeferredResultHolder.CALLBACK_CMD_CONFIGDOWNLOAD + (ObjectUtils.isEmpty(channelId) ? deviceId : channelId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
try {
|
try {
|
||||||
cmder.deviceConfigQuery(device, channelId, configType, event -> {
|
cmder.deviceConfigQuery(device, channelId, configType, event -> {
|
||||||
RequestMessage msg = new RequestMessage();
|
RequestMessage msg = new RequestMessage();
|
||||||
|
|
|
@ -14,7 +14,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
@ -39,7 +39,7 @@ import java.util.UUID;
|
||||||
public class DeviceControl {
|
public class DeviceControl {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISIPCommander cmder;
|
private ISIPCommander cmder;
|
||||||
|
@ -59,7 +59,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("设备远程启动API调用");
|
log.debug("设备远程启动API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
try {
|
try {
|
||||||
cmder.teleBootCmd(device);
|
cmder.teleBootCmd(device);
|
||||||
} catch (InvalidArgumentException | SipException | ParseException e) {
|
} catch (InvalidArgumentException | SipException | ParseException e) {
|
||||||
|
@ -85,7 +85,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("开始/停止录像API调用");
|
log.debug("开始/停止录像API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + channelId;
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + channelId;
|
||||||
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(3 * 1000L);
|
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(3 * 1000L);
|
||||||
|
@ -132,7 +132,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("布防/撤防API调用");
|
log.debug("布防/撤防API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + deviceId;
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + deviceId;
|
||||||
String uuid =UUID.randomUUID().toString();
|
String uuid =UUID.randomUUID().toString();
|
||||||
try {
|
try {
|
||||||
|
@ -181,7 +181,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("报警复位API调用");
|
log.debug("报警复位API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + channelId;
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + channelId;
|
||||||
try {
|
try {
|
||||||
|
@ -225,7 +225,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("强制关键帧API调用");
|
log.debug("强制关键帧API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
try {
|
try {
|
||||||
cmder.iFrameCmd(device, channelId);
|
cmder.iFrameCmd(device, channelId);
|
||||||
} catch (InvalidArgumentException | SipException | ParseException e) {
|
} catch (InvalidArgumentException | SipException | ParseException e) {
|
||||||
|
@ -263,7 +263,7 @@ public class DeviceControl {
|
||||||
}
|
}
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + (ObjectUtils.isEmpty(channelId) ? deviceId : channelId);
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + (ObjectUtils.isEmpty(channelId) ? deviceId : channelId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
try {
|
try {
|
||||||
cmder.homePositionCmd(device, channelId, enabled, resetTime, presetIndex, event -> {
|
cmder.homePositionCmd(device, channelId, enabled, resetTime, presetIndex, event -> {
|
||||||
RequestMessage msg = new RequestMessage();
|
RequestMessage msg = new RequestMessage();
|
||||||
|
@ -326,7 +326,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(String.format("设备拉框放大 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy));
|
log.debug(String.format("设备拉框放大 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy));
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
StringBuffer cmdXml = new StringBuffer(200);
|
StringBuffer cmdXml = new StringBuffer(200);
|
||||||
cmdXml.append("<DragZoomIn>\r\n");
|
cmdXml.append("<DragZoomIn>\r\n");
|
||||||
cmdXml.append("<Length>" + length+ "</Length>\r\n");
|
cmdXml.append("<Length>" + length+ "</Length>\r\n");
|
||||||
|
@ -378,7 +378,7 @@ public class DeviceControl {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(String.format("设备拉框缩小 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy));
|
log.debug(String.format("设备拉框缩小 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy));
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
StringBuffer cmdXml = new StringBuffer(200);
|
StringBuffer cmdXml = new StringBuffer(200);
|
||||||
cmdXml.append("<DragZoomOut>\r\n");
|
cmdXml.append("<DragZoomOut>\r\n");
|
||||||
cmdXml.append("<Length>" + length+ "</Length>\r\n");
|
cmdXml.append("<Length>" + length+ "</Length>\r\n");
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class DeviceQuery {
|
||||||
@GetMapping("/devices/{deviceId}")
|
@GetMapping("/devices/{deviceId}")
|
||||||
public Device devices(@PathVariable String deviceId){
|
public Device devices(@PathVariable String deviceId){
|
||||||
|
|
||||||
return storager.queryVideoDevice(deviceId);
|
return deviceService.getDevice(deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,12 +103,14 @@ public class DeviceQuery {
|
||||||
@Operation(summary = "分页查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "分页查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "page", description = "当前页", required = true)
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
|
@Parameter(name = "query", description = "搜索", required = false)
|
||||||
|
@Parameter(name = "status", description = "状态", required = false)
|
||||||
@GetMapping("/devices")
|
@GetMapping("/devices")
|
||||||
@Options()
|
@Options()
|
||||||
public PageInfo<Device> devices(int page, int count){
|
public PageInfo<Device> devices(int page, int count, String query, Boolean status){
|
||||||
// if (page == null) page = 0;
|
// if (page == null) page = 0;
|
||||||
// if (count == null) count = 20;
|
// if (count == null) count = 20;
|
||||||
return storager.queryVideoDeviceList(page, count,null);
|
return deviceService.getAll(page, count,query, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,18 +133,16 @@ public class DeviceQuery {
|
||||||
@Parameter(name = "query", description = "查询内容")
|
@Parameter(name = "query", description = "查询内容")
|
||||||
@Parameter(name = "online", description = "是否在线")
|
@Parameter(name = "online", description = "是否在线")
|
||||||
@Parameter(name = "channelType", description = "设备/子目录-> false/true")
|
@Parameter(name = "channelType", description = "设备/子目录-> false/true")
|
||||||
@Parameter(name = "catalogUnderDevice", description = "是否直属与设备的目录")
|
|
||||||
public PageInfo<DeviceChannel> channels(@PathVariable String deviceId,
|
public PageInfo<DeviceChannel> channels(@PathVariable String deviceId,
|
||||||
int page, int count,
|
int page, int count,
|
||||||
@RequestParam(required = false) String query,
|
@RequestParam(required = false) String query,
|
||||||
@RequestParam(required = false) Boolean online,
|
@RequestParam(required = false) Boolean online,
|
||||||
@RequestParam(required = false) Boolean channelType,
|
@RequestParam(required = false) Boolean channelType) {
|
||||||
@RequestParam(required = false) Boolean catalogUnderDevice) {
|
|
||||||
if (ObjectUtils.isEmpty(query)) {
|
if (ObjectUtils.isEmpty(query)) {
|
||||||
query = null;
|
query = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return storager.queryChannelsByDeviceId(deviceId, query, channelType, online, catalogUnderDevice, page, count);
|
return deviceChannelService.queryChannelsByDeviceId(deviceId, query, channelType, online, page, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -158,7 +158,7 @@ public class DeviceQuery {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("设备通道信息同步API调用,deviceId:" + deviceId);
|
log.debug("设备通道信息同步API调用,deviceId:" + deviceId);
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
boolean status = deviceService.isSyncRunning(deviceId);
|
boolean status = deviceService.isSyncRunning(deviceId);
|
||||||
// 已存在则返回进度
|
// 已存在则返回进度
|
||||||
if (status) {
|
if (status) {
|
||||||
|
@ -240,13 +240,13 @@ public class DeviceQuery {
|
||||||
@RequestParam(required = false) Boolean online,
|
@RequestParam(required = false) Boolean online,
|
||||||
@RequestParam(required = false) Boolean channelType){
|
@RequestParam(required = false) Boolean channelType){
|
||||||
|
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(deviceId,channelId);
|
DeviceChannel deviceChannel = deviceChannelService.getOne(deviceId,channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
PageInfo<DeviceChannel> deviceChannelPageResult = new PageInfo<>();
|
PageInfo<DeviceChannel> deviceChannelPageResult = new PageInfo<>();
|
||||||
return deviceChannelPageResult;
|
return deviceChannelPageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
return storager.querySubChannels(deviceId, channelId, query, channelType, online, page, count);
|
return deviceChannelService.getSubChannels(deviceChannel.getDeviceDbId(), channelId, query, channelType, online, page, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -340,7 +340,7 @@ public class DeviceQuery {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("设备状态查询API调用");
|
log.debug("设备状态查询API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICESTATUS + deviceId;
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICESTATUS + deviceId;
|
||||||
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(2*1000L);
|
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(2*1000L);
|
||||||
|
@ -403,7 +403,7 @@ public class DeviceQuery {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("设备报警查询API调用");
|
log.debug("设备报警查询API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_ALARM + deviceId;
|
String key = DeferredResultHolder.CALLBACK_CMD_ALARM + deviceId;
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -320,7 +320,7 @@ public class PlatformController {
|
||||||
if (ObjectUtils.isEmpty(platformId) || ObjectUtils.isEmpty(catalogId)) {
|
if (ObjectUtils.isEmpty(platformId) || ObjectUtils.isEmpty(catalogId)) {
|
||||||
catalogId = null;
|
catalogId = null;
|
||||||
}
|
}
|
||||||
PageInfo<ChannelReduce> channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, catalogId);
|
PageInfo<ChannelReduce> channelReduces = deviceChannelService.queryAllChannelList(page, count, query, online, channelType, platformId, catalogId);
|
||||||
|
|
||||||
return channelReduces;
|
return channelReduces;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
||||||
import com.genersoft.iot.vmp.service.IPlayService;
|
import com.genersoft.iot.vmp.service.IPlayService;
|
||||||
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||||
|
@ -75,6 +76,8 @@ public class PlayController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceChannelService deviceChannelService;
|
private IDeviceChannelService deviceChannelService;
|
||||||
|
@ -87,8 +90,11 @@ public class PlayController {
|
||||||
@PathVariable String channelId) {
|
@PathVariable String channelId) {
|
||||||
|
|
||||||
log.info("[开始点播] deviceId:{}, channelId:{}, ", deviceId, channelId);
|
log.info("[开始点播] deviceId:{}, channelId:{}, ", deviceId, channelId);
|
||||||
|
if (ObjectUtils.isEmpty(deviceId) || ObjectUtils.isEmpty(channelId)) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR400);
|
||||||
|
}
|
||||||
// 获取可用的zlm
|
// 获取可用的zlm
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
MediaServer newMediaServerItem = playService.getNewMediaServerItem(device);
|
MediaServer newMediaServerItem = playService.getNewMediaServerItem(device);
|
||||||
|
|
||||||
RequestMessage requestMessage = new RequestMessage();
|
RequestMessage requestMessage = new RequestMessage();
|
||||||
|
@ -163,7 +169,7 @@ public class PlayController {
|
||||||
throw new ControllerException(ErrorCode.ERROR400);
|
throw new ControllerException(ErrorCode.ERROR400);
|
||||||
}
|
}
|
||||||
|
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "设备[" + deviceId + "]不存在");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "设备[" + deviceId + "]不存在");
|
||||||
}
|
}
|
||||||
|
@ -206,7 +212,7 @@ public class PlayController {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("语音广播API调用");
|
log.debug("语音广播API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "未找到设备: " + deviceId);
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "未找到设备: " + deviceId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.service.IInviteStreamService;
|
||||||
import com.genersoft.iot.vmp.service.IPlayService;
|
import com.genersoft.iot.vmp.service.IPlayService;
|
||||||
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||||
|
@ -67,6 +68,9 @@ public class PlaybackController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@Operation(summary = "开始视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "开始视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||||
|
@ -136,7 +140,7 @@ public class PlaybackController {
|
||||||
if (ObjectUtils.isEmpty(deviceId) || ObjectUtils.isEmpty(channelId) || ObjectUtils.isEmpty(stream)) {
|
if (ObjectUtils.isEmpty(deviceId) || ObjectUtils.isEmpty(channelId) || ObjectUtils.isEmpty(stream)) {
|
||||||
throw new ControllerException(ErrorCode.ERROR400);
|
throw new ControllerException(ErrorCode.ERROR400);
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "设备:" + deviceId + " 未找到");
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "设备:" + deviceId + " 未找到");
|
||||||
}
|
}
|
||||||
|
@ -191,7 +195,7 @@ public class PlaybackController {
|
||||||
log.warn("streamId不存在!");
|
log.warn("streamId不存在!");
|
||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "streamId不存在");
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "streamId不存在");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(inviteInfo.getDeviceId());
|
Device device = deviceService.getDevice(inviteInfo.getDeviceId());
|
||||||
try {
|
try {
|
||||||
cmder.playSeekCmd(device, inviteInfo.getStreamInfo(), seekTime);
|
cmder.playSeekCmd(device, inviteInfo.getStreamInfo(), seekTime);
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
|
@ -215,7 +219,7 @@ public class PlaybackController {
|
||||||
log.warn("不支持的speed: " + speed);
|
log.warn("不支持的speed: " + speed);
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "不支持的speed(0.25 0.5 1、2、4)");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "不支持的speed(0.25 0.5 1、2、4)");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(inviteInfo.getDeviceId());
|
Device device = deviceService.getDevice(inviteInfo.getDeviceId());
|
||||||
try {
|
try {
|
||||||
cmder.playSpeedCmd(device, inviteInfo.getStreamInfo(), speed);
|
cmder.playSpeedCmd(device, inviteInfo.getStreamInfo(), speed);
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
@ -36,6 +37,9 @@ public class PtzController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IVideoManagerStorage storager;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeferredResultHolder resultHolder;
|
private DeferredResultHolder resultHolder;
|
||||||
|
|
||||||
|
@ -62,7 +66,7 @@ public class PtzController {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,command:%s ,horizonSpeed:%d ,verticalSpeed:%d ,zoomSpeed:%d",deviceId, channelId, command, horizonSpeed, verticalSpeed, zoomSpeed));
|
log.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,command:%s ,horizonSpeed:%d ,verticalSpeed:%d ,zoomSpeed:%d",deviceId, channelId, command, horizonSpeed, verticalSpeed, zoomSpeed));
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
int cmdCode = 0;
|
int cmdCode = 0;
|
||||||
switch (command){
|
switch (command){
|
||||||
case "left":
|
case "left":
|
||||||
|
@ -125,7 +129,7 @@ public class PtzController {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2));
|
log.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2));
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2);
|
cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2);
|
||||||
|
@ -144,7 +148,7 @@ public class PtzController {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("设备预置位查询API调用");
|
log.debug("设备预置位查询API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_PRESETQUERY + (ObjectUtils.isEmpty(channelId) ? deviceId : channelId);
|
String key = DeferredResultHolder.CALLBACK_CMD_PRESETQUERY + (ObjectUtils.isEmpty(channelId) ? deviceId : channelId);
|
||||||
DeferredResult<String> result = new DeferredResult<String> (3 * 1000L);
|
DeferredResult<String> result = new DeferredResult<String> (3 * 1000L);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class GBRecordController {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "endTime格式为" + DateUtil.PATTERN);
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "endTime格式为" + DateUtil.PATTERN);
|
||||||
}
|
}
|
||||||
|
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = deviceService.getDevice(deviceId);
|
||||||
// 指定超时时间 1分钟30秒
|
// 指定超时时间 1分钟30秒
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
int sn = (int)((Math.random()*9+1)*100000);
|
int sn = (int)((Math.random()*9+1)*100000);
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.web.gb28181;
|
||||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -28,7 +28,7 @@ public class ApiControlController {
|
||||||
private SIPCommander cmder;
|
private SIPCommander cmder;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备控制 - 云台控制
|
* 设备控制 - 云台控制
|
||||||
|
@ -51,7 +51,7 @@ public class ApiControlController {
|
||||||
}
|
}
|
||||||
if (channel == null) {channel = 0;}
|
if (channel == null) {channel = 0;}
|
||||||
if (speed == null) {speed = 0;}
|
if (speed == null) {speed = 0;}
|
||||||
Device device = storager.queryVideoDevice(serial);
|
Device device = deviceService.getDevice(serial);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "device[ " + serial + " ]未找到");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "device[ " + serial + " ]未找到");
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ public class ApiControlController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel == null) {channel = 0;}
|
if (channel == null) {channel = 0;}
|
||||||
Device device = storager.queryVideoDevice(serial);
|
Device device = deviceService.getDevice(serial);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "device[ " + serial + " ]未找到");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "device[ " + serial + " ]未找到");
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.PresetQuerySipReq;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
|
import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
||||||
import com.genersoft.iot.vmp.service.IDeviceService;
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.DeferredResultEx;
|
import com.genersoft.iot.vmp.vmanager.bean.DeferredResultEx;
|
||||||
|
@ -43,11 +44,14 @@ public class ApiDeviceController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SIPCommander cmder;
|
private SIPCommander cmder;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceChannelService channelService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeferredResultHolder resultHolder;
|
private DeferredResultHolder resultHolder;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取设备列表 现在直接返回,尚未实现分页
|
* 分页获取设备列表 现在直接返回,尚未实现分页
|
||||||
|
@ -70,10 +74,10 @@ public class ApiDeviceController {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
List<Device> devices;
|
List<Device> devices;
|
||||||
if (start == null || limit ==null) {
|
if (start == null || limit ==null) {
|
||||||
devices = storager.queryVideoDeviceList(online);
|
devices = deviceService.getAllByStatus(online);
|
||||||
result.put("DeviceCount", devices.size());
|
result.put("DeviceCount", devices.size());
|
||||||
}else {
|
}else {
|
||||||
PageInfo<Device> deviceList = storager.queryVideoDeviceList(start/limit, limit,online);
|
PageInfo<Device> deviceList = deviceService.getAll(start/limit, limit,null, online);
|
||||||
result.put("DeviceCount", deviceList.getTotal());
|
result.put("DeviceCount", deviceList.getTotal());
|
||||||
devices = deviceList.getList();
|
devices = deviceList.getList();
|
||||||
}
|
}
|
||||||
|
@ -120,7 +124,7 @@ public class ApiDeviceController {
|
||||||
String[] split = code.trim().split(",");
|
String[] split = code.trim().split(",");
|
||||||
channelIds = Arrays.asList(split);
|
channelIds = Arrays.asList(split);
|
||||||
}
|
}
|
||||||
List<DeviceChannelExtend> allDeviceChannelList = storager.queryChannelsByDeviceId(serial,channelIds,online);
|
List<DeviceChannelExtend> allDeviceChannelList = channelService.queryChannelExtendsByDeviceId(serial,channelIds,online);
|
||||||
if (start == null || limit ==null) {
|
if (start == null || limit ==null) {
|
||||||
deviceChannels = allDeviceChannelList;
|
deviceChannels = allDeviceChannelList;
|
||||||
result.put("ChannelCount", deviceChannels.size());
|
result.put("ChannelCount", deviceChannels.size());
|
||||||
|
@ -196,7 +200,7 @@ public class ApiDeviceController {
|
||||||
serial, channel, code, fill, timeout);
|
serial, channel, code, fill, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
Device device = storager.queryVideoDevice(serial);
|
Device device = deviceService.getDevice(serial);
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_PRESETQUERY + (ObjectUtils.isEmpty(code) ? serial : code);
|
String key = DeferredResultHolder.CALLBACK_CMD_PRESETQUERY + (ObjectUtils.isEmpty(code) ? serial : code);
|
||||||
DeferredResult<Object> result = new DeferredResult<> (timeout * 1000L);
|
DeferredResult<Object> result = new DeferredResult<> (timeout * 1000L);
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class ApiStreamController {
|
||||||
|
|
||||||
){
|
){
|
||||||
DeferredResult<JSONObject> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue() + 10);
|
DeferredResult<JSONObject> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue() + 10);
|
||||||
Device device = storager.queryVideoDevice(serial);
|
Device device = deviceService.getDevice(serial);
|
||||||
if (device == null ) {
|
if (device == null ) {
|
||||||
JSONObject resultJSON = new JSONObject();
|
JSONObject resultJSON = new JSONObject();
|
||||||
resultJSON.put("error","device[ " + serial + " ]未找到");
|
resultJSON.put("error","device[ " + serial + " ]未找到");
|
||||||
|
@ -104,7 +104,7 @@ public class ApiStreamController {
|
||||||
// 清理RTP server
|
// 清理RTP server
|
||||||
});
|
});
|
||||||
|
|
||||||
DeviceChannel deviceChannel = storager.queryChannel(serial, code);
|
DeviceChannel deviceChannel = deviceChannelService.getOne(serial, code);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
JSONObject resultJSON = new JSONObject();
|
JSONObject resultJSON = new JSONObject();
|
||||||
resultJSON.put("error","channel[ " + code + " ]未找到");
|
resultJSON.put("error","channel[ " + code + " ]未找到");
|
||||||
|
|
|
@ -52,11 +52,9 @@
|
||||||
<el-main style="padding: 5px;">
|
<el-main style="padding: 5px;">
|
||||||
<el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%"
|
<el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%"
|
||||||
header-row-class-name="table-header">
|
header-row-class-name="table-header">
|
||||||
<el-table-column prop="channelId" label="通道编号" min-width="180">
|
<el-table-column prop="deviceId" label="编号" min-width="180">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="deviceId" label="设备编号" min-width="180">
|
<el-table-column prop="name" label="名称" min-width="180">
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="name" label="通道名称" min-width="180">
|
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-show="scope.row.edit"
|
v-show="scope.row.edit"
|
||||||
|
@ -85,7 +83,9 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="subCount" label="子节点数" min-width="100">
|
<el-table-column prop="subCount" label="子节点数" min-width="100">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="manufacture" label="厂家" min-width="100">
|
<el-table-column prop="manufacturer" label="厂家" min-width="100">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="model" label="型号" min-width="150">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="位置信息" min-width="120">
|
<el-table-column label="位置信息" min-width="120">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -102,16 +102,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="ptzType" label="云台类型" min-width="100">
|
<el-table-column prop="ptzType" label="云台类型" min-width="100">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<el-select v-show="scope.row.edit" v-model="scope.row.ptzType"
|
<div >{{ scope.row.ptzTypeText }}</div>
|
||||||
placeholder="云台类型" filterable>
|
|
||||||
<el-option
|
|
||||||
v-for="(value, key) in ptzTypes"
|
|
||||||
:key="key"
|
|
||||||
:label="value"
|
|
||||||
:value="key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<div v-show="!scope.row.edit">{{ scope.row.ptzTypeText }}</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="开启音频" min-width="100">
|
<el-table-column label="开启音频" min-width="100">
|
||||||
|
@ -138,8 +129,8 @@
|
||||||
<el-table-column label="状态" min-width="100">
|
<el-table-column label="状态" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium" v-if="scope.row.status === true">在线</el-tag>
|
<el-tag size="medium" v-if="scope.row.status === 'ON'">在线</el-tag>
|
||||||
<el-tag size="medium" type="info" v-if="scope.row.status === false">离线</el-tag>
|
<el-tag size="medium" type="info" v-if="scope.row.status !== 'ON'">离线</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -347,7 +338,7 @@ export default {
|
||||||
sendDevicePush: function (itemData) {
|
sendDevicePush: function (itemData) {
|
||||||
let deviceId = this.deviceId;
|
let deviceId = this.deviceId;
|
||||||
this.isLoging = true;
|
this.isLoging = true;
|
||||||
let channelId = itemData.channelId;
|
let channelId = itemData.deviceId;
|
||||||
console.log("通知设备推流1:" + deviceId + " : " + channelId);
|
console.log("通知设备推流1:" + deviceId + " : " + channelId);
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$axios({
|
this.$axios({
|
||||||
|
@ -394,13 +385,13 @@ export default {
|
||||||
},
|
},
|
||||||
queryRecords: function (itemData) {
|
queryRecords: function (itemData) {
|
||||||
let deviceId = this.deviceId;
|
let deviceId = this.deviceId;
|
||||||
let channelId = itemData.channelId;
|
let channelId = itemData.deviceId;
|
||||||
|
|
||||||
this.$router.push(`/gbRecordDetail/${deviceId}/${channelId}`)
|
this.$router.push(`/gbRecordDetail/${deviceId}/${channelId}`)
|
||||||
},
|
},
|
||||||
queryCloudRecords: function (itemData) {
|
queryCloudRecords: function (itemData) {
|
||||||
let deviceId = this.deviceId;
|
let deviceId = this.deviceId;
|
||||||
let channelId = itemData.channelId;
|
let channelId = itemData.deviceId;
|
||||||
|
|
||||||
this.$router.push(`/cloudRecordDetail/rtp/${deviceId}_${channelId}`)
|
this.$router.push(`/cloudRecordDetail/rtp/${deviceId}_${channelId}`)
|
||||||
},
|
},
|
||||||
|
@ -408,7 +399,7 @@ export default {
|
||||||
var that = this;
|
var that = this;
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId,
|
url: '/api/play/stop/' + this.deviceId + "/" + itemData.deviceId,
|
||||||
params: {
|
params: {
|
||||||
isSubStream: this.isSubStream
|
isSubStream: this.isSubStream
|
||||||
}
|
}
|
||||||
|
@ -454,7 +445,7 @@ export default {
|
||||||
changeSubchannel(itemData) {
|
changeSubchannel(itemData) {
|
||||||
this.beforeUrl = this.$router.currentRoute.path;
|
this.beforeUrl = this.$router.currentRoute.path;
|
||||||
|
|
||||||
var url = `/${this.$router.currentRoute.name}/${this.$router.currentRoute.params.deviceId}/${itemData.channelId}`
|
var url = `/${this.$router.currentRoute.name}/${this.$router.currentRoute.params.deviceId}/${itemData.deviceId}`
|
||||||
this.$router.push(url).then(() => {
|
this.$router.push(url).then(() => {
|
||||||
this.searchSrt = "";
|
this.searchSrt = "";
|
||||||
this.channelType = "";
|
this.channelType = "";
|
||||||
|
|
Loading…
Reference in New Issue