|
@@ -33,6 +33,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import jodd.introspector.MapperFunction;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -258,6 +259,19 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
ExcelUtils.write(response, "设备列表.xls", "设备列表", DeviceInfoDto.DeviceExcelVO.class, deviceExcelVOS);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Async
|
|
|
+ @ApiOperation("导出设备(异步)")
|
|
|
+ @PostMapping("exportDevices/async")
|
|
|
+ public void exportDevicesAsync(DeviceInfoDto.Page page) {
|
|
|
+ PageBean<DeviceInfoDto.Vo2> pageBean = queryPage(page);
|
|
|
+ List<DeviceInfoDto.Vo2> records = pageBean.getRecords();
|
|
|
+ List<DeviceInfoDto.DeviceExcelVO> deviceExcelVOS = BeanUtil.copyToList(records, DeviceInfoDto.DeviceExcelVO.class);
|
|
|
+ //TODO:
|
|
|
+ // 输出
|
|
|
+// ExcelUtils.write(response, "设备列表.xls", "设备列表", DeviceInfoDto.DeviceExcelVO.class, deviceExcelVOS);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("nearbyPage")
|
|
|
@ApiOperation("附近设备分页查询")
|
|
|
public R<PageBean<DeviceInfoDto.Vo2>> nearbyPage(@RequestBody DeviceInfoDto.Page page) {
|