From 5b5085d410b0b14f04df24e5fd141de2090dce76 Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Mon, 16 Jul 2018 18:35:19 +0800 Subject: [PATCH 1/2] fix : AliForExcel --- .../dev/core/impl/AliforexcelServiceImpl.java | 15 +++++---------- .../manage/mappers/system/ClientMapper.xml | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index d62f770d9..172311d44 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -5,9 +5,10 @@ import au.com.royalpay.payment.manage.dev.core.AliforexcelService; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import com.alibaba.fastjson.JSONObject; import org.apache.commons.io.IOUtils; -import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -34,18 +35,12 @@ public class AliforexcelServiceImpl implements AliforexcelService { httpResponse.addHeader("Content-Disposition", "attachment; filename=" + codedFileName +query.getDatefrom() + "~" +query.getDateto() + ".xls"); ous = httpResponse.getOutputStream(); HSSFWorkbook wb = new HSSFWorkbook(); - HSSFFont font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 15); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); Sheet sheet = wb.createSheet("支付宝进件专用" ); sheet.createFreezePane(1, 2); sheet.setDefaultColumnWidth((short) 25); int rowNum = 0; Row row = sheet.createRow(rowNum); - String[] title = {"公司注册名称", "对外营业名称", "","所属行业(数字代码即可)","地址","eg. Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00\n请注意格式","+61 452296105\n" + - "请注意格式","youtube视频介绍链接(若有)","门店介绍","标签"}; + String[] title = {"Company name", "Store name", "Partner Code","Industry","Store address","Business hours","Contact information","Video link (optional)","Store description","Tags"}; for (int i = 0; i < title.length; i++) { row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); } @@ -59,7 +54,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("business_hours")); row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_phone")); row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("")); - row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("description")); + row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("merchant_introduction")); row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("")); } wb.write(ous); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index 7224d8e2d..ef9a4a2ff 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -168,7 +168,7 @@