diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J1205.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J1205.java index 31f316ce4..09769de0f 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J1205.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J1205.java @@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.jt1078.proc.response.Rs; import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service; import com.genersoft.iot.vmp.jt1078.session.Session; import com.genersoft.iot.vmp.jt1078.session.SessionManager; +import com.genersoft.iot.vmp.utils.DateUtil; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import org.springframework.context.ApplicationEvent; @@ -35,8 +36,10 @@ public class J1205 extends Re { for (int i = 0; i < size; i++) { JRecordItem item = new JRecordItem(); item.setChannelId(buf.readUnsignedByte()); - item.setStartTime(ByteBufUtil.hexDump(buf.readSlice(6))); - item.setEndTime(ByteBufUtil.hexDump(buf.readSlice(6))); + String startTime = ByteBufUtil.hexDump(buf.readSlice(6)); + item.setStartTime(DateUtil.jt1078Toyyyy_MM_dd_HH_mm_ss(startTime)); + String endTime = ByteBufUtil.hexDump(buf.readSlice(6)); + item.setEndTime(DateUtil.jt1078Toyyyy_MM_dd_HH_mm_ss(endTime)); item.setWarn(buf.readLong()); item.setMediaType(buf.readUnsignedByte()); item.setStreamType(buf.readUnsignedByte()); diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java index aff4bc5f6..b9010756d 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java @@ -241,6 +241,14 @@ public class jt1078ServiceImpl implements Ijt1078Service { public void stopPlay(String phoneNumber, Integer channelId) { String playKey = VideoManagerConstants.INVITE_INFO_1078_PLAY + phoneNumber + ":" + channelId; dynamicTask.stop(playKey); + // 清理回调 + List> generalCallbacks = inviteErrorCallbackMap.get(playKey); + if (generalCallbacks != null && !generalCallbacks.isEmpty()) { + for (GeneralCallback callback : generalCallbacks) { + callback.run(InviteErrorCode.ERROR_FOR_FINISH.getCode(), InviteErrorCode.ERROR_FOR_FINISH.getMsg(), null); + } + } + jt1078Template.checkTerminalStatus(phoneNumber); StreamInfo streamInfo = (StreamInfo) redisTemplate.opsForValue().get(playKey); // 发送停止命令 J9102 j9102 = new J9102(); @@ -256,13 +264,7 @@ public class jt1078ServiceImpl implements Ijt1078Service { mediaServerService.closeRTPServer(streamInfo.getMediaServerId(), streamInfo.getStream()); redisTemplate.delete(playKey); } - // 清理回调 - List> generalCallbacks = inviteErrorCallbackMap.get(playKey); - if (generalCallbacks != null && !generalCallbacks.isEmpty()) { - for (GeneralCallback callback : generalCallbacks) { - callback.run(InviteErrorCode.ERROR_FOR_FINISH.getCode(), InviteErrorCode.ERROR_FOR_FINISH.getMsg(), null); - } - } + } @Override @@ -445,7 +447,7 @@ public class jt1078ServiceImpl implements Ijt1078Service { @Override public void stopPlayback(String phoneNumber, Integer channelId) { - playbackControl(phoneNumber, channelId, 2, null, String.valueOf(0)); + playbackControl(phoneNumber, channelId, 2, null, null); } private Map> fileUploadMap = new ConcurrentHashMap<>(); diff --git a/web_src/src/components/JTChannelList.vue b/web_src/src/components/JTChannelList.vue index bb711cf80..d4a940f97 100755 --- a/web_src/src/components/JTChannelList.vue +++ b/web_src/src/components/JTChannelList.vue @@ -186,7 +186,6 @@ export default { this.isLoging = true; let channelId = itemData.channelId; console.log("通知设备推流1:" + this.device.phoneNumber + " : " + channelId); - console.log(this.device); this.$axios({ method: 'get', url: '/api/jt1078/live/start', @@ -196,12 +195,9 @@ export default { type: 0, } }).then((res)=> { - console.log(res) this.isLoging = false; if (res.data.code === 0) { - setTimeout(() => { - let snapId = this.device.phoneNumber + "_" + channelId; this.loadSnap[this.device.phoneNumber + channelId] = 0; this.getSnapErrorEvent(snapId) @@ -232,10 +228,7 @@ export default { } }, queryRecords: function (itemData) { - let deviceId = this.deviceId; - let channelId = itemData.channelId; - - this.$router.push(`/gbRecordDetail/${deviceId}/${channelId}`) + this.$router.push(`/jtRecordDetail/${this.device.phoneNumber}/${itemData.channelId}`) }, queryCloudRecords: function (itemData) { let deviceId = this.deviceId; @@ -244,7 +237,6 @@ export default { this.$router.push(`/cloudRecordDetail/rtp/${deviceId}_${channelId}`) }, stopDevicePush: function (itemData) { - var that = this; this.$axios({ method: 'get', url: '/api/jt1078/live/stop', @@ -252,14 +244,15 @@ export default { phoneNumber: this.device.phoneNumber, channelId: itemData.channelId, } - }).then(function (res) { - that.initData(); - }).catch(function (error) { - if (error.response.status === 402) { // 已经停止过 - that.initData(); - } else { - console.log(error) + }).then((res)=> { + console.log(res) + if (res.data.code === 0) { + this.initData(); + }else { + this.$message.error(res.data.msg); } + }).catch(function (error) { + console.error(error) }); }, getSnap: function (row) { @@ -291,18 +284,6 @@ export default { this.initData(); }) }, - changeSubchannel(itemData) { - this.beforeUrl = this.$router.currentRoute.path; - - var url = `/${this.$router.currentRoute.name}/${this.$router.currentRoute.params.deviceId}/${itemData.channelId}` - this.$router.push(url).then(() => { - this.searchSrt = ""; - this.channelType = ""; - this.online = ""; - this.initParam(); - this.initData(); - }) - }, search: function () { this.currentPage = 1; this.total = 0; @@ -331,66 +312,6 @@ export default { setTimeout(this.getList, 200) }) }, - treeNodeClickEvent: function (device, data, isCatalog) { - console.log(device) - if (!!!data.channelId) { - this.parentChannelId = device.deviceId; - } else { - this.parentChannelId = data.channelId; - } - this.initData(); - }, - // 保存 - handleSave(row) { - if (row.location) { - const segements = row.location.split(","); - if (segements.length !== 2) { - this.$message.warning("位置信息格式有误,例:117.234,36.378"); - return; - } else { - row.customLongitude = parseFloat(segements[0]); - row.custom_latitude = parseFloat(segements[1]); - if (!(row.longitude && row.latitude)) { - this.$message.warning("位置信息格式有误,例:117.234,36.378"); - return; - } - } - } else { - delete row.longitude; - delete row.latitude; - } - Object.keys(row).forEach(key => { - const value = row[key]; - if (value === null || value === undefined || (typeof value === "string" && value.trim() === "")) { - delete row[key]; - } - }); - this.$axios({ - method: 'post', - url: `/api/device/query/channel/update/${this.deviceId}`, - params: row - }).then(response => { - if (response.data.code === 0) { - this.$message.success("修改成功!"); - this.initData(); - } else { - this.$message.error("修改失败!"); - } - }).catch(_ => { - this.$message.error("修改失败!"); - }) - }, - // 是否正在编辑 - isEdit() { - let editing = false; - this.deviceChannelList.forEach(e => { - if (e.edit) { - editing = true; - } - }); - - return editing; - }, // 编辑 handleEdit(row) { this.$refs.channelEdit.openDialog(row, this.deviceId, () => { @@ -406,57 +327,3 @@ export default { } }; - - diff --git a/web_src/src/components/JTRecordDetail.vue b/web_src/src/components/JTRecordDetail.vue new file mode 100755 index 000000000..3a61f9b78 --- /dev/null +++ b/web_src/src/components/JTRecordDetail.vue @@ -0,0 +1,556 @@ + + + + + + diff --git a/web_src/src/router/index.js b/web_src/src/router/index.js index 4eb24290c..99945f926 100755 --- a/web_src/src/router/index.js +++ b/web_src/src/router/index.js @@ -6,6 +6,7 @@ import console from '../components/console.vue' import deviceList from '../components/DeviceList.vue' import jtDeviceList from '../components/JTDeviceList.vue' import jtChannelList from '../components/JTChannelList.vue' +import jtRecordDetail from '../components/JTRecordDetail.vue' import channelList from '../components/channelList.vue' import gbRecordDetail from '../components/GBRecordDetail.vue' import pushVideoList from '../components/PushVideoList.vue' @@ -81,6 +82,11 @@ export default new VueRouter({ name: 'gbRecordDetail', component: gbRecordDetail, }, + { + path: '/jtRecordDetail/:phoneNumber/:channelId/', + name: 'jtRecordDetail', + component: jtRecordDetail, + }, { path: '/parentPlatformList/:count/:page', name: 'parentPlatformList',