copy from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/ComSupport.java
copy to pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/ComSupportP206V100.java
| File was copied from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/ComSupport.java | 
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.mw.protocol.Command; | 
|---|
|  |  |  | import com.dy.common.mw.protocol.CommandType; | 
|---|
|  |  |  | import com.dy.common.mw.protocol.p206V202404.CodeV202404; | 
|---|
|  |  |  | import com.dy.common.mw.protocol.p206V202404.ProtocolConstantV206V202404; | 
|---|
|  |  |  | import com.dy.common.mw.protocol.p206V202404.downVos.ComCdXyVo; | 
|---|
|  |  |  | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponse; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.http.HttpEntity; | 
|---|
|  |  |  | 
|---|
|  |  |  | * @Date: 2024/5/14 17:32 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class ComSupport { | 
|---|
|  |  |  | public class ComSupportP206V100 { | 
|---|
|  |  |  | protected static String mwUrlTest = "http://127.0.0.1:8070/rtuMw/com/test" ; | 
|---|
|  |  |  | protected static String mwUrlSendCom = "http://127.0.0.1:8070/rtuMw/com/send" ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | protected static String rtuAddr = "37142501020100215" ; | 
|---|
|  |  |  | protected static String rtuAddr = "620201000029" ; | 
|---|
|  |  |  | protected static String rtuResultSendWebUrl = "http://127.0.0.1:65535/test/comRes/receive" ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | protected static String controllerType = "57" ;//控制器类型 | 
|---|
|  |  |  | protected static Integer projectNo = 10 ;//项目编码 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | protected static String icCardAddr = "04BEA5BB" ;//IC卡地址 | 
|---|
|  |  |  | protected static String icCardNo = "37142501020500001" ;//IC卡编号(用户卡序列号) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | private RestTemplate restTemplate; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | protected ComCdXyVo comCdXyVo(){ | 
|---|
|  |  |  | ComCdXyVo comVo = new ComCdXyVo() ; | 
|---|
|  |  |  | comVo.controllerType = controllerType ; | 
|---|
|  |  |  | comVo.projectNo = projectNo  ; | 
|---|
|  |  |  | return comVo ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | protected Command command(String code, Object param, String comId){ | 
|---|
|  |  |  | Command com = new Command() ; | 
|---|
|  |  |  | com.id = comId==null?Command.defaultId:(comId.trim().equals("")?Command.defaultId:comId) ;//实际应用中,替换成数据库记录id | 
|---|
|  |  |  | com.protocol = ProtocolConstantV206V202404.protocolName ; | 
|---|
|  |  |  | com.protocol = ProtocolConstantV206V1_0_0.protocolName ; | 
|---|
|  |  |  | com.code = code ; | 
|---|
|  |  |  | com.rtuAddr = rtuAddr ; | 
|---|
|  |  |  | com.type = CommandType.outerCommand ; | 
|---|