From f717ad3e0a712e823d61383f42de6faf917e7636 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 11 二月 2025 15:23:10 +0800
Subject: [PATCH] 远程模块websocket中,如果客户端id为空,系统设置其一id
---
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/Web2RtuMw.java | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/Web2RtuMw.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/Web2RtuMw.java
index e4f1d05..728a1ae 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/Web2RtuMw.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/Web2RtuMw.java
@@ -3,7 +3,6 @@
import com.dy.common.multiDataSource.DataSourceContext;
import com.dy.common.mw.protocol.Command;
import com.dy.common.mw.protocol.CommandType;
-import com.dy.common.softUpgrade.state.UpgradeTaskVo;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import org.springframework.core.env.Environment;
@@ -91,12 +90,18 @@
String url = UriComponentsBuilder.fromUriString(toMwUrl)
.build()
.toUriString();
- HttpHeaders headers = new HttpHeaders();
- HttpEntity<?> httpEntity = new HttpEntity<>(headers);
+
+ //UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url)
+ // .queryParam("test", test);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url) ;
+
ResponseEntity<BaseResponse> response = null;
try {
- // 閫氳繃Post鏂瑰紡璋冪敤鎺ュ彛
- response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, BaseResponse.class);
+ // 閫氳繃Get鏂瑰紡璋冪敤鎺ュ彛
+ response = restTemplate.exchange(builder.toUriString(),
+ HttpMethod.GET,
+ new HttpEntity<>(new HttpHeaders()),
+ BaseResponse.class);
} catch (Exception e) {
e.printStackTrace();
return BaseResponseUtils.buildError("鍚庣绯荤粺鍑洪敊锛屼腑闂翠欢璋冪敤寮傚父");
--
Gitblit v1.8.0