2026-01-15 16:03:11 +08:00
|
|
|
|
package com.ruoyi.device.controller;
|
|
|
|
|
|
|
2026-01-15 18:25:25 +08:00
|
|
|
|
import com.ruoyi.common.core.domain.R;
|
2026-01-15 16:03:11 +08:00
|
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
2026-01-15 18:25:25 +08:00
|
|
|
|
import com.ruoyi.common.security.annotation.InnerAuth;
|
2026-01-15 19:03:34 +08:00
|
|
|
|
import com.ruoyi.device.api.domain.DeviceTempVO;
|
2026-01-15 19:14:11 +08:00
|
|
|
|
import com.ruoyi.device.controller.convert.DeviceTempControllerConvert;
|
2026-01-15 19:03:34 +08:00
|
|
|
|
import com.ruoyi.device.service.api.IDeviceTempService;
|
|
|
|
|
|
import com.ruoyi.device.service.dto.DeviceTempDTO;
|
2026-01-15 16:03:11 +08:00
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 设备临时表Controller
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
|
* @date 2026-01-15
|
|
|
|
|
|
*/
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/device/temp")
|
|
|
|
|
|
public class DeviceTempController extends BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
private IDeviceTempService deviceTempService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询设备临时表列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/list")
|
2026-01-15 19:03:34 +08:00
|
|
|
|
public TableDataInfo list(DeviceTempVO deviceTemp)
|
2026-01-15 16:03:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
startPage();
|
2026-01-15 19:03:34 +08:00
|
|
|
|
// API Domain → Service DTO
|
2026-01-21 11:43:56 +08:00
|
|
|
|
DeviceTempDTO dto = DeviceTempControllerConvert.to(deviceTemp);
|
2026-01-15 19:03:34 +08:00
|
|
|
|
List<DeviceTempDTO> dtoList = deviceTempService.selectDeviceTempList(dto);
|
|
|
|
|
|
// Service DTO → API Domain
|
2026-01-21 11:43:56 +08:00
|
|
|
|
List<DeviceTempVO> list = DeviceTempControllerConvert.fromList(dtoList);
|
2026-01-15 19:03:34 +08:00
|
|
|
|
return getDataTable(list);
|
2026-01-15 16:03:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-15 18:25:25 +08:00
|
|
|
|
* 获取设备临时表详细信息(内部调用)
|
2026-01-15 16:03:11 +08:00
|
|
|
|
*/
|
2026-01-15 18:25:25 +08:00
|
|
|
|
@InnerAuth
|
2026-01-15 16:03:11 +08:00
|
|
|
|
@GetMapping(value = "/{id}")
|
2026-01-15 19:03:34 +08:00
|
|
|
|
public R<DeviceTempVO> getDeviceById(@PathVariable("id") String id)
|
2026-01-15 18:25:25 +08:00
|
|
|
|
{
|
2026-01-15 19:03:34 +08:00
|
|
|
|
DeviceTempDTO dto = deviceTempService.selectDeviceTempById(id);
|
2026-01-21 11:43:56 +08:00
|
|
|
|
DeviceTempVO deviceTemp = DeviceTempControllerConvert.from(dto);
|
2026-01-15 18:25:25 +08:00
|
|
|
|
return R.ok(deviceTemp);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-15 19:03:34 +08:00
|
|
|
|
* 获取设备临时表详细信息(外部调用)
|
2026-01-15 18:25:25 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping(value = "/info/{id}")
|
2026-01-15 16:03:11 +08:00
|
|
|
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
|
|
|
|
|
{
|
2026-01-15 19:03:34 +08:00
|
|
|
|
DeviceTempDTO dto = deviceTempService.selectDeviceTempById(id);
|
2026-01-21 11:43:56 +08:00
|
|
|
|
DeviceTempVO deviceTemp = DeviceTempControllerConvert.from(dto);
|
2026-01-15 19:03:34 +08:00
|
|
|
|
return success(deviceTemp);
|
2026-01-15 16:03:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|