diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java index 762dd534..cc870e12 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -1824,6 +1824,10 @@ public class EstimateService { byte[] excelBytes = excelUtil.download(request, response, excelData, excelList, excelTemplateNam); + if (excelBytes == null || excelBytes.length == 0) { + throw new RuntimeException("Excel template processing returned empty result. Template: " + excelTemplateNam); + } + InputStream in = new ByteArrayInputStream(excelBytes); workbook = WorkbookFactory.create(in); // JXLS POI 엑셀로 재변환 diff --git a/src/main/java/com/interplug/qcast/util/ExcelUtil.java b/src/main/java/com/interplug/qcast/util/ExcelUtil.java index a725d097..44925563 100644 --- a/src/main/java/com/interplug/qcast/util/ExcelUtil.java +++ b/src/main/java/com/interplug/qcast/util/ExcelUtil.java @@ -69,7 +69,8 @@ public class ExcelUtil { excelBytes = byteArrayOutputStream.toByteArray(); } } catch (Exception e) { - log.debug(e.getMessage()); + log.error("ExcelUtil.download error: {}", e.getMessage(), e); + throw new RuntimeException("Excel template processing failed", e); } return excelBytes; @@ -118,7 +119,8 @@ public class ExcelUtil { JxlsHelper.getInstance().processTemplate(is, os, context); } } catch (Exception e) { - log.debug(e.getMessage()); + log.error("ExcelUtil.download error: {}", e.getMessage(), e); + throw new RuntimeException("Excel template processing failed", e); } } diff --git a/src/main/resources/mappers/estimate/estimateMapper.xml b/src/main/resources/mappers/estimate/estimateMapper.xml index fb721f5c..0ab01ebd 100644 --- a/src/main/resources/mappers/estimate/estimateMapper.xml +++ b/src/main/resources/mappers/estimate/estimateMapper.xml @@ -396,116 +396,76 @@