1、测试子模块实现“定时关阀计划开阀(A1H)”和“定量关阀计划开阀(A2H)”.
1个文件已修改
47 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java
@@ -5,6 +5,7 @@
import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.downVos.*;
import com.dy.common.util.DateTime;
import com.dy.common.webUtil.BaseResponse;
import com.dy.pipIrrMwTestWeb.common.CodeLocal;
import lombok.extern.slf4j.Slf4j;
@@ -29,6 +30,7 @@
        if(com == null){
            rt = this.connect() ;//连接通信中间件测试
        }else{
            try{
            if(com.equals("10")){
                rt = this.cd10() ;
            }else if(com.equals("21")){
@@ -71,8 +73,15 @@
                rt = this.cd99() ;
            }else if(com.equals("A0")){
                rt = this.cdA0() ;
                }else if(com.equals("A1")){
                    rt = this.cdA1() ;
                }else if(com.equals("A2")){
                    rt = this.cdA2() ;
            }else if(com.equals("B0")){
                rt = this.cdB0() ;
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        return rt ;
@@ -204,9 +213,45 @@
        comVo.moneyRemain = 234.56 ;
        comVo.waterPrice = 1.2 ;
        comVo.waterAmount = 10 ;
        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_98, comVo, null)) ;
        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_A0, comVo, null)) ;
    }
    //定时关阀计划开阀
    private BaseResponse cdA1() throws Exception {
        ComA1Vo comVo = new ComA1Vo() ;
        comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo;
        comVo.moneyRemain = 234.56 ;
        comVo.waterPrice = 1.2 ;
        comVo.minutes = 3 ;
        String nextDtStr = DateTime.nextXMinute_yyyy_MM_dd_HH_mm_ss(DateTime.yyyy_MM_dd_HH_mm_ss(), 5) ;//将来5分钟
        int[] nextDt = DateTime.yyyy_MM_dd_HH_MM_SS_2_ymdhmsGroup(nextDtStr) ;
        comVo.year = nextDt[0] ;
        comVo.month = nextDt[1] ;
        comVo.day = nextDt[2] ;
        comVo.hour = nextDt[3] ;
        comVo.minute = nextDt[4] ;
        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_A1, comVo, null)) ;
    }
    //定量关阀计划开阀
    private BaseResponse cdA2() throws Exception {
        ComA2Vo comVo = new ComA2Vo() ;
        comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo;
        comVo.moneyRemain = 234.56 ;
        comVo.waterPrice = 1.2 ;
        comVo.waterAmount = 10 ;
        String nextDtStr = DateTime.nextXMinute_yyyy_MM_dd_HH_mm_ss(DateTime.yyyy_MM_dd_HH_mm_ss(), 5) ;//将来5分钟
        int[] nextDt = DateTime.yyyy_MM_dd_HH_MM_SS_2_ymdhmsGroup(nextDtStr) ;
        comVo.year = nextDt[0] ;
        comVo.month = nextDt[1] ;
        comVo.day = nextDt[2] ;
        comVo.hour = nextDt[3] ;
        comVo.minute = nextDt[4] ;
        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_A2, comVo, null)) ;
    }
    private BaseResponse cdB0(){
        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_B0, null, null)) ;
    }