diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index e9b33d0ab..23a93e8c4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -42,8 +42,6 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.joda.time.DateTime; @@ -630,11 +628,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider JSONObject clearTransation = listClearingTransactions(client_id, clearingDetailId, partner); resp.setContentType("application/octet-stream;"); Date reportDate = clearTransation.getDate("report_date"); - resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyy-MM-dd") + ".xls"); + resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyy-MM-dd") + ".xlsx"); ous = resp.getOutputStream(); - HSSFWorkbook wb = new HSSFWorkbook(); + Workbook wb = new XSSFWorkbook(); Cell cell = null; - HSSFFont font = wb.createFont(); + Font font = wb.createFont(); font.setBoldweight(Font.BOLDWEIGHT_BOLD); font.setFontHeightInPoints((short) 10); CellStyle analysisStyle = wb.createCellStyle(); @@ -660,7 +658,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_time")); row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getInteger("gateway")).getTradeType()); + if (settle.getInteger("gateway") != null) { + row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); + } else { + row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("-"); + } row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString()); row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_type")); row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency"));