| | |
| | | return catalogData.getChannelList(); |
| | | } |
| | | |
| | | public int getTotal(String key) { |
| | | CatalogData catalogData = data.get(key); |
| | | if (catalogData == null) return 0; |
| | | return catalogData.getTotal(); |
| | | } |
| | | |
| | | public void del(String key) { |
| | | data.remove(key); |
| | | } |
| | |
| | | import javax.sip.address.SipURI; |
| | | import javax.sip.header.HeaderAddress; |
| | | import javax.sip.header.ToHeader; |
| | | import javax.sip.message.Response; |
| | | import java.text.ParseException; |
| | | import java.util.Iterator; |
| | | |
| | |
| | | if (!StringUtils.isEmpty(getText(rootElement,"PTZCmd")) && !parentPlatform.getServerGBId().equals(targetGBId)) { |
| | | String cmdString = getText(rootElement,"PTZCmd"); |
| | | Device deviceForPlatform = storager.queryVideoDeviceByPlatformIdAndChannelId(parentPlatform.getServerGBId(), channelId); |
| | | if (deviceForPlatform == null) { |
| | | try { |
| | | responseAck(evt, Response.NOT_FOUND); |
| | | return; |
| | | } catch (SipException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidArgumentException e) { |
| | | e.printStackTrace(); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | cmder.fronEndCmd(deviceForPlatform, channelId, cmdString, eventResult -> { |
| | | // 失败的回复 |
| | | try { |
| | |
| | | continue; |
| | | } |
| | | //by brewswang |
| | | if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Longitude"))) {//如果包含位置信息,就更新一下位置 |
| | | processNotifyMobilePosition(evt, itemDevice); |
| | | } |
| | | |
| | | // if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Longitude"))) {//如果包含位置信息,就更新一下位置 |
| | | // processNotifyMobilePosition(evt, itemDevice); |
| | | // } |
| | | DeviceChannel deviceChannel = XmlUtil.channelContentHander(itemDevice); |
| | | deviceChannel.setDeviceId(device.getDeviceId()); |
| | | logger.debug("收到来自设备【{}】的通道: {}【{}】", device.getDeviceId(), deviceChannel.getName(), deviceChannel.getChannelId()); |
| | | |
| | | channelList.add(deviceChannel); |
| | | } |
| | | |
| | | logger.debug("收到来自设备【{}】的通道: {}个,{}/{}", device.getDeviceId(), channelList.size(), catalogDataCatch.get(key) == null ? 0 :catalogDataCatch.get(key).size(), sumNum); |
| | | catalogDataCatch.put(key, sumNum, device, channelList); |
| | | if (catalogDataCatch.get(key).size() == sumNum) { |
| | | // 数据已经完整接收 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public String getChannelSyncProgress(String deviceId) { |
| | | String key = DeferredResultHolder.CALLBACK_CMD_CATALOG + deviceId; |
| | | return catalogDataCatch.get(key) == null ? "0/0" : catalogDataCatch.get(key).size() + "/" + catalogDataCatch.getTotal(key); |
| | | } |
| | | } |
| | |
| | | channels = deviceChannelList; |
| | | } |
| | | if (stringBuilder.length() > 0) { |
| | | logger.debug("[目录查询]收到的数据存在重复: {}" , stringBuilder); |
| | | logger.info("[目录查询]收到的数据存在重复: {}" , stringBuilder); |
| | | } |
| | | try { |
| | | int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); |
| | |
| | | }); |
| | | // 等待其他相同请求返回时一起返回 |
| | | if (resultHolder.exist(key, null)) { |
| | | resultHolder.put(key, uuid, result); |
| | | return result; |
| | | }else { |
| | | cmder.catalogQuery(device, event -> { |
| | | RequestMessage msg = new RequestMessage(); |
| | | msg.setKey(key); |
| | | msg.setId(uuid); |
| | | WVPResult<Object> wvpResult = new WVPResult<>(); |
| | | wvpResult.setCode(-1); |
| | | wvpResult.setData(device); |
| | | wvpResult.setMsg(String.format("同步通道失败,错误码: %s, %s", event.statusCode, event.msg)); |
| | | msg.setData(wvpResult); |
| | | resultHolder.invokeAllResult(msg); |
| | | }); |
| | | resultHolder.put(key, uuid, result); |
| | | return result; |
| | | } |
| | | cmder.catalogQuery(device, event -> { |
| | | RequestMessage msg = new RequestMessage(); |
| | | msg.setKey(key); |
| | | msg.setId(uuid); |
| | | WVPResult<Object> wvpResult = new WVPResult<>(); |
| | | wvpResult.setCode(-1); |
| | | wvpResult.setData(device); |
| | | wvpResult.setMsg(String.format("同步通道失败,错误码: %s, %s", event.statusCode, event.msg)); |
| | | msg.setData(wvpResult); |
| | | resultHolder.invokeAllResult(msg); |
| | | }); |
| | | |
| | | resultHolder.put(key, uuid, result); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | <el-table-column label="操作" width="450" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" :loading="scope.row.loading" v-if="scope.row.online!=0" icon="el-icon-refresh" @click="refDevice(scope.row)">刷新</el-button> |
| | | <el-button size="mini" :loading="syncDevices.includes(scope.row.deviceId)" 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> |
| | |
| | | currentPage:1, |
| | | count:15, |
| | | total:0, |
| | | getDeviceListLoading: false |
| | | getDeviceListLoading: false, |
| | | syncDevices:[] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }); |
| | | this.currentDeviceChannelsLenth = channels.length; |
| | | } |
| | | |
| | | console.log("数据:" + JSON.stringify(channels)); |
| | | return channels; |
| | | } |
| | | }, |
| | |
| | | count: that.count |
| | | } |
| | | }).then(function (res) { |
| | | console.log(res); |
| | | console.log(res.data.list); |
| | | that.total = res.data.total; |
| | | that.deviceList = res.data.list; |
| | | that.getDeviceListLoading = false; |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | console.error(error); |
| | | that.getDeviceListLoading = false; |
| | | }); |
| | | |
| | |
| | | }).then((res)=>{ |
| | | this.getDeviceList(); |
| | | }).catch((error) =>{ |
| | | console.log(error); |
| | | console.error(error); |
| | | }); |
| | | }).catch(() => { |
| | | |
| | |
| | | |
| | | }, |
| | | showChannelList: function(row) { |
| | | console.log(JSON.stringify(row)) |
| | | this.$router.push(`/channelList/${row.deviceId}/0/15/1`); |
| | | }, |
| | | showDevicePosition: function(row) { |
| | | console.log(JSON.stringify(row)) |
| | | this.$router.push(`/devicePosition/${row.deviceId}/0/15/1`); |
| | | }, |
| | | |
| | |
| | | refDevice: function(itemData) { |
| | | console.log("刷新对应设备:" + itemData.deviceId); |
| | | var that = this; |
| | | that.$set(itemData,"loading", true); |
| | | this.syncDevices.push(itemData.deviceId) |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: '/api/device/query/devices/' + itemData.deviceId + '/sync' |
| | | }).then(function(res) { |
| | | }).then((res) => { |
| | | console.log("刷新设备结果:"+JSON.stringify(res)); |
| | | if (res.data.code !==0) { |
| | | that.$message({ |
| | |
| | | }); |
| | | } |
| | | that.initData() |
| | | that.$set(itemData,"loading", true); |
| | | }).catch(function(e) { |
| | | this.syncDevices.splice(this.syncDevices.indexOf(itemData.deviceId, 1)); |
| | | }).catch((e) => { |
| | | console.error(e) |
| | | that.$message({ |
| | | showClose: true, |
| | | message: e, |
| | | type: 'error' |
| | | }); |
| | | that.$set(itemData,"loading", true); |
| | | this.syncDevices.splice(this.syncDevices.indexOf(itemData.deviceId, 1)); |
| | | }); |
| | | }, |
| | | //通知设备上传媒体流 |
| | |
| | | // }); |
| | | }, |
| | | transportChange: function (row) { |
| | | console.log(row); |
| | | console.log(`修改传输方式为 ${row.streamMode}:${row.deviceId} `); |
| | | let that = this; |
| | | this.$axios({ |
| | |
| | | }); |
| | | }, |
| | | edit: function (row) { |
| | | console.log(row); |
| | | this.$refs.deviceEdit.openDialog(row, ()=>{ |
| | | this.$refs.deviceEdit.close(); |
| | | this.$message({ |