ncc协议x
This commit is contained in:
parent
bf3267a695
commit
21567c062f
@ -2,6 +2,7 @@ package club.joylink.xiannccda.ats.message.line3;
|
||||
|
||||
import club.joylink.xiannccda.ats.message.MessageResponse;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
@ -11,6 +12,7 @@ import java.util.List;
|
||||
/**
|
||||
* 2.8.6 调度日志报告消息
|
||||
*/
|
||||
@Getter
|
||||
public class DispatcherReportResponse extends MessageResponse {
|
||||
|
||||
/**
|
||||
@ -41,17 +43,18 @@ public class DispatcherReportResponse extends MessageResponse {
|
||||
|
||||
@Override
|
||||
public void decode2(ByteBuf buf) throws Exception {
|
||||
this.lineId=buf.readShort();
|
||||
this.reportId=buf.readShort();
|
||||
this.totalMessage=buf.readShort();
|
||||
this.messageSequence=buf.readShort();
|
||||
this.count=buf.readShort();
|
||||
this.logs=new ArrayList<>(this.count);
|
||||
for(int i=0;i<this.count;i++){
|
||||
this.lineId = buf.readShort();
|
||||
this.reportId = buf.readShort();
|
||||
this.totalMessage = buf.readShort();
|
||||
this.messageSequence = buf.readShort();
|
||||
this.count = buf.readShort();
|
||||
this.logs = new ArrayList<>(this.count);
|
||||
for (int i = 0; i < this.count; i++) {
|
||||
this.logs.add(new LogCell().decode(buf));
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class LogCell {
|
||||
|
||||
/**
|
||||
@ -65,27 +68,19 @@ public class DispatcherReportResponse extends MessageResponse {
|
||||
/**
|
||||
* 记录内容(256)
|
||||
*/
|
||||
private String logItem;
|
||||
private String logItem;
|
||||
|
||||
public LogCell decode(final ByteBuf buf) {
|
||||
/**
|
||||
* 日期(7)
|
||||
*/
|
||||
final byte[] reportTime = new byte[7];
|
||||
/**
|
||||
* 调度员(32)
|
||||
*/
|
||||
final byte[] userName = new byte[32];
|
||||
/**
|
||||
* 记录内容(256)
|
||||
*/
|
||||
final byte[] logItem = new byte[256];
|
||||
buf.readBytes(reportTime);
|
||||
buf.readBytes(userName);
|
||||
buf.readBytes(logItem);
|
||||
//
|
||||
this.reportTime = DateTimeUtil.convert(reportTime);
|
||||
this.userName = new String(userName, MessageCons.STRING_CHARSET);
|
||||
this.userName = new String(userName, MessageCons.STRING_CHARSET);
|
||||
this.logItem = new String(logItem, MessageCons.STRING_CHARSET);
|
||||
//
|
||||
return this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user