From d736d220008f3ddaed44ac6bfa8a19eb8ca61e96 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 12 十月 2024 14:09:39 +0800
Subject: [PATCH] 1、江海协议功能C2增加订单号数据项; 2、下行命令构造时标TP当月份大于等于10时有错,进行修改。
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java
index 9a0db38..df5a0b8 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java
@@ -114,25 +114,14 @@
ByteUtil.string2BCD_BE(bs, DateTime.mm(), index + 1) ;
ByteUtil.string2BCD_BE(bs, DateTime.HH(), index + 2) ;
ByteUtil.string2BCD_BE(bs, DateTime.dd(), index + 3) ;
+ //浠ヤ笅鍐欐硶鑷劧涔熸槸BCD
+ byte week = DateTime.week_Int().byteValue() ;
byte month = Byte.parseByte(DateTime.MM()) ;
- byte week = (byte)(DateTime.week_Int().byteValue() << 1) ;
- String month1 = "0" ;
- String month2 = "0" ;
if(month < 10){
- month1 = "" + month ;
+ bs[index + 4] = (byte)(week << 5 | month) ;
}else{
- if(month == 10){
- month1 = "0" ;
- }else if(month == 11){
- month1 = "1" ;
- }else if(month == 12){
- month1 = "2" ;
- }
- week = (byte)(week | 0x01) ;
+ bs[index + 4] = (byte)(week << 5 | 0x10 | (month - 10)) ;
}
- month2 = "" + week ;
-
- ByteUtil.string2BCD_BE(bs, month2 + month1, index + 4) ;
ByteUtil.string2BCD_BE(bs, DateTime.yy(), index + 5) ;
/*
--
Gitblit v1.8.0