pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/RtuLogCtrl.java
@@ -1,9 +1,9 @@
package com.dy.pipIrrRemote.rtu;
import com.dy.common.aop.SsoAop;
import com.dy.common.multiDataSource.DataSourceContext;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.rtuMw.Web2RtuMw;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -32,11 +32,7 @@
@Slf4j
@RestController
@RequestMapping(path="rtuLog")
public class RtuLogCtrl {
    private static final String pro_mw = "mw";
    private static final String key_mw_file = "rtuLogFileUrl";
    private static final String key_mw_text = "rtuLogTextUrl";
public class RtuLogCtrl extends Web2RtuMw {
    private Environment env ;
    private RestTemplate restTemplate;
@@ -55,10 +51,10 @@
    @GetMapping(path = "file")
    @SsoAop()
    public BaseResponse<List<String>> rtuLogFile(String rtuAddr, HttpServletRequest req, HttpServletResponse rep){
        String mwUrlRtuLogFile = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw_file);
        String rqUrl = this.get2MwRequestUrl(this.env, ContextRtuLogFile) ;
        ServletOutputStream out = null ;
        try{
            byte[] bs = this.requestMw4File(rtuAddr, mwUrlRtuLogFile) ;
            byte[] bs = this.requestMw4File(rtuAddr, rqUrl) ;
            if(bs != null && bs.length > 0){
                String fileReName = rtuAddr + ".log" ;
                //URLEncoder.encode可以防止中文乱码
@@ -91,8 +87,9 @@
    @GetMapping(path="text")
    @SsoAop()
    public BaseResponse<List<String>> rtuLogText(String rtuAddr){
        String mwUrlRtuLogText = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw_text);
        BaseResponse<List<String>> text = this.requestMw4Text(rtuAddr, mwUrlRtuLogText);
        String rqUrl = this.get2MwRequestUrl(this.env, ContextRtuLogText) ;
        //String mwUrlRtuLogText = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw_text);
        BaseResponse<List<String>> text = this.requestMw4Text(rtuAddr, rqUrl);
        if (text != null){
            if (text.getContent().get(0).contains("控制器")){
                return BaseResponseUtils.buildErrorMsg(""+text.getContent().get(0)+"") ;
@@ -101,7 +98,6 @@
        }else {
            return BaseResponseUtils.buildErrorMsg("获取日志文件为null") ;
        }
//        return this.requestMw4Text(rtuAddr, mwUrlRtuLogText) ;
    }
@@ -141,5 +137,4 @@
        return (response==null?null:response.getBody());
    }
}