From b421b28125bff8f39675e3f5ce29b3f58f13b5ae Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 15 五月 2024 14:13:35 +0800 Subject: [PATCH] 1、增加了单数据源的Configuration; 2、RestTemplateConfiguration.java更换包路径; 3、完善王江海制定协议的实现代码。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_88_Down.java | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_88_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_88_Down.java index d466d89..513bf20 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_88_Down.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_88_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; @@ -47,18 +48,16 @@ public byte[] doParse(ParseParamsForDownV202404 para) throws Exception { byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode); if(para.param != null){ - String json = (String)para.param; - ComCdXyVo cvo = JSON.parseObject(json, ComCdXyVo.class) ; - if(cvo == null){ - throw new Exception("json杞珻omCdXyVo涓簄ull") ; - } + JSONObject obj = (JSONObject)para.param; + String controllerType = (String)obj.get("controllerType"); + Integer projectNo = (Integer)obj.get("projectNo") ; byte[] bs = new byte[2] ; int index = 0 ; - bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16)); + bs[index] = (byte)(Integer.parseInt(controllerType, 16)); index ++ ; - bs[index] = cvo.projectNo.byteValue() ; + bs[index] = projectNo.byteValue() ; bytes = ByteUtil.bytesMerge(bytes, bs) ; }else{ -- Gitblit v1.8.0