提交 eb187f68 作者: 方治民

feat: 添加厂区进出标记

上级 ba2d6d1c
...@@ -98,6 +98,9 @@ public class LocationLog implements Serializable { ...@@ -98,6 +98,9 @@ public class LocationLog implements Serializable {
@Comment("电量单位") @Comment("电量单位")
String voltUnit; String voltUnit;
@Comment("是否在厂区外")
Boolean out;
@Comment("原始数据") @Comment("原始数据")
@Type(type = "jsonb") @Type(type = "jsonb")
@Column(columnDefinition = "jsonb") @Column(columnDefinition = "jsonb")
......
...@@ -6,13 +6,11 @@ import com.yiring.common.annotation.FieldMapping; ...@@ -6,13 +6,11 @@ import com.yiring.common.annotation.FieldMapping;
import com.yiring.common.domain.BasicEntity; import com.yiring.common.domain.BasicEntity;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import javax.persistence.*; import javax.persistence.*;
import lombok.*; import lombok.*;
import lombok.experimental.FieldDefaults; import lombok.experimental.FieldDefaults;
import lombok.experimental.FieldNameConstants; import lombok.experimental.FieldNameConstants;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.hibernate.Hibernate;
import org.hibernate.annotations.Comment; import org.hibernate.annotations.Comment;
import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Point;
...@@ -102,10 +100,13 @@ public class LocationTag extends BasicEntity implements Serializable { ...@@ -102,10 +100,13 @@ public class LocationTag extends BasicEntity implements Serializable {
@Comment("类型(1:内部/2:访客)") @Comment("类型(1:内部/2:访客)")
Integer category; Integer category;
@Comment("最定位坐标") @Comment("最定位坐标")
@Column(columnDefinition = "geometry(Point,4326)") @Column(columnDefinition = "geometry(Point,4326)")
Point point; Point point;
@Comment("是否在厂外")
Boolean out;
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
public enum Type { public enum Type {
BTT01("蓝牙人员定位卡"), BTT01("蓝牙人员定位卡"),
...@@ -121,17 +122,4 @@ public class LocationTag extends BasicEntity implements Serializable { ...@@ -121,17 +122,4 @@ public class LocationTag extends BasicEntity implements Serializable {
return this.text; return this.text;
} }
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
LocationTag that = (LocationTag) o;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public int hashCode() {
return getClass().hashCode();
}
} }
...@@ -137,6 +137,7 @@ public class PositionMessageServiceImpl implements PositionMessageService { ...@@ -137,6 +137,7 @@ public class PositionMessageServiceImpl implements PositionMessageService {
.silent(data.getBoolean("silent")) .silent(data.getBoolean("silent"))
.volt(data.getInteger("volt")) .volt(data.getInteger("volt"))
.voltUnit(data.getString("voltUnit")) .voltUnit(data.getString("voltUnit"))
.out(data.getBoolean("out"))
.build(); .build();
// 获取定位卡当前绑定的用户 // 获取定位卡当前绑定的用户
...@@ -267,6 +268,7 @@ public class PositionMessageServiceImpl implements PositionMessageService { ...@@ -267,6 +268,7 @@ public class PositionMessageServiceImpl implements PositionMessageService {
locationLogRepository.saveAndFlush(locationLog); locationLogRepository.saveAndFlush(locationLog);
// 更新定位标签卡状态信息 // 更新定位标签卡状态信息
tag.setOut(locationLog.getOut());
tag.setPoint(locationLog.getPoint()); tag.setPoint(locationLog.getPoint());
tag.setVolt(locationLog.getVolt()); tag.setVolt(locationLog.getVolt());
tag.setVoltUnit(locationLog.getVoltUnit()); tag.setVoltUnit(locationLog.getVoltUnit());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论