mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-20 01:45:55 +08:00
后端功能完善
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.IotDevice;
|
||||
import com.ruoyi.system.domain.vo.IotDeviceListDto;
|
||||
|
||||
/**
|
||||
* 设备Service接口
|
||||
@@ -19,13 +20,18 @@ public interface IIotDeviceService
|
||||
*/
|
||||
public IotDevice selectIotDeviceById(Long deviceId);
|
||||
|
||||
/**
|
||||
* 根据编号查询设备
|
||||
*/
|
||||
public IotDevice selectIotDeviceByNum(String deviceNum);
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
* @param iotDevice 设备
|
||||
* @return 设备集合
|
||||
*/
|
||||
public List<IotDevice> selectIotDeviceList(IotDevice iotDevice);
|
||||
public List<IotDeviceListDto> selectIotDeviceList(IotDevice iotDevice);
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
|
||||
@@ -27,6 +27,14 @@ public interface IIotDeviceStatusService
|
||||
*/
|
||||
public IotDeviceStatus selectIotDeviceStatusByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 根据设备编号查询设备最新状态
|
||||
*
|
||||
* @param deviceNum 设备编号
|
||||
* @return 设备状态
|
||||
*/
|
||||
public IotDeviceStatus selectIotDeviceStatusByDeviceNum(String deviceNum);
|
||||
|
||||
/**
|
||||
* 查询设备状态列表
|
||||
*
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.IotGroup;
|
||||
|
||||
/**
|
||||
* 分组Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2021-05-18
|
||||
*/
|
||||
public interface IIotGroupService
|
||||
{
|
||||
/**
|
||||
* 查询分组
|
||||
*
|
||||
* @param groupId 分组ID
|
||||
* @return 分组
|
||||
*/
|
||||
public IotGroup selectIotGroupById(Long groupId);
|
||||
|
||||
/**
|
||||
* 查询分组列表
|
||||
*
|
||||
* @param iotGroup 分组
|
||||
* @return 分组集合
|
||||
*/
|
||||
public List<IotGroup> selectIotGroupList(IotGroup iotGroup);
|
||||
|
||||
/**
|
||||
* 新增分组
|
||||
*
|
||||
* @param iotGroup 分组
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertIotGroup(IotGroup iotGroup);
|
||||
|
||||
/**
|
||||
* 修改分组
|
||||
*
|
||||
* @param iotGroup 分组
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateIotGroup(IotGroup iotGroup);
|
||||
|
||||
/**
|
||||
* 批量删除分组
|
||||
*
|
||||
* @param groupIds 需要删除的分组ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIotGroupByIds(Long[] groupIds);
|
||||
|
||||
/**
|
||||
* 删除分组信息
|
||||
*
|
||||
* @param groupId 分组ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIotGroupById(Long groupId);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.vo.IotDeviceListDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.IotDeviceMapper;
|
||||
@@ -32,6 +33,18 @@ public class IotDeviceServiceImpl implements IIotDeviceService
|
||||
return iotDeviceMapper.selectIotDeviceById(deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编号查询设备
|
||||
*
|
||||
* @param deviceNum 设备编号
|
||||
* @return 设备
|
||||
*/
|
||||
@Override
|
||||
public IotDevice selectIotDeviceByNum(String deviceNum)
|
||||
{
|
||||
return iotDeviceMapper.selectIotDeviceByNum(deviceNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
@@ -39,7 +52,7 @@ public class IotDeviceServiceImpl implements IIotDeviceService
|
||||
* @return 设备
|
||||
*/
|
||||
@Override
|
||||
public List<IotDevice> selectIotDeviceList(IotDevice iotDevice)
|
||||
public List<IotDeviceListDto> selectIotDeviceList(IotDevice iotDevice)
|
||||
{
|
||||
return iotDeviceMapper.selectIotDeviceList(iotDevice);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,18 @@ public class IotDeviceStatusServiceImpl implements IIotDeviceStatusService
|
||||
return iotDeviceStatusMapper.selectIotDeviceStatusByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编号查询最新设备状态
|
||||
*
|
||||
* @param deviceNum 设备编号
|
||||
* @return 设备状态
|
||||
*/
|
||||
@Override
|
||||
public IotDeviceStatus selectIotDeviceStatusByDeviceNum(String deviceNum)
|
||||
{
|
||||
return iotDeviceStatusMapper.selectIotDeviceStatusByDeviceNum(deviceNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备状态列表
|
||||
*
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.IotGroupMapper;
|
||||
import com.ruoyi.system.domain.IotGroup;
|
||||
import com.ruoyi.system.service.IIotGroupService;
|
||||
|
||||
/**
|
||||
* 分组Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2021-05-18
|
||||
*/
|
||||
@Service
|
||||
public class IotGroupServiceImpl implements IIotGroupService
|
||||
{
|
||||
@Autowired
|
||||
private IotGroupMapper iotGroupMapper;
|
||||
|
||||
/**
|
||||
* 查询分组
|
||||
*
|
||||
* @param groupId 分组ID
|
||||
* @return 分组
|
||||
*/
|
||||
@Override
|
||||
public IotGroup selectIotGroupById(Long groupId)
|
||||
{
|
||||
return iotGroupMapper.selectIotGroupById(groupId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分组列表
|
||||
*
|
||||
* @param iotGroup 分组
|
||||
* @return 分组
|
||||
*/
|
||||
@Override
|
||||
public List<IotGroup> selectIotGroupList(IotGroup iotGroup)
|
||||
{
|
||||
return iotGroupMapper.selectIotGroupList(iotGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分组
|
||||
*
|
||||
* @param iotGroup 分组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertIotGroup(IotGroup iotGroup)
|
||||
{
|
||||
iotGroup.setCreateTime(DateUtils.getNowDate());
|
||||
return iotGroupMapper.insertIotGroup(iotGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分组
|
||||
*
|
||||
* @param iotGroup 分组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateIotGroup(IotGroup iotGroup)
|
||||
{
|
||||
iotGroup.setUpdateTime(DateUtils.getNowDate());
|
||||
return iotGroupMapper.updateIotGroup(iotGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分组
|
||||
*
|
||||
* @param groupIds 需要删除的分组ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteIotGroupByIds(Long[] groupIds)
|
||||
{
|
||||
return iotGroupMapper.deleteIotGroupByIds(groupIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分组信息
|
||||
*
|
||||
* @param groupId 分组ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteIotGroupById(Long groupId)
|
||||
{
|
||||
return iotGroupMapper.deleteIotGroupById(groupId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user