| | |
| | | import io.netty.buffer.Unpooled; |
| | | import lombok.Data; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | |
| | |
| | | */ |
| | | public byte[] encode() { |
| | | ByteBuf byteBuf = Unpooled.buffer(120); |
| | | byte[] bytes1 = this.getVehicleNo().getBytes(); |
| | | byte[] bytes1 = new byte[0]; |
| | | try { |
| | | bytes1 = this.getVehicleNo().getBytes("GBK"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | for (int i = 0; i < 21; i++) { |
| | | if (i < bytes1.length) { |
| | | byteBuf.writeByte(bytes1[i]); |
| | |
| | | byteBuf.writeInt(this.getSupervisionId()); |
| | | byteBuf.writeLong(this.getSupervisionEndTime()); |
| | | byteBuf.writeByte(this.getSupervisionLevel()); |
| | | byte[] bytes2 = this.getSupervisor().getBytes(); |
| | | byte[] bytes2 = new byte[0]; |
| | | try { |
| | | bytes2 = this.getSupervisor().getBytes("GBK"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | for (int i = 0; i < 16; i++) { |
| | | if (i < bytes2.length) { |
| | | byteBuf.writeByte(bytes2[i]); |
| | |
| | | byteBuf.writeByte(0x00); |
| | | } |
| | | } |
| | | byte[] bytes3 = this.getSupervisorTel().getBytes(); |
| | | byte[] bytes3 = new byte[0]; |
| | | try { |
| | | bytes3 = this.getSupervisorTel().getBytes("GBK"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | for (int i = 0; i < 20; i++) { |
| | | if (i < bytes3.length) { |
| | | byteBuf.writeByte(bytes3[i]); |
| | |
| | | byteBuf.writeByte(0x00); |
| | | } |
| | | } |
| | | byte[] bytes4 = this.getSupervisorEmail().getBytes(); |
| | | byte[] bytes4 = new byte[0]; |
| | | try { |
| | | bytes4 = this.getSupervisorEmail().getBytes("GBK"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | for (int i = 0; i < 32; i++) { |
| | | if (i < bytes4.length) { |
| | | byteBuf.writeByte(bytes4[i]); |