mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
添加设备重置接口
This commit is contained in:
@@ -153,6 +153,20 @@ public class DeviceController extends BaseController
|
|||||||
return toAjax(deviceService.updateDevice(device));
|
return toAjax(deviceService.updateDevice(device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置设备状态
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('iot:device:edit')")
|
||||||
|
@Log(title = "设备", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/reset/{serialNumber}")
|
||||||
|
@ApiOperation("重置设备设备")
|
||||||
|
public AjaxResult resetDeviceStatus(@PathVariable String serialNumber)
|
||||||
|
{
|
||||||
|
Device device=new Device();
|
||||||
|
device.setSerialNumber(serialNumber);
|
||||||
|
return toAjax(deviceService.resetDeviceStatus(device.getSerialNumber()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除设备
|
* 删除设备
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -161,9 +161,23 @@ public interface DeviceMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int deleteDeviceGroupByDeviceIds(Long[] deviceIds);
|
public int deleteDeviceGroupByDeviceIds(Long[] deviceIds);
|
||||||
// 查询所有简短设备列表
|
|
||||||
|
/**
|
||||||
|
* 重置设备状态
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int resetDeviceStatus(String deviceNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有简短设备列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName);
|
List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName);
|
||||||
//精准查询
|
|
||||||
|
/**
|
||||||
|
* 精准查询
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
List<Device> selectDeviceListAccurate(Device device);
|
List<Device> selectDeviceListAccurate(Device device);
|
||||||
|
|
||||||
List<DeviceShortOutput> selectDeviceShortListAccurate(Device device);
|
List<DeviceShortOutput> selectDeviceShortListAccurate(Device device);
|
||||||
|
|||||||
@@ -152,12 +152,30 @@ public interface IDeviceService
|
|||||||
*/
|
*/
|
||||||
public String generationDeviceNum();
|
public String generationDeviceNum();
|
||||||
|
|
||||||
// 获取所有简短设备列表
|
/**
|
||||||
|
* 重置设备状态
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int resetDeviceStatus(String deviceNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有简短设备列表
|
||||||
|
* @param userName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName);
|
List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName);
|
||||||
|
|
||||||
// 精准查询
|
/**
|
||||||
|
* 精准查询
|
||||||
|
* @param device
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<Device> selectDeviceListAccurate(Device device);
|
List<Device> selectDeviceListAccurate(Device device);
|
||||||
|
|
||||||
// 精准查询所有条件设备的简短信息
|
/**
|
||||||
|
* 精准查询所有条件设备的简短信息
|
||||||
|
* @param device
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<DeviceShortOutput> selectDeviceShortListAccurate(Device device);
|
List<DeviceShortOutput> selectDeviceShortListAccurate(Device device);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -659,6 +659,15 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置设备状态
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int resetDeviceStatus(String deviceNum) {
|
||||||
|
int result=deviceMapper.resetDeviceStatus(deviceNum);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除设备
|
* 批量删除设备
|
||||||
|
|||||||
@@ -329,6 +329,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where serial_number = #{serialNumber}
|
where serial_number = #{serialNumber}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="resetDeviceStatus" parameterType="String">
|
||||||
|
-- 设备状态(1-未激活,2-禁用,3-在线,4-离线)
|
||||||
|
update iot_device set status=4
|
||||||
|
where serial_number = #{serialNumber} and status = 3
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updateDeviceBySerialNumber" parameterType="com.ruoyi.iot.domain.Device">
|
<update id="updateDeviceBySerialNumber" parameterType="com.ruoyi.iot.domain.Device">
|
||||||
update iot_device
|
update iot_device
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
|||||||
Reference in New Issue
Block a user