diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java index 21cb5da8b..2be146cb3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettlementDevController.java @@ -10,6 +10,7 @@ import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import com.alibaba.fastjson.JSONObject; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.InputStreamResource; +import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -169,8 +170,10 @@ public class SettlementDevController { @GetMapping("/settle_batches/{batchId}/settle_report_xlsx") public ResponseEntity getSettlementReportForBatch(@PathVariable int batchId) { + ByteArrayResource body = cleanService.downloadBatchSettleReportXlsx(batchId); return ResponseEntity.ok().contentType(MediaType.APPLICATION_OCTET_STREAM) - .body(cleanService.downloadBatchSettleReportXlsx(batchId)); + .header(HttpHeaders.CONTENT_DISPOSITION, body.getFilename()) + .body(body); } @GetMapping("/details/{detailId}") diff --git a/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java b/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java index c7ca5f24c..9c46058bf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java +++ b/src/main/java/au/com/royalpay/payment/manage/support/poi/ExcelTemplate.java @@ -13,8 +13,8 @@ import java.util.Map; * Create by davep at 2020-03-12 11:59 */ public class ExcelTemplate { - public static final CellStyleFactory STYLE_LEFT = new CellStyleFactory(CellStyle.BORDER_MEDIUM, CellStyle.ALIGN_LEFT); - public static final CellStyleFactory STYLE_RIGHT = new CellStyleFactory(CellStyle.BORDER_MEDIUM, CellStyle.ALIGN_RIGHT); + public static final CellStyleFactory STYLE_LEFT = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_LEFT); + public static final CellStyleFactory STYLE_RIGHT = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_RIGHT); private Map sheets; public ExcelTemplate() { @@ -104,7 +104,7 @@ public class ExcelTemplate { rowNum++; Workbook workbook = sheet.getWorkbook(); Font boldFont = PoiUtils.initBoldFont(workbook); - CellStyle titleStyle = new CellStyleFactory(CellStyle.BORDER_MEDIUM, CellStyle.ALIGN_CENTER).buildCellStyle(workbook, boldFont); + CellStyle titleStyle = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_CENTER).buildCellStyle(workbook, boldFont); for (int i = 0, len = columns.size(); i < len; i++) { ColumnTemplate col = columns.get(i); Cell cell = titleRow.createCell(i, Cell.CELL_TYPE_STRING);