wuzeyu
2023-11-30 ee6e575076ba17c1fc8f4ba33253b7ea0fba45f8
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

 Conflicts:
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/ThreadPoolImp.java
 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/busi/deal/p206V1_0_0/TkPreGenObjs.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/pom.xml
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/ServerProperties.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/console/Command.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/console/CommandConsole.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Code.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwTestClientStatus.java
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/resources/Config.xml
20个文件已删除
3 文件已重命名
24个文件已修改
17个文件已添加
3064 ■■■■ 已修改文件
pipIrr-platform/pipIrr-common/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mybatis/envm/Deleted.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mybatis/envm/Disabled.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/ThreadPoolImp.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/.gitignore 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/pipIrr-global.iml 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/.gitignore 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/busi/deal/p206V1_0_0/TkPreGenObjs.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw.iml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/AdapterImp_TcpClUnit.java 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/Server.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/ServerProperties.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpClUnit.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpClUnitAdapter.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpClUnitConfigVo.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpPost.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/MyThreadJob.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/RtuData4HAC_NBhV2_5.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/RtuData4MeterV1_0.java 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/TestBase64.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/UpDataPayloadVo.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/UpDataVo.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/Code.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/ResConfigVo.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiResponseVo.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalCodecFactory.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalDecoder.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalEncoder.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnitConfigVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpConnect.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpHandler.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/LocalDecoder.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/LocalEncoder.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/MinaConnectPool.java 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/MinaHandler.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/Config.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/application.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/log4j2.xml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/log4j2.yml 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/pom.xml 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/ServerProperties.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/console/Command.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/console/CommandConsole.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Code.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwTestClientStatus.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/resources/Config.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/resources/log4j2.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pom.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-platform.iml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/.gitignore 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sso/.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web.iml 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/文档/文件加入了 .gitignore,但还是被 git 跟踪.docx 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/pom.xml
@@ -56,6 +56,12 @@
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- api在线文档  https://springdoc.org/#modules-->
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java
@@ -12,6 +12,9 @@
import java.util.ArrayList;
import java.util.List;
/**
 * å¿…须实现WebMvcConfigurer否则不启作用,即Controller转json时不用fastjson
 */
@Configuration
public class FastJsonConfig implements WebMvcConfigurer {
    /**
@@ -29,12 +32,12 @@
                JSONWriter.Feature.WriteMapNullValue,
                //输出null的boolean ä¸º false
                JSONWriter.Feature.WriteNullBooleanAsFalse,
                //把Long型输出为String
                //把Long型输出为String,在pojo的属性中个性设置
                //JSONWriter.Feature.WriteLongAsString,
                //输出null的list ä¸º []
                JSONWriter.Feature.WriteNullListAsEmpty,
                //输出null的number ä¸º 0
                JSONWriter.Feature.WriteNullNumberAsZero,
                //JSONWriter.Feature.WriteNullNumberAsZero,
                //输出null字符串 ä¸º ""
                JSONWriter.Feature.WriteNullStringAsEmpty,
                //对map进行排序
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java
@@ -28,15 +28,15 @@
     *     org.apache.mina.filter.codec.ProtocolDecoderOutput)
     */
    protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) {
        String meterNo = (String)session.getAttribute(TcpIoSessionAttrIdIsRtuAddr.sessionArrIdKey) ;
        if(meterNo == null){
        String rtuAddr = (String)session.getAttribute(TcpIoSessionAttrIdIsRtuAddr.sessionArrIdKey) ;
        if(rtuAddr == null){
            //会话未被管理
            //会话管理器中不存在此会话,说明刚建立网络连接,
            return this.doDecode_onLineData(session, in, out) ;
        }else{
            //会话已被管理
            //会话管理器中存在此会话,说明已经上线了,
            return this.doDecode_data(session, in, out, meterNo) ;
            return this.doDecode_data(session, in, out, rtuAddr) ;
        }
    }
    
@@ -73,16 +73,16 @@
     * @param session IO会话
     * @param in è¾“å…¥Buffer
     * @param out åè®®è¾“出编码
     * @param meterNo æŽ§åˆ¶å™¨ç¼–号
     * @param rtuAddr æŽ§åˆ¶å™¨åœ°å€
     * @return æ˜¯å¦æ­£å¥½æˆ–粘包
     */
    @SuppressWarnings("unused")
    private boolean doDecode_data(IoSession session, IoBuffer in, ProtocolDecoderOutput out, String meterNo) {
    private boolean doDecode_data(IoSession session, IoBuffer in, ProtocolDecoderOutput out, String rtuAddr) {
        //非上线数据,可能会出现断包或粘包现象
        PrefixedDataAvailableStatus dataStatus = this.pdaHandle.forUpData(in) ;
        if(dataStatus == null){
            //不可能发生
            log.error("严重错误,Rtu (水表号为" + meterNo + ")上行数据完整性检查时,返回的对象为空。") ;
            log.error("严重错误,Rtu (RTU" + rtuAddr + ")上行数据完整性检查时,返回的对象为空。") ;
            this.nextDeal(in, null, out) ;
            return true;
        }else{
@@ -94,7 +94,7 @@
                this.nextDeal(in, dataStatus.getDataLen(), out) ;
                if(dataStatus.isAdjoined()){
                    //说明粘包了,还有数据,需要对这些数据再次执行doDecode_方法.
                    return this.doDecode_data(session, in, out, meterNo) ;//加上递归
                    return this.doDecode_data(session, in, out, rtuAddr) ;//加上递归
                }else if(dataStatus.isCompleted()){
                    //数据不断不粘
                    return true;
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java
@@ -177,17 +177,6 @@
        
        return this ;
    }
    /*
    public static void main(String[] args){
        String json = "{\"attachment\":null,\"code\":\"03\",\"deviceId\":\"d8c9601f214747d98d47a4736e5\",\"id\":\"999999999\",\"meterNo\":\"23040600377\",\"productId\":16873252,\"param\":\"0002\",\"protocol\":\"HAC_NBhV2_5\",\"rtuAddr\":\"863318060168996\",\"type\":\"outerCommand\"}" ;
        try {
            Command com = jsonToObject(json) ;
            System.out.println(com.param);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
     */
    public String getId() {
        return id;
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java
@@ -60,11 +60,9 @@
        Data d = new Data() ;
        d.code = "01" ;
        d.rtuAddr = "123234" ;
        d.meterNo = "1234567890123456" ;
        DataV1_0_1 subD = new DataV1_0_1() ;
        subD.rtuAddr = "2342345" ;
        subD.meterNo = "1234567890123456" ;
        
        d.subData = subD ;
        
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mybatis/envm/Deleted.java
@@ -16,6 +16,14 @@
        this.name = name ;
    }
    /**
     * å®žé™…上转json,见Pojo的对应属性
     * @return json
     */
//    public String toString(){
//        return "{\"code\":" + this.code + "," + "\"name\":" + this.name + "}" ;
//    }
    @Override
    public Byte getCode() {
        return this.code ;
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mybatis/envm/Disabled.java
@@ -16,6 +16,14 @@
        this.name = name ;
    }
    /**
     * å®žé™…上转json,见Pojo的对应属性
     * @return json
     */
    //public String toString(){
    //    return "{\"code\":" + this.code + "," + "\"name\":" + this.name + "}" ;
    //}
    @Override
    public Byte getCode() {
        return this.code ;
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/ThreadPoolImp.java
@@ -73,38 +73,7 @@
        /**
         * æ—¥å¿— 
         */
        private Logger log = LogManager.getLogger(MonitorThread.class.getName());
        /**
         * å¾—到默认唯一实例
         * @return
         */
//        public MyThreadPool getDefaultInstance(){
//            if(myPool == null){
//                myPool = new MyThreadPool(null, null, null, null, null) ;
//            }
//            return myPool ;
//        }
        /**
         * å¾—到唯一实例
         * @param poolName
         * @param maxNum
         * @param minNum
         * @param freeTimeout
         * @param busyTimeout
         * @return
         */
//        public MyThreadPool getInstance(
//                String poolName ,
//                Integer maxNum ,
//                Integer minNum ,
//                Long freeTimeout ,
//                Long busyTimeout){
//            if(myPool == null){
//                myPool = new MyThreadPool(poolName, maxNum, minNum, freeTimeout, busyTimeout) ;
//            }
//            return myPool ;
//        }
        private static final Logger log = LogManager.getLogger(MonitorThread.class) ;
        /**
         * çº¿ç¨‹æ± æž„造方法
@@ -125,8 +94,8 @@
            }
            this.poolName = poolName ;
            
            if(maxNum == null || maxNum.intValue() <= 0){
                maxNum = -1 ;
            if(maxNum == null || maxNum.intValue() < 0){
                maxNum = 65535 ;
            }
            if(minNum == null || minNum.intValue() < 0){
                minNum = 0 ;
@@ -148,10 +117,9 @@
            }else{
                this.busyTimeout = busyTimeout ;    
            }
            this.busiThreads = new ArrayList<MyThread>();
            this.freeThreads = new ArrayList<MyThread>();
            if(maxNum != 0){
                this.busiThreads = new ArrayList<>();
                this.freeThreads = new ArrayList<>();
            //最小化线程池
            for (int i = 0; i < this.minNum ; i++) {
                MyThread t = new MyThread(this);
@@ -159,9 +127,9 @@
                this.freeThreads.add(t);
                this.currNum++;
            }
            this.monitorThread = new MonitorThread(this) ;
            this.monitorThread.start() ;
            }
        }
        /**
@@ -171,6 +139,9 @@
         */
        @Override
        public void putJob(Job job) throws Exception {
            if(this.busiThreads == null || this.freeThreads == null){
                throw new Exception("线程池未启动") ;
            }
            synchronized(this.synObj) {
                //log.debug("工作任务分配到线程池中。") ;
                MyThread t = null ;
@@ -215,7 +186,10 @@
        /**
         * çº¿ç¨‹å·¥ä½œå®Œæˆï¼Œä»ŽbusiThreads回归freeThreads
         */
        protected void freeThread(MyThread t) {
        protected void freeThread(MyThread t) throws Exception {
            if(this.busiThreads == null || this.freeThreads == null){
                throw new Exception("线程池未启动") ;
            }
            synchronized (synObj) {
                busiThreads.remove(t);
                freeThreads.add(t);
@@ -236,7 +210,7 @@
            /**
             * 
             * @param pool
             * @param pool æ± 
             */
            public MonitorThread(MyThreadPool pool){
                this.pool = pool ;
@@ -302,6 +276,7 @@
                            }
                        }//end synchronized (pool.synObj)
                    }catch(Exception e){
                        e.printStackTrace();
                    }finally{
                        continue ;
                    }
@@ -354,7 +329,7 @@
        
        /**
         * è®¾ç½®çº¿ç¨‹å·¥ä½œå¯¹è±¡
         * @param job
         * @param job å·¥ä½œ
         */
        protected void putJob(Job job) throws Exception {
            if(job == null){
@@ -418,6 +393,7 @@
        }
        
        public void free(){
            try{
            //使本线程回归空闲线程池
            pool.freeThread(this);
            //空闲开始记时
@@ -425,6 +401,11 @@
            // æ²¡æœ‰å¯åšçš„了
            this.canJob = false;
            log.debug("线程池(" + this.pool.poolName + ")中的线程回归空闲集合。");
            }catch (Exception e){
                log.error("线程池(" + pool.poolName + ")的工作线程释放回归时发生异常:\n" + e.getMessage(), e);
                e.printStackTrace();
            }
        }
        /**
pipIrr-platform/pipIrr-global/.gitignore
pipIrr-platform/pipIrr-global/pipIrr-global.iml
File was deleted
pipIrr-platform/pipIrr-mw/.gitignore
@@ -1,2 +1,34 @@
HELP.md
target/
/pipIrr-mw.iml
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/busi/deal/p206V1_0_0/TkPreGenObjs.java
New file
@@ -0,0 +1,82 @@
package com.dy.aceMw.server.busi.deal.p206V1_0_0;
import com.dy.aceMw.server.busi.deal.TaskSurpport;
import com.dy.common.mw.protocol.Data;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class TkPreGenObjs extends TaskSurpport {
    private static final Logger log = LogManager.getLogger(TkPreGenObjs.class.getName()) ;
    //ç±»ID,一定与Tree.xml配置文件中配置一致
    public static final String taskId = "TkPreGenObjs" ;
    /**
     * æ‰§è¡ŒèŠ‚ç‚¹ä»»åŠ¡
     * @param data éœ€è¦å¤„理的数据
     */
    @Override
    public void execute(Object data) {
        Data d = (Data)data ;
        String rtuAddr = d.getRtuAddr() ;
        //得到本地RTU æ•°æ®ï¼Œä»¥å¤‡åŽé¢èŠ‚ç‚¹åº”ç”¨
        /*
        BuziInterface baseBusi = BuziGeter.getBaseBusi() ;
        BuziInterface orgBusi = null ;
        SyRtu nbRtu = null ;
        SyRtuTramp rtuTramp = null ;
        if(baseBusi != null){
            nbRtu = DbSyBuzi.getRtu(baseBusi, imei) ;
            if(nbRtu != null){
                //数据库中查询到NB产品(RTU实体)
                if(nbRtu.orgTag != null && !nbRtu.orgTag.trim().equals("")){
                    orgBusi = BuziGeter.getBusi(nbRtu.orgTag) ;
                    if(orgBusi == null){
                        log.error("严重错误,未能得到标签为" + nbRtu.orgTag + "的供水机构数据库业务Busi");
                    }else{
                        BaMeter meter = DbOrgBuzi.getMeterByImeiAndNo(orgBusi, imei, rtuAddr) ;
                        //可能未查询到meter,即仍是流浪者RTU,但仍要后续处理:(1)、仍能识别出流浪者RTU,(2)、仍要记录其上报数据
                        if(meter != null){
                            String protocol = d.getProtocol() ;
                            if(protocol != null){
                                protocol = protocol.trim();
                                if(!protocol.equals("")){
                                    if(meter.protocol == null
                                            || meter.protocol.trim().equals("")
                                            || !meter.protocol.trim().equals(protocol)){
                                        //需要更新协议名称
                                        DbOrgBuzi.updateMeter4Protocol(orgBusi, meter.id, protocol);
                                    }
                                }
                            }
                        }
                        this.taskResult = new Object[]{baseBusi, orgBusi, nbRtu, null, meter} ;
                        this.toNextTasks(data);
                    }
                }else{
                    //NB产品(RTU实体)未分配给具体的供水机构
                    //流浪者RTU
                    rtuTramp = DbSyBuzi.getSyRtuTramp(baseBusi, imei, rtuAddr) ;
                    if(rtuTramp == null){
                        rtuTramp = new SyRtuTramp(imei, rtuAddr) ;
                    }
                    this.taskResult = new Object[]{baseBusi, orgBusi, nbRtu, rtuTramp, null} ;
                    this.toNextOneTask(data, TkDealRtuTramp.taskId);
                }
            }else{
                //数据库中未查询到NB产品(RTU实体)
                //流浪者RTU
                rtuTramp = DbSyBuzi.getSyRtuTramp(baseBusi, imei, rtuAddr) ;
                if(rtuTramp == null){
                    rtuTramp = new SyRtuTramp(imei, rtuAddr) ;
                }
                this.taskResult = new Object[]{baseBusi, orgBusi, nbRtu, rtuTramp, null} ;
                this.toNextOneTask(data, TkDealRtuTramp.taskId);
            }
        }else{
            log.error("严重错误,未能得到BaseBusi对象");
        }
        */
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mw.iml
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/AdapterImp_TcpClUnit.java
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/Server.java
@@ -68,20 +68,40 @@
            //支持模块: springHibernate和 çº¿ç¨‹æ± 
            SupportUnitConfigVo supVo = new SupportUnitConfigVo() ;
            //短工作时长线程池,线程负责用时较短的工作任务
            supVo.short_maxThread = conf.getSetAttrPlusInt(doc, "config.support", "short_maxThread", null, 1, 1000, null) ;//池中最大线程数为所有CPU核数+1
            supVo.short_minThread = conf.getSetAttrPlusInt(doc, "config.support", "short_minThread", null, 1, 5, null) ;//池中最小线程数
            supVo.short_maxThread = conf.getSetAttrPlusInt(doc, "config.support", "short_maxThread", null, -1, 1000, null) ;//池中最大线程数为所有CPU核数+1
            if(supVo.short_maxThread < 0){
                supVo.short_maxThread = -1 ;
            }
            supVo.short_minThread = conf.getSetAttrPlusInt(doc, "config.support", "short_minThread", null, -1, 100, null) ;//池中最小线程数
            if(supVo.short_minThread < 0){
                supVo.short_minThread = -1 ;
            }
            supVo.short_freeTimeout = conf.getSetAttrPlusInt(doc, "config.support", "short_freeTimeout", null, 1, 90, null) * 1000 ;//线程数空闲时长,若池中线程数量大于minThread,且有的线程空闲时长超过freeTimeout,则清除该线程,为了不清除,把minThread与maxThread设置相等
            supVo.short_busyTimeout = conf.getSetAttrPlusInt(doc, "config.support", "short_busyTimeout", null, 1, 10, null) * 1000 ;//线程不间断工作时长(单位为秒)超时限,认为线程已经了崩溃,将强制清除,短工作时长设置为5秒
            if(supVo.short_maxThread == 0 || supVo.short_minThread == 0){
                supVo.enableShortThreadPool = false ;
            }else{
                supVo.enableShortThreadPool = true ;
            }
            //长工作时长线程池,线程负责用时较长的工作任务
            supVo.long_maxThread = conf.getSetAttrInt(doc, "config.support", "long_maxThread", null, -1, 1000, null)  ;//池中最大线程数,若为-1,不受限制
            if(supVo.long_maxThread < 0){
                supVo.long_maxThread = -1 ;
            }
            supVo.long_minThread = conf.getSetAttrPlusInt(doc, "config.support", "long_minThread", null, 0, 5, null) ;//池中最小线程数
            supVo.long_minThread = conf.getSetAttrPlusInt(doc, "config.support", "long_minThread", null, -1, 100, null) ;//池中最小线程数
            if(supVo.long_minThread < 0){
                supVo.long_minThread = -1 ;
            }
            supVo.long_freeTimeout = conf.getSetAttrPlusInt(doc, "config.support", "long_freeTimeout", null, 1, 90, null) * 1000 ;//线程数空闲时长,若池中线程数量大于minThread,且有的线程空闲时长超过freeTimeout,则清除该线程
            supVo.long_busyTimeout = conf.getSetAttrInt(doc, "config.support", "long_busyTimeout", null, -1, 10, null) ;//线程不间断工作时长(单位为秒)超时限,若为-1,不受限制
            if(supVo.long_busyTimeout < 0){
                supVo.long_busyTimeout = -1 ;
            }
            if(supVo.long_maxThread == 0 || supVo.long_minThread == 0){
                supVo.enableLongThreadPool = false ;
            }else{
                supVo.enableLongThreadPool = true ;
            }
            supVo.showStartInfo = showStartInfo ;
@@ -113,8 +133,6 @@
            // Tcp Client æ¨¡å—
            TcpClUnitConfigVo tcpClVo = new TcpClUnitConfigVo();
            tcpClVo.enable = conf.getSetAttrBoolean(doc, "config.tcpCl", "enable", null, null) ;
            tcpClVo.heartbeatTimes = conf.getSetAttrPlusInt(doc, "config.tcpCl", "heartbeatTimes", null, 1, 10, null) ;//连续配置次数心跳后发送一次数据
            tcpClVo.sendInterval = conf.getSetAttrPlusInt(doc, "config.tcpCl", "sendInterval", null, 1, 60, null) ;//发送心跳或数据的时间间隔
            if(tcpClVo.enable){
                AdapterImp_TcpClUnit httpClAdap = new AdapterImp_TcpClUnit();
                httpClAdap.setConfig(tcpClVo);
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/ServerProperties.java
@@ -7,9 +7,13 @@
    //RTU截止地址
    public static Long rtuAddrEnd = 0L ;
    //服务端IP
    public static String serverIp = "" ;
    public static String tcpServerIp = "" ;
    //服务端上下文
    public static Integer serverPort = 0 ;
    public static Integer tcpServerPort = 0 ;
    //发送数据数据间隔
    public static Integer sendInterval = 0 ;//秒
    //每一轮次发送数据,其中包括心跳数据的次数
    public static Integer heartbeatTimes = 3 ;
    //发送数据次数
    public static Integer sendTimes = 0 ;
    
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpClUnit.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpClUnitAdapter.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpClUnitConfigVo.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/HttpPost.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/MyThreadJob.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/RtuData4HAC_NBhV2_5.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/RtuData4MeterV1_0.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/TestBase64.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/UpDataPayloadVo.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/httpCl/UpDataVo.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/Code.java
@@ -10,6 +10,8 @@
    
    public static String cd4 = "004" ;//向服务端上报信息
    
    public static String cd5 = "005" ;//向服务端上报  æ•°æ®ä¸ŠæŠ¥å·¥ä½œå·²ç»å®Œæˆ
    public static String cd5 = "005" ;//向服务端上报  å®Œæˆä»»åŠ¡çš„æ•°é‡
    public static String cd6 = "006" ;//向服务端上报  å…¨éƒ¨ä»»åŠ¡å®Œæˆ
    
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/ResConfigVo.java
@@ -8,9 +8,13 @@
    //模拟客户的IMEI号截止号
    public Long rtuAddrEnd = 0L ;
    //服务端IP
    public String serverIp = "" ;
    public String tcpServerIp = "" ;
    //服务端上下文
    public Integer serverPort = 0 ;
    public Integer tcpServerPort = 0 ;
    //发送数据间隔
    public Integer sendInterval = 2 ;//秒
    //每一轮次发送数据,其中包括心跳发送次数
    public Integer heartbeatTimes = 3 ;
    //发送数据次数
    public Integer sendTimes = 0 ;
    
@@ -58,20 +62,36 @@
        this.rtuAddrEnd = rtuAddrEnd;
    }
    public String getServerIp() {
        return serverIp;
    public String getTcpServerIp() {
        return tcpServerIp;
    }
    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    public void setTcpServerIp(String tcpServerIp) {
        this.tcpServerIp = tcpServerIp;
    }
    public Integer getServerPort() {
        return serverPort;
    public Integer getTcpServerPort() {
        return tcpServerPort;
    }
    public void setServerPort(Integer serverPort) {
        this.serverPort = serverPort;
    public void setTcpServerPort(Integer tcpServerPort) {
        this.tcpServerPort = tcpServerPort;
    }
    public Integer getSendInterval() {
        return sendInterval;
    }
    public void setSendInterval(Integer sendInterval) {
        this.sendInterval = sendInterval;
    }
    public Integer getHeartbeatTimes() {
        return heartbeatTimes;
    }
    public void setHeartbeatTimes(Integer heartbeatTimes) {
        this.heartbeatTimes = heartbeatTimes;
    }
    public Integer getSendTimes() {
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java
@@ -94,13 +94,30 @@
    }
    
    //把数据上报完成情况  ä¸ŠæŠ¥ç»™mwTestServer
    public void reportHadReportOver(Long seconds){
    public void reportHadReportOver(Integer count){
        try {
            Thread.sleep(100L);
            RmiRequestVo rqVo = new RmiRequestVo() ;
            rqVo.id = id ;
            rqVo.token = token ;
            rqVo.code = Code.cd5 ;
            rqVo.count = count ;
            String json = rqVo.toJson() ;
            frmWork.syncRequest(json) ;
        } catch (Exception e) {
            log.error("把数据上报完成情况  ä¸ŠæŠ¥ç»™mwTestServer失败" + e.getMessage());
        }
    }
    //把数据上报完成情况  ä¸ŠæŠ¥ç»™mwTestServer
    public void allOver(Long seconds){
        try {
            Thread.sleep(100L);
            RmiRequestVo rqVo = new RmiRequestVo() ;
            rqVo.id = id ;
            rqVo.token = token ;
            rqVo.code = Code.cd6 ;
            rqVo.over = true ;
            rqVo.seconds = seconds ;
            String json = rqVo.toJson() ;
@@ -178,15 +195,19 @@
                                if(rVo != null){
                                    ServerProperties.rtuAddrStart = rVo.rtuAddrStart;
                                    ServerProperties.rtuAddrEnd = rVo.rtuAddrEnd;
                                    ServerProperties.serverIp = rVo.serverIp;
                                    ServerProperties.serverPort = rVo.serverPort;
                                    ServerProperties.tcpServerIp = rVo.tcpServerIp;
                                    ServerProperties.tcpServerPort = rVo.tcpServerPort;
                                    ServerProperties.sendInterval = rVo.sendInterval ;
                                    ServerProperties.heartbeatTimes = rVo.heartbeatTimes ;
                                    ServerProperties.sendTimes = rVo.sendTimes ;
                                    log.info("得到配置成功");
                                    log.info("    å¼€å§‹RtuAddr=" + ServerProperties.rtuAddrStart);
                                    log.info("    æˆªæ­¢RtuAddr=" + ServerProperties.rtuAddrEnd);
                                    log.info("    mwAccept服务IP=" + ServerProperties.serverIp);
                                    log.info("    mwAccept服务端口=" + ServerProperties.serverPort);
                                    log.info("    æ¯imei上报数据次数=" + ServerProperties.sendTimes);
                                    log.info("    mwAccept服务IP=" + ServerProperties.tcpServerIp);
                                    log.info("    mwAccept服务端口=" + ServerProperties.tcpServerPort);
                                    log.info("    å‘送数据间隔=" + ServerProperties.sendTimes);
                                    log.info("    æ¯è½®æ¬¡å‘送心跳次数=" + ServerProperties.heartbeatTimes);
                                    log.info("    æ¯RTU上报数据轮次=" + ServerProperties.sendTimes);
                                    break ;
                                }else{
                                    log.error("rmi得到配置失败:json转ResConfigVo为null");
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiResponseVo.java
@@ -1,6 +1,7 @@
package com.dy.testClient.rmiClient;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
public class RmiResponseVo {
@@ -33,11 +34,10 @@
     */
    public static RmiResponseVo jsonToObject(String json, Class<?> clazz)throws Exception{
        try{
            return JSON.parseObject(json, RmiResponseVo.class) ;
            //JSONDeserializer<RmiResponseVo> jsonD = new JSONDeserializer<RmiResponseVo>() ;
            //jsonD.use("obj", clazz) ;
            //RmiResponseVo resp = jsonD.deserialize(json, RmiResponseVo.class) ;
            //return resp ;
            JSONObject jsonObject = JSON.parseObject(json);
            RmiResponseVo vo = jsonObject.to(RmiResponseVo.class) ;
            vo.obj = jsonObject.getObject("obj", clazz);
            return vo ;
        }catch(Exception e){
            throw new Exception(e.getMessage() , e ) ;
        }
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalCodecFactory.java
File was renamed from pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/LocalCodecFactory.java
@@ -1,9 +1,9 @@
package com.dy.testClient.tcpConnect;
package com.dy.testClient.tcpClient;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolEncoder;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;
public class LocalCodecFactory implements ProtocolCodecFactory {
    private ProtocolEncoder encoder;
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalDecoder.java
New file
@@ -0,0 +1,31 @@
package com.dy.testClient.tcpClient;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolDecoderOutput;
import java.io.IOException;
public class LocalDecoder extends CumulativeProtocolDecoder {
    private static final String DECODER_STATE_KEY = LocalDecoder.class.getName() + ".STATE";
    public static final int MAX_SIZE = 2147483647 ;
    /**
     * å¯¹ç½‘络传输来的数据进行解码
     */
    protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws IOException, Exception{
        int remain = in.remaining() ;
        if(remain > 0){
            byte[] preByte = new byte[remain];
            in.get(preByte) ;
            in.position(0) ;
        }
        return true;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalEncoder.java
New file
@@ -0,0 +1,22 @@
package com.dy.testClient.tcpClient;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
import java.io.IOException;
public class LocalEncoder extends ProtocolEncoderAdapter {
    /**
     * å¯¹æ•°æ®è¿›è¡Œç¼–码,以备网络传输
     */
    public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws IOException, Exception{
        byte[] data = (byte[])message;
        //log.info("下行数据:" + ByteUtil.bytes2Hex(data, true));
        out.write(IoBuffer.allocate((data==null?0:data.length), false).put(data).flip());
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java
@@ -1,45 +1,125 @@
package com.dy.testClient.tcpClient;
import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate;
import com.dy.common.threadPool.ThreadPool;
import com.dy.testClient.httpCl.*;
import java.util.Base64;
import com.dy.common.util.ByteUtil;
import com.dy.testClient.ServerProperties;
import org.apache.mina.core.future.CloseFuture;
import org.apache.mina.core.session.IoSession;
public class MyThreadJob  implements ThreadPool.Job {
    public String rtuAddr;
    public String serverIp;
    public Integer serverPort;
    public IoSession session ;
    public static final int connectTimeout = 3000 ;
    public int sendTimes = 0 ;//发送数据次数
    public int heartbeatTimes = 0 ;//上报心跳次数
    public boolean isOver = false ;
    public MyThreadJob(){
    }
    public MyThreadJob(String rtuAddr){
    public MyThreadJob(String rtuAddr, String serverIp, Integer serverPort){
        this.rtuAddr = rtuAddr ;
        this.serverIp = serverIp ;
        this.serverPort = serverPort ;
    }
    @Override
    public void execute() throws Exception {
        testP206V1_0_0() ;
        if(session == null){
            IoSession se = new TcpConnect().createSession(this.rtuAddr, this, this.serverIp, this.serverPort, connectTimeout, new TcpHandler()) ;
            if(se != null){
                this.session = se ;
            }
        }else{
            if(sendTimes <= ServerProperties.sendTimes){
                sendDataOfP206V1_0_0() ;
            }else{
                this.jobOver() ;
            }
        }
    }
    private void testP206V1_0_0(){
    private void sendDataOfP206V1_0_0(){
        try{
            RtuData4MeterV1_0 rd = new RtuData4MeterV1_0() ;
            byte[] bs = rd.create(rtuAddr) ;
            bs = Base64.getEncoder().encode(bs) ;
            UpDataPayloadVo payloadVo = new UpDataPayloadVo() ;
            payloadVo.APPdata = new String(bs, "UTF-8") ;
            UpDataVo vo = new UpDataVo(rtuAddr, "8086" + rtuAddr) ;
            vo.payload = payloadVo ;
            String json = vo.toJson() ;
            byte[] bytes = json.getBytes() ;
            HttpPost.post(bytes);
            if(heartbeatTimes >= ServerProperties.heartbeatTimes){
                heartbeatTimes = 0 ;
                this.sendReportData() ;
                sendTimes++ ;
            }else{
                this.sendHeartbeat() ;
                heartbeatTimes++ ;
            }
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            HttpClUnit.clientOver() ;
        }
    }
    private void sendHeartbeat(){
        try{
            byte[] bs = this.createHeartbeat() ;
            this.session.write(bs) ;
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    private void sendReportData(){
        TcpClUnit.clientSendData();
    }
    private void jobOver(){
        CloseFuture closeFuture = session.closeOnFlush() ;
        this.isOver = true ;
        TcpClUnit.clientOver() ;
    }
    /**
     * æž„造下行数据
     * @return å­—节数组
     * @throws Exception å¼‚常
     */
    public byte[] createHeartbeat( ) throws Exception {
        CommonV1_0_1 commonV1_0_1 = new CommonV1_0_1() ;
        byte[] bytes ;
        byte[] bsHead = new byte[ProtocolConstantV206V1_0_0.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = commonV1_0_1.createCtrl((byte)0) ;
        index++ ;
        GlCreate.createRtuAddr(this.rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes("02", bsHead, index) ;
        byte[] bs = new byte[1] ;
        bs[0] = (byte)0xF2 ;//数据域: 1 ä¸ªå­—节,F0 ç™»å½•, F1 é€€å‡ºç™»å½•,F2 åœ¨çº¿ä¿æŒã€‚
        bytes = ByteUtil.bytesMerge(bsHead, bs) ;
        GlCreate.createLen(bytes);//长度放字节数组中
        bytes = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中
        return bytes ;
    }
    @Override
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java
@@ -10,6 +10,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class TcpClUnit  implements UnitInterface {
    private static final Logger log = LogManager.getLogger(TcpClUnit.class) ;
@@ -20,8 +24,10 @@
    public static TcpClUnitConfigVo confVo ;
    private static ThreadPool.Pool pool ;
    private static Map<String, MyThreadJob> jobMap = new HashMap<>() ;
    private static Integer totalRunedClientCount = 0;
    private static Integer totalSendDataCount = 0;
    private static Integer totalOverClientCount = 0;
    private static Long startTime = 0L ;
@@ -69,12 +75,13 @@
                            startTime = System.currentTimeMillis() ;
                            for(Long addr = ServerProperties.rtuAddrStart; addr <= ServerProperties.rtuAddrEnd; addr++){
                                totalRunedClientCount++ ;
                                startClient(addr) ;
                                createImitate(addr) ;
                            }
                            startJob() ;
                            while(true){
                                if(totalOverClientCount.longValue() >= totalRunedClientCount.longValue()){
                                    Long seconds = (System.currentTimeMillis() - startTime)/1000 ;
                                    RmiClUnit.getInstance().reportHadReportOver(seconds) ;
                                    RmiClUnit.getInstance().allOver(seconds) ;
                                    System.out.println("共用时" + seconds + "秒");
                                    break ;
                                }else{
@@ -91,20 +98,48 @@
        }).start();
    }
    private void startClient(Long rtuAddr){
        try {
            pool.putJob(new MyThreadJob("" + rtuAddr));
        } catch (Exception e) {
            log.error("TcpClUnit.startClient() ", e);
        }
    /**
     * åˆ›å»ºRTU模拟MyThreadJob
     * @param rtuAddr rtu地址
     */
    private void createImitate(Long rtuAddr){
        jobMap.put("" + rtuAddr, new MyThreadJob("" + rtuAddr, ServerProperties.tcpServerIp, ServerProperties.tcpServerPort)) ;
    }
    private void startJob(){
        new Thread(new Runnable(){
            @Override
            public void run() {
                try {
                    Thread.sleep(1000L);
                    while(true){
                        Collection<MyThreadJob> collection = jobMap.values() ;
                        for(MyThreadJob job : collection){
                            pool.putJob(job);
                        }
                        Thread.sleep(ServerProperties.sendInterval * 1000);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }
    public static synchronized void clientSendData(){
        totalSendDataCount++;
        if(totalSendDataCount % 100 == 0){
            RmiClUnit.getInstance().reportHadReportCount(totalSendDataCount);
            System.out.println("已经发送" + totalSendDataCount + "条数据");
        }
    }
    public static synchronized void clientOver(){
        totalOverClientCount++;
        if(totalOverClientCount % 100 == 0){
            RmiClUnit.getInstance().reportHadReportCount(totalOverClientCount);
            System.out.println("已经发送" + totalOverClientCount + "条数据");
            RmiClUnit.getInstance().reportHadReportOver(totalOverClientCount);
            System.out.println("已有" + totalOverClientCount + "完成了任务");
        }
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnitConfigVo.java
@@ -2,6 +2,4 @@
public class TcpClUnitConfigVo {
    public boolean enable ;
    public int heartbeatTimes ;
    public int sendInterval ;
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpConnect.java
File was renamed from pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/MinaConnect.java
@@ -1,38 +1,44 @@
package com.dy.testClient.tcpConnect;
package com.dy.testClient.tcpClient;
import org.apache.mina.core.future.ConnectFuture;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.transport.socket.SocketConnector;
import org.apache.mina.transport.socket.nio.NioSocketConnector;
import java.net.InetSocketAddress;
public class MinaConnect {
public class TcpConnect {
    public static final String rtuAddrKey = "rtuAddr" ;
    public static final String threadJobKey = "threadJob" ;
    /**
     * åˆ¤æ–­ä¼šè¯æ˜¯å¦æœ‰æ•ˆ
     * @param se ç½‘络会话
     * @return æ˜¯å¦è¿žæŽ¥
     */
    protected boolean isConnected(IoSession se) {
    public boolean isConnected(IoSession se) {
        return (se != null && se.isConnected());
    }
    /**
     * åˆ›å»ºæ–°ä¼šè¯
     * @param rtuAddr rtu地址
     * @param job rtu工作类
     * @param host æœåС噍URI
     * @param port æœåŠ¡å™¨ç«¯å£
     * @return ç½‘络会话
     */
    protected IoSession createSession(String host , int port , int connectTimeout , MinaHandler handler) throws Exception{
    public IoSession createSession(String rtuAddr, MyThreadJob job, String host , int port , int connectTimeout , TcpHandler handler) throws Exception{
        SocketConnector connector = new NioSocketConnector();
        connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new LocalCodecFactory()));
        connector.setHandler(handler);
        ConnectFuture connectFuture = connector.connect(new InetSocketAddress(host, port));
        connectFuture.awaitUninterruptibly(connectTimeout);
        IoSession se = connectFuture.getSession();
        se.setAttribute(rtuAddrKey, rtuAddr) ;
        se.setAttribute(threadJobKey, job) ;
        return se ;
    }
@@ -42,7 +48,7 @@
     * @param se
     * @param connectTimeout
     */
    protected void disconnect(IoSession se , int connectTimeout) {
    public void disconnect(IoSession se , int connectTimeout) {
        if (se != null) {
            try{
                se.closeNow().awaitUninterruptibly(connectTimeout);
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpHandler.java
New file
@@ -0,0 +1,77 @@
package com.dy.testClient.tcpClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IdleStatus;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.FilterEvent;
public class TcpHandler  extends IoHandlerAdapter {
    private static Logger log = LogManager.getLogger(TcpHandler.class.getName()) ;
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionCreated(IoSession session) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionOpened(IoSession session) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionClosed(IoSession session) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void sessionIdle(IoSession session, IdleStatus status) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void messageReceived(IoSession session, Object message) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void messageSent(IoSession session, Object message) throws Exception {
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void inputClosed(IoSession session) throws Exception {
        session.closeNow();
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void event(IoSession session, FilterEvent event) throws Exception {
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/LocalDecoder.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/LocalEncoder.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/MinaConnectPool.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpConnect/MinaHandler.java
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/Config.xml
@@ -32,17 +32,13 @@
     -->
    <rmiCl
        rmiSvUrl="127.0.0.1"
        rmiSvContext="mwTestServer"
        rmiSvPort="9898"
        rmiSvContext="mwTestSv"
        rmiSvPort="12345"
    />
    <!--
    enable:是否启动
    heartbeatTimes:连续配置次数心跳后发送一次数据
    sendInterval:发送心跳或数据的时间间隔
     -->
    <tcpCl
        enable="true"
        heartbeatTimes="3"
        sendInterval="3"
    />
</config>        
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/application.yml
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/log4j2.xml
New file
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="OFF">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout charset="GBK" pattern="%d %-5p [%t] (%F:%L) - %m%n%throwable"/>
    </Console>
    <!--
        fileName="${sys:user.home}/logs/aepTest.log" filePattern="${sys:user.home}/logs/aepTest-%d{yyyy-MM}-%i.log.gz"
        fileName="/logs/testJgroups.log" filePattern="/logs/testJgroups-%d{yyyyMMdd}-%i.log.gz"
        fileName="logs/testJgroups.log" filePattern="logs/testJgroups-%d{yyyyMMdd}-%i.log.gz"
        sys:user.home当前用户在操作系统中的文档目录
        /logs/testJgroups.log当前软件所在硬盘根目录
        logs/testJgroups.log当前软件所在目录
     -->
    <RollingFile name="File" fileName="logs/mwTestCl.log" filePattern="logs/aepTest-%d{yyyyMMdd}-%i.log">
      <PatternLayout charset="UTF-8" pattern="%d %-5p [%t] (%class.%method:%L) - %m%n%throwable"/>
      <Policies>
        <TimeBasedTriggeringPolicy interval="7" />
        <SizeBasedTriggeringPolicy size="10MB"/>
      </Policies>
      <DefaultRolloverStrategy max="50" />
    </RollingFile>
  </Appenders>
  <Loggers>
      <!--
      <Logger name="com.zhzc.jgTest" level="debug">
      <AppenderRef ref="Console"/>
    </Logger>
      <Logger name="org.jgroups" level="info">
      <AppenderRef ref="File"/>
    </Logger>
      -->
    <!-- Root与各个Logger同时起作用 -->
    <Root level="info">
      <AppenderRef ref="Console"/>
      <AppenderRef ref="File"/>
    </Root>
  </Loggers>
</Configuration>
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/resources/log4j2.yml
File was deleted
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/pom.xml
New file
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>pipIrr-mw</artifactId>
        <groupId>com.dy</groupId>
        <version>1.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <packaging>jar</packaging>
    <artifactId>pipIrr-mwTest-server</artifactId>
    <version>1.0.0</version>
    <name>pipIrr-mwTest-server</name>
    <description>为模拟RTU测试端提供服务</description>
    <dependencies>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.yml</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <!-- è¯¥æ’件不会将项目中引入的依赖打进最终的 Jar æ–‡ä»¶ -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <!-- ç”Ÿæˆçš„jar中,不要包含pom.xml和pom.properties这两个文件 -->
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <!-- è¿™éƒ¨åˆ†å¯æœ‰å¯æ— ,加上的话则直接生成可运行jar包 -->
                        <manifest>
                            <mainClass>com.dy.testServer.Server</mainClass>
                            <useUniqueVersions>false</useUniqueVersions>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                        </manifest>
                        <!-- manifestEntries的作用是指定本地(自己下载的lib下的)jar包添加到MANIFEST.MF文件中去
                        <manifestEntries>
                            <Class-Path>.lib/alipay-sdk.java.jar</Class-Path>
                        </manifestEntries>
                        -->
                    </archive>
                    <!-- æŽ’除某个文件
                    <excludes>
                        <exclude>com/dy/App.class</exclude>
                    </excludes>
                    -->
                    <!-- å¯æ‰§è¡Œjar进行命名。这样会打包成两个jar包,不会对普通jar重新命名。
                    <classifier>exec</classifier>
                     -->
                </configuration>
            </plugin>
            <plugin>
                <!-- å½“项目中依赖比较多时,我们可以借助 maven-dependency-plugin æ’件自动帮我们下载依赖的 Jar æ–‡ä»¶ï¼ŒæŽ¨èå°†è¯¥æ’件绑定到package生命周期上 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- ç»‘定生命周期 -->
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <!-- è®¾ç½®ä¾èµ–的存放路径 -->
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- è®¾ç½®java编译版本,运行环境版本 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- source: æºä»£ç ç¼–译版本;target: ç›®æ ‡å¹³å°ç¼–译版本;encoding: å­—符集编码。 -->
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- è§£å†³èµ„源文件的编码问题 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- maven里执行测试用例的插件 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java
New file
@@ -0,0 +1,169 @@
package com.dy.testServer;
import java.io.Console;
import java.util.ArrayList;
import java.util.List;
import com.dy.testServer.console.CommandConsole;
import com.dy.testServer.forRmi.Manager;
import org.jdom2.Document;
import com.dy.common.mw.UnitInterface;
import com.dy.common.mw.UnitStartedCallbackInterface;
import com.dy.common.mw.channel.rmi.RmiConfigVo;
import com.dy.common.mw.channel.rmi.RmiUnit;
import com.dy.common.util.ConfigXml;
import com.dy.common.util.NumUtil;
public class Server{
    private ConfigXml conf = null ;
    private Document doc = null ;
    private boolean showStartInfo = false ;
    private String RmiSvUrl ;
    private final List<UnitInterface> units = new ArrayList<>() ;
    /**
     * @param args å‚æ•°
     */
    public static void main(String[] args) {
        new Server().startServer(args);
    }
    /**
     * å¯åŠ¨æœåŠ¡
     */
    public void startServer(String[] args){
        Server sv = new Server();
        long start = System.currentTimeMillis() ;
        try {
            sv.conf = new ConfigXml() ;
            sv.doc = sv.conf.createDom(sv.getClass(), "config.xml") ;
            ////////////////
            //服务 é…ç½®
            sv.showStartInfo = sv.conf.getSetAttrBoolean(sv.doc, "config.server", "showStartInfo", null, null) ;
            sv.startUnits() ;
            String svName ;
            try{
                svName = sv.conf.getSetAttrTxt(sv.doc, "config.server", "name", null, false, null) ;
            }catch(Exception e){
                svName = "" ;
            }
            System.out.println("OOOOOOOOOO           OOOOOOOO       OOOOOOOO") ;
            System.out.println("@@@@@@@@@@@@@@@@#O    $@@@@@@@@&    @@@@@@@@#") ;
            System.out.println("@@@@@@@@@@@@@@@@@@@#    @@@@@@@@# $@@@@@@@@&") ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@#   #@@@@@@@@@@@@@@@@O") ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@@@   &@@@@@@@@@@@@@@") ;
            System.out.println("@@@@@@$      $@@@@@@@@@&   O@@@@@@@@@@@#") ;
            System.out.println("@@@@@@$        @@@@@@@@@     @@@@@@@@@&  " + svName + "mwTestSv " ) ;
            System.out.println("@@@@@@$        @@@@@@@@@     &@@@@@@@@") ;
            System.out.println("@@@@@@$       O@@@@@@@@@     &@@@@@@@@") ;
            if(sv.RmiSvUrl != null){
                System.out.println("@@@@@@$      #@@@@@@@@@$     &@@@@@@@@   RmiSv " + sv.RmiSvUrl ) ;
            }else{
                System.out.println("@@@@@@$      #@@@@@@@@@$     &@@@@@@@@" ) ;
            }
            System.out.println("@@@@@@@@@@@@@@@@@@@@@@#      &@@@@@@@@   Runing in standalone mode" ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@@@&       &@@@@@@@@   Startup in " + (System.currentTimeMillis() - start) + " MS" ) ;
            System.out.println("@@@@@@@@@@@@@@@@@@@#         &@@@@@@@@") ;
            System.out.println("@@@@@@@@@@@@@@@@#O           &@@@@@@@@") ;
            Console console = System.console();
            if (console == null) {
                throw new IllegalStateException("严重错误,未能得到控制台对象!");
            }
            CommandConsole mwConsole = new CommandConsole(console) ;
            mwConsole.init(args);
            boolean exit = mwConsole.clientConsole() ;
            if(exit){
                System.exit(-1);
            }
        }catch(Exception e){
            e.printStackTrace();
        }
    }
    private void startUnits(){
        try {
            ///////////////
            //基本配置
            String txt = conf.getSetAttrTxt(doc, "config.base", "rtuAddrStart", null, false, null) ;
            if(txt == null || txt.trim().equals("")){
                throw new Exception("元素config.base的属性rtuAddrStart的值为空字符串!");
            }
            txt = txt.trim() ;
            if(!NumUtil.isPlusIntNumber(txt)){
                throw new Exception("元素config.base的属性rtuAddrStart的值必须为数值!");
            }
            if(txt.startsWith("0")){
                throw new Exception("元素config.base的属性rtuAddrStart的数值不能以0开头!");
            }
            if(txt.length() != 10){
                throw new Exception("元素config.base的属性rtuAddrStart的数值长度必须为10位!");
            }
            ServerProperties.rtuAddrStart = Long.valueOf(txt) ;
            txt = conf.getSetAttrTxt(doc, "config.base", "rtuAddrEnd", null, false, null) ;
            if(txt == null || txt.trim().equals("")){
                throw new Exception("元素config.base的属性rtuAddrEnd的值为空字符串!");
            }
            txt = txt.trim() ;
            if(!NumUtil.isPlusIntNumber(txt)){
                throw new Exception("元素config.base的属性rtuAddrEnd的值必须为数值!");
            }
            if(txt.startsWith("0")){
                throw new Exception("元素config.base的属性rtuAddrEnd的数值不能以0开头!");
            }
            if(txt.length() != 10){
                throw new Exception("元素config.base的属性rtuAddrEnd的数值长度必须为10位!");
            }
            ServerProperties.rtuAddrEnd = Long.valueOf(txt) ;
            if(ServerProperties.rtuAddrEnd <= ServerProperties.rtuAddrStart){
                throw new Exception("元素config.base的属性rtuAddrEnd的数值必须大于rtuAddrStart!");
            }
            ServerProperties.rtuAddrPerMwTest = conf.getSetAttrPlusInt(doc, "config.base", "rtuAddrPerMwTest", null, 1, null, null) ;
            if(ServerProperties.rtuAddrPerMwTest > ServerProperties.rtuAddrEnd - ServerProperties.rtuAddrStart){
                throw new Exception("元素config.base的属性rtuAddrPerMwTest的数值配置不正确!");
            }
            ServerProperties.tcpServerIp = conf.getSetAttrTxt(doc, "config.base", "tcpServerIp", null, false, null) ;
            ServerProperties.tcpServerPort = conf.getSetAttrPlusInt(doc, "config.base", "tcpServerPort", null, 1, 65535, null) ;
            ServerProperties.sendInterval = conf.getSetAttrPlusInt(doc, "config.base", "sendInterval", null, 1, null, null) ;
            ServerProperties.heartbeatTimes = conf.getSetAttrPlusInt(doc, "config.base", "heartbeatTimes", null, 1, null, null) ;
            ServerProperties.sendTimes = conf.getSetAttrPlusInt(doc, "config.base", "sendTimes", null, 1, null, null) ;
            /////////////////
            //RMI模块
            Manager.init();
            RmiConfigVo rmiVo = new RmiConfigVo();
            rmiVo.enable = conf.getSetAttrBoolean(doc, "config.rmi", "enable", null, null) ;
            if(rmiVo.enable){
                rmiVo.port = conf.getSetAttrPlusInt(doc, "config.rmi", "port", null, 100, 65535, null);
                rmiVo.context = conf.getSetAttrTxt(doc, "config.rmi", "context", null, false, null);
                rmiVo.showStartInfo = showStartInfo ;
                AdapterImp_RmiUnit rmiAdap = new AdapterImp_RmiUnit();
                rmiAdap.setConfig(rmiVo);
                RmiUnit rmiUnit = RmiUnit.getInstance();
                rmiUnit.setAdapter(rmiAdap);
                rmiUnit.start(new UnitStartedCallbackInterface(){
                    @Override
                    public void call(Object obj) {
                    }
                });
                RmiSvUrl = "[ip]:" + rmiVo.port + "/" + rmiVo.context ;
                units.add(rmiUnit) ;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/ServerProperties.java
New file
@@ -0,0 +1,22 @@
package com.dy.testServer;
public class ServerProperties {
    //模拟客户的rtuAddr起始号
    public static Long rtuAddrStart = 0L ;
    //模拟客户的rtuAddr截止号
    public static Long rtuAddrEnd = 0L ;
    //每个mwTest分配的rtuAddr数
    public static Integer rtuAddrPerMwTest = 0 ;
    //服务端URL
    public static String tcpServerIp = "" ;
    //服务端上下文
    public static Integer tcpServerPort = 60000 ;
    //发送数据间隔 ç§’
    public static Integer sendInterval = 0 ;
    //每一轮次发送数据,其中包括心跳发送次数
    public static Integer heartbeatTimes = 0 ;
    //发送数据次数
    public static Integer sendTimes = 0 ;
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/console/Command.java
New file
@@ -0,0 +1,128 @@
package com.dy.testServer.console;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.dy.common.mw.channel.rmi.RmiConfigVo;
import com.dy.common.mw.channel.rmi.RmiUnit;
import com.dy.testServer.ServerProperties;
import com.dy.testServer.forRmi.MwTestClientStatus;
import com.dy.testServer.forRmi.Manager;
public class Command {
    private static final String[] commands ;
    static{
        commands = new String[]{
                "config æŸ¥çœ‹é…ç½®ä¿¡æ¯",
                "show æ˜¾ç¤ºmwTest情况",
                "start å¯åЍmwTest上报数据",
                "exit é€€å‡º",
        };
    }
    public static boolean dealCommand(String command, PrintWriter prtWrt){
        boolean exit = false ;
        if (command.equals("help")) {
            outCommand(prtWrt);
        } else if (command.equals("config")) {
            config(prtWrt);
        } else if (command.equals("show")) {
            show(prtWrt);
        } else if (command.equals("start")) {
            start(prtWrt);
        } else if(command.equals("exit")){
            exit = true ;
        } else {
            outError(prtWrt);
        }
        return exit ;
    }
    private static void outCommand(PrintWriter prtWrt){
        prtWrt.println("");
        prtWrt.println("命令");
        for(String s : commands){
            prtWrt.println("  " + s);
        }
        prtWrt.println("");
    }
    private static void outError(PrintWriter prtWrt){
        prtWrt.println("");
        prtWrt.println("命令不可识别!");
        prtWrt.println("");
    }
    private static void config(PrintWriter prtWrt){
        prtWrt.println("");
        prtWrt.println("相关mwTest的配置");
        prtWrt.println("  æ¨¡æ‹Ÿå®¢æˆ·çš„RtuAddr起始号:" + ServerProperties.rtuAddrStart);
        prtWrt.println("  æ¨¡æ‹Ÿå®¢æˆ·çš„RtuAddr截止号:" + ServerProperties.rtuAddrEnd);
        prtWrt.println("  æ¯ä¸ªmwTest分配的RtuAddr数:" + ServerProperties.rtuAddrPerMwTest);
        prtWrt.println("  é€šä¿¡ä¸­é—´ä»¶IP:" + ServerProperties.tcpServerIp);
        prtWrt.println("  é€šä¿¡ä¸­é—´ä»¶ç«¯å£ï¼š" + ServerProperties.tcpServerPort);
        prtWrt.println("  mwTest发送数据间隔(秒):" + ServerProperties.sendInterval);
        prtWrt.println("  mwTest每RtuAddr号发送数据次数:" + ServerProperties.sendTimes);
        prtWrt.println("  mwTest每一轮次发送数据,其中包括心跳发送次数:" + ServerProperties.heartbeatTimes);
        prtWrt.println("本服务RMI Server配置");
        String ip = null ;
        try {
            ip = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        RmiConfigVo confVo = RmiUnit.getInstance().getAdapter().getConfig() ;
        if(ip != null){
            prtWrt.println("  RMI Server:" + ip + ":" + confVo.port + "/" + confVo.context);
        }else{
            prtWrt.println("  RMI Server:[ip]:" + confVo.port + "/" + confVo.context);
        }
        prtWrt.println("");
    }
    private static void show(PrintWriter prtWrt){
        prtWrt.println("");
        prtWrt.println("当前已注册mwTest客户端数量:" + Manager.id2TokenMap.size());
        if(Manager.id2TokenMap.size() > 0){
            prtWrt.println("mwTest客户端及其工作信息");
            Set<Map.Entry<String, MwTestClientStatus>> set = Manager.token2ClientMap.entrySet() ;
            Iterator<Map.Entry<String, MwTestClientStatus>> it = set.iterator() ;
            Map.Entry<String, MwTestClientStatus> ent ;
            while(it.hasNext()){
                ent = it.next() ;
                prtWrt.println("  mwTest客户端(token=" + ent.getKey() + ")");
                MwTestClientStatus sta = ent.getValue() ;
                if(sta != null){
                    if(sta.confVo != null){
                        prtWrt.println("    rtuAddr范围:" + sta.confVo.rtuAddrStart + "--" + sta.confVo.rtuAddrEnd);
                    }
                    if(sta.startVo != null){
                        prtWrt.println("    ä¸ŠæŠ¥æ•°æ®ï¼š" + (sta.startVo.start?"已经开始":"未开始"));
                    }else{
                        prtWrt.println("    ä¸ŠæŠ¥æ•°æ®ï¼šæœªå¼€å§‹") ;
                    }
                    if(sta.count != null){
                        prtWrt.println("    å·²ç»ä¸ŠæŠ¥æ•°æ®ï¼š" + sta.count + "条");
                    }
                    if(sta.over != null && sta.over){
                        prtWrt.println("    ä¸ŠæŠ¥æ•°æ®å·²ç»å®Œæˆï¼Œå…±ç”¨æ—¶ï¼š" + sta.seconds + "秒");
                    }
                }
            }
        }
        prtWrt.println("");
    }
    private static void start(PrintWriter prtWrt){
        prtWrt.println("");
        prtWrt.println("  å·²ç»å…è®¸mwTest上报数据了");
        prtWrt.println("");
        Manager.enablemwTestStart = true ;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/console/CommandConsole.java
New file
@@ -0,0 +1,91 @@
package com.dy.testServer.console;
import java.io.Console;
import java.io.PrintWriter;
public class CommandConsole {
    private Console console ;
    private PrintWriter prtWrt ;
    private static final String myPassword = "123456" ;
    private static final String commandPrefix1 = ">>" ;
    private static final String commandPrefix2 = "$: " ;
    private static String commandPrefix = commandPrefix1 + commandPrefix2 ;
    public CommandConsole(Console console)throws Exception{
        this.console = console ;
        if(this.console == null){
            throw new Exception("严重错误,java控制台对象为空!");
        }
        prtWrt = console.writer() ;
    }
    /**
     * åˆå§‹ï¼Œæ£€æŸ¥å¹¶è¾“出一些信息
     * @param args å‚æ•°
     * @throws Exception å¼‚常
     */
    public void init(String[] args) throws Exception{
        PrintWriter prtWrt = console.writer() ;
        if(args != null && args.length > 0){
            String str = "" ;
            for(String s : args){
                str += s ;
            }
            prtWrt.println("info:启动参数" + str);
        }
        prtWrt.println("----------------------------------------");
        prtWrt.println("--                                    --");
        prtWrt.println("--    æ¬¢è¿Žä½¿ç”¨mwTest æœåŠ¡æŽ§åˆ¶ç«¯       --");
        prtWrt.println("--                                    --");
        prtWrt.println("----------------------------------------");
    }
    /**
     * æ‰§è¡ŒæŽ§åˆ¶å°æŽ§åˆ¶
     * @return è¿”回
     */
    public boolean clientConsole(){
        boolean exit = false ;
        try {
            this.login() ;
            exit = this.doConsole();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return exit ;
    }
    private boolean login(){
        while (true) {
            //String username = console.readLine("Username: ");
            char[] password = console.readPassword(">>Password: ");
            String passwordStr = String.valueOf(password) ;
            if (passwordStr.equals("help")) {
                console.printf("密码是%1$s.\n", "123456");
                // ä½¿ç”¨åŽåº”立即将数组清空,以减少其在内存中占用的时间,增强安全性
                password = null;
            } else if(passwordStr.equals(myPassword)){
                return true;
            }
        }
    }
    private boolean doConsole(){
        boolean exit = false ;
        while (!exit) {
            String command = console.readLine(commandPrefix);
            exit = Command.dealCommand(command, prtWrt) ;
        }
        return exit ;
    }
    public static void changeCommandPrefix(String prefix){
        commandPrefix = commandPrefix1 + prefix ;
    }
    public static void recoverCommandPrefix(){
        commandPrefix = commandPrefix1 + commandPrefix2 ;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Code.java
New file
@@ -0,0 +1,16 @@
package com.dy.testServer.forRmi;
public class Code {
    public static String cd1 = "001" ;//注册
    public static String cd2 = "002" ;//请求mwClient的配置
    public static String cd3 = "003" ;//请求开始工作
    public static String cd4 = "004" ;//向服务端上报信息
    public static String cd5 = "005" ;//向服务端上报  å®Œæˆä»»åŠ¡çš„æ•°é‡
    public static String cd6 = "006" ;//向服务端上报  å…¨éƒ¨ä»»åŠ¡å®Œæˆ
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java
New file
@@ -0,0 +1,192 @@
package com.dy.testServer.forRmi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.dy.testServer.ServerProperties;
public class Manager {
    public static boolean enablemwTestStart = false ;
    public static int clientId = 1 ;
    public static long maxClient = 0 ;
    public static Map<String, String> id2TokenMap = new HashMap<>() ;
    public static Map<String, MwTestClientStatus> token2ClientMap = new HashMap<>() ;
    public static List<Object[]> rtuAddrList = new ArrayList<>() ;
    public static void init(){
        maxClient = (ServerProperties.rtuAddrEnd - ServerProperties.rtuAddrStart)/ServerProperties.rtuAddrPerMwTest ;
        if((ServerProperties.rtuAddrEnd - ServerProperties.rtuAddrStart)%ServerProperties.rtuAddrPerMwTest > 0 ){
            maxClient = maxClient + 1 ;
        }
        int count = 0 ;
        for(int i = 0; i < maxClient; i++){
            long start = ServerProperties.rtuAddrStart + (i * ServerProperties.rtuAddrPerMwTest) ;
            long end = ServerProperties.rtuAddrStart + ((i + 1) * ServerProperties.rtuAddrPerMwTest - 1) ;
            if(end > ServerProperties.rtuAddrEnd){
                end = ServerProperties.rtuAddrEnd ;
            }
            if(end < start){
                break ;
            }else{
                rtuAddrList.add(count++, new Object[]{start, end});
            }
        }
    }
    public synchronized static String dealRequest(Object obj) throws Exception{
        RmiResponseVo resVo ;
        if(obj == null){
            resVo = new RmiResponseVo() ;
            resVo.success = false ;
            resVo.errorInfo = "收到的数据为null" ;
        }else if(!(obj instanceof String)){
            resVo = new RmiResponseVo() ;
            resVo.success = false ;
            resVo.errorInfo = "收到的数据不是字符串类型" ;
        }else{
            RmiRequestVo rqVo = RmiRequestVo.jsonToObject((String)obj) ;
            resVo = doDeal(rqVo) ;
        }
        return resVo.toJson() ;
    }
    private static RmiResponseVo doDeal(RmiRequestVo rqVo){
        RmiResponseVo resVo = new RmiResponseVo() ;
        resVo.code = rqVo.code ;
        if(rqVo.code.equals(Code.cd1)){
            if(rqVo.id == null || rqVo.id.trim().equals("")){
                resVo.success = false ;
                resVo.errorInfo = "注册失败,必须提供客户端ID " ;
            }else{
                ResRegisterVo vo = doDealRegister(rqVo) ;
                if(vo != null){
                    resVo.obj = vo ;
                }else{
                    resVo.success = false ;
                    resVo.errorInfo = "rtuAddr已经分配完成,注册失败" ;
                }
            }
        }else if(rqVo.code.equals(Code.cd2)){
            resVo.obj = doDealGetConfig(rqVo) ;
        }else if(rqVo.code.equals(Code.cd3)){
            resVo.obj = doDealGetStart(rqVo) ;
        }else if(rqVo.code.equals(Code.cd4)){
            doDealReportCount(rqVo) ;
        }else if(rqVo.code.equals(Code.cd5)){
            doDealReportOver(rqVo) ;
        }else if(rqVo.code.equals(Code.cd6)){
            doDealAllOver(rqVo) ;
        }
        return resVo ;
    }
    private static ResRegisterVo doDealRegister(RmiRequestVo rqVo){
        ResRegisterVo resVo = null ;
        String token = id2TokenMap.get(rqVo.id) ;
        if(token == null){
            if(clientId <= rtuAddrList.size()){
                resVo =  new ResRegisterVo() ;
                resVo.token = "" + clientId ;
                id2TokenMap.put(rqVo.id, resVo.token) ;
                clientId++ ;
            }
        }else{
            resVo =  new ResRegisterVo() ;
            resVo.token = token ;
        }
        return resVo ;
    }
    private static MwConfigVo doDealGetConfig(RmiRequestVo rqVo){
        MwConfigVo conVo ;
        int token = Integer.parseInt(rqVo.token) ;
        MwTestClientStatus sta = token2ClientMap.get("" + token);
        if(sta == null){
            Object[] rtuAddrs = rtuAddrList.get(token-1) ;
            conVo = new MwConfigVo() ;
            conVo.rtuAddrStart = (Long)rtuAddrs[0] ;
            conVo.rtuAddrEnd = (Long)rtuAddrs[1] ;
            conVo.tcpServerIp = ServerProperties.tcpServerIp ;
            conVo.tcpServerPort = ServerProperties.tcpServerPort ;
            conVo.sendInterval = ServerProperties.sendInterval ;
            conVo.heartbeatTimes = ServerProperties.heartbeatTimes ;
            conVo.sendTimes = ServerProperties.sendTimes ;
            sta = new MwTestClientStatus() ;
            sta.confVo = conVo ;
            token2ClientMap.put("" + token, sta);
        }else{
            conVo = sta.confVo;
        }
        return conVo ;
    }
    private static ResStartVo doDealGetStart(RmiRequestVo rqVo){
        ResStartVo rvo = new ResStartVo() ;
        rvo.start = enablemwTestStart ;
        int token = Integer.parseInt(rqVo.token) ;
        MwTestClientStatus sta = token2ClientMap.get("" + token);
        if(sta == null){
            sta = new MwTestClientStatus() ;
            sta.startVo = rvo ;
            token2ClientMap.put("" + token, sta);
        }else{
            sta.startVo = rvo ;
        }
        return rvo ;
    }
    private static void doDealReportCount(RmiRequestVo rqVo){
        int token = Integer.parseInt(rqVo.token) ;
        MwTestClientStatus sta = token2ClientMap.get("" + token);
        if(sta == null){
            sta = new MwTestClientStatus() ;
            sta.count = rqVo.count ;
            token2ClientMap.put("" + token, sta);
        }else{
            sta.count = rqVo.count ;
        }
    }
    private static void doDealReportOver(RmiRequestVo rqVo){
        int token = Integer.parseInt(rqVo.token) ;
        MwTestClientStatus sta = token2ClientMap.get("" + token);
        if(sta == null){
            sta = new MwTestClientStatus() ;
            sta.overCount = rqVo.count ;
            token2ClientMap.put("" + token, sta);
        }else{
            sta.count = rqVo.count ;
        }
    }
    private static void doDealAllOver(RmiRequestVo rqVo){
        int token = Integer.parseInt(rqVo.token) ;
        MwTestClientStatus sta = token2ClientMap.get("" + token);
        if(sta == null){
            sta = new MwTestClientStatus() ;
            if(rqVo.over != null && rqVo.over){
                sta.over = true ;
                sta.seconds = rqVo.seconds ;
            }
            token2ClientMap.put("" + token, sta);
        }else{
            if(rqVo.over != null && rqVo.over){
                sta.over = true ;
                sta.seconds = rqVo.seconds ;
            }
        }
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java
New file
@@ -0,0 +1,103 @@
package com.dy.testServer.forRmi;
import com.alibaba.fastjson2.JSON;
public class MwConfigVo {
    //模拟客户的RtuAddr起始号
    public Long rtuAddrStart = 0L ;
    //模拟客户的RtuAddr截止号
    public Long rtuAddrEnd = 0L ;
    //通信中间件IP
    public String tcpServerIp = "" ;
    //通信中间件端口
    public Integer tcpServerPort = 0 ;
    //发送数据数据间隔
    public Integer sendInterval = 2 ;//秒
    //每一轮次发送数据,其中包括心跳发送次数
    public Integer heartbeatTimes = 3 ;
    //发送数据次数
    public Integer sendTimes = 0 ;
    /**
     * å¯¹è±¡è½¬æˆjson
     * @return è¿”回 json
     * @throws Exception å¼‚常
     */
    public String toJson()throws Exception{
        try{
            return JSON.toJSONString(this) ;
            //return new JSONSerializer().exclude(new String[]{"class", "*.class"}).deepSerialize(this);
        }catch(Exception e){
            throw new Exception(e.getMessage() , e ) ;
        }
    }
    /**
     * json转成对象
     * @param json å‚æ•°
     * @return è¿”回对象
     * @throws Exception å¼‚常
     */
    public static MwConfigVo jsonToObject(String json)throws Exception{
        try{
            return JSON.parseObject(json, MwConfigVo.class) ;
            //return new JSONDeserializer<ResConfigVo>().deserialize(json, ResConfigVo.class) ;
        }catch(Exception e){
            throw new Exception(e.getMessage() , e ) ;
        }
    }
    public Long getRtuAddrStart() {
        return rtuAddrStart;
    }
    public void setRtuAddrStart(Long rtuAddrStart) {
        this.rtuAddrStart = rtuAddrStart;
    }
    public Long getRtuAddrEnd() {
        return rtuAddrEnd;
    }
    public void setRtuAddrEnd(Long rtuAddrEnd) {
        this.rtuAddrEnd = rtuAddrEnd;
    }
    public String getTcpServerIp() {
        return tcpServerIp;
    }
    public void setTcpServerIp(String tcpServerIp) {
        this.tcpServerIp = tcpServerIp;
    }
    public Integer getTcpServerPort() {
        return tcpServerPort;
    }
    public void setTcpServerPort(Integer tcpServerPort) {
        this.tcpServerPort = tcpServerPort;
    }
    public Integer getSendInterval() {
        return sendInterval;
    }
    public void setSendInterval(Integer sendInterval) {
        this.sendInterval = sendInterval;
    }
    public Integer getHeartbeatTimes() {
        return heartbeatTimes;
    }
    public void setHeartbeatTimes(Integer heartbeatTimes) {
        this.heartbeatTimes = heartbeatTimes;
    }
    public Integer getSendTimes() {
        return sendTimes;
    }
    public void setSendTimes(Integer sendTimes) {
        this.sendTimes = sendTimes;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwTestClientStatus.java
New file
@@ -0,0 +1,58 @@
package com.dy.testServer.forRmi;
public class MwTestClientStatus {
    public MwConfigVo confVo ;
    public ResStartVo startVo ;
    public Integer count ;//mwTest上报数据数量
    public Integer overCount ;//mwTest完成全部上报数据RTU数量
    public Boolean over ;//mwTest上报数据结束
    public Long seconds ;//mwTest上报数据用时(秒)
    public MwConfigVo getConfVo() {
        return confVo;
    }
    public void setConfVo(MwConfigVo confVo) {
        this.confVo = confVo;
    }
    public ResStartVo getStartVo() {
        return startVo;
    }
    public void setStartVo(ResStartVo startVo) {
        this.startVo = startVo;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Boolean getOver() {
        return over;
    }
    public void setOver(Boolean over) {
        this.over = over;
    }
    public Long getSeconds() {
        return seconds;
    }
    public void setSeconds(Long seconds) {
        this.seconds = seconds;
    }
}
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/resources/Config.xml
New file
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
        <server name="mwTest测试控制端" showStartInfo="true" company="http://www.dyjs.com"/>
        <!--
        åŸºæœ¬é…ç½®
        rtuAddrStart: æ¨¡æ‹Ÿå®¢æˆ·çš„RtuAddr起始号
        rtuAddrEnd: æ¨¡æ‹Ÿå®¢æˆ·çš„RtuAddr截止号
        rtuAddrsPerMwTest: æ¯ä¸ªmwTest分配的RtuAddr数
        tcpServerIp: é€šä¿¡ä¸­é—´ä»¶IP
        tcpServerPort: é€šä¿¡ä¸­é—´ä»¶ç«¯å£
        sendInterval:发送数据间隔 ç§’
        heartbeatTimes:每一轮次发送数据,其中包括心跳发送次数
        sendTimes:发送数据次数
         -->
        <base
            rtuAddrStart="5323280000"
            rtuAddrEnd="5323289999"
            rtuAddrPerMwTest="1"
            tcpServerIp="127.0.0.1"
            tcpServerPort="60000"
            sendInterval="2"
            heartbeatTimes="3"
            sendTimes="1"
        />
        <!--
        port:rmi服务端口号
        context:rmi服务上下文
         -->
        <rmi enable="true"
            port="12345"
            context="mwTestSv"
        />
</config>
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/resources/log4j2.xml
New file
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="OFF">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout charset="GBK" pattern="%d %-5p [%t] (%F:%L) - %m%n%throwable"/>
    </Console>
    <!--
        fileName="${sys:user.home}/logs/aepTest.log" filePattern="${sys:user.home}/logs/aepTest-%d{yyyy-MM}-%i.log.gz"
        fileName="/logs/testJgroups.log" filePattern="/logs/testJgroups-%d{yyyyMMdd}-%i.log.gz"
        fileName="logs/testJgroups.log" filePattern="logs/testJgroups-%d{yyyyMMdd}-%i.log.gz"
        sys:user.home当前用户在操作系统中的文档目录
        /logs/testJgroups.log当前软件所在硬盘根目录
        logs/testJgroups.log当前软件所在目录
     -->
    <RollingFile name="File" fileName="logs/mwTestSv.log" filePattern="logs/aepTest-%d{yyyyMMdd}-%i.log">
      <PatternLayout charset="UTF-8" pattern="%d %-5p [%t] (%class.%method:%L) - %m%n%throwable"/>
      <Policies>
        <TimeBasedTriggeringPolicy interval="7" />
        <SizeBasedTriggeringPolicy size="10MB"/>
      </Policies>
      <DefaultRolloverStrategy max="50" />
    </RollingFile>
  </Appenders>
  <Loggers>
    <!-- Root与各个Logger同时起作用 -->
    <Root level="info">
      <AppenderRef ref="Console"/>
      <AppenderRef ref="File"/>
    </Root>
  </Loggers>
</Configuration>
pipIrr-platform/pipIrr-mw/pom.xml
@@ -25,7 +25,11 @@
            <groupId>com.dy</groupId>
            <artifactId>pipIrr-common</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
            <!--
            scope不能用provided,否则Server.java的运行不起来
            scope不能用runtime,否则不能编辑
            -->
            <scope>compile</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
@@ -39,7 +43,7 @@
            <groupId>com.dy</groupId>
            <artifactId>pipIrr-global</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
            <scope>compile</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
@@ -76,9 +80,8 @@
            <artifactId>jackson-dataformat-yaml</artifactId>
            <exclusions>
                <exclusion>
                    <!-- æŽ’除掉依赖 -->
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
pipIrr-platform/pipIrr-platform.iml
File was deleted
pipIrr-platform/pipIrr-web/.gitignore
@@ -1,2 +1,2 @@
target/
/pipIrr-web.iml
pipIrr-web.iml
pipIrr-platform/pipIrr-web/pipIrr-web-sso/.gitignore
@@ -1,6 +1,7 @@
HELP.md
target/
/pipIrr-web-sso.iml
mvnw
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
pipIrr-platform/pipIrr-web/pipIrr-web.iml
File was deleted
pipIrr-platform/pipIrr-web/pom.xml
@@ -80,6 +80,12 @@
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- ç³»ç»Ÿç›‘管 -->
pipIrr-platform/Îĵµ/Îļþ¼ÓÈëÁË .gitignore£¬µ«»¹ÊDZ» git ¸ú×Ù.docx
Binary files differ