|
|
@@ -5,7 +5,7 @@ package com.mes.netty;
|
|
|
// 协议 v2(2026-06-29 修订):oprno 字段从 6 字符扩到 8 字符,后续字段偏移整体 +2
|
|
|
public class ProtocolParam {
|
|
|
// bbbbfffffARWAQDWGWOP100 GY100000ID151245P00000106200123062900001 RSOKDA2023-09-07ZT10:16:58
|
|
|
- public static Integer fixedLength = 98; // 固定长度(响应报文,v1=96,v2 扩 oprno 后 +2)
|
|
|
+ public static Integer fixedLength = 99; // 固定长度(响应报文,v1=96,v2 扩 oprno 后 +2)
|
|
|
|
|
|
// 获取消息类型 所有报文都可使用
|
|
|
public static String getMsgType(String msg){
|
|
|
@@ -41,34 +41,34 @@ public class ProtocolParam {
|
|
|
}
|
|
|
|
|
|
public static String getLx(String msg){
|
|
|
- if(msg.length() < 74){
|
|
|
+ if(msg.length() < 75){
|
|
|
return "";
|
|
|
}
|
|
|
- return msg.substring(72,74);
|
|
|
+ return msg.substring(72,75).trim();
|
|
|
}
|
|
|
|
|
|
// 获取结果
|
|
|
public static String getResult(String msg){
|
|
|
- if(msg.length() < 76){
|
|
|
+ if(msg.length() < 77){
|
|
|
return "";
|
|
|
}
|
|
|
- return msg.substring(74,76);
|
|
|
+ return msg.substring(75,77);
|
|
|
}
|
|
|
|
|
|
// 获取日期
|
|
|
public static String getDay(String msg){
|
|
|
- if(msg.length() < 88){
|
|
|
+ if(msg.length() < 89){
|
|
|
return "";
|
|
|
}
|
|
|
- return msg.substring(78,88);
|
|
|
+ return msg.substring(79,89);
|
|
|
}
|
|
|
|
|
|
// 获取时间
|
|
|
public static String getTime(String msg){
|
|
|
- if(msg.length() < 98){
|
|
|
+ if(msg.length() < 99){
|
|
|
return "";
|
|
|
}
|
|
|
- return msg.substring(90,98);
|
|
|
+ return msg.substring(91,99);
|
|
|
}
|
|
|
|
|
|
}
|