修复推流流注册时写入节点ID
parent
c2fb892f2a
commit
3d2a87f61d
|
@ -80,9 +80,9 @@ public interface StreamPushMapper {
|
||||||
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||||
|
|
||||||
@Update("UPDATE wvp_stream_push " +
|
@Update("UPDATE wvp_stream_push " +
|
||||||
"SET pushing=#{pushing}, server_id=#{serverId} " +
|
"SET pushing=#{pushing}, server_id=#{serverId}, media_server_id=#{mediaServerId} " +
|
||||||
"WHERE id=#{id}")
|
"WHERE id=#{id}")
|
||||||
int updatePushStatus(@Param("id") int id, @Param("pushing") boolean pushing, @Param("serverId") String serverId);
|
int updatePushStatus(StreamPush streamPush);
|
||||||
|
|
||||||
@Select("<script> "+
|
@Select("<script> "+
|
||||||
"SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
|
"SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
|
||||||
|
|
|
@ -88,11 +88,9 @@ public interface IStreamPushService {
|
||||||
|
|
||||||
Map<String, StreamPush> getAllGBId();
|
Map<String, StreamPush> getAllGBId();
|
||||||
|
|
||||||
void updateStatus(StreamPush push);
|
|
||||||
|
|
||||||
void deleteByAppAndStream(String app, String stream);
|
void deleteByAppAndStream(String app, String stream);
|
||||||
|
|
||||||
void updatePushStatus(StreamPush streamPush, boolean pushIng);
|
void updatePushStatus(StreamPush streamPush);
|
||||||
|
|
||||||
void batchUpdate(List<StreamPush> streamPushItemForUpdate);
|
void batchUpdate(List<StreamPush> streamPushItemForUpdate);
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,11 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
streamPush.setPushTime(DateUtil.getNow());
|
streamPush.setPushTime(DateUtil.getNow());
|
||||||
add(streamPush);
|
add(streamPush);
|
||||||
}else {
|
}else {
|
||||||
updatePushStatus(streamPushInDb, true);
|
streamPushInDb.setPushTime(DateUtil.getNow());
|
||||||
|
streamPushInDb.setPushing(true);
|
||||||
|
streamPushInDb.setServerId(userSetting.getServerId());
|
||||||
|
streamPushInDb.setMediaServerId(mediaInfo.getMediaServer().getId());
|
||||||
|
updatePushStatus(streamPushInDb);
|
||||||
}
|
}
|
||||||
// 冗余数据,自己系统中自用
|
// 冗余数据,自己系统中自用
|
||||||
if (!"broadcast".equals(event.getApp()) && !"talk".equals(event.getApp())) {
|
if (!"broadcast".equals(event.getApp()) && !"talk".equals(event.getApp())) {
|
||||||
|
@ -144,7 +148,8 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (streamPush.getGbDeviceId() != null) {
|
if (streamPush.getGbDeviceId() != null) {
|
||||||
updatePushStatus(streamPush, false);
|
streamPush.setPushing(false);
|
||||||
|
updatePushStatus(streamPush);
|
||||||
}else {
|
}else {
|
||||||
deleteByAppAndStream(event.getApp(), event.getStream());
|
deleteByAppAndStream(event.getApp(), event.getStream());
|
||||||
}
|
}
|
||||||
|
@ -492,20 +497,13 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
return streamPushMapper.getAllGBId();
|
return streamPushMapper.getAllGBId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateStatus(StreamPush push) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updatePushStatus(StreamPush streamPush, boolean pushIng) {
|
public void updatePushStatus(StreamPush streamPush) {
|
||||||
streamPush.setPushing(pushIng);
|
|
||||||
if (userSetting.getUsePushingAsStatus()) {
|
if (userSetting.getUsePushingAsStatus()) {
|
||||||
streamPush.setGbStatus(pushIng?"ON":"OFF");
|
streamPush.setGbStatus(streamPush.isPushing()?"ON":"OFF");
|
||||||
}
|
}
|
||||||
streamPush.setPushTime(DateUtil.getNow());
|
streamPushMapper.updatePushStatus(streamPush);
|
||||||
streamPushMapper.updatePushStatus(streamPush.getId(), pushIng, userSetting.getServerId());
|
|
||||||
if (ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
|
if (ObjectUtils.isEmpty(streamPush.getGbDeviceId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue