kaiyu
2021-06-21 b3204224f9ba08969dbdf383849ed91a04279156
screen-manage/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
@@ -76,6 +76,8 @@
    @Autowired
    private VersionSensorUnitMapper versionSensorUnitMapper;
    /*
     * 从redis获取设备信息
     * */
@@ -163,6 +165,11 @@
    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();