1、靳总协议功能码调整与增加;
2、实现只有靳总协议中有的整上报数据处理逻辑及数据库设计。
4 文件已重命名
7个文件已修改
3个文件已删除
7个文件已添加
| | |
| | | //功能码为字符串,十六进制数据 |
| | | public static final String cd_02 = "02" ;//遥测站链路检测 |
| | | public static final String cd_10 = "10" ;//设置遥测站终端地址 |
| | | public static final String cd_11 = "11" ;//设置遥测站时钟(未实现) |
| | | 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_35 = "35" ;//设置自报周期 |
| | | 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_3E = "3E" ;//设置黑名单(未实现) |
| | | public static final String cd_50 = "50" ;//查询遥测站终端地址 |
| | | 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_65 = "65" ;//查询自报周期 |
| | | public static final String cd_66 = "66" ;//查询IP和端口 |
| | | //public static final String cd_66 = "66" ;//查询阀门状态(靳总把该命令设计成召测83功能码数据的命令了,因为这个命令回执没有阀门状态数据域,所以这个命令只能作为召测命令用了) |
| | | public static final String cd_67 = "67" ;//查询流量采集周期 |
| | | public static final String cd_68 = "68" ;//查询用户余额报警值 |
| | | public static final String cd_69 = "69" ;//查询电池电压报警值 |
| | | public static final String cd_6A = "6A" ;//查询阀门堵转电流值 |
| | | public static final String cd_6B = "6B" ;//查询阀门超时时间 |
| | | public static final String cd_71 = "71" ;//设置工作模式(李天赐制定的协议,当前未实现) |
| | | public static final String cd_6D = "6D" ;//查询阶梯水价(未实现) |
| | | public static final String cd_81 = "81" ;//随机自报报 |
| | | public static final String cd_83 = "83" ;//遥测站开关阀自报 |
| | | public static final String cd_84 = "84" ;//开阀工作报 |
| | | public static final String cd_85 = "85" ;//APP开阀工作报 |
| | | public static final String cd_91 = "91" ;//清空历史记录 |
| | | public static final String cd_92 = "92" ;//遥控启动阀门 |
| | | public static final String cd_93 = "93" ;//遥控关闭阀门 |
| | | public static final String cd_95 = "95" ;//复位终端参数和状态(未实现) |
| | | public static final String cd_97 = "97" ;//APP远程开阀 |
| | | public static final String cd_98 = "98" ;//APP远程关阀 |
| | | public static final String cd_99 = "99" ;//定时关阀开阀 |
| | | public static final String cd_A0 = "A0" ;//定量关阀开阀 |
| | | public static final String cd_3C = "3C" ;//设置水价 |
| | | public static final String cd_6C = "6C" ;//查询水价 |
| | | public static final String cd_3D = "3D" ;//设置黑名单 |
| | | public static final String cd_B0 = "B0" ;//查询实时数据(未实现) |
| | | public static final String cd_C0 = "C0" ;//遥测站自报实时数据 |
| | | |
| | | public static String getCodeName(String code) { |
| | | public static String getCodeName(String code) { |
| | | String name = (code.equals(cd_02) ? "链路检测" : |
| | | (code.equals(cd_10) ? "设置遥测站终端地址" : |
| | | (code.equals(cd_10) ? "设置终端地址" : |
| | | (code.equals(cd_11) ? "设置终端时钟" : |
| | | (code.equals(cd_12) ? "设置终端工作模式" : |
| | | (code.equals(cd_1F) ? "设置流量参数上限值" : |
| | | (code.equals(cd_21) ? "设置IP和端口" : |
| | | (code.equals(cd_35) ? "设置自报周期" : |
| | | (code.equals(cd_36) ? "设置IP和端口" : |
| | | (code.equals(cd_37) ? "设置流量采集周期" : |
| | | (code.equals(cd_38) ? "设置用户余额报警值" : |
| | | (code.equals(cd_39) ? "设置电池电压报警值" : |
| | | (code.equals(cd_3A) ? "设置阀门堵转电流" : |
| | | (code.equals(cd_3B) ? "设置阀门超时时间" : |
| | | (code.equals(cd_50) ? "查询遥测站终端地址" : |
| | | (code.equals(cd_3C) ? "设置自报周期" : |
| | | (code.equals(cd_3D) ? "设置水价" : |
| | | (code.equals(cd_3E) ? "设置黑名单" : |
| | | (code.equals(cd_50) ? "查询终端地址" : |
| | | (code.equals(cd_51) ? "查询终端时钟" : |
| | | (code.equals(cd_52) ? "查询终端工作模式" : |
| | | (code.equals(cd_53) ? "查询自报种类及时间间隔" : |
| | | (code.equals(cd_5E) ? "查询终端状态和报警状态" : |
| | | (code.equals(cd_65) ? "查询自报周期" : |
| | | (code.equals(cd_66) ? "查询IP和端口" : |
| | | (code.equals(cd_67) ? "查询流量采集周期" : |
| | |
| | | (code.equals(cd_69) ? "查询电池电压报警值" : |
| | | (code.equals(cd_6A) ? "查询阀门堵转电流值" : |
| | | (code.equals(cd_6B) ? "查询阀门超时时间" : |
| | | (code.equals(cd_71) ? "设置工作模式" : |
| | | (code.equals(cd_6D) ? "查询水价" : |
| | | (code.equals(cd_81) ? "随机自报" : |
| | | (code.equals(cd_83) ? "开关阀自报" : |
| | | (code.equals(cd_84) ? "开阀工作报" : |
| | | (code.equals(cd_85) ? "APP开阀工作报" : |
| | | (code.equals(cd_91) ? "清空历史记录" : |
| | | (code.equals(cd_92) ? "遥控启动阀门" : |
| | | (code.equals(cd_93) ? "遥控关闭阀门" : |
| | | (code.equals(cd_95) ? "复位终端参数和状态" : |
| | | (code.equals(cd_97) ? "APP远程开阀" : |
| | | (code.equals(cd_98) ? "APP远程关阀" : |
| | | (code.equals(cd_99) ? "定时关阀开阀" : |
| | | (code.equals(cd_A0) ? "定量关阀开阀" : |
| | | (code.equals(cd_3C) ? "设置水价" : |
| | | (code.equals(cd_6C) ? "查询水价" : |
| | | (code.equals(cd_3D) ? "设置黑名单" : |
| | | (code.equals(cd_B0) ? "查询实时数据" : |
| | | (code.equals(cd_C0) ? "自报实时数据" : |
| | | ""))))))))))))))))))))))))))))))))) ; |
| | | "")))))))))))))))))))))))))))))))))))))))))) ; |
| | | return name ; |
| | | } |
| | | |
File was renamed from pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Down.java |
| | |
| | | import com.dy.common.util.ByteUtil; |
| | | |
| | | @AnnotationCodeDown(ifAny={ |
| | | CodeV1_0_1.cd_71 |
| | | CodeV1_0_1.cd_12 |
| | | }) |
| | | public class Cd_71_Down implements CodeParse { |
| | | public class Cd_12_Down implements CodeParse { |
| | | |
| | | //private static Logger log = LogManager.getLogger(Cd_71_Down.class); |
| | | //private static Logger log = LogManager.getLogger(Cd_12_Down.class); |
| | | |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception { |
File was renamed from pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Up.java |
| | |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | @AnnotationCodeUp(ifAny={ |
| | | CodeV1_0_1.cd_71 |
| | | CodeV1_0_1.cd_12 |
| | | }) |
| | | @SuppressWarnings("unused") |
| | | public class Cd_71_Up implements CodeParse { |
| | | public class Cd_12_Up implements CodeParse { |
| | | |
| | | private static final Logger log = LogManager.getLogger(Cd_71_Up.class); |
| | | private static final Logger log = LogManager.getLogger(Cd_12_Up.class); |
| | | |
| | | /** |
| | | * 分析上行数据 |
| | |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/4/10 18:51 |
| | | * @LastEditTime 2024/4/10 18:51 |
| | | * @Description |
| | | * @Date 2024/4/10 18:26 |
| | | * @LastEditTime 2024/4/10 18:26 |
| | | * @Description 设置水价 |
| | | */ |
| | | @AnnotationCodeDown(ifAny={ |
| | | CodeV1_0_1.cd_3D |
| | |
| | | throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; |
| | | }else{ |
| | | index = 0 ; |
| | | byte[] bs = new byte[12] ; |
| | | String icCardNo = ((String)para.param) ; |
| | | Integer icCardNoInt = Integer.valueOf(icCardNo); |
| | | ByteUtilUnsigned.int2Bytes_LE(bs, icCardNoInt, index); |
| | | index += 4 ; |
| | | byte[] bs = new byte[10] ; |
| | | Double priceDb = ((Double)para.param) * 100 ; |
| | | Integer priceInt = priceDb.intValue() ; |
| | | ByteUtilUnsigned.short2Bytes_LE(bs, priceInt.shortValue(), index); |
| | | index += 2 ; |
| | | GlCreate.createPw(bs, index); |
| | | index += 2 ; |
| | | GlCreate.createTp(bs, index); |
| | |
| | | return bytes ; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | 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.DataCd3DVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd3CVo; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | |
| | | */ |
| | | protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { |
| | | DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; |
| | | DataCd3DVo cdData = new DataCd3DVo() ; |
| | | DataCd3CVo cdData = new DataCd3CVo() ; |
| | | dV1.subData = cdData ; |
| | | Long v = ByteUtilUnsigned.bytes2Int_LE(bs, ProtocolConstantV206V1_0_0.dataIndex) ; |
| | | cdData.icCardNo = "" + v; |
| | | int priceInt = ByteUtilUnsigned.bytes2Short_LE(bs, ProtocolConstantV206V1_0_0.dataIndex) ; |
| | | cdData.price = priceInt/100.0D; |
| | | } |
| | | |
| | | } |
File was renamed from pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_6C_Down.java |
| | |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeDown(ifAny={ |
| | | CodeV1_0_1.cd_6C |
| | | CodeV1_0_1.cd_6D |
| | | }) |
| | | public class Cd_6C_Down implements CodeParse { |
| | | public class Cd_6D_Down implements CodeParse { |
| | | |
| | | @Override |
| | | public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception { |
File was renamed from pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_6C_Up.java |
| | |
| | | * @Description |
| | | */ |
| | | @AnnotationCodeUp(ifAny={ |
| | | CodeV1_0_1.cd_6C |
| | | CodeV1_0_1.cd_6D |
| | | }) |
| | | public class Cd_6C_Up implements CodeParse { |
| | | public class Cd_6D_Up implements CodeParse { |
| | | |
| | | private static final Logger log = LogManager.getLogger(Cd_6C_Up.class); |
| | | private static final Logger log = LogManager.getLogger(Cd_6D_Up.class); |
| | | |
| | | /** |
| | | * 分析上行数据 |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/26 21:32 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmOnHourReportHistoryMapper { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmOnHourReportHistory record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmOnHourReportHistory record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmOnHourReportHistory selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmOnHourReportHistory record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmOnHourReportHistory record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/26 21:15 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmOnHourReportLastMapper { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmOnHourReportLast record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmOnHourReportLast record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmOnHourReportLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmOnHourReportLast record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmOnHourReportLast record); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据阀控器地址获取整点上报最新数据 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | List<RmOnHourReportLast> getRmOnHourReportLast(String rtuAddr); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | 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.DataCdC0Vo; |
| | | 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.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/26 21:32 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 控制器整点报(只有靳总协议有) |
| | | */ |
| | | |
| | | @TableName(value="rm_on_hour_report_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器整点报历史数据") |
| | | public class RmOnHourReportHistory implements BaseEntity { |
| | | public static final long serialVersionUID = 202406262133001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | |
| | | */ |
| | | public String rtuAddr; |
| | | |
| | | /** |
| | | * 数据接收日期时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 控制器时钟 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date rtuDt; |
| | | |
| | | /** |
| | | * 瞬时流量,单位为m3/h |
| | | */ |
| | | public Double instantAmount; |
| | | |
| | | /** |
| | | * 累计流量,单位为m3 |
| | | */ |
| | | public Double totalAmount; |
| | | |
| | | /** |
| | | * 损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0)单位为m3。 |
| | | */ |
| | | public Double lossAmount; |
| | | |
| | | /** |
| | | * 水压,单位为KPa |
| | | */ |
| | | public Double waterPress; |
| | | |
| | | /** |
| | | * 蓄电池电压,单位为V |
| | | */ |
| | | public Double batteryVolt; |
| | | |
| | | /** |
| | | * 太阳能电压,单位为V |
| | | */ |
| | | public Double sunVolt; |
| | | |
| | | /** |
| | | * 信号强度,取值范围0~99 |
| | | */ |
| | | public Integer signalValue; |
| | | |
| | | /** |
| | | * 水价,单位为元 |
| | | */ |
| | | public Double waterPrice; |
| | | public void valueFrom(DataV1_0_1 dV1_0_1, DataCdC0Vo cdData) throws Exception{ |
| | | this.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt); |
| | | this.rtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.rtuDt); |
| | | this.instantAmount = cdData.instantAmount; //瞬时流量,单位为m3/h |
| | | this.totalAmount = cdData.totalAmount ;//累计流量,单位为m3 |
| | | this.lossAmount = cdData.lossAmount ;// 损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0)单位为m3。 |
| | | this.waterPress = cdData.waterPress ;// 水压,单位为KPa |
| | | this.batteryVolt = cdData.batteryVolt ;// 蓄电池电压,单位为V |
| | | this.sunVolt = cdData.sunVolt ;// 太阳能电压,单位为V |
| | | this.signalValue = cdData.signalValue ;// 信号强度,取值范围0~99 |
| | | this.waterPrice = cdData.waterPrice ;// 水价,单位为元。 |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | 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.DataCdC0Vo; |
| | | 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.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/6/26 21:15 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 控制器整点报(只有靳总协议有) |
| | | */ |
| | | |
| | | @TableName(value="rm_on_hour_report_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器整点报最新数据") |
| | | public class RmOnHourReportLast implements BaseEntity { |
| | | public static final long serialVersionUID = 202406262117001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口实体ID(外键) |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | |
| | | */ |
| | | public String rtuAddr; |
| | | |
| | | /** |
| | | * 数据接收日期时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 控制器时钟 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date rtuDt; |
| | | |
| | | /** |
| | | * 瞬时流量,单位为m3/h |
| | | */ |
| | | public Double instantAmount; |
| | | |
| | | /** |
| | | * 累计流量,单位为m3 |
| | | */ |
| | | public Double totalAmount; |
| | | |
| | | /** |
| | | * 损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0)单位为m3。 |
| | | */ |
| | | public Double lossAmount; |
| | | |
| | | /** |
| | | * 水压,单位为KPa |
| | | */ |
| | | public Double waterPress; |
| | | |
| | | /** |
| | | * 蓄电池电压,单位为V |
| | | */ |
| | | public Double batteryVolt; |
| | | |
| | | /** |
| | | * 太阳能电压,单位为V |
| | | */ |
| | | public Double sunVolt; |
| | | |
| | | /** |
| | | * 信号强度,取值范围0~99 |
| | | */ |
| | | public Integer signalValue; |
| | | |
| | | /** |
| | | * 水价,单位为元 |
| | | */ |
| | | public Double waterPrice; |
| | | |
| | | |
| | | public void valueFrom(DataV1_0_1 dV1_0_1, DataCdC0Vo cdData) throws Exception{ |
| | | this.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt); |
| | | this.rtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.rtuDt); |
| | | this.instantAmount = cdData.instantAmount; //瞬时流量,单位为m3/h |
| | | this.totalAmount = cdData.totalAmount ;//累计流量,单位为m3 |
| | | this.lossAmount = cdData.lossAmount ;// 损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0)单位为m3。 |
| | | this.waterPress = cdData.waterPress ;// 水压,单位为KPa |
| | | this.batteryVolt = cdData.batteryVolt ;// 蓄电池电压,单位为V |
| | | this.sunVolt = cdData.sunVolt ;// 太阳能电压,单位为V |
| | | this.signalValue = cdData.signalValue ;// 信号强度,取值范围0~99 |
| | | this.waterPrice = cdData.waterPrice ;// 水价,单位为元。 |
| | | } |
| | | |
| | | } |
| | |
| | | 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.DataCdC0Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo; |
| | | import com.dy.common.po.BaseEntity; |
| | |
| | | this.lossTotalAmountDay = cdData.lossTotalAmountDay ;// 漏损水量 |
| | | this.batteryVolt = cdData.batteryVolt ;// 后备电池电压 |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_on_hour_report_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | <result column="instant_amount" jdbcType="FLOAT" property="instantAmount" /> |
| | | <result column="total_amount" jdbcType="FLOAT" property="totalAmount" /> |
| | | <result column="loss_amount" jdbcType="FLOAT" property="lossAmount" /> |
| | | <result column="water_press" jdbcType="FLOAT" property="waterPress" /> |
| | | <result column="battery_volt" jdbcType="FLOAT" property="batteryVolt" /> |
| | | <result column="sun_volt" jdbcType="FLOAT" property="sunVolt" /> |
| | | <result column="signal_value" jdbcType="INTEGER" property="signalValue" /> |
| | | <result column="water_price" jdbcType="FLOAT" property="waterPrice" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, instant_amount, total_amount, |
| | | loss_amount, water_press, battery_volt, sun_volt, signal_value, water_price |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_on_hour_report_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_on_hour_report_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_on_hour_report_history (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | instant_amount, total_amount, loss_amount, |
| | | water_press, battery_volt, sun_volt, |
| | | signal_value, water_price) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{instantAmount,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT}, #{lossAmount,jdbcType=FLOAT}, |
| | | #{waterPress,jdbcType=FLOAT}, #{batteryVolt,jdbcType=FLOAT}, #{sunVolt,jdbcType=FLOAT}, |
| | | #{signalValue,jdbcType=INTEGER}, #{waterPrice,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_on_hour_report_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount, |
| | | </if> |
| | | <if test="waterPress != null"> |
| | | water_press, |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | battery_volt, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value, |
| | | </if> |
| | | <if test="waterPrice != null"> |
| | | water_price, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | #{instantAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | #{totalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | #{lossAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="waterPress != null"> |
| | | #{waterPress,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | #{signalValue,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="waterPrice != null"> |
| | | #{waterPrice,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_on_hour_report_history |
| | | <set> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount = #{instantAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount = #{totalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount = #{lossAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="waterPress != null"> |
| | | water_press = #{waterPress,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="waterPrice != null"> |
| | | water_price = #{waterPrice,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_on_hour_report_history |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | instant_amount = #{instantAmount,jdbcType=FLOAT}, |
| | | total_amount = #{totalAmount,jdbcType=FLOAT}, |
| | | loss_amount = #{lossAmount,jdbcType=FLOAT}, |
| | | water_press = #{waterPress,jdbcType=FLOAT}, |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | water_price = #{waterPrice,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmOnHourReportLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_on_hour_report_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | <result column="instant_amount" jdbcType="FLOAT" property="instantAmount" /> |
| | | <result column="total_amount" jdbcType="FLOAT" property="totalAmount" /> |
| | | <result column="loss_amount" jdbcType="FLOAT" property="lossAmount" /> |
| | | <result column="water_press" jdbcType="FLOAT" property="waterPress" /> |
| | | <result column="battery_volt" jdbcType="FLOAT" property="batteryVolt" /> |
| | | <result column="sun_volt" jdbcType="FLOAT" property="sunVolt" /> |
| | | <result column="signal_value" jdbcType="INTEGER" property="signalValue" /> |
| | | <result column="water_price" jdbcType="FLOAT" property="waterPrice" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, instant_amount, total_amount, |
| | | loss_amount, water_press, battery_volt, sun_volt, signal_value, water_price |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_on_hour_report_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_on_hour_report_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_on_hour_report_last (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | instant_amount, total_amount, loss_amount, |
| | | water_press, battery_volt, sun_volt, |
| | | signal_value, water_price) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{instantAmount,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT}, #{lossAmount,jdbcType=FLOAT}, |
| | | #{waterPress,jdbcType=FLOAT}, #{batteryVolt,jdbcType=FLOAT}, #{sunVolt,jdbcType=FLOAT}, |
| | | #{signalValue,jdbcType=INTEGER}, #{waterPrice,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_on_hour_report_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount, |
| | | </if> |
| | | <if test="waterPress != null"> |
| | | water_press, |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | battery_volt, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value, |
| | | </if> |
| | | <if test="waterPrice != null"> |
| | | water_price, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | #{instantAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | #{totalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | #{lossAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="waterPress != null"> |
| | | #{waterPress,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | #{signalValue,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="waterPrice != null"> |
| | | #{waterPrice,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_on_hour_report_last |
| | | <set> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="instantAmount != null"> |
| | | instant_amount = #{instantAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount = #{totalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount = #{lossAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="waterPress != null"> |
| | | water_press = #{waterPress,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="waterPrice != null"> |
| | | water_price = #{waterPrice,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_on_hour_report_last |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | instant_amount = #{instantAmount,jdbcType=FLOAT}, |
| | | total_amount = #{totalAmount,jdbcType=FLOAT}, |
| | | loss_amount = #{lossAmount,jdbcType=FLOAT}, |
| | | water_press = #{waterPress,jdbcType=FLOAT}, |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | water_price = #{waterPrice,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据阀控器地址获取定点上报最新数据--> |
| | | <select id="getRmOnHourReportLast" resultType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_on_hour_report_last |
| | | where rtu_addr = #{rtuAddr} |
| | | </select> |
| | | </mapper> |
| | |
| | | private RmTimingReportLastMapper rmTimingReportLastDao; // 定点上报最新数据DAO |
| | | |
| | | @Autowired |
| | | private RmOnHourReportHistoryMapper rmOnHourReportHistoryDao; // 整点上报历史数据DAO |
| | | @Autowired |
| | | private RmOnHourReportLastMapper rmOnHourReportLastDao; // 整点上报最新数据DAO |
| | | |
| | | @Autowired |
| | | private RmOpenCloseHistoryMapper rmOpenCloseHistoryDao; |
| | | @Autowired |
| | | private RmOpenCloseLastMapper rmOpenCloseLastDao; |
| | |
| | | |
| | | ///////////////////////////////////////////////// |
| | | // |
| | | // 定点报数据功能 |
| | | // 定点报数据功能(只在王江海的协议有此数据) |
| | | // |
| | | //////////////////////////////////////////////// |
| | | |
| | |
| | | this.rmTimingReportLastDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | ///////////////////////////////////////////////// |
| | | // |
| | | // 整点上报实时数据功能(只在靳总的协议有此数据) |
| | | // |
| | | //////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * 保存控制器整点上报历史数据 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmOnHourReportHistory(RmOnHourReportHistory po){ |
| | | this.rmOnHourReportHistoryDao.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据阀控器地址获取整点上报最新数据 |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public RmOnHourReportLast getRmOnHourReportLast(String rtuAddr) { |
| | | List<RmOnHourReportLast> list = this.rmOnHourReportLastDao.getRmOnHourReportLast(rtuAddr) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器整点上报最新数据 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmOnHourReportLast(RmOnHourReportLast po) { |
| | | this.rmOnHourReportLastDao.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 保存控制器整点上报罪行数据 |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmOnHourReportLast(RmOnHourReportLast po) { |
| | | this.rmOnHourReportLastDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | ///////////////////////////////////////////////// |
| | | // |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V1_0_0; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCdC0Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmTimingReportHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmTimingReportLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 14:11 |
| | | * @LastEditTime 2024/1/16 14:11 |
| | | * @Description 控制器自报实时数据(功能码为C0)(整点上报) |
| | | */ |
| | | public class TkDealOnHourReport extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealOnHourReport.class.getName()) ; |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealOnHourReport" ; |
| | | |
| | | /** |
| | | * 执行节点任务:控制器自报数据(功能码为C0) |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data) data; |
| | | DataV1_0_1 dV1_0_1 = (DataV1_0_1) d.getSubData();//前面任务已经判断不为null |
| | | Object cdObj = dV1_0_1.subData; |
| | | if (cdObj != null && cdObj instanceof DataCdC0Vo){ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjs.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | try{ |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV1_0_1, (DataCdC0Vo)cdObj); |
| | | }catch (Exception e){ |
| | | log.error("保存控制器整点上报数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 处理阀上报数据 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param cdData 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData) throws Exception { |
| | | this.saveOrUpdateLast(sv, controller, rtuAddr, dV1_0_1, cdData); |
| | | this.saveHistory(sv, controller, rtuAddr, dV1_0_1, cdData); |
| | | } |
| | | /** |
| | | * 保存自报最新数据 |
| | | * @param sv 服务 |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param cdData 自报数据对象 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData) throws Exception { |
| | | RmOnHourReportLast po = sv.getRmOnHourReportLast(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmOnHourReportLast(); |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | | po.valueFrom(dV1_0_1, cdData); |
| | | sv.saveRmOnHourReportLast(po) ; |
| | | }else{ |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.valueFrom(dV1_0_1, cdData); |
| | | sv.updateRmOnHourReportLast(po); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存或更新控制器该上报历史数据 |
| | | * @param sv 服务bean |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param dV1_0_1 协议数据 |
| | | * @param cdData 功能数据 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception { |
| | | RmOnHourReportHistory po = new RmOnHourReportHistory(); |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | | po.valueFrom(dV1_0_1, cdData); |
| | | sv.saveRmOnHourReportHistory(po); ; |
| | | } |
| | | } |
| | | |
| | |
| | | Data d = (Data) data; |
| | | DataV202404 dV202404 = (DataV202404) d.getSubData();//前面任务已经判断不为null |
| | | Object cdObj = dV202404.subData; |
| | | if (cdObj != null) { |
| | | if (cdObj != null && cdObj instanceof DataCd83Vo) { |
| | | try { |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrController controller = (PrController) objs[1]; |
| | | if (cdObj instanceof DataCd83Vo) { |
| | | DataCd83Vo cdData = (DataCd83Vo) (cdObj); |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV202404, (DataCd83Vo)cdObj); |
| | | } |
| | | this.doDeal(sv, controller, d.getRtuAddr(), dV202404, (DataCd83Vo)cdObj); |
| | | } catch (Exception e) { |
| | | log.error("保存控制器控制器定时报数据时发生异常", e); |
| | | } |
| | |
| | | <!-- 识别非命令应答上行数据 --> |
| | | <task id="TkFindReport" name="识别非命令应答上行数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkFindReport"> |
| | | <task id="TkDealAlarmStatus" name="控制器报警与状态数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealAlarmStatus" /> |
| | | <task id="TkDealAutoReport" name="控制器自报数据(整点报)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealAutoReport" /> |
| | | <task id="TkDealOnHourReport" name="控制器自报数据(整点报)" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealOnHourReport" /> |
| | | <task id="TkDealWorkReport" name="控制器阀开工作上报" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealWorkReport" /> |
| | | <task id="TkDealOpenValveReport" name="控制器开阀上报" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealOpenValveReport" /> |
| | | <task id="TkDealCloseValveReport" name="控制器关阀上报" enable="true" class="com.dy.rtuMw.server.rtuData.p206V1_0_0.TkDealCloseValveReport" /> |