forked from dyf/fys-Multi-tenant
事件地址
This commit is contained in:
@ -69,4 +69,9 @@ public class DeviceFenceAccessRecord extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Date eventTime;
|
private Date eventTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件地址
|
||||||
|
*/
|
||||||
|
private String eventAddress;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.fuyuanshen.equipment.domain.bo;
|
package com.fuyuanshen.equipment.domain.bo;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||||
import com.fuyuanshen.common.core.validate.EditGroup;
|
import com.fuyuanshen.common.core.validate.EditGroup;
|
||||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||||
@ -81,6 +82,11 @@ public class DeviceFenceAccessRecordBo extends BaseEntity {
|
|||||||
@NotNull(message = "事件时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotNull(message = "事件时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Date eventTime;
|
private Date eventTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件地址
|
||||||
|
*/
|
||||||
|
private String eventAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -97,6 +97,12 @@ public class DeviceFenceAccessRecordVo implements Serializable {
|
|||||||
@ExcelProperty(value = "事件时间")
|
@ExcelProperty(value = "事件时间")
|
||||||
private Date eventTime;
|
private Date eventTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "事件地址")
|
||||||
|
private String eventAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录创建时间
|
* 记录创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import com.fuyuanshen.equipment.service.IDeviceFenceAccessRecordService;
|
|||||||
import com.fuyuanshen.equipment.service.IDeviceFenceStatusService;
|
import com.fuyuanshen.equipment.service.IDeviceFenceStatusService;
|
||||||
import com.fuyuanshen.equipment.service.IDeviceGeoFenceService;
|
import com.fuyuanshen.equipment.service.IDeviceGeoFenceService;
|
||||||
import com.fuyuanshen.equipment.utils.map.GeoFenceChecker;
|
import com.fuyuanshen.equipment.utils.map.GeoFenceChecker;
|
||||||
|
import com.fuyuanshen.equipment.utils.map.GetAddressFromLatUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -240,6 +241,9 @@ public class DeviceGeoFenceServiceImpl implements IDeviceGeoFenceService {
|
|||||||
recordBo.setFenceId(fence.getId());
|
recordBo.setFenceId(fence.getId());
|
||||||
recordBo.setLatitude(request.getLatitude());
|
recordBo.setLatitude(request.getLatitude());
|
||||||
recordBo.setLongitude(request.getLongitude());
|
recordBo.setLongitude(request.getLongitude());
|
||||||
|
String address = GetAddressFromLatUtil.getAdd(request.getLongitude().toString(), request.getLatitude().toString());
|
||||||
|
recordBo.setEventAddress(address);
|
||||||
|
|
||||||
recordBo.setEventTime(new Date());
|
recordBo.setEventTime(new Date());
|
||||||
// 1表示进入围栏,2表示离开围栏
|
// 1表示进入围栏,2表示离开围栏
|
||||||
recordBo.setEventType(currentStatus);
|
recordBo.setEventType(currentStatus);
|
||||||
|
|||||||
@ -8,6 +8,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 根据经纬度获取地址信息工具类
|
||||||
|
*
|
||||||
* @author: 默苍璃
|
* @author: 默苍璃
|
||||||
* @date: 2025-07-2615:59
|
* @date: 2025-07-2615:59
|
||||||
*/
|
*/
|
||||||
@ -74,5 +76,6 @@ public class GetAddressFromLatUtil {
|
|||||||
System.out.println("通过API获取到具体位置:" + res);
|
System.out.println("通过API获取到具体位置:" + res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
r.latitude,
|
r.latitude,
|
||||||
r.longitude,
|
r.longitude,
|
||||||
r.accuracy,
|
r.accuracy,
|
||||||
r.event_time,
|
r.event_time, r.event_address,
|
||||||
r.create_time
|
r.create_time
|
||||||
FROM device_fence_access_record r
|
FROM device_fence_access_record r
|
||||||
LEFT JOIN device_geo_fence f ON r.fence_id = f.id
|
LEFT JOIN device_geo_fence f ON r.fence_id = f.id
|
||||||
@ -90,7 +90,7 @@
|
|||||||
AND r.event_time <![CDATA[ <= ]]> #{bo.endTime}
|
AND r.event_time <![CDATA[ <= ]]> #{bo.endTime}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY r.id ASC
|
ORDER BY r.event_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user