diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTQueryMediaDataCommand.java b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTQueryMediaDataCommand.java index 9d6cbcb02..05b18e193 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTQueryMediaDataCommand.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTQueryMediaDataCommand.java @@ -33,8 +33,16 @@ public class JTQueryMediaDataCommand { byteBuf.writeByte(type); byteBuf.writeByte(chanelId); byteBuf.writeByte(event); - byteBuf.writeBytes(BCDUtil.strToBcd(DateUtil.yyyy_MM_dd_HH_mm_ssTo1078(startTime))); - byteBuf.writeBytes(BCDUtil.strToBcd(DateUtil.yyyy_MM_dd_HH_mm_ssTo1078(endTime))); + if (startTime == null) { + byteBuf.writeBytes(BCDUtil.strToBcd("000000000000")); + }else { + byteBuf.writeBytes(BCDUtil.strToBcd(DateUtil.yyyy_MM_dd_HH_mm_ssTo1078(startTime))); + } + if (endTime == null) { + byteBuf.writeBytes(BCDUtil.strToBcd("000000000000")); + }else { + byteBuf.writeBytes(BCDUtil.strToBcd(DateUtil.yyyy_MM_dd_HH_mm_ssTo1078(endTime))); + } if (delete != null) { byteBuf.writeByte(delete); } diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/codec/encode/Jt808Encoder.java b/src/main/java/com/genersoft/iot/vmp/jt1078/codec/encode/Jt808Encoder.java index 6868f642a..c3c6d1cb0 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/codec/encode/Jt808Encoder.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/codec/encode/Jt808Encoder.java @@ -23,7 +23,7 @@ public class Jt808Encoder extends MessageToByteEncoder { protected void encode(ChannelHandlerContext ctx, Rs msg, ByteBuf out) throws Exception { Session session = ctx.channel().attr(Session.KEY).get(); - List encodeList = Jt808EncoderCmd.encode(msg, session, session.nextSerialNo()); + List encodeList = Jt808EncoderCmd.encode(msg, session, session.nextSerialNo()); if(encodeList!=null && !encodeList.isEmpty()){ for (ByteBuf byteBuf : encodeList) { log.debug("< {} hex:{}", session, ByteBufUtil.hexDump(byteBuf)); 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 34b3032bb..03d25e6df 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 @@ -812,8 +812,8 @@ public class jt1078ServiceImpl implements Ijt1078Service { J8805 j8805 = new J8805(); j8805.setMediaId(mediaId); j8805.setDelete(1); - log.info("[JT-单条存储多媒体数据上传] 请求上传图片,媒体编号: {}, 设备编号: {}", mediaId, phoneNumber); - JTMediaEventInfo mediaEventInfo = (JTMediaEventInfo)jt1078Template.uploadMediaDataForSingle(phoneNumber, j8805, 300); + log.info("[JT-单条存储多媒体数据上传] 请求上传,媒体编号: {}, 设备编号: {}", mediaId, phoneNumber); + JTMediaEventInfo mediaEventInfo = (JTMediaEventInfo)jt1078Template.uploadMediaDataForSingle(phoneNumber, j8805, 600); if (mediaEventInfo == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), ErrorCode.ERROR100.getMsg()); } diff --git a/web/src/api/jtDevice.js b/web/src/api/jtDevice.js index 116c909b6..99c56d380 100644 --- a/web/src/api/jtDevice.js +++ b/web/src/api/jtDevice.js @@ -326,10 +326,17 @@ export function queryMediaAttribute(phoneNumber) { } }) } -export function setPhoneBook(data) { +export function queryMediaData(data) { return request({ method: 'post', - url: '/api/jt1078/set-phone-book', + url: '/api/jt1078/media/list', + data: data + }) +} +export function shooting(data) { + return request({ + method: 'post', + url: '/api/jt1078/shooting', data: data }) } diff --git a/web/src/store/modules/jtDevice.js b/web/src/store/modules/jtDevice.js index 6aec99a25..711e18578 100644 --- a/web/src/store/modules/jtDevice.js +++ b/web/src/store/modules/jtDevice.js @@ -17,12 +17,12 @@ import { queryDeviceById, queryDevices, queryDriverInfo, - queryMediaAttribute, + queryMediaAttribute, queryMediaData, queryPosition, queryRecordList, reset, sendTextMessage, - setConfig, setPhoneBook, + setConfig, setPhoneBook, shooting, startPlayback, stopPlay, stopPlayback, @@ -352,6 +352,26 @@ const actions = { reject(error) }) }) + }, + queryMediaData({ commit }, data) { + return new Promise((resolve, reject) => { + queryMediaData(data).then(response => { + const { data } = response + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + shooting({ commit }, data) { + return new Promise((resolve, reject) => { + shooting(data).then(response => { + const { data } = response + resolve(data) + }).catch(error => { + reject(error) + }) + }) } } diff --git a/web/src/views/jtDevice/deviceParam/imageConfig.vue b/web/src/views/jtDevice/deviceParam/imageConfig.vue index e2b7532c7..9f9b0724f 100755 --- a/web/src/views/jtDevice/deviceParam/imageConfig.vue +++ b/web/src/views/jtDevice/deviceParam/imageConfig.vue @@ -91,5 +91,5 @@ export default { margin-top: 6px; font-size: 12px; width: 2rem !important; -} + } diff --git a/web/src/views/jtDevice/deviceParam/videoParam.vue b/web/src/views/jtDevice/deviceParam/videoParam.vue index 2775af771..6a1d35bcc 100755 --- a/web/src/views/jtDevice/deviceParam/videoParam.vue +++ b/web/src/views/jtDevice/deviceParam/videoParam.vue @@ -22,10 +22,10 @@ - - - - + + + + diff --git a/web/src/views/jtDevice/dialog/position.vue b/web/src/views/jtDevice/dialog/position.vue index 046e06982..2d251d196 100755 --- a/web/src/views/jtDevice/dialog/position.vue +++ b/web/src/views/jtDevice/dialog/position.vue @@ -10,7 +10,7 @@ :destroy-on-close="true" @close="close()" > -
+
{{ positionData.longitude }} {{ positionData.latitude }} diff --git a/web/src/views/jtDevice/dialog/queryMediaList.vue b/web/src/views/jtDevice/dialog/queryMediaList.vue index 07bdcb8a1..cca408e62 100755 --- a/web/src/views/jtDevice/dialog/queryMediaList.vue +++ b/web/src/views/jtDevice/dialog/queryMediaList.vue @@ -1,121 +1,113 @@ diff --git a/web/src/views/jtDevice/dialog/shootingNow.vue b/web/src/views/jtDevice/dialog/shootingNow.vue new file mode 100755 index 000000000..46af2acf0 --- /dev/null +++ b/web/src/views/jtDevice/dialog/shootingNow.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/web/src/views/jtDevice/list.vue b/web/src/views/jtDevice/list.vue index 56cdd0982..2ef70f1f4 100755 --- a/web/src/views/jtDevice/list.vue +++ b/web/src/views/jtDevice/list.vue @@ -46,8 +46,16 @@ > - - + + + + + + @@ -129,6 +137,8 @@ 连接指定服务器 车门控制 + + 立即拍摄 多媒体检索 @@ -158,6 +168,7 @@ +
@@ -173,13 +184,14 @@ import connectionServer from './dialog/connectionServer.vue' import controlDoor from './dialog/controlDoor.vue' import mediaAttribute from './dialog/mediaAttribute.vue' import phoneBook from './dialog/phoneBook.vue' -import queryMediaList from './dialog/queryMediaList.vue' +import queryMediaList from './dialog/queryMediaListDialog.vue' +import shootingNow from './dialog/shootingNow.vue' export default { name: 'App', components: { deviceEdit, configInfo, attribute, position, textMsg, telephoneCallback, driverInfo, connectionServer, controlDoor - , mediaAttribute, phoneBook, queryMediaList + , mediaAttribute, phoneBook, queryMediaList, shootingNow }, data() { return { @@ -304,6 +316,8 @@ export default { this.setPhoneBook(itemData) } else if (command === 'queryMediaList') { this.queryMediaList(itemData) + } else if (command === 'shooting') { + this.shootingNow(itemData) } else { this.$message.info('尚不支持') } @@ -393,6 +407,9 @@ export default { controlDoor: function(itemData) { this.$refs.controlDoor.openDialog(itemData.phoneNumber) }, + shootingNow: function(itemData) { + this.$refs.shootingNow.openDialog(itemData.phoneNumber, itemData.id) + }, linkDetection: function(itemData) { this.$store.dispatch('jtDevice/linkDetection', itemData.phoneNumber) .then((data) => {