You've already forked FrameTour-BE
fix(device): 移除未配置 deviceNo 时的被动存储查询
- 在 VptPassiveStorageOperator 和 WvpPassiveStorageOperator 中添加日志警告 - 返回空列表以避免使用未配置的 deviceNo 进行查询 - 移除 DeviceEntity 中的 no2 字段 - 更新 DeviceServiceImpl 中的缓存清除逻辑
This commit is contained in:
@@ -84,7 +84,8 @@ public class VptPassiveStorageOperator extends ADeviceStorageOperator {
|
|||||||
if (StringUtils.isNotBlank(config.getDeviceNo())) {
|
if (StringUtils.isNotBlank(config.getDeviceNo())) {
|
||||||
task.deviceNo = config.getDeviceNo();
|
task.deviceNo = config.getDeviceNo();
|
||||||
} else {
|
} else {
|
||||||
task.deviceNo = device.getNo2();
|
log.warn("设备未配置deviceNo:{}", device);
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
task.startTime = startDate;
|
task.startTime = startDate;
|
||||||
task.endTime = endDate;
|
task.endTime = endDate;
|
||||||
|
@@ -81,7 +81,8 @@ public class WvpPassiveStorageOperator extends ADeviceStorageOperator {
|
|||||||
if (StringUtils.isNotBlank(config.getDeviceNo())) {
|
if (StringUtils.isNotBlank(config.getDeviceNo())) {
|
||||||
task.deviceNo = config.getDeviceNo();
|
task.deviceNo = config.getDeviceNo();
|
||||||
} else {
|
} else {
|
||||||
task.deviceNo = device.getNo2();
|
log.warn("设备未配置deviceNo:{}", device);
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
task.startTime = startDate;
|
task.startTime = startDate;
|
||||||
task.endTime = endDate;
|
task.endTime = endDate;
|
||||||
|
@@ -28,7 +28,6 @@ public class DeviceEntity {
|
|||||||
* 设备编号
|
* 设备编号
|
||||||
*/
|
*/
|
||||||
private String no;
|
private String no;
|
||||||
private String no2;
|
|
||||||
/**
|
/**
|
||||||
* 经度
|
* 经度
|
||||||
*/
|
*/
|
||||||
|
@@ -160,7 +160,6 @@ public class DeviceServiceImpl implements DeviceService {
|
|||||||
deviceMapper.updateSort(item.getId(), item.getSort());
|
deviceMapper.updateSort(item.getId(), item.getSort());
|
||||||
deviceRepository.clearDeviceCache(item.getId());
|
deviceRepository.clearDeviceCache(item.getId());
|
||||||
deviceRepository.clearDeviceCache(item.getNo());
|
deviceRepository.clearDeviceCache(item.getNo());
|
||||||
deviceRepository.clearDeviceCache(item.getNo2());
|
|
||||||
});
|
});
|
||||||
return ApiResponse.success(true);
|
return ApiResponse.success(true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user