package com.dy.pipIrrMwTestWeb.test;
|
|
import com.dy.common.mw.protocol.p206V202404.CodeV202404;
|
import com.dy.common.mw.protocol.p206V202404.downVos.ComCd10Vo;
|
import com.dy.common.mw.protocol.p206V202404.downVos.ComCd15Vo;
|
import com.dy.common.mw.protocol.p206V202404.downVos.ComCd65Vo;
|
import com.dy.common.webUtil.BaseResponse;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* @Author: liurunyu
|
* @Date: 2024/5/14 14:20
|
* @Description
|
*/
|
@Component
|
public class Test extends TestSupport{
|
|
/**
|
* 连接通信中间件测试
|
* @return
|
*/
|
public BaseResponse test(){
|
//return this.connect() ;
|
return this.cd50() ;
|
}
|
|
/**
|
* 测试连通性
|
* @return
|
*/
|
private BaseResponse connect(){
|
return this.sendTest() ;
|
}
|
|
//设置终端地址(AFN=0x10H)
|
private BaseResponse cd10(){
|
ComCd10Vo comVo = new ComCd10Vo() ;
|
comVo.controllerType = Test.controllerType ;
|
comVo.projectNo = Test.projectNo ;
|
comVo.rtuNewAddr = Test.rtuAddr ;
|
return this.sendCom2Mw(this.command(CodeV202404.cd_10, comVo, null)) ;
|
}
|
//查询设备终端地址(AFN=0x50H)
|
private BaseResponse cd50(){
|
return this.sendCom2Mw(this.command(CodeV202404.cd_50, this.comCdXyVo(), null)) ;
|
}
|
//查询设备终端实时值(AFN=0x5BH)
|
private BaseResponse cd5B(){
|
return this.sendCom2Mw(this.command(CodeV202404.cd_5B, this.comCdXyVo(), null)) ;
|
}
|
//查询设备终端用户用水记录(AFN=0x65H)
|
private BaseResponse cd65(){
|
ComCd65Vo comVo = new ComCd65Vo() ;
|
comVo.controllerType = Test.controllerType ;
|
comVo.projectNo = Test.projectNo ;
|
comVo.page = 1 ;
|
return this.sendCom2Mw(this.command(CodeV202404.cd_65, comVo, null)) ;
|
}
|
//清除设备终端用户用水记录 (AFN=0x97H)
|
private BaseResponse cd97(){
|
return this.sendCom2Mw(this.command(CodeV202404.cd_97, this.comCdXyVo(), null)) ;
|
}
|
//远程用户充值 (AFN=0x15H)
|
private BaseResponse cd15(){
|
ComCd15Vo comVo = new ComCd15Vo() ;
|
comVo.controllerType = Test.controllerType ;
|
comVo.projectNo = Test.projectNo ;
|
comVo.icCardAddr = "" ;//IC卡地址(8位数字或字母)
|
comVo.icCardNo = "" ;//用户卡序列号(17位数字)(6字节BCD,2字节HEX)
|
comVo.chargeMoney = 123.45 ;//单位:元 2位小数点(最大值 99999999.99)
|
comVo.chargeWater = 123.45 ;//单位:m3 2位小数点(最大值 99999999.99)
|
comVo.flowNo = "" ;//流水号(12位数字)
|
|
return this.sendCom2Mw(this.command(CodeV202404.cd_65, comVo, null)) ;
|
}
|
|
}
|