|
|
@@ -1,6 +1,5 @@
|
|
|
package com.xunmei.deploy.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
@@ -29,7 +28,6 @@ import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -56,11 +54,11 @@ public class IotDailyCheckDataServiceImpl extends ServiceImpl<IotDailyCheckDataM
|
|
|
}
|
|
|
|
|
|
private void dealReqParam(DailyCheckDataPageDto req) {
|
|
|
- if (ObjectUtil.isNotEmpty(req)) {
|
|
|
+ /* if (ObjectUtil.isNotEmpty(req.getRange())) {
|
|
|
Date startTime = DateUtil.beginOfDay(req.getRange()[0]);
|
|
|
Date endTime = DateUtil.endOfDay(req.getRange()[1]);
|
|
|
req.setRange(new Date[]{startTime, endTime});
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (req.getCheckSub()) {
|
|
|
SysOrg sysOrg = remoteOrgService.selectOrgById(req.getOrgId(), SecurityConstants.INNER);
|
|
|
req.setOrgPath(sysOrg.getPath());
|
|
|
@@ -93,7 +91,8 @@ public class IotDailyCheckDataServiceImpl extends ServiceImpl<IotDailyCheckDataM
|
|
|
try {
|
|
|
exportToExcel(exportDataList, response);
|
|
|
} catch (IOException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
+ log.error("导出失败", e);
|
|
|
+ throw new RuntimeException("导出失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -104,12 +103,11 @@ public class IotDailyCheckDataServiceImpl extends ServiceImpl<IotDailyCheckDataM
|
|
|
Sheet sheet = workbook.createSheet("智能巡查每日工作登记簿");
|
|
|
|
|
|
// 设置列宽
|
|
|
- for (int i = 0; i < 5; i++) { // 假设我们有5列
|
|
|
- sheet.setColumnWidth(i, 256 * 40); // 列宽设为20个字符宽度
|
|
|
+ for (int i = 0; i < 5; i++) {
|
|
|
+ sheet.setColumnWidth(i, 256 * 40);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // 创建表头
|
|
|
+ // 创建三行表头
|
|
|
createHeader(sheet,exportDataList.get(0));
|
|
|
|
|
|
// 填充数据
|
|
|
@@ -118,7 +116,7 @@ public class IotDailyCheckDataServiceImpl extends ServiceImpl<IotDailyCheckDataM
|
|
|
Row row = sheet.createRow(rowNum++);
|
|
|
row.setHeight((short) 700);
|
|
|
int colNum = 0;
|
|
|
- // 填充行数据,根据你的 exportVo 属性进行调整
|
|
|
+ // 填充行数据
|
|
|
row.createCell(colNum++).setCellValue(exportVo.getType());
|
|
|
row.createCell(colNum++).setCellValue(exportVo.getTotalCount());
|
|
|
row.createCell(colNum++).setCellValue(exportVo.getExceptionCount());
|