1、通信中间件本地命令处理逻辑修改;
2、参数设置软件增量开发,以处理MQTT相关配置;
3、《打包发布配置修改》文档修改。
6个文件已修改
89 ■■■■ 已修改文件
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/paramSet/ParamKey.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/paramSet/ParamSetMw.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/resources/application-params.yml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/文档/打包发布/打包发布配置修改.docx 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java
@@ -58,7 +58,21 @@
     */
    @GetMapping("/rtuLogFile")
    public void rtuLogFile(String rtuAddr, HttpServletRequest req, HttpServletResponse rep){
        File logFile = ResourceUnit.getInstance().getLogFile(rtuAddr + ".log") ;
        logFile(rtuAddr, req, rep) ;
    }
    /**
     * ä¸‹è½½æŽ§åˆ¶å™¨ï¼ˆRTU)上下行数据的log日志文件
     * @param devId
     * @param req
     * @param rep
     */
    @GetMapping("/mqttDevLogFile")
    public void mqttDevLogFile(String devId, HttpServletRequest req, HttpServletResponse rep){
        logFile(devId, req, rep) ;
    }
    private void logFile(String fileName, HttpServletRequest req, HttpServletResponse rep){
        File logFile = ResourceUnit.getInstance().getLogFile(fileName + ".log") ;
        if(logFile != null && logFile.exists()){
            //在Spring Boot中,application/octet-stream;charset=UTF-8通常表示响应的内容是字节流,
            //并且字符集是UTF-8。对于这种类型的响应,Spring Boot默认使用ByteArrayHttpMessageConverter来处理,
@@ -67,7 +81,7 @@
            //字符集通常用于文本内容,而application/octet-stream通常用于二进制内容,因此在这种情况下指定字符集可能是不合适的。
            //不过,如果你确实需要处理带有特定字符集的application/octet-stream响应,你可能需要自定义HttpMessageConverter。
            rep.addHeader("content-type", "application/octet-stream;charset=UTF-8");
            rep.addHeader("Content-Disposition", "attachment;fileName=" + (rtuAddr + ".log")) ;
            rep.addHeader("Content-Disposition", "attachment;fileName=" + (fileName + ".log")) ;
            ServletOutputStream out = null;
            FileInputStream in = null ;
            try {
@@ -112,27 +126,38 @@
     */
    @GetMapping("/rtuLogText")
    public BaseResponse<List<String>> rtuLogText(String rtuAddr){
        return logText(rtuAddr, true) ;
    }
    /**
     * ä¸‹è½½æŽ§åˆ¶å™¨ï¼ˆRTU)上下行数据的log日志文件
     * @param devId
     */
    @GetMapping("/mqttDevLogText")
    public BaseResponse<List<String>> mqttDevLogText(String devId){
        return logText(devId, false) ;
    }
    /**
     * ä¸‹è½½æŽ§åˆ¶å™¨ï¼ˆRTU)上下行数据的log日志文件
     * @param fileName
     * @param reverseOrder
     */
    private BaseResponse<List<String>> logText(String fileName, boolean reverseOrder){
        List<String> list ;
        File logFile = ResourceUnit.getInstance().getLogFile(rtuAddr + ".log") ;
        File logFile = ResourceUnit.getInstance().getLogFile(fileName + ".log") ;
        if(logFile != null && logFile.exists()){
            BufferedReader reader = null ;
            try {
                reader = new BufferedReader(new FileReader(logFile)) ;
                //新的实现方法
                Stream<String> linesStream = reader.lines() ;
                //list = linesStream.toList() ; //按原来顺序
                list = linesStream.sorted(Comparator.reverseOrder()).collect(Collectors.toList()) ;//倒序
                /* åŽŸæ¥çš„å®žçŽ°æ–¹æ³•
                list = new ArrayList() ;
                String line ;
                while((line = reader.readLine()) != null){
                    list.add(line) ;
                if(reverseOrder){
                    list = linesStream.sorted(Comparator.reverseOrder()).collect(Collectors.toList()) ;//倒序
                }else{
                    list = linesStream.toList() ; //按原来顺序
                }
                */
                return BaseResponseUtils.buildSuccess(list);
            } catch (Exception e) {
                list = new ArrayList() ;
                list.add("读取控制器(" + rtuAddr + ")的日志文件异常:" + (e.getMessage() == null?"":("," + e.getMessage()))) ;
                list.add("读取控制器(" + fileName + ")的日志文件异常:" + (e.getMessage() == null?"":("," + e.getMessage()))) ;
                return BaseResponseUtils.buildSuccess(list);
            }finally{
                if(reader != null){
@@ -144,7 +169,7 @@
            }
        }else{
            list = new ArrayList() ;
            list.add("未得到控制器(" + rtuAddr + ")的日志文件") ;
            list.add("未得到控制器(" + fileName + ")的日志文件") ;
            return BaseResponseUtils.buildSuccess(list);
        }
    }
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties
@@ -10,7 +10,7 @@
#   ç”˜å·žï¼š gz
#   å‡‰å·žï¼š lz
#   é‡‘川: jc
base.orgTag=mq
base.orgTag=ym
# 233服务器:
#   å…ƒè°‹ï¼š 60000
@@ -45,7 +45,7 @@
#   ç”˜å·žï¼š mqtt.enable=false  mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
#   å‡‰å·žï¼š mqtt.enable=false  mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
#   é‡‘川: mqtt.enable=true  mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather,1;soil,1;manure,1;state,1
mqtt.enable=true
mqtt.enable=false
mqtt.protocolAndDeviceIds=sd1/338220031439,sd1/338220031440
mqtt.subTopicAndQos=weather,1;soil,1;manure,1;state,1
#MQtt设备在一定时间(分钟)后未发布消息,认为设备离线
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/paramSet/ParamKey.java
@@ -31,6 +31,8 @@
    public static final String TcpPort = "tcpPort" ;
    public static final String UpDataMinInterval = "upDataMinInterval" ;
    public static final String WebPort = "webPort" ;
    public static final String MqttEnable = "mqttEnable" ;
    public static final String MqttNoSubThenOff = "noSubThenOff" ;
    public static final String ActutorPort = "actutorPort" ;
    public static final String DbName = "dbName" ;
}
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/paramSet/ParamSetMw.java
@@ -121,6 +121,10 @@
                    newLine = "tcp.port=" + paramMap.get(ParamKey.TcpPort);
                }else if(newLine != null && newLine.trim().startsWith("base.upData.min.interval=")){
                    newLine = "base.upData.min.interval=" + paramMap.get(ParamKey.UpDataMinInterval);
                }else if(newLine != null && newLine.trim().startsWith("mqtt.enable=")){
                    newLine = "mqtt.enable=" + paramMap.get(ParamKey.MqttEnable);
                }else if(newLine != null && newLine.trim().startsWith("mqtt.noSubThenOff=")){
                    newLine = "mqtt.noSubThenOff=" + paramMap.get(ParamKey.MqttNoSubThenOff);
                }
                newLines.add(newLine);
            }
@@ -150,6 +154,12 @@
        key = ParamKey.WebPort;
        this.getConfig(env, map, paramNamePre + key, key);
        key = ParamKey.MqttEnable;
        this.getConfig(env, map, paramNamePre + key, key);
        key = ParamKey.MqttNoSubThenOff;
        this.getConfig(env, map, paramNamePre + key, key);
        key = ParamKey.ActutorPort;
        this.getConfig(env, map, paramNamePre + key, key);
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/resources/application-params.yml
@@ -4,6 +4,8 @@
            orgTag: ym
            tcpPort: 60000
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8070
            actutorPort: 9070
            dbName: pipIrr_ym
@@ -11,6 +13,8 @@
            orgTag: sp
            tcpPort: 62000
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8073
            actutorPort: 9073
            dbName: pipIrr_sp
@@ -18,6 +22,8 @@
            orgTag: test
            tcpPort: 65000
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8072
            actutorPort: 9072
            dbName: pipIrr_test
@@ -25,6 +31,8 @@
            orgTag: mj
            tcpPort: 61000
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8071
            actutorPort: 9071
            dbName: pipIrr_mj
@@ -33,6 +41,8 @@
            orgTag: mq
            tcpPort: 60100
            upDataMinInterval: 6
            mqttEnable: true
            noSubThenOff: 10
            webPort: 8100
            actutorPort: 9100
            dbName: pipIrr_mq
@@ -40,6 +50,8 @@
            orgTag: yq
            tcpPort: 60101
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8101
            actutorPort: 9101
            dbName: pipIrr_yq
@@ -47,6 +59,8 @@
            orgTag: hlj
            tcpPort: 60102
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8102
            actutorPort: 9102
            dbName: pipIrr_hlj
@@ -54,6 +68,8 @@
            orgTag: gz
            tcpPort: 60103
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8103
            actutorPort: 9103
            dbName: pipIrr_gz
@@ -61,6 +77,8 @@
            orgTag: lz
            tcpPort: 60104
            upDataMinInterval: 6
            mqttEnable: false
            noSubThenOff: 10
            webPort: 8104
            actutorPort: 9104
            dbName: pipIrr_lz
@@ -68,6 +86,8 @@
            orgTag: jc
            tcpPort: 60105
            upDataMinInterval: 6
            mqttEnable: true
            noSubThenOff: 10
            webPort: 8105
            actutorPort: 9105
            dbName: pipIrr_jc
pipIrr-platform/Îĵµ/´ò°ü·¢²¼/´ò°ü·¢²¼ÅäÖÃÐÞ¸Ä.docx
Binary files differ