1、靳总协议解析与构造修改完善;
2、靳总协议上行数据处理修改完善;
3、增加UserTokenFilter非过滤(放行)URL功能实现。
5 文件已重命名
20个文件已修改
16个文件已添加
1个文件已删除
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | |
| | | public static final String cd_12 = "12" ;//设置工作模式(未实现) |
| | | public static final String cd_1F = "1F" ;//设置流量参数上限值(未实现) |
| | | public static final String cd_21 = "21" ;//设置服务端IP和端口 |
| | | public static final String cd_36 = "36" ;//设置主信道IP和端口 |
| | | public static final String cd_36 = "36" ;//设置主信道IP和端口(无此命令) |
| | | public static final String cd_37 = "37" ;//设置流量采集周期 |
| | | public static final String cd_38 = "38" ;//设置用户余额报警值 |
| | | public static final String cd_39 = "39" ;//设置电池电压报警值 |
| | | public static final String cd_3A = "3A" ;//设置阀门堵转电流 |
| | | public static final String cd_3B = "3B" ;//设置阀门超时时间 |
| | | public static final String cd_3C = "3C" ;//设置自报周期 |
| | | public static final String cd_3D = "3D" ;//设置阶梯水价 |
| | | public static final String cd_3D = "3D" ;//设置阶梯水价(RTU未实现) |
| | | public static final String cd_3E = "3E" ;//设置黑名单(未实现) |
| | | public static final String cd_50 = "50" ;//查询遥测站终端地址 |
| | | public static final String cd_51 = "51" ;//查询时钟(未实现) |
| | | public static final String cd_51 = "51" ;//查询时钟 |
| | | public static final String cd_52 = "52" ;//查询工作模式(未实现) |
| | | public static final String cd_53 = "53" ;//查询自报种类及时间间隔(未实现) |
| | | public static final String cd_5E = "5E" ;//查询终端状态和报警状态(未实现) |
| | | public static final String cd_5E = "5E" ;//查询终端状态和报警状态 |
| | | public static final String cd_65 = "65" ;//查询自报周期 |
| | | public static final String cd_66 = "66" ;//查询IP和端口 |
| | | public static final String cd_67 = "67" ;//查询流量采集周期 |
| | |
| | | */ |
| | | public static String icCardType(byte type){ |
| | | return switch (type) { |
| | | case 0 -> "无卡"; |
| | | case 1 -> "用户卡"; |
| | | case 2 -> "管理员卡"; |
| | | case 3 -> "调试卡"; |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:00 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class Com21Vo { |
| | | public String ip ;//IP(例如 125.235.35.89) |
| | | public Integer port ;//端口号(0~65536) |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:08 |
| | | * @Description |
| | | */ |
| | | public class Com37Vo { |
| | | public Integer seconds ;//流量采集周期(秒)(大于1) |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:08 |
| | | * @Description |
| | | */ |
| | | public class Com38Vo { |
| | | public Double remainMoneyAlarm ;//用户余额报警值(大于1.0) |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:08 |
| | | * @Description |
| | | */ |
| | | public class Com39Vo { |
| | | public Double batteryVoltAlarm ;//电池电压报警值(大于0.1) |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:08 |
| | | * @Description |
| | | */ |
| | | public class Com3AVo { |
| | | public Double current ;//阀门堵转电流(大于0) |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:08 |
| | | * @Description |
| | | */ |
| | | public class Com3BVo { |
| | | public Integer second ;//阀门超时时间(秒)(大于1) |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.downVos; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 7:08 |
| | | * @Description |
| | | */ |
| | | public class Com3CVo { |
| | | public Integer minute ;//自报周期(分钟)(大于0) |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com21Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.ComCd21Vo; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | | |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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, (byte)0) ; |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | |
| | | /* |
| | | 参数格式: ip1,ip2,ip3,ip4,port |
| | | */ |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else{ |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com21Vo cvo = JSON.parseObject(json, Com21Vo.class); |
| | | if(cvo == null){ |
| | | throw new Exception("json转Com21Vo为null") ; |
| | | } |
| | | if(cvo.ip == null || cvo.ip.equals("")){ |
| | | throw new Exception("IP不能为空") ; |
| | | } |
| | | if(cvo.ip.length() > 15){ |
| | | throw new Exception("IP最大长度是15个字符") ; |
| | | } |
| | | if(cvo.port < 0 || cvo.port > 65535){ |
| | | throw new Exception("端口号必须是0~65535范围内的整数") ; |
| | | } |
| | | 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, (byte)0) ; |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | |
| | | index = 0 ; |
| | | byte[] bs = new byte[13] ; |
| | | String ipPort = (String)para.param ; |
| | | String[] ipPorts = ipPort.split(",") ; |
| | | String[] ipPorts = cvo.ip.split(".") ; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[0]), index++); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[1]), index++); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[2]), index++); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[3]), index++); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, Integer.parseInt(ipPorts[4]), index); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, cvo.port, index); |
| | | index += 2 ; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | GlCreate.createTp(bs, index); |
| | | |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com21Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com37Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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 ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else { |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com37Vo cvo = JSON.parseObject(json, Com37Vo.class); |
| | | if (cvo == null) { |
| | | throw new Exception("json转Com21Vo为null"); |
| | | } |
| | | if (cvo.seconds == null) { |
| | | throw new Exception("采集周期不能为空"); |
| | | } |
| | | if (cvo.seconds < 1) { |
| | | throw new Exception("采集周期不能小于1"); |
| | | } |
| | | 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] = 0;//帧长度 |
| | | |
| | | index++ ; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ; |
| | | index++; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte; |
| | | |
| | | index++ ; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ; |
| | | index++; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte) 0, (byte) 0); |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | index++; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index); |
| | | |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[10] ; |
| | | Integer second = (Integer)para.param ; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, second.shortValue(), index); |
| | | index += 2 ; |
| | | index = 0; |
| | | byte[] bs = new byte[10]; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, cvo.seconds.shortValue(), index); |
| | | index += 2; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createTp(bs, index); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes);//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail); |
| | | |
| | | return bytes; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com38Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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 ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else { |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com38Vo cvo = JSON.parseObject(json, Com38Vo.class); |
| | | if (cvo == null) { |
| | | throw new Exception("json转Com21Vo为null"); |
| | | } |
| | | if (cvo.remainMoneyAlarm == null) { |
| | | throw new Exception("用户余额报警值不能为空"); |
| | | } |
| | | if (cvo.remainMoneyAlarm < 1.0) { |
| | | throw new Exception("用户余额报警值不能小于1.0"); |
| | | } |
| | | 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] = 0;//帧长度 |
| | | |
| | | index++ ; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ; |
| | | index++; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte; |
| | | |
| | | index++ ; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ; |
| | | index++; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte) 0, (byte) 0); |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | index++; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index); |
| | | |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[10] ; |
| | | Double remainMoneyAlarmDb = ((Double)para.param) * 100 ; |
| | | Integer remainMoneyAlarmInt = remainMoneyAlarmDb.intValue() ; |
| | | index = 0; |
| | | byte[] bs = new byte[10]; |
| | | Double remainMoneyAlarmDb = cvo.remainMoneyAlarm * 100.0; |
| | | Integer remainMoneyAlarmInt = remainMoneyAlarmDb.intValue(); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, remainMoneyAlarmInt.shortValue(), index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createTp(bs, index); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes);//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail); |
| | | |
| | | return bytes; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com38Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com39Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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 ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else { |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com39Vo cvo = JSON.parseObject(json, Com39Vo.class); |
| | | if (cvo == null) { |
| | | throw new Exception("json转Com21Vo为null"); |
| | | } |
| | | if (cvo.batteryVoltAlarm == null) { |
| | | throw new Exception("电池电压报警值不能为空"); |
| | | } |
| | | if (cvo.batteryVoltAlarm < 0.1) { |
| | | throw new Exception("电池电压报警值不能小于0.1"); |
| | | } |
| | | 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] = 0;//帧长度 |
| | | |
| | | index++ ; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ; |
| | | index++; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte; |
| | | |
| | | index++ ; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ; |
| | | index++; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte) 0, (byte) 0); |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | index++; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index); |
| | | |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[10] ; |
| | | Double batteryvoltAlarmDb = ((Double)para.param) * 100 ; |
| | | Integer batteryvoltAlarmInt = batteryvoltAlarmDb.intValue() ; |
| | | index = 0; |
| | | byte[] bs = new byte[10]; |
| | | Double batteryvoltAlarmDb = cvo.batteryVoltAlarm * 100; |
| | | Integer batteryvoltAlarmInt = batteryvoltAlarmDb.intValue(); |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, batteryvoltAlarmInt.shortValue(), index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createTp(bs, index); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes);//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail); |
| | | |
| | | return bytes; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com39Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com3AVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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 ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else { |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com3AVo cvo = JSON.parseObject(json, Com3AVo.class); |
| | | if (cvo == null) { |
| | | throw new Exception("json转Com21Vo为null"); |
| | | } |
| | | if (cvo.current == null) { |
| | | throw new Exception("阀门堵转电流不能为空"); |
| | | } |
| | | if (cvo.current < 0) { |
| | | throw new Exception("阀门堵转电流不能小于0"); |
| | | } |
| | | 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] = 0;//帧长度 |
| | | |
| | | index++ ; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ; |
| | | index++; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte; |
| | | |
| | | index++ ; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ; |
| | | index++; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte) 0, (byte) 0); |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | index++; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index); |
| | | |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[11] ; |
| | | Double currentDb = ((Double)para.param) * 100 ; |
| | | Integer currentInt = currentDb.intValue() ; |
| | | index = 0; |
| | | byte[] bs = new byte[11]; |
| | | Double currentDb = cvo.current * 100; |
| | | Integer currentInt = currentDb.intValue(); |
| | | ByteUtilUnsigned.int2Bytes_LE(bs, currentInt.shortValue(), index); |
| | | index += 3 ;//上面是三byte的数值 |
| | | index += 3;//上面是三byte的数值 |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createTp(bs, index); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes);//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail); |
| | | |
| | | return bytes; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com3AVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com3BVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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 ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else { |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com3BVo cvo = JSON.parseObject(json, Com3BVo.class); |
| | | if (cvo == null) { |
| | | throw new Exception("json转Com21Vo为null"); |
| | | } |
| | | if (cvo.second == null) { |
| | | throw new Exception("阀门超时时间不能为空"); |
| | | } |
| | | if (cvo.second < 1) { |
| | | throw new Exception("阀门超时时间不能小于0"); |
| | | } |
| | | 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] = 0;//帧长度 |
| | | |
| | | index++ ; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ; |
| | | index++; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte; |
| | | |
| | | index++ ; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ; |
| | | index++; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte) 0, (byte) 0); |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | index++; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index); |
| | | |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[10] ; |
| | | Integer second = (Integer)para.param; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, second.shortValue(), index); |
| | | index += 2 ; |
| | | index = 0; |
| | | byte[] bs = new byte[10]; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, cvo.second.shortValue(), index); |
| | | index += 2; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createTp(bs, index); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes);//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail); |
| | | |
| | | return bytes; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com3BVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com3CVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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 ; |
| | | if(para.param == null) { |
| | | throw new Exception("命令参数为null") ; |
| | | }else { |
| | | JSONObject obj = (JSONObject) para.param; |
| | | String json = obj.toJSONString(); |
| | | Com3CVo cvo = JSON.parseObject(json, Com3CVo.class); |
| | | if (cvo == null) { |
| | | throw new Exception("json转Com21Vo为null"); |
| | | } |
| | | if (cvo.minute == null) { |
| | | throw new Exception("自报周期不能为空"); |
| | | } |
| | | if (cvo.minute < 1) { |
| | | throw new Exception("自报周期不能小于1"); |
| | | } |
| | | 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] = 0;//帧长度 |
| | | |
| | | index++ ; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ; |
| | | index++; |
| | | bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte; |
| | | |
| | | index++ ; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ; |
| | | index++; |
| | | bsHead[index] = commonV1_0_1.createCtrl((byte) 0, (byte) 0); |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | index++; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index); |
| | | |
| | | if(para.param == null){ |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[10] ; |
| | | Integer minute = (Integer)para.param ; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, minute.shortValue(), index); |
| | | index += 2 ; |
| | | index = 0; |
| | | byte[] bs = new byte[10]; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, cvo.minute.shortValue(), index); |
| | | index += 2; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | index += 2; |
| | | GlCreate.createTp(bs, index); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes);//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail); |
| | | |
| | | return bytes; |
| | | } |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_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.util.ByteUtil; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:51 |
| | | * @LastEditTime 2024/4/10 18:51 |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeDown(ifAny={ |
| | | CodeV1_0_1.cd_51 |
| | | }) |
| | | public class Cd_51_Down implements CodeParse { |
| | | |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception { |
| | | ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ; |
| | | byte[] bs = this.doParse(para) ; |
| | | |
| | | MidResultToRtu midRs = new MidResultToRtu() ; |
| | | midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL |
| | | midRs.protocolName = para.protocolName ;//协议名称 |
| | | midRs.rtuAddr = para.rtuAddr ;//Rtu地址 |
| | | midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果 |
| | | midRs.downCode = para.commandCode ;//下行命令功能码; |
| | | midRs.downBuffer = bs ;//下行命令数据 |
| | | midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式 |
| | | midRs.hasResponse = true ;//是否有应答 |
| | | midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置 |
| | | midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true |
| | | |
| | | if(isLowPower != null && isLowPower.booleanValue()){ |
| | | //低功耗时,尽快发送 |
| | | midRs.isQuickSend = true ; |
| | | } |
| | | |
| | | return new MidResult[]{midRs} ; |
| | | } |
| | | |
| | | /** |
| | | * 构造下行数据 |
| | | * @param para 参数 |
| | | * @return 字节数组 |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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, (byte)0) ; |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | |
| | | bytes = bsHead ; |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd51Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.parse.global.GlParse; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:42 |
| | | * @LastEditTime 2024/4/10 18:42 |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeUp(ifAny={ |
| | | CodeV1_0_1.cd_51 |
| | | }) |
| | | public class Cd_51_Up implements CodeParse { |
| | | |
| | | private static final Logger log = LogManager.getLogger(Cd_51_Up.class); |
| | | |
| | | /** |
| | | * 分析上行数据 |
| | | */ |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { |
| | | ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; |
| | | int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; |
| | | if(bsLen > 0){ |
| | | this.doParse(para.upBuffer, |
| | | bsLen, |
| | | para.upCode, |
| | | para.data) ; |
| | | } |
| | | log.info("分析命令应答数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString()); |
| | | |
| | | MidResultFromRtu midRs = new MidResultFromRtu() ; |
| | | midRs.protocolName = para.protocolName ;//协议名称 |
| | | midRs.rtuAddr = para.rtuAddr ;//Rtu地址 |
| | | midRs.upCode = para.upCode ;//上行数据中的功能码 |
| | | midRs.upHex = para.upHex ;//上行数据十六进制形式 |
| | | midRs.upBuffer = para.upBuffer ;//上行数据字节数组 |
| | | midRs.data = para.data ;//解析后的数据 |
| | | |
| | | midRs.reportOrResponse_trueOrFalse = false ;//命令应答 |
| | | |
| | | callback.callback(midRs.reportOrResponse_trueOrFalse); |
| | | return new MidResult[]{midRs} ; |
| | | } |
| | | /** |
| | | * 执行分析 |
| | | * @param bs 字节数组 |
| | | * @param bsLen 字节长度(总包长,包括包头和包尾) |
| | | * @param dataCode 功能码 |
| | | * @param data 数据 |
| | | * @throws Exception 异常 |
| | | */ |
| | | protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { |
| | | DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; |
| | | DataCd51Vo cdData = new DataCd51Vo() ; |
| | | dV1.subData = cdData ; |
| | | cdData.rtuDt = GlParse.parseRtuDt(bs, ProtocolConstantV206V1_0_0.dataIndex) ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_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.util.ByteUtil; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:51 |
| | | * @LastEditTime 2024/4/10 18:51 |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeDown(ifAny={ |
| | | CodeV1_0_1.cd_5E |
| | | }) |
| | | public class Cd_5E_Down implements CodeParse { |
| | | |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception { |
| | | ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ; |
| | | byte[] bs = this.doParse(para) ; |
| | | |
| | | MidResultToRtu midRs = new MidResultToRtu() ; |
| | | midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL |
| | | midRs.protocolName = para.protocolName ;//协议名称 |
| | | midRs.rtuAddr = para.rtuAddr ;//Rtu地址 |
| | | midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果 |
| | | midRs.downCode = para.commandCode ;//下行命令功能码; |
| | | midRs.downBuffer = bs ;//下行命令数据 |
| | | midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式 |
| | | midRs.hasResponse = true ;//是否有应答 |
| | | midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置 |
| | | midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true |
| | | |
| | | if(isLowPower != null && isLowPower.booleanValue()){ |
| | | //低功耗时,尽快发送 |
| | | midRs.isQuickSend = true ; |
| | | } |
| | | |
| | | return new MidResult[]{midRs} ; |
| | | } |
| | | |
| | | /** |
| | | * 构造下行数据 |
| | | * @param para 参数 |
| | | * @return 字节数组 |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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, (byte)0) ; |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | |
| | | bytes = bsHead ; |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd51Vo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd5EVo; |
| | | import com.dy.common.mw.protocol.p206V202404.parse.global.GlParse; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:42 |
| | | * @LastEditTime 2024/4/10 18:42 |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeUp(ifAny={ |
| | | CodeV1_0_1.cd_5E |
| | | }) |
| | | public class Cd_5E_Up implements CodeParse { |
| | | |
| | | private static final Logger log = LogManager.getLogger(Cd_5E_Up.class); |
| | | |
| | | /** |
| | | * 分析上行数据 |
| | | */ |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { |
| | | ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; |
| | | int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; |
| | | if(bsLen > 0){ |
| | | this.doParse(para.upBuffer, |
| | | bsLen, |
| | | para.upCode, |
| | | para.data) ; |
| | | } |
| | | log.info("分析命令应答数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString()); |
| | | |
| | | MidResultFromRtu midRs = new MidResultFromRtu() ; |
| | | midRs.protocolName = para.protocolName ;//协议名称 |
| | | midRs.rtuAddr = para.rtuAddr ;//Rtu地址 |
| | | midRs.upCode = para.upCode ;//上行数据中的功能码 |
| | | midRs.upHex = para.upHex ;//上行数据十六进制形式 |
| | | midRs.upBuffer = para.upBuffer ;//上行数据字节数组 |
| | | midRs.data = para.data ;//解析后的数据 |
| | | |
| | | midRs.reportOrResponse_trueOrFalse = false ;//命令应答 |
| | | |
| | | callback.callback(midRs.reportOrResponse_trueOrFalse); |
| | | return new MidResult[]{midRs} ; |
| | | } |
| | | /** |
| | | * 执行分析 |
| | | * @param bs 字节数组 |
| | | * @param bsLen 字节长度(总包长,包括包头和包尾) |
| | | * @param dataCode 功能码 |
| | | * @param data 数据 |
| | | * @throws Exception 异常 |
| | | */ |
| | | protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { |
| | | DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; |
| | | DataCd5EVo cdData = new DataCd5EVo() ; |
| | | dV1.subData = cdData ; |
| | | short index = ProtocolConstantV206V1_0_0.dataIndex ; |
| | | cdData.alarmVo = com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse.parseAlarm(bs, index) ; |
| | | index += 2 ; |
| | | cdData.stateVo = com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse.parseState(bs, index) ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.parse; |
| | | |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_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.util.ByteUtil; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/06/29 7:55 |
| | | * @LastEditTime 2024/06/29 7:55 |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeDown(ifAny={ |
| | | CodeV1_0_1.cd_B0 |
| | | }) |
| | | public class Cd_B0_Down implements CodeParse { |
| | | |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception { |
| | | ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ; |
| | | byte[] bs = this.doParse(para) ; |
| | | |
| | | MidResultToRtu midRs = new MidResultToRtu() ; |
| | | midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL |
| | | midRs.protocolName = para.protocolName ;//协议名称 |
| | | midRs.rtuAddr = para.rtuAddr ;//Rtu地址 |
| | | midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果 |
| | | midRs.downCode = para.commandCode ;//下行命令功能码; |
| | | midRs.downBuffer = bs ;//下行命令数据 |
| | | midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式 |
| | | midRs.hasResponse = true ;//是否有应答 |
| | | midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置 |
| | | midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true |
| | | |
| | | if(isLowPower != null && isLowPower.booleanValue()){ |
| | | //低功耗时,尽快发送 |
| | | midRs.isQuickSend = true ; |
| | | } |
| | | |
| | | return new MidResult[]{midRs} ; |
| | | } |
| | | |
| | | /** |
| | | * 构造下行数据 |
| | | * @param para 参数 |
| | | * @return 字节数组 |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] doParse(ParseParamsForDownV1_0_1 para) 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, (byte)0) ; |
| | | |
| | | index++ ; |
| | | GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); |
| | | index += 5 ; |
| | | |
| | | ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; |
| | | |
| | | byte index1 = 0 ; |
| | | byte[] bs = new byte[9] ; |
| | | bs[index1++] = (byte)0xF0 ; |
| | | GlCreate.createPw(bs, index1); |
| | | index1 += 2 ; |
| | | GlCreate.createTp(bs, index1); |
| | | |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |
| | | byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bsTail) ; |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.upVos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:44 |
| | | * @LastEditTime 2024/4/10 18:44 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class DataCd51Vo { |
| | | public String rtuDt ; |
| | | |
| | | public String toString(){ |
| | | StringBuilder sb = new StringBuilder() ; |
| | | sb.append(" 查询终端时钟应答:\n"); |
| | | sb.append(" 时钟:"); |
| | | sb.append(rtuDt); |
| | | sb.append("\n"); |
| | | |
| | | return sb.toString() ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0.upVos; |
| | | |
| | | import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:44 |
| | | * @LastEditTime 2024/4/10 18:44 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class DataCd5EVo { |
| | | public DataAlarmVo alarmVo ; |
| | | public DataStateVo stateVo ; |
| | | |
| | | public String toString(){ |
| | | StringBuilder sb = new StringBuilder() ; |
| | | sb.append(" 查询终端状态和报警状态应答:\n"); |
| | | if(alarmVo != null){ |
| | | sb.append(alarmVo.toString()); |
| | | sb.append("\n"); |
| | | } |
| | | if(stateVo != null){ |
| | | sb.append(stateVo.toString()); |
| | | sb.append("\n"); |
| | | } |
| | | return sb.toString() ; |
| | | } |
| | | } |
| | |
| | | public class DataCd84Vo { |
| | | |
| | | public Byte opType;//开关阀类型(1:刷卡开阀;2:刷卡关阀;3:中心站开阀;4:中心站关阀;5:欠费关阀;6:流量计故障关阀;7:紧急关闭;8:用户远程开阀;9:用户远程关阀;10:开关阀卡关阀;11:开关阀卡刷卡卡开阀;) |
| | | public Byte cardType ;//卡类型(1:用户卡;2:管理员卡;3:调试卡;4:开关阀卡;5:清空卡) |
| | | public Byte cardType ;//卡类型(0:无卡;1:用户卡;2:管理员卡;3:调试卡;4:开关阀卡;5:清空卡) |
| | | public String cardAddr ;//IC卡地址(8位字符) |
| | | public String cardNo ;//IC卡编号 |
| | | public Double remainMoney ;//剩余金额:用户余额4字节BCD码,取值范围0.00~999999.99,单位为元 |
| | |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | |
| | | @Slf4j |
| | | public class UserTokenFilter implements Filter { |
| | | |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException { |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { |
| | | HttpServletRequest request = (HttpServletRequest) servletRequest; |
| | | HttpServletResponse response = (HttpServletResponse) servletResponse; |
| | | String token = request.getHeader(Constant.UserTokenKeyInHeader); |
| | | if(!StringUtils.isNullOrEmpty(token)){ |
| | | UserTokenContext.set(token); |
| | | HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; |
| | | String requestURI = httpRequest.getRequestURI(); |
| | | // 检查请求是否为非过滤项 |
| | | if (UserTokenNoFilter.urls != null && UserTokenNoFilter.urls.stream().anyMatch(url -> requestURI.startsWith(url))) { |
| | | // 如果是非过滤项,直接调用下一个过滤器或servlet |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | }else{ |
| | | PrintWriter pw = null ; |
| | | try { |
| | | BaseResponse<?> res = BaseResponseUtils.buildToLogin() ; |
| | | String jsonString = JSON.toJSONString(res); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/json; charset=utf-8"); |
| | | pw = response.getWriter() ; |
| | | pw.write(jsonString); |
| | | pw.flush(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | if(pw != null){ |
| | | pw.close(); |
| | | } else { |
| | | // 如果不是非过滤项,执行过滤逻辑 |
| | | HttpServletRequest request = (HttpServletRequest) servletRequest; |
| | | HttpServletResponse response = (HttpServletResponse) servletResponse; |
| | | String token = request.getHeader(Constant.UserTokenKeyInHeader); |
| | | if(!StringUtils.isNullOrEmpty(token)){ |
| | | UserTokenContext.set(token); |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | }else{ |
| | | PrintWriter pw = null ; |
| | | try { |
| | | BaseResponse<?> res = BaseResponseUtils.buildToLogin() ; |
| | | String jsonString = JSON.toJSONString(res); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/json; charset=utf-8"); |
| | | pw = response.getWriter() ; |
| | | pw.write(jsonString); |
| | | pw.flush(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | if(pw != null){ |
| | | pw.close(); |
| | | } |
| | | } |
| | | //request.setAttribute(Constant.ErrorKeyInRequest, "未得到用户token"); |
| | | //response.sendRedirect("/error"); |
| | | } |
| | | //request.setAttribute(Constant.ErrorKeyInRequest, "未得到用户token"); |
| | | //response.sendRedirect("/error"); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.dy.common.webFilter; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/1 14:01 |
| | | * @Description |
| | | */ |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "tokennofilter") |
| | | public class UserTokenNoFilter { |
| | | |
| | | public static List<String> urls ; |
| | | |
| | | public List<String> getUrls(){ |
| | | return urls ; |
| | | } |
| | | |
| | | public void setUrls(List<String> urls){ |
| | | UserTokenNoFilter.urls = urls ; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd83OpenVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.common.util.DateTime; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | |
| | | @Schema(description = "关阀时控制器时钟", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Date closeDt; |
| | | |
| | | public void valueFrom(DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo)throws Exception { |
| | | this.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | this.opType = dataCd83OpenVo.type ; |
| | | this.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | | this.opIcCardNo = dataCd83OpenVo.icCardNo ; |
| | | this.opIcCardAddr = dataCd83OpenVo.icCardAddr ; |
| | | this.opRemainMoney = dataCd83OpenVo.remainMoney ; |
| | | this.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt) ; |
| | | this.clDt = null ; |
| | | this.clType = null ; |
| | | this.clTotalAmount = null ; |
| | | this.clIcCardNo = null ; |
| | | this.clIcCardAddr = null ; |
| | | this.clRemainMoney = null ; |
| | | this.clThisAmount = null ; |
| | | this.clThisMoney = null ; |
| | | this.clThisTime = null ; |
| | | this.clOpenDt = null ; |
| | | this.closeDt = null ; |
| | | } |
| | | |
| | | public void updateFrom(DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo, boolean clearCloseValve)throws Exception { |
| | | this.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | this.opType = dataCd83OpenVo.type ; |
| | | this.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | | this.opIcCardNo = dataCd83OpenVo.icCardNo ; |
| | | this.opIcCardAddr = dataCd83OpenVo.icCardAddr ; |
| | | this.opRemainMoney = dataCd83OpenVo.remainMoney ; |
| | | this.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt) ; |
| | | if(clearCloseValve){ |
| | | this.clDt = null ; |
| | | this.clType = null ; |
| | | this.clTotalAmount = null ; |
| | | this.clIcCardNo = null ; |
| | | this.clIcCardAddr = null ; |
| | | this.clRemainMoney = null ; |
| | | this.clThisAmount = null ; |
| | | this.clThisMoney = null ; |
| | | this.clThisTime = null ; |
| | | this.clOpenDt = null ; |
| | | this.closeDt = null ; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd83OpenVo; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.common.util.DateTime; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | |
| | | @Schema(description = "关阀时控制器时钟", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Date closeDt; |
| | | |
| | | public void valueFrom(DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo)throws Exception { |
| | | this.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | this.opType = dataCd83OpenVo.type ; |
| | | this.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | | this.opIcCardNo = dataCd83OpenVo.icCardNo ; |
| | | this.opIcCardAddr = dataCd83OpenVo.icCardAddr ; |
| | | this.opRemainMoney = dataCd83OpenVo.remainMoney ; |
| | | this.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt) ; |
| | | this.clDt = null ; |
| | | this.clType = null ; |
| | | this.clTotalAmount = null ; |
| | | this.clIcCardNo = null ; |
| | | this.clIcCardAddr = null ; |
| | | this.clRemainMoney = null ; |
| | | this.clThisAmount = null ; |
| | | this.clThisMoney = null ; |
| | | this.clThisTime = null ; |
| | | this.clOpenDt = null ; |
| | | this.closeDt = null ; |
| | | } |
| | | |
| | | public void updateFrom(DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo, boolean clearCloseValve) throws Exception { |
| | | this.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt); |
| | | this.opType = dataCd83OpenVo.type ; |
| | | this.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | | this.opIcCardNo = dataCd83OpenVo.icCardNo ; |
| | | this.opIcCardAddr = dataCd83OpenVo.icCardAddr ; |
| | | this.opRemainMoney = dataCd83OpenVo.remainMoney ; |
| | | this.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt) ; |
| | | |
| | | if(clearCloseValve) { |
| | | this.clDt = null; |
| | | this.clType = null; |
| | | this.clTotalAmount = null; |
| | | this.clIcCardNo = null; |
| | | this.clIcCardAddr = null; |
| | | this.clRemainMoney = null; |
| | | this.clThisAmount = null; |
| | | this.clThisMoney = null; |
| | | this.clThisTime = null; |
| | | this.clOpenDt = null; |
| | | this.closeDt = null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | # pj: 101 |
| | | |
| | | #通讯协议 |
| | | #protocol: DYJS_2023,DYJS_2024 |
| | | #protocol: DYJS_2023,DYJS_2024 |
| | | |
| | | #不进行userToken过滤的URL,@ConfigurationProperties要求tokennofilter中所有字母都小写 |
| | | tokennofilter: |
| | | urls: |
| | | - /sso/sso |
| | |
| | | //数据库中存在该控制器的开关阀数据 |
| | | if(DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt).equals(poLast.openDt)){ |
| | | //时间一致,重复上报数据,不进行任何处理 |
| | | //log.error("测试开阀日期一致"); |
| | | }else{ |
| | | if(poLast.opType != null){ |
| | | //原记录存在开阀数据,首先进行时间对比 |
| | |
| | | * @throws Exception |
| | | */ |
| | | private RmOpenCloseValveLast newRmOpenCloseValveLast(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo)throws Exception { |
| | | RmOpenCloseValveLast po = new RmOpenCloseValveLast(null, null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | dataCd83OpenVo.type, |
| | | dataCd83OpenVo.totalAmount, |
| | | dataCd83OpenVo.icCardNo, |
| | | dataCd83OpenVo.icCardAddr, |
| | | dataCd83OpenVo.remainMoney, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt), |
| | | null, null, null, null, null, null, null, null, null, null, null) ; |
| | | RmOpenCloseValveLast po = new RmOpenCloseValveLast() ; |
| | | po.controllerId = controller==null?null:controller.getId() ; |
| | | po.intakeId = controller==null?null:controller.getIntakeId() ; |
| | | po.rtuAddr = rtuAddr ; |
| | | po.valueFrom(dV1_0_1, dataCd83OpenVo); |
| | | return po ; |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | private RmOpenCloseValveHistory newRmOpenCloseValveHistory(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo)throws Exception { |
| | | RmOpenCloseValveHistory po = new RmOpenCloseValveHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | dataCd83OpenVo.type, |
| | | dataCd83OpenVo.totalAmount, |
| | | dataCd83OpenVo.icCardNo, |
| | | dataCd83OpenVo.icCardAddr, |
| | | dataCd83OpenVo.remainMoney, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt), |
| | | null, null, null, null, null, null, null, null, null, null, null) ; |
| | | RmOpenCloseValveHistory po = new RmOpenCloseValveHistory() ; |
| | | po.controllerId = controller==null?null:controller.getId() ; |
| | | po.intakeId = controller==null?null:controller.getIntakeId() ; |
| | | po.rtuAddr = rtuAddr ; |
| | | po.valueFrom(dV1_0_1, dataCd83OpenVo); |
| | | return po ; |
| | | } |
| | | |
| | |
| | | private void updateOpenValve(PrController controller, RmOpenCloseValveLast poLast, RmOpenCloseValveHistory poHistory, DataV1_0_1 dV1_0_1, DataCd83OpenVo dataCd83OpenVo, boolean clearCloseValve) throws Exception { |
| | | poLast.controllerId = controller==null?null:controller.getId(); |
| | | poLast.intakeId = controller==null?null:controller.getIntakeId(); |
| | | |
| | | poLast.opDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt); |
| | | poLast.opType = dataCd83OpenVo.type ; |
| | | poLast.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | | poLast.opIcCardNo = dataCd83OpenVo.icCardNo ; |
| | | poLast.opIcCardAddr = dataCd83OpenVo.icCardAddr ; |
| | | poLast.opRemainMoney = dataCd83OpenVo.remainMoney ; |
| | | poLast.openDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCd83OpenVo.openDt) ; |
| | | poLast.updateFrom(dV1_0_1, dataCd83OpenVo, clearCloseValve); |
| | | |
| | | if(poHistory != null){ |
| | | poHistory.controllerId = controller==null?null:controller.getId(); |
| | | poHistory.intakeId = controller==null?null:controller.getIntakeId(); |
| | | |
| | | poHistory.opDt = poLast.opDt; |
| | | poHistory.opType = dataCd83OpenVo.type ; |
| | | poHistory.opTotalAmount = dataCd83OpenVo.totalAmount ; |
| | | poHistory.opIcCardNo = dataCd83OpenVo.icCardNo ; |
| | | poHistory.opIcCardAddr = dataCd83OpenVo.icCardAddr ; |
| | | poHistory.opRemainMoney = dataCd83OpenVo.remainMoney ; |
| | | poHistory.openDt = poLast.openDt ; |
| | | poHistory.updateFrom(dV1_0_1, dataCd83OpenVo, clearCloseValve); |
| | | } |
| | | |
| | | if(clearCloseValve){ |
| | | poLast.clDt = null ; |
| | | poLast.clType = null ; |
| | | poLast.clTotalAmount = null ; |
| | | poLast.clIcCardNo = null ; |
| | | poLast.clIcCardAddr = null ; |
| | | poLast.clRemainMoney = null ; |
| | | poLast.clThisAmount = null ; |
| | | poLast.clThisMoney = null ; |
| | | poLast.clThisTime = null ; |
| | | poLast.clOpenDt = null ; |
| | | poLast.closeDt = null ; |
| | | |
| | | if(poHistory != null) { |
| | | poHistory.clDt = null; |
| | | poHistory.clType = null; |
| | | poHistory.clTotalAmount = null; |
| | | poHistory.clIcCardNo = null; |
| | | poHistory.clIcCardAddr = null; |
| | | poHistory.clRemainMoney = null; |
| | | poHistory.clThisAmount = null; |
| | | poHistory.clThisMoney = null; |
| | | poHistory.clThisTime = null; |
| | | poHistory.clOpenDt = null; |
| | | poHistory.closeDt = null; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrMwTestWeb; |
| | | |
| | | import com.dy.pipIrrMwTestWeb.test.CommandP206V202404Ctrl; |
| | | import com.dy.pipIrrMwTestWeb.p206V202404test.CommandP206V202404Ctrl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/CodeLocal.java |
| | |
| | | package com.dy.pipIrrMwTestWeb.test; |
| | | package com.dy.pipIrrMwTestWeb.common; |
| | | |
| | | public class CodeLocal { |
| | | |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/CommandResultCtrl.java |
| | |
| | | package com.dy.pipIrrMwTestWeb.test; |
| | | package com.dy.pipIrrMwTestWeb.common; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.webUtil.BaseResponse; |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/ComSupportP206V100.java |
| | |
| | | package com.dy.pipIrrMwTestWeb.test; |
| | | package com.dy.pipIrrMwTestWeb.p206V1_0_0; |
| | | |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.CommandType; |
| | |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/14 17:32 |
| | | * @Date: 2024/6/29 6:47 |
| | | * @Description |
| | | */ |
| | | public class ComSupportP206V100 { |
| | | public class ComSupportP206V1_0_0 { |
| | | 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 = "620201000029" ; |
| | | protected static String rtuAddr = "532328059995" ; |
| | | protected static String rtuResultSendWebUrl = "http://127.0.0.1:65535/test/comRes/receive" ; |
| | | protected static String icCardNo = "37142501020500001" ;//IC卡编号(用户卡序列号) |
| | | protected static String icCardNo = "7044010686" ;//IC卡编号(用户卡序列号) |
| | | |
| | | |
| | | @Autowired |
| | |
| | | return response.getBody(); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrMwTestWeb.p206V1_0_0; |
| | | |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.CommandType; |
| | | 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.webUtil.BaseResponse; |
| | | import com.dy.pipIrrMwTestWeb.common.CodeLocal; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/29 6:46 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="comP206V1_0_0") |
| | | @SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked") |
| | | public class CommandP206V1_0_0Ctrl extends ComSupportP206V1_0_0 { |
| | | |
| | | @GetMapping(path = "test") |
| | | public BaseResponse<String> test(String com) { |
| | | BaseResponse<String> rt = null ; |
| | | if(com == null){ |
| | | rt = this.connect() ;//连接通信中间件测试 |
| | | }else{ |
| | | if(com.equals("21")){ |
| | | rt = this.cd21() ; |
| | | }else if(com.equals("37")){ |
| | | rt = this.cd37() ; |
| | | }else if(com.equals("38")){ |
| | | rt = this.cd38() ; |
| | | }else if(com.equals("39")){ |
| | | rt = this.cd39() ; |
| | | }else if(com.equals("3A")){ |
| | | rt = this.cd3A() ; |
| | | }else if(com.equals("3B")){ |
| | | rt = this.cd3B() ; |
| | | }else if(com.equals("3C")){ |
| | | rt = this.cd3C() ; |
| | | }else if(com.equals("92")){ |
| | | rt = this.cd92() ; |
| | | }else if(com.equals("93")){ |
| | | rt = this.cd93() ; |
| | | }else if(com.equals("97")){ |
| | | rt = this.cd97() ; |
| | | }else if(com.equals("98")){ |
| | | rt = this.cd98() ; |
| | | }else if(com.equals("B0")){ |
| | | rt = this.cdB0() ; |
| | | } |
| | | } |
| | | return rt ; |
| | | } |
| | | |
| | | /** |
| | | * 测试连通性 |
| | | * @return |
| | | */ |
| | | private BaseResponse connect(){ |
| | | return this.sendTest() ; |
| | | } |
| | | |
| | | private BaseResponse cd21(){ |
| | | Com21Vo comVo = new Com21Vo() ; |
| | | comVo.ip = "8.140.180.59" ;//IP(例如 125.235.35.89) |
| | | comVo.port = 6001 ;///端口号(0~65536) |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_21, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd37(){ |
| | | Com37Vo comVo = new Com37Vo() ; |
| | | comVo.seconds = 20 ; |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_37, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd38(){ |
| | | Com38Vo comVo = new Com38Vo() ; |
| | | comVo.remainMoneyAlarm = 10.0 ;//用户余额报警值(大于1.0) |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_38, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd39(){ |
| | | Com39Vo comVo = new Com39Vo() ; |
| | | comVo.batteryVoltAlarm = 1.0 ;//电池电压报警值(大于0.1) |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_39, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd3A(){ |
| | | Com3AVo comVo = new Com3AVo() ; |
| | | comVo.current = 1.0 ;//阀门堵转电流(大于0) |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3A, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd3B(){ |
| | | Com3BVo comVo = new Com3BVo() ; |
| | | comVo.second = 30 ;//阀门超时时间(秒)(大于1) |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3B, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd3C(){ |
| | | Com3CVo comVo = new Com3CVo() ; |
| | | comVo.minute = 10 ;//自报周期(分钟)(大于0) |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3C, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd92(){ |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_92, null, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cd93(){ |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_93, null, null)) ; |
| | | } |
| | | |
| | | //APP远程开阀 |
| | | private BaseResponse cd97(){ |
| | | Com97Vo comVo = new Com97Vo() ; |
| | | comVo.icCardNo = CommandP206V1_0_0Ctrl.icCardNo ; |
| | | comVo.moneyRemain = 234.56 ; |
| | | comVo.waterPrice = 1.2 ; |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_97, comVo, null)) ; |
| | | } |
| | | //APP远程关阀 |
| | | private BaseResponse cd98(){ |
| | | Com98Vo comVo = new Com98Vo() ; |
| | | comVo.icCardNo = CommandP206V1_0_0Ctrl.icCardNo ; |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_98, comVo, null)) ; |
| | | } |
| | | |
| | | private BaseResponse cdB0(){ |
| | | return this.sendCom2Mw(this.command(CodeV1_0_1.cd_B0, null, null)) ; |
| | | } |
| | | |
| | | //在线情况 |
| | | private BaseResponse online(){ |
| | | Command com = new Command() ; |
| | | com.id = Command.defaultId;//实际应用中,替换成数据库记录id |
| | | com.protocol = ProtocolConstantV206V1_0_0.protocolName ; |
| | | com.code = CodeLocal.onLine ; |
| | | com.type = CommandType.innerCommand ; |
| | | com.rtuResultSendWebUrl = rtuResultSendWebUrl ; |
| | | return this.sendCom2Mw(com) ; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/ComSupportP206V202404.java |
| | |
| | | package com.dy.pipIrrMwTestWeb.test; |
| | | package com.dy.pipIrrMwTestWeb.p206V202404test; |
| | | |
| | | 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.webUtil.BaseResponse; |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/CommandP206V202404Ctrl.java |
| | |
| | | package com.dy.pipIrrMwTestWeb.test; |
| | | package com.dy.pipIrrMwTestWeb.p206V202404test; |
| | | |
| | | import com.dy.common.mw.protocol.p206V202404.CodeV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.*; |
| | |
| | | package com.dy.sso.config; |
| | | |
| | | import com.dy.common.webListener.ConfigListener; |
| | | import com.dy.sso.util.SsoListener; |
| | | import jakarta.servlet.ServletContextListener; |
| | | import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | <version>3.1.3</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |