From dd15f7f00e9eda3b15bd956ff830ccbe78752a4f Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 20 五月 2024 17:11:07 +0800
Subject: [PATCH] 田间灌溉项目管理 项目模块 解决分页问题、增加创建时间字段、解决地址ID不一致问题 灌溉单元模块 创建Ctrl SV mapper 实体类
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java
index a853664..767e569 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_15_Down.java
@@ -1,6 +1,7 @@
package com.dy.common.mw.protocol.p206V202404.parse;
import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V202404.CodeV202404;
import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
@@ -48,7 +49,8 @@
public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
if(para.param != null){
- String json = (String)para.param;
+ JSONObject obj = (JSONObject)para.param;
+ String json = obj.toJSONString();
ComCd15Vo cvo = JSON.parseObject(json, ComCd15Vo.class) ;
if(cvo == null){
throw new Exception("json杞珻omCd15Vo涓簄ull") ;
@@ -62,7 +64,7 @@
if(cvo.flowNo.length() != 12){
throw new Exception("娴佹按鍙峰繀椤绘槸12浣嶆暟瀛�") ;
}
- byte[] bs = new byte[17] ;
+ byte[] bs = new byte[40] ;
int index = 0 ;
bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
@@ -96,9 +98,9 @@
bs[index++] = 0 ;
}
}
- if(cvo.chargeMoney != null){
- String chargeMoney = "" + (Double.valueOf(cvo.chargeWater * 100)).longValue() ;
- byte[] bTemp = ByteUtil.string2BCD_LE(chargeMoney) ;
+ if(cvo.chargeWater != null){
+ String chargeWater = "" + (Double.valueOf(cvo.chargeWater * 100)).longValue() ;
+ byte[] bTemp = ByteUtil.string2BCD_LE(chargeWater) ;
int bTempLen = bTemp.length ;
int count = 0 ;
for(int i = 0 ; i < bTempLen; i++){
@@ -120,9 +122,12 @@
ByteUtil.string2BCD_BE(bs, cvo.flowNo, index) ;
index += 6 ;
+ GlCreate.createDt(bs, index);
+
+ index += 6 ;
GlCreate.createPw(bs, index);
- index ++ ;
+ index += 2 ;
GlCreate.createS2D(bs, index) ;
index += 4 ;
--
Gitblit v1.8.0