|
@@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.SortablePageParam;
|
|
|
+import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotdeviceallotlog.vo.IotDeviceAllotSaveReqVO;
|
|
@@ -166,8 +168,8 @@ public class IotDeviceController {
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得设备台账分页")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
- public CommonResult<PageResult<IotDeviceRespVO>> getIotDevicePage(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
- PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDevicePage(pageReqVO);
|
|
|
+ public CommonResult<PageResult<IotDeviceRespVO>> getIotDevicePage(@Valid IotDevicePageReqVO pageReqVO, @Valid SortablePageParam pageParam) {
|
|
|
+ PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDevicePage(pageReqVO, pageParam);
|
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
|
}
|
|
@@ -202,8 +204,8 @@ public class IotDeviceController {
|
|
|
@GetMapping("/deviceDynamicsPage")
|
|
|
@Operation(summary = "获得设备动态 分页")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
- public CommonResult<PageResult<IotDeviceRespVO>> responsiblePagedeviceDynamicsPage(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
- PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDevicePage(pageReqVO);
|
|
|
+ public CommonResult<PageResult<IotDeviceRespVO>> responsiblePagedeviceDynamicsPage(@Valid IotDevicePageReqVO pageReqVO, @Valid SortablePageParam pageParam) {
|
|
|
+ PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDevicePage(pageReqVO, pageParam);
|
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
|
}
|
|
@@ -369,13 +371,18 @@ public class IotDeviceController {
|
|
|
@Operation(summary = "导出设备台账 Excel")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
- public void exportIotDeviceExcel(@Valid IotDevicePageReqVO pageReqVO,
|
|
|
+ public void exportIotDeviceExcel(@Valid IotDevicePageReqVO pageReqVO,@Valid SortablePageParam pageParam,
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<IotDeviceDO> list = iotDeviceService.getIotDevicePage(pageReqVO).getList();
|
|
|
+ List<IotDeviceDO> list = iotDeviceService.getIotDevicePage(pageReqVO, pageParam).getList();
|
|
|
// 导出 Excel
|
|
|
ExcelUtils.write(response, "设备台账.xls", "数据", IotDeviceRespVO.class,
|
|
|
BeanUtils.toBean(list, IotDeviceRespVO.class));
|
|
|
}
|
|
|
|
|
|
+ @PermitAll
|
|
|
+ @GetMapping("/init")
|
|
|
+ public void init() {
|
|
|
+ iotDeviceService.updateSort();
|
|
|
+ }
|
|
|
}
|