|
@@ -3,9 +3,10 @@ package com.mes.netty;
|
|
|
|
|
|
|
|
// 固定格式报文各参数获取方法
|
|
// 固定格式报文各参数获取方法
|
|
|
// 协议 v2(2026-06-29 修订):oprno 字段从 6 字符扩到 8 字符,后续字段偏移整体 +2
|
|
// 协议 v2(2026-06-29 修订):oprno 字段从 6 字符扩到 8 字符,后续字段偏移整体 +2
|
|
|
|
|
+// 协议 v3(2026-07-13 修订):LX 字段从 2 字符扩到 3 字符(支持 INSPXXX),后续字段偏移整体 +1
|
|
|
public class ProtocolParam {
|
|
public class ProtocolParam {
|
|
|
// bbbbfffffARWAQDWGWOP100 GY100000ID151245P00000106200123062900001 RSOKDA2023-09-07ZT10:16:58
|
|
// bbbbfffffARWAQDWGWOP100 GY100000ID151245P00000106200123062900001 RSOKDA2023-09-07ZT10:16:58
|
|
|
- public static Integer fixedLength = 98;
|
|
|
|
|
|
|
+ public static Integer fixedLength = 99;
|
|
|
|
|
|
|
|
public static String getMsgType(String msg){
|
|
public static String getMsgType(String msg){
|
|
|
System.out.print(msg);
|
|
System.out.print(msg);
|
|
@@ -37,31 +38,31 @@ public class ProtocolParam {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static String getLx(String msg){
|
|
public static String getLx(String msg){
|
|
|
- if(msg.length() < 74){
|
|
|
|
|
|
|
+ if(msg.length() < 75){
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
- return msg.substring(72,74);
|
|
|
|
|
|
|
+ return msg.substring(72,75).trim();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static String getResult(String msg){
|
|
public static String getResult(String msg){
|
|
|
- if(msg.length() < 76){
|
|
|
|
|
|
|
+ if(msg.length() < 77){
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
- return msg.substring(74,76);
|
|
|
|
|
|
|
+ return msg.substring(75,77);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static String getDay(String msg){
|
|
public static String getDay(String msg){
|
|
|
- if(msg.length() < 88){
|
|
|
|
|
|
|
+ if(msg.length() < 89){
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
- return msg.substring(78,88);
|
|
|
|
|
|
|
+ return msg.substring(79,89);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static String getTime(String msg){
|
|
public static String getTime(String msg){
|
|
|
- if(msg.length() < 98){
|
|
|
|
|
|
|
+ if(msg.length() < 99){
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
- return msg.substring(90,98);
|
|
|
|
|
|
|
+ return msg.substring(91,99);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|