|
@@ -126,17 +126,20 @@ public class DeviceAnalogVariableListServiceImpl extends AbstractCrudService<Dev
|
|
|
Workbook workbook = null;
|
|
|
File file = null;
|
|
|
final String[] err1 = {"导出文件失败"};
|
|
|
+ Page<DeviceAnalogVariableListOneVo> page1 = new Page<>(1, 10);
|
|
|
+ page1 = baseMapper.variableListExport(page1,siteId, variableName, dataArea);
|
|
|
try {
|
|
|
+ List<DeviceAnalogVariableListOneVo> variableList = page1.getRecords();
|
|
|
+ if (null == variableList || variableList.size() ==0){
|
|
|
+ err1[0] ="导出失败,监控设备未绑定或数据为空";
|
|
|
+ throw new BusinessException(err1[0]);
|
|
|
+ }
|
|
|
ExportParams params = new ExportParams(null, "变量列表");
|
|
|
workbook = ExcelExportUtil.exportBigExcel(params, DeviceAnalogVariableListExportVO.class,
|
|
|
(o, i) -> {
|
|
|
Page<DeviceAnalogVariableListOneVo> page = new Page<>(i, 30);
|
|
|
page = baseMapper.variableListExport(page,siteId, variableName, dataArea);
|
|
|
- List<DeviceAnalogVariableListOneVo> variableList = page.getRecords();
|
|
|
- if (null == variableList || variableList.size() ==0){
|
|
|
- err1[0] ="导出失败,监控设备未绑定或数据为空";
|
|
|
- throw new BusinessException(err1[0]);
|
|
|
- }
|
|
|
+
|
|
|
return new ArrayList<>(BeanMapperUtils.mapList(page.getRecords(), DeviceAnalogVariableListOneVo.class, DeviceAnalogVariableListExportVO.class));
|
|
|
}, null);
|
|
|
if (null != workbook) {
|