|
|
|
@ -65,6 +65,7 @@ import org.apache.poi.hssf.usermodel.HSSFClientAnchor; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFPatriarch; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.*; |
|
|
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook; |
|
|
|
import org.dom4j.Document; |
|
|
|
import org.dom4j.DocumentHelper; |
|
|
|
import org.dom4j.Element; |
|
|
|
@ -224,13 +225,13 @@ public class PatrolTaskController extends BaseController { |
|
|
|
logger.info("---------------[TASK] query resultAnalysis {}", resultAnalysis); |
|
|
|
// 初筛数据 |
|
|
|
List<PatrolData> filterList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); |
|
|
|
logger.debug("---------------[TASK] query filterList {}", filterList); |
|
|
|
// logger.debug("---------------[TASK] query filterList {}", filterList); |
|
|
|
List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult()); |
|
|
|
resultAnalysis.setFilter("0"); |
|
|
|
long t2 = System.currentTimeMillis(); |
|
|
|
// 大模型数据 |
|
|
|
List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); |
|
|
|
logger.info("----------------[TASK] query newList {}", newList); |
|
|
|
// logger.info("----------------[TASK] query newList {}", newList); |
|
|
|
// if (newList == null) { |
|
|
|
// return getDataTable(2, new ArrayList<>(), new ArrayList<>()); |
|
|
|
// } |
|
|
|
@ -2468,7 +2469,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
logger.warn("图片下载失败: {}", imagePath, e); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
logger.info("图片下载成功"); |
|
|
|
// exportExcel(response, newList); |
|
|
|
exportExcelStream(response, newList, streamHashMap); |
|
|
|
logger.info("任务详情导出耗时: {} ms", (System.currentTimeMillis() - start)); |
|
|
|
@ -2481,8 +2482,8 @@ public class PatrolTaskController extends BaseController { |
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=\"task_export_" + System.currentTimeMillis() + ".xlsx\""); |
|
|
|
|
|
|
|
|
|
|
|
try (HSSFWorkbook workbook = new HSSFWorkbook(); |
|
|
|
// 使用SXSSFWorkbook来处理大数据量,避免内存溢出 |
|
|
|
try (SXSSFWorkbook workbook = new SXSSFWorkbook(20); |
|
|
|
ServletOutputStream out = response.getOutputStream()) { |
|
|
|
|
|
|
|
Sheet sheet = workbook.createSheet(MessageUtils.get("任务详情")); |
|
|
|
@ -2549,7 +2550,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
row.createCell(11).setCellValue(item.getDesc()); // 分析结果 |
|
|
|
} |
|
|
|
|
|
|
|
private void insertImages(HSSFWorkbook workbook, Drawing<?> drawing, Sheet sheet, |
|
|
|
private void insertImages(SXSSFWorkbook workbook, Drawing<?> drawing, Sheet sheet, |
|
|
|
Row row, PatrolData item, Map<String, byte[]> imageCache) { |
|
|
|
|
|
|
|
try { |
|
|
|
@ -2581,7 +2582,7 @@ public class PatrolTaskController extends BaseController { |
|
|
|
return (images.length > 0) ? images[0] : null; |
|
|
|
} |
|
|
|
|
|
|
|
private void insertImage(HSSFWorkbook workbook, Drawing<?> drawing, Row row, |
|
|
|
private void insertImage(SXSSFWorkbook workbook, Drawing<?> drawing, Row row, |
|
|
|
int colIndex, byte[] imageData) { |
|
|
|
|
|
|
|
// 计算图片位置 |
|
|
|
|