diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java index d3543a01..5ec58b3b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java @@ -117,7 +117,7 @@ public class CatalogDataCatch { // 超过五秒收不到消息任务超时, 只更新这一部分数据, 收到数据与声明的总数一致,则重置通道数据,数据不全则只对收到的数据做更新操作 if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.runIng)) { if (catalogData.getTotal() == catalogData.getChannelList().size()) { - deviceChannelService.resetChannels(catalogData.getDevice().getDeviceId(), catalogData.getChannelList()); + deviceChannelService.resetChannels(catalogData.getDevice().getId(), catalogData.getChannelList()); }else { deviceChannelService.updateChannels(catalogData.getDevice(), catalogData.getChannelList()); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java index 83e44b96..c4f224bf 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java @@ -130,7 +130,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp if (catalogDataCatch.get(take.getDevice().getDeviceId()).size() == sumNum) { // 数据已经完整接收, 此时可能存在某个设备离线变上线的情况,但是考虑到性能,此处不做处理, // 目前支持设备通道上线通知时和设备上线时向上级通知 - boolean resetChannelsResult = deviceChannelService.resetChannels(take.getDevice().getDeviceId(), catalogDataCatch.get(take.getDevice().getDeviceId())); + boolean resetChannelsResult = deviceChannelService.resetChannels(device.getId(), catalogDataCatch.get(take.getDevice().getDeviceId())); if (!resetChannelsResult) { String errorMsg = "接收成功,写入失败,共" + sumNum + "条,已接收" + catalogDataCatch.get(take.getDevice().getDeviceId()).size() + "条"; catalogDataCatch.setChannelSyncEnd(take.getDevice().getDeviceId(), errorMsg); diff --git a/src/main/java/com/genersoft/iot/vmp/service/IDeviceChannelService.java b/src/main/java/com/genersoft/iot/vmp/service/IDeviceChannelService.java index e9ce0cb0..76c9da78 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/IDeviceChannelService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/IDeviceChannelService.java @@ -105,7 +105,7 @@ public interface IDeviceChannelService { void cleanChannelsForDevice(int deviceId); - boolean resetChannels(String deviceId, List deviceChannels); + boolean resetChannels(int deviceDbId, List deviceChannels); PageInfo getSubChannels(int deviceDbId, String channelId, String query, Boolean channelType, Boolean online, int page, int count); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java index 4ccf15b8..49dc829d 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java @@ -422,15 +422,11 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService { @Override @Transactional - public boolean resetChannels(String deviceId, List deviceChannelList) { + public boolean resetChannels(int deviceDbId, List deviceChannelList) { if (CollectionUtils.isEmpty(deviceChannelList)) { return false; } - Device device = deviceMapper.getDeviceByDeviceId(deviceId); - if (device == null) { - throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备: " +deviceId); - } - List allChannels = channelMapper.queryAllChannels(device.getId()); + List allChannels = channelMapper.queryAllChannels(deviceDbId); Map allChannelMap = new ConcurrentHashMap<>(); if (!allChannels.isEmpty()) { for (DeviceChannel deviceChannel : allChannels) { @@ -507,7 +503,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService { } int limitCount = 50; boolean result = false; - if (!result && !addChannels.isEmpty()) { + if (!addChannels.isEmpty()) { if (addChannels.size() > limitCount) { for (int i = 0; i < addChannels.size(); i += limitCount) { int toIndex = i + limitCount; diff --git a/web_src/src/components/ChannelEdit.vue b/web_src/src/components/ChannelEdit.vue index 47f26885..c7ecff8b 100644 --- a/web_src/src/components/ChannelEdit.vue +++ b/web_src/src/components/ChannelEdit.vue @@ -2,49 +2,40 @@
- - + - - + - - + - - + - - + - - + - - + - - + - + - - + - + @@ -52,25 +43,23 @@ - + - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
保存 @@ -96,26 +188,12 @@ export default { computed: {}, created() { // 获取完整信息 - this.getCommonChannel(data=>{ - if (data.gbDeviceDbId) { - // 国标类型特殊处理 - this.getDeviceChannel(chanel=>{ - this.form = chanel; - console.log(chanel) - }) - }else { - this.form = data; - console.log(data) - } - }) + this.getCommonChannel() }, data() { return { locading: true, - form: { - gbName: "测试", - gbNameLabel: "测试" - }, + form: {}, }; }, methods: { @@ -125,7 +203,10 @@ export default { close: function () { }, - getCommonChannel:function (callback) { + test: function () { + console.log(this.form.gbDownloadSpeedArray) + }, + getCommonChannel:function () { this.$axios({ method: 'get', url: "/api/common/channel/one", @@ -134,9 +215,8 @@ export default { } }).then((res) => { if (res.data.code === 0) { - if(callback) { - callback(res.data.data) - } + res.data.data.gbDownloadSpeedArray = res.data.data.gbDownloadSpeed.split("/") + this.form = res.data.data; } }).catch((error) => { console.error(error) @@ -144,25 +224,25 @@ export default { this.locading = false ]) }, - getDeviceChannel:function (callback) { - this.$axios({ - method: 'get', - url: "/api/device/query/channel/raw", - params: { - id: this.id - } - }).then((res) => { - if (res.data.code === 0) { - if(callback) { - callback(res.data.data) - } - } - }).catch((error) => { - console.error(error) - }).finally(()=>[ - this.locading = false - ]) - } + // getDeviceChannel:function (callback) { + // this.$axios({ + // method: 'get', + // url: "/api/device/query/channel/raw", + // params: { + // id: this.id + // } + // }).then((res) => { + // if (res.data.code === 0) { + // if(callback) { + // callback(res.data.data) + // } + // } + // }).catch((error) => { + // console.error(error) + // }).finally(()=>[ + // this.locading = false + // ]) + // } }, };