wuzeyu
2024-05-23 0857b855609b1735a1583d69f8289a2d26950419
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_24_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;
@@ -24,6 +25,7 @@
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        midRs.downCode = para.commandCode ;//下行命令功能码;
@@ -50,7 +52,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();
            ComCd24Vo cvo = JSON.parseObject(json, ComCd24Vo.class) ;
            if(cvo == null){
                throw new Exception("json转ComCd24Vo为null") ;
@@ -86,7 +89,7 @@
            bytes = ByteUtil.bytesMerge(bytes, bsRg) ;
            byte[] bs1 = new byte[7] ;
            index ++ ;
            index = 0 ;
            GlCreate.createPw(bs1, index);
            index += 2 ;