package com.zc.business.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; @Data @ApiModel(value = "DcDevice", description = "设备实体") public class DcDevice { public static final Integer UNUSEDSTATE = 0; public static final Integer USEOFSTATE = 1; // 离线状态 public static final String OFFLINE = "0"; // 在线状态 public static final String ONLINE = "1"; @ApiModelProperty("ID") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty("物联设备ID") private String iotDeviceId; @ApiModelProperty("组ID") private Long groupId; @ApiModelProperty("产品ID") private Long productId; @ApiModelProperty("桩号") private String stakeMark; @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)") private String direction; @ApiModelProperty("设备名称") private String deviceName; @ApiModelProperty("设备编号") private String deviceCode; @ApiModelProperty("设备类型") private Integer deviceType; @ApiModelProperty("设备图片") private String deviceImg; @ApiModelProperty("安装日期") private Date installationDate; @ApiModelProperty("生产日期") private Date productionDate; @ApiModelProperty("使用年限") private String durableYears; @ApiModelProperty("安装位置") private String installationSite; @ApiModelProperty("设备状态") private String deviceState; @ApiModelProperty("使用状态") private Integer useState; @ApiModelProperty("其他配置") private String otherConfig; @ApiModelProperty("备注") private String remark; @ApiModelProperty("设施归属类型(0:默认1: 道路沿线2:桥梁3: 隧道4:收费广场5: 收费站6: 服务区等") private String facilitiesType; @ApiModelProperty("设备ip") private String deviceIp; @ApiModelProperty("范围桩号") private String stakeMarkRange; @ApiModelProperty("创建时间") private Date createTime; @ApiModelProperty("修改时间") private Date updateTime; @ApiModelProperty("子类型") private String childType; @TableField(exist = false) private String longitude; @TableField(exist = false) private String latitude; //设备厂商 @TableField(exist = false) private String manufacturer; public Integer stakeMarkToInt() { if (stakeMark == null) { return null; } // 不区分大小写的正则表达式匹配 'k' 和 '+' String[] parts = this.stakeMark.split("(?i)k|\\+"); // 提取出公里数部分和米数部分 String kmStr = parts[1].trim(); // 将公里数和米数转换为整数 int km = Integer.parseInt(kmStr); int m = 0; if (parts.length == 3) { String mStr = parts[2].trim(); m = Integer.parseInt(mStr); } // 计算总米数 return km * 1000 + m; } }