设备定位优化

This commit is contained in:
kerwincui
2022-05-30 17:01:23 +08:00
parent aab50e5a78
commit b6cd6975f8
3 changed files with 18 additions and 8 deletions

View File

@@ -566,12 +566,13 @@ public class DeviceServiceImpl implements IDeviceService {
@Override
@Transactional(rollbackFor = Exception.class)
public int updateDeviceStatusAndLocation(Device device,String ipAddress) {
// 设置定位和状态
// 设置自动定位和状态
if(ipAddress!="") {
if(device.getActiveTime()==null){
device.setActiveTime(DateUtils.getNowDate());
}
if (device.getIsCustomLocation() == 0) {
// 定位方式(1=ip自动定位2=设备定位3=自定义)
if (device.getIsCustomLocation() == 1) {
device.setNetworkIp(ipAddress);
setLocation(ipAddress, device);
}
@@ -596,7 +597,6 @@ public class DeviceServiceImpl implements IDeviceService {
deviceLog.setLogType(6);
}
logService.saveDeviceLog(deviceLog);
// deviceLogService.insertDeviceLog(deviceLog);
return result;
}