dao/src/main/java/com/sandu/ximon/dao/domain/LightPoleHeeling.java
@@ -1,39 +1,76 @@ package com.sandu.ximon.dao.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.time.LocalDateTime; import lombok.Data; @Data /** * 灯杆倾侧 * 倾侧告警表 * @TableName light_pole_heeling */ @TableName(value ="light_pole_heeling") @Data public class LightPoleHeeling implements Serializable { /** * */ @TableId(type = IdType.AUTO) private Long id; //所属人 /** * 所属人 */ private Long userId; //告警号 /** * 告警号 */ private String warningNumber; //灯杆ID /** * 灯杆ID */ private Long lightPoleId; //灯杆名称 /** * 灯杆名称 */ private String lightPoleName; //告警等级 /** * 警告等级 */ private String warningLevel; //X轴 private int theXAxis; //Y轴 private int theYAxis; //Z轴 private int theZAxis; //处理状态 // 1:已处理;0:未处理 private int processingState; //告警时间 /** * X轴 */ private Double theXAxis; /** * Y轴 */ private Double theYAxis; /** * Z轴 */ private Double theZAxis; /** * 处理状态 */ private Integer processingState; /** * */ private LocalDateTime createTime; } @TableField(exist = false) private static final long serialVersionUID = 1L; } dao/src/main/java/com/sandu/ximon/dao/mapper/LightPoleHeelingMapper.java
@@ -1,9 +1,14 @@ package com.sandu.ximon.dao.mapper; import com.sandu.common.domain.BaseMapper; import com.sandu.ximon.dao.domain.LightPoleHeeling; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; @Mapper public interface LightPoleHeelingMapper extends BaseMapper<LightPoleHeeling> { } dao/src/main/resources/mapper/LightPoleHeelingMapper.xml
@@ -3,17 +3,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.sandu.ximon.dao.mapper.LightPoleHeelingMapper"> <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightPoleHeeling"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="userId" column="user_id" jdbcType="BIGINT"/> <result property="warningNumber" column="warning_number" jdbcType="VARCHAR"/> <result property="lightPoleId" column="light_pole_id" jdbcType="BIGINT"/> <result property="lightPoleName" column="light_pole_name" jdbcType="VARCHAR"/> <result property="warningLevel" column="warning_level" jdbcType="VARCHAR"/> <result property="theXAxis" column="the_x_axis" jdbcType="INTEGER"/> <result property="theYAxis" column="the_y_axis" jdbcType="INTEGER"/> <result property="theZAxis" column="the_z_axis" jdbcType="INTEGER"/> <result property="processingState" column="processing_state" jdbcType="INTEGER"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <id property="id" column="id" jdbcType="BIGINT"/> <result property="userId" column="user_id" jdbcType="BIGINT"/> <result property="warningNumber" column="warning_number" jdbcType="VARCHAR"/> <result property="lightPoleId" column="light_pole_id" jdbcType="BIGINT"/> <result property="lightPoleName" column="light_pole_name" jdbcType="VARCHAR"/> <result property="warningLevel" column="warning_level" jdbcType="VARCHAR"/> <result property="theXAxis" column="the_x_axis" jdbcType="DOUBLE"/> <result property="theYAxis" column="the_y_axis" jdbcType="DOUBLE"/> <result property="theZAxis" column="the_z_axis" jdbcType="DOUBLE"/> <result property="processingState" column="processing_state" jdbcType="INTEGER"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> </resultMap> </mapper> <sql id="Base_Column_List"> id,user_id,warning_number, light_pole_id,light_pole_name,warning_level, the_x_axis,the_y_axis,the_z_axis, processing_state,create_time </sql> </mapper> ximon-admin/src/main/java/com/sandu/ximon/admin/manager/iot/frame/inner/report/A5LightPoleHeelingHeartbeatReportInnerFrame.java
@@ -52,7 +52,7 @@ @Data public static class HeartBeatDataPackage implements IResponseInnerFrame<HeartBeatDataPackage> { //设备型号 private int equipmentModel; private String equipmentModel; //X轴 private double theXAxis; //Y轴 @@ -60,24 +60,24 @@ //Z轴 private double theZAxis; //预留 private int reservedA; private int reservedB; private int reservedC; private int reservedD; private String reservedA; private String reservedB; private String reservedC; private String reservedD; @Override public HeartBeatDataPackage transformFrame(String hex) { if (StrUtil.isBlank(hex)) { return null; } this.equipmentModel = (parseVal(hex, 0, 4)); this.equipmentModel = "V" + (parseVal(hex, 0, 2)) + "." + String.format("%02d", parseVal(hex, 2, 4)); this.theXAxis = NumberUtil.round(temperatureTransition(hex.substring(4, 8)) * 0.1, 1).doubleValue(); this.theYAxis = NumberUtil.round(temperatureTransition(hex.substring(8, 12)) * 0.1, 1).doubleValue(); this.theZAxis = NumberUtil.round(temperatureTransition(hex.substring(12, 16)) * 0.1, 1).doubleValue(); this.reservedA = (parseVal(hex, 16, 20)); this.reservedB = (parseVal(hex, 20, 24)); this.reservedC = (parseVal(hex, 24, 28)); this.reservedD = (parseVal(hex, 28, 32)); this.reservedA = hex.substring(16, 20); this.reservedB = hex.substring(20, 24); this.reservedC = hex.substring(24, 28); this.reservedD = hex.substring(28, 32); //72-80保留,暂未使用 return this;