| | |
| | | package com.ruoyi.dataInterchange.model; |
| | | |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.dataInterchange.pojo.BaseModel; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.ByteArrayUtil; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | |
| | | import org.springframework.data.elasticsearch.annotations.Document; |
| | | import org.springframework.data.elasticsearch.annotations.Field; |
| | | import org.springframework.data.elasticsearch.annotations.FieldType; |
| | | |
| | | import java.text.ParseException; |
| | | |
| | | /** |
| | | * 上报报警信息 |
| | |
| | | this.warnSrc = byteBuf.readByte(); |
| | | //报警类型 |
| | | this.warnType = byteBuf.readShort(); |
| | | String date = byteBuf.readByte() + "-" + byteBuf.readByte() + "-" + byteBuf.readShort() + " " + |
| | | byteBuf.readByte() + ":" + byteBuf.readByte() + ":" + byteBuf.readByte(); |
| | | long time = 0; |
| | | try { |
| | | time = DateUtils.parseDate(date, "dd-MM-yyyy HH:mm:ss").getTime(); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | byte[] readableBytes = new byte[8]; |
| | | byteBuf.readBytes(readableBytes); |
| | | String time = ByteArrayUtil.bytes2HexStr(readableBytes); |
| | | //报警时间 |
| | | this.warnTime = time; |
| | | this.warnTime = Long.parseLong(time, 16); |
| | | //信息ID |
| | | this.infoId = byteBuf.readInt(); |
| | | //报警数据长度 |