| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.device.dto.DataConfigDto; |
| | | import com.ruoyi.device.dto.DeviceConfigDtoPage; |
| | | import com.ruoyi.device.mapper.DataConfigMapper; |
| | | import com.ruoyi.device.mapper.DeviceMapper; |
| | | import com.ruoyi.device.pojo.DataConfig; |
| | |
| | | if (dataConfigList.getIsDevice()) { |
| | | Device device = new Device(); |
| | | BeanUtils.copyProperties(dataConfigList, device); |
| | | List<String> channelList = dataConfigList.getChannel(); |
| | | if (channelList != null &&!channelList.isEmpty()) { |
| | | String channelString = String.join(",", channelList); |
| | | device.setChannel(channelString); |
| | | } |
| | | device.setId(deviceId); |
| | | deviceMapper.updateById(device); |
| | | } else { |
| | |
| | | List<DataConfig> list = baseMapper.selectList(wrapper); |
| | | return Result.success(list); |
| | | } else { |
| | | return Result.success(dataConfigMapper.selectDataConfigList(dataConfig.getDeviceId())); |
| | | List<DeviceConfigDtoPage> deviceConfigDtoPages = dataConfigMapper.selectDataConfigList(dataConfig.getDeviceId()); |
| | | return Result.success(deviceConfigDtoPages); |
| | | } |
| | | } |
| | | } |