| | |
| | | @Autowired |
| | | private VersionSensorUnitMapper versionSensorUnitMapper; |
| | | |
| | | |
| | | |
| | | /* |
| | | * 从redis获取设备信息 |
| | | * */ |
| | |
| | | public void update(Device device) { |
| | | Integer deviceId = device.getId(); |
| | | Device oldDevice = deviceMapper.selectById(deviceId); |
| | | //判断是否更新了站点,如果更新了站点则查询对应站点的组织id进行更新 |
| | | if(!ObjectUtils.isEmpty(device.getMonitorPointId())){ |
| | | MonitorPoint monitorPoint = monitorPointMapper.selectById(device.getMonitorPointId()); |
| | | device.setOrganizationId(monitorPoint.getOrganizationId()); |
| | | } |
| | | deviceMapper.updateById(device); |
| | | Device updateDevice = deviceMapper.selectById(deviceId); |
| | | String mac = updateDevice.getMac(); |