zhubaomin
7 天以前 00d54db361d697cf8fdf2f15940f4650b21b3185
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java
@@ -5,6 +5,7 @@
import com.dy.common.mw.protocol.p206V202404.ProtocolConstantV206V202404;
import com.dy.common.mw.protocol.p206V202404.downVos.ComCdXyVo;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -22,15 +23,15 @@
    //protected static final String mwIp = "romq9311819.vicp.fun" ; //http://romq9311819.vicp.fun:16583
    //protected static final String mwPort = "16583" ;
    protected static final String mwIp = "127.0.0.1" ;
    protected static final String mwPort = "8071" ;
    protected static final String mwPort = "65533" ;
    protected static String mwUrlTest = "http://" + mwIp + ":" + mwPort + "/rtuMw/com/test" ;
    protected static String mwUrlSendCom = "http://" + mwIp + ":" + mwPort + "/rtuMw/com/send" ;
    protected static String rtuAddr = "41162810400100001" ;
    protected static String rtuAddr = "37142501020100229" ;
    protected static String rtuResultSendWebUrl = "http://127.0.0.1:65535/test/comRes/receive" ;
    protected static String controllerType = "57" ;//控制器类型
    protected static String controllerType = "02" ;//控制器类型 57水泵,02阀门
    protected static Integer projectNo = 10 ;//项目编码
    protected static String icCardAddr = "04BEA5BB" ;//IC卡地址
@@ -78,8 +79,13 @@
            response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
    /**
@@ -98,8 +104,13 @@
            response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }
        return response.getBody();
        if(response == null){
            return BaseResponseUtils.buildError("后端系统出错,中间件调用异常");
        }else{
            return response.getBody();
        }
    }
}