|
|
|
@@ -53,6 +53,7 @@ class StockLotLedgerReportController( |
|
|
|
return mapOf("earliest" to earliest.format(DateTimeFormatter.ISO_LOCAL_DATE)) |
|
|
|
} |
|
|
|
|
|
|
|
/** FP-MTMS Version Checklist | Functions Ref. No. 91 | v1.0.0 | 2026-11-06 */ |
|
|
|
@GetMapping("/print-stock-lot-ledger-excel") |
|
|
|
fun exportStockLotLedgerReportExcel( |
|
|
|
@RequestParam(required = false) itemCode: String?, |
|
|
|
@@ -71,7 +72,6 @@ class StockLotLedgerReportController( |
|
|
|
dbData = result.rows, |
|
|
|
reportPeriodStart = period.startStr, |
|
|
|
reportPeriodEnd = period.endStr, |
|
|
|
timings = result.timings, |
|
|
|
) |
|
|
|
val excelMs = (System.nanoTime() - tExcel) / 1_000_000 |
|
|
|
val totalMs = (System.nanoTime() - tAll) / 1_000_000 |
|
|
|
@@ -209,11 +209,11 @@ class StockLotLedgerReportController( |
|
|
|
return v?.toString() == "1" |
|
|
|
} |
|
|
|
|
|
|
|
/** FP-MTMS Version Checklist | Functions Ref. No. 91 | v1.0.0 | 2026-11-06 */ |
|
|
|
private fun createExcel( |
|
|
|
dbData: List<Map<String, Any>>, |
|
|
|
reportPeriodStart: String, |
|
|
|
reportPeriodEnd: String, |
|
|
|
timings: List<String>, |
|
|
|
): ByteArray { |
|
|
|
val workbook = SXSSFWorkbook(100) |
|
|
|
workbook.setCompressTempFiles(true) |
|
|
|
@@ -252,16 +252,6 @@ class StockLotLedgerReportController( |
|
|
|
cellStyle = styles.subtitle |
|
|
|
} |
|
|
|
sheet.addMergedRegion(CellRangeAddress(1, 1, 5, totalColumns - 1)) |
|
|
|
if (timings.isNotEmpty()) { |
|
|
|
val timingRow = sheet.createRow(rowIndex++) |
|
|
|
timingRow.createCell(0).apply { |
|
|
|
setCellValue("耗時:${timings.joinToString(" | ")}") |
|
|
|
cellStyle = styles.subtitle |
|
|
|
} |
|
|
|
sheet.addMergedRegion(CellRangeAddress(2, 2, 0, totalColumns - 1)) |
|
|
|
} else { |
|
|
|
sheet.createRow(rowIndex++) |
|
|
|
} |
|
|
|
|
|
|
|
val headerRowIndex = rowIndex |
|
|
|
val headerRow = sheet.createRow(rowIndex++) |
|
|
|
|