|
@@ -1,5 +1,6 @@
|
|
|
package com.xy.service;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -224,8 +225,9 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
public void exportDevices(HttpServletResponse response, @RequestBody @Valid DeviceInfoDto.Page page) throws IOException {
|
|
|
PageBean<DeviceInfoDto.Vo2> pageBean = queryPage(page);
|
|
|
List<DeviceInfoDto.Vo2> records = pageBean.getRecords();
|
|
|
+ List<DeviceInfoDto.DeviceExcelVO> deviceExcelVOS = BeanUtil.copyToList(records, DeviceInfoDto.DeviceExcelVO.class);
|
|
|
// 输出
|
|
|
- ExcelUtils.write(response, "设备列表.xls", "设备列表", DeviceInfoDto.DeviceExcelVO.class, Beans.copy(DeviceInfoDto.DeviceExcelVO.class, records));
|
|
|
+ ExcelUtils.write(response, "设备列表.xls", "设备列表", DeviceInfoDto.DeviceExcelVO.class, deviceExcelVOS);
|
|
|
}
|
|
|
|
|
|
@PostMapping("nearbyPage")
|