| | |
| | | String app = json.getString("app");
|
| | | String streamId = json.getString("stream");
|
| | | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
|
| | | if ("rtp".equals(app) && streamId.indexOf("gb_play") > -1 && streamInfo == null) {
|
| | | if ("rtp".equals(app) && streamId.contains("gb_play") && streamInfo == null) {
|
| | | String[] s = streamId.split("_");
|
| | | if (s.length == 4) {
|
| | | String deviceId = s[2];
|
| | |
| | | */ |
| | | boolean isChannelSendingRTP(String channelId); |
| | | |
| | | /** |
| | | * 清空某个设备的所有缓存 |
| | | * @param deviceId 设备ID |
| | | */ |
| | | void clearCatchByDeviceId(String deviceId); |
| | | } |
| | |
| | | int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel); |
| | | |
| | | @Delete("<script> "+ |
| | | "DELETE FROM platform_gb_channel WHERE deviceId='${deviceId}' " + |
| | | "</script>") |
| | | int delChannelForDeviceId(String deviceId); |
| | | |
| | | @Delete("<script> "+ |
| | | "DELETE FROM platform_gb_channel WHERE platformId='${platformId}'" + |
| | | "</script>") |
| | | int cleanChannelForGB(String platformId); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void clearCatchByDeviceId(String deviceId) { |
| | | List<Object> playLeys = redis.scan(String.format("%S_*_%s_*", VideoManagerConstants.PLAYER_PREFIX, |
| | | deviceId)); |
| | | if (playLeys.size() > 0) { |
| | | for (Object key : playLeys) { |
| | | redis.del(key.toString()); |
| | | } |
| | | } |
| | | |
| | | List<Object> playBackers = redis.scan(String.format("%S_*_%s_*", VideoManagerConstants.PLAY_BLACK_PREFIX, |
| | | deviceId)); |
| | | if (playBackers.size() > 0) { |
| | | for (Object key : playBackers) { |
| | | redis.del(key.toString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean delete(String deviceId) { |
| | | int result = deviceMapper.del(deviceId); |
| | | |
| | | return result > 0; |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | boolean result = false; |
| | | try { |
| | | if (platformChannelMapper.delChannelForDeviceId(deviceId) <0 // 删除与国标平台的关联 |
| | | || deviceChannelMapper.cleanChannelsByDeviceId(deviceId) < 0 // 删除他的通道 |
| | | || deviceMapper.del(deviceId) < 0 // 移除设备信息 |
| | | ) { |
| | | //事务回滚 |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | } |
| | | result = true; |
| | | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| | | }catch (Exception e) { |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | public void mediaOutline(String app, String streamId) { |
| | | gbStreamMapper.setStatus(app, streamId, false); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.annotations.*; |
| | | import org.slf4j.Logger; |
| | |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorager storager; |
| | | |
| | | @Autowired |
| | | private IRedisCatchStorage redisCatchStorage; |
| | | |
| | | @Autowired |
| | | private SIPCommander cmder; |
| | |
| | | if (offLineDetector.isOnline(deviceId)) { |
| | | return new ResponseEntity<String>("不允许删除在线设备!", HttpStatus.NOT_ACCEPTABLE); |
| | | } |
| | | // 清除redis记录 |
| | | boolean isSuccess = storager.delete(deviceId); |
| | | if (isSuccess) { |
| | | redisCatchStorage.clearCatchByDeviceId(deviceId); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("deviceId", deviceId); |
| | | return new ResponseEntity<>(json.toString(),HttpStatus.OK); |
| | |
| | | |
| | | <el-table-column label="操作" width="360" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" :ref="scope.row.deviceId + 'refbtn' " icon="el-icon-refresh" @click="refDevice(scope.row)">刷新</el-button> |
| | | <el-button size="mini" :ref="scope.row.deviceId + 'refbtn' " v-if="scope.row.online!=0" icon="el-icon-refresh" @click="refDevice(scope.row)">刷新</el-button> |
| | | <el-button-group> |
| | | <el-button size="mini" icon="el-icon-video-camera-solid" v-bind:disabled="scope.row.online==0" type="primary" @click="showChannelList(scope.row)">通道</el-button> |
| | | <el-button size="mini" icon="el-icon-location" v-bind:disabled="scope.row.online==0" type="primary" @click="showDevicePosition(scope.row)">定位</el-button> |
| | | <el-button size="mini" icon="el-icon-s-tools" v-bind:disabled="scope.row.online==0" type="primary">控制</el-button> |
| | | <el-button size="mini" icon="el-icon-delete" type="danger" v-if="scope.row.online==0" @click="deleteDevice(scope.row)">删除</el-button> |
| | | </el-button-group> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | }); |
| | | |
| | | }, |
| | | deleteDevice: function(row) { |
| | | let that = this; |
| | | this.$axios({ |
| | | method: 'delete', |
| | | url:`/api/device/query/devices/${row.deviceId}/delete` |
| | | }).then((res)=>{ |
| | | this.getDeviceList(); |
| | | }).catch((error) =>{ |
| | | console.log(error); |
| | | }); |
| | | |
| | | }, |
| | | showChannelList: function(row) { |
| | | console.log(JSON.stringify(row)) |
| | | this.$router.push(`/channelList/${row.deviceId}/0/15/1`); |