From ea58523b67ad59002a1191c3c564258c5b81f6f2 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 06 五月 2025 17:35:16 +0800
Subject: [PATCH] Revert "1、实现万用token(0000-0000-1234-9876-5); 2、web端单独实现命令结果等待器,并修改相关部分; 3、web端实现透传命令; 4、修改一些不当注释; 5、优化一些代码。"

---
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/rtuMw/Web2RtuMw.java |   62 +++++++++++++++---------------
 1 files changed, 31 insertions(+), 31 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 42d074e..41de437 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
@@ -31,20 +31,20 @@
     private static final String pro_mw = "mw";
     private static final String pro_url = "url";
 
-    public static final String ContextComSend = "/rtuMw/com/send";
+    protected static final String ContextComSend = "/rtuMw/com/send";
 
-    public static final String ContextRtuLogFile = "/rtuMw/com/rtuLogFile";
-    public static final String ContextRtuLogText = "/rtuMw/com/rtuLogText";
+    protected static final String ContextRtuLogFile = "/rtuMw/com/rtuLogFile";
+    protected static final String ContextRtuLogText = "/rtuMw/com/rtuLogText";
 
-    public static final String ContextRegisterMsReceiverWebUrl = "/rtuMw/com/registerMsReceiverWebUrl";
-    public static final String ContextUgTaskSend = "/rtuMw/com/upgradeRtu";
-    public static final String ContextUgForceOver = "/rtuMw/com/ugForceOver";
+    protected static final String ContextRegisterMsReceiverWebUrl = "/rtuMw/com/registerMsReceiverWebUrl";
+    protected static final String ContextUgTaskSend = "/rtuMw/com/upgradeRtu";
+    protected static final String ContextUgForceOver = "/rtuMw/com/ugForceOver";
     /**
      * 寰楀埌鍚戦�氫俊涓棿浠跺彂閫佹暟鎹殑URL
      * @param env
      * @return
      */
-    public String get2MwUrl(Environment env) {
+    protected String get2MwUrl(Environment env) {
         return env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + pro_url);
     }
     /**
@@ -53,76 +53,76 @@
      * @param orgTag
      * @return
      */
-    public String get2MwUrl(Environment env, String orgTag) {
+    protected String get2MwUrl(Environment env, String orgTag) {
         return env.getProperty(pro_mw + "." + orgTag + "." + pro_url);
     }
     /**
-     * 寰楀埌鍚戦�氫俊涓棿浠跺彂閫佹暟鎹殑URL
+     * 寰楀埌鍚戦�氫俊涓棿浠跺彂閫佸己鍒跺仠姝㈠崌绾х殑鍛戒护URL
      * @param env
      * @param context
      * @return
      */
-    public String get2MwRequestUrl(Environment env, String context) {
+    protected String get2MwRequestUrl(Environment env, String context) {
         return get2MwUrl(env) + context;
     }
     /**
-     * 寰楀埌鍚戦�氫俊涓棿浠跺彂閫佹暟鎹殑URL
+     * 寰楀埌鍚戦�氫俊涓棿浠跺彂閫佸己鍒跺仠姝㈠崌绾х殑鍛戒护URL
      * @param env
      * @param orgTag
      * @param context
      * @return
      */
-    public String get2MwRequestUrl(Environment env, String orgTag, String context) {
+    protected String get2MwRequestUrl(Environment env, String orgTag, String context) {
         return get2MwUrl(env, orgTag) + context;
     }
 
     /**
-     * 鍚戦�氫俊涓棿浠跺彂閫丳ost璇锋眰
+     * 鍚戦�氫俊涓棿浠跺彂閫乺tu杩滅▼鍗囩骇浠诲姟
      * @param restTemplate SpringBoot鐨凴estTemplate
      * @param toMwUrl 鍒伴�氫俊涓棿浠剁殑web璇锋眰Url
-     * @param body 鏁版嵁
+     * @param body 璇锋眰鏁版嵁
      * @return
      */
-    public BaseResponse sendPostRequest2Mw(RestTemplate restTemplate, String toMwUrl, Object body) {
+    protected BaseResponse sendPostRequest2Mw(RestTemplate restTemplate, String toMwUrl, Object body) {
         String url = UriComponentsBuilder.fromUriString(toMwUrl)
                 .build()
                 .toUriString();
         HttpHeaders headers = new HttpHeaders();
         HttpEntity<?> httpEntity = new HttpEntity<>(body, headers);
-        ResponseEntity<BaseResponse> resEntity = null;
+        ResponseEntity<BaseResponse> response = null;
         try {
             // 閫氳繃Post鏂瑰紡璋冪敤鎺ュ彛
-            resEntity = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
+            response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, BaseResponse.class);
         } catch (Exception e) {
             e.printStackTrace();
             return BaseResponseUtils.buildError("鍚庣绯荤粺鍑洪敊锛屼腑闂翠欢璋冪敤寮傚父");
         }
-        if(resEntity == null){
+        if(response == null){
             return BaseResponseUtils.buildError("鍚庣绯荤粺鍑洪敊锛屼腑闂翠欢璋冪敤寮傚父");
         }else{
-            return resEntity.getBody();
+            return response.getBody();
         }
     }
 
     /**
-     * 鍚戦�氫俊涓棿浠跺彂閫丟et璇锋眰
+     * 鍚戦�氫俊涓棿浠跺彂閫乺tu杩滅▼鍗囩骇浠诲姟
      * @param restTemplate SpringBoot鐨凴estTemplate
      * @param toMwUrl 鍒伴�氫俊涓棿浠剁殑web璇锋眰Url
      * @return
      */
-    public BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, String toMwUrl) {
+    protected BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, String toMwUrl) {
         return sendGetRequest2Mw(restTemplate, toMwUrl, null);
     }
 
     /**
-     * 鍚戦�氫俊涓棿浠跺彂閫丟et璇锋眰
+     * 鍚戦�氫俊涓棿浠跺彂閫乺tu杩滅▼鍗囩骇浠诲姟
      * @param restTemplate SpringBoot鐨凴estTemplate
      * @param toMwUrl 鍒伴�氫俊涓棿浠剁殑web璇锋眰Url
      * @param paramName 鍙傛暟鍚嶇О
      * @param paramValue 鍙傛暟
      * @return
      */
-    public BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, String toMwUrl, String paramName, String paramValue) {
+    protected BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, String toMwUrl, String paramName, String paramValue) {
         String url = UriComponentsBuilder.fromUriString(toMwUrl)
                 .build()
                 .toUriString();
@@ -135,13 +135,13 @@
     }
 
     /**
-     * 鍚戦�氫俊涓棿浠跺彂閫丟et璇锋眰
+     * 鍚戦�氫俊涓棿浠跺彂閫乺tu杩滅▼鍗囩骇浠诲姟
      * @param restTemplate SpringBoot鐨凴estTemplate
      * @param toMwUrl 鍒伴�氫俊涓棿浠剁殑web璇锋眰Url
      * @param params 鍙傛暟闆嗗悎锛屽弬鏁板悕绉版槸key锛屽弬鏁版槸value
      * @return
      */
-    public BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, String toMwUrl, Map<String, String> params) {
+    protected BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, String toMwUrl, Map<String, String> params) {
         String url = UriComponentsBuilder.fromUriString(toMwUrl)
                 .build()
                 .toUriString();
@@ -159,12 +159,12 @@
     }
 
     /**
-     * 鍚戦�氫俊涓棿浠跺彂閫丟et璇锋眰
+     * 鍚戦�氫俊涓棿浠跺彂閫乺tu杩滅▼鍗囩骇浠诲姟
      * @param restTemplate SpringBoot鐨凴estTemplate
      * @param builder
      * @return
      */
-    public BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, UriComponentsBuilder builder) {
+    protected BaseResponse sendGetRequest2Mw(RestTemplate restTemplate, UriComponentsBuilder builder) {
         ResponseEntity<BaseResponse> response;
         try {
             // 閫氳繃Get鏂瑰紡璋冪敤鎺ュ彛
@@ -188,7 +188,7 @@
      * @param code 鍛戒护code
      * @return
      */
-    public Command createOuterCommand(String comId, String code) {
+    protected Command createOuterCommand(String comId, String code) {
         Command com = new Command();
         com.id = comId;
         com.code = code ;
@@ -201,7 +201,7 @@
      * @param code 鍛戒护code
      * @return
      */
-    public Command createOuterTransparentCommand(String comId, String code) {
+    protected Command createOuterTransparentCommand(String comId, String code) {
         Command com = new Command();
         com.id = comId;
         com.code = code ;
@@ -210,11 +210,11 @@
     }
 
     /**
-     * 鍒涘缓鍐呴儴鍛戒护
+     * 鍒涘缓鍐呴儴
      * @param code 鍛戒护code
      * @return
      */
-    public Command createInnerCommand(String code) {
+    protected Command createInnerCommand(String code) {
         Command com = new Command();
         com.id = Command.defaultId;
         com.code = code ;

--
Gitblit v1.8.0