From 5695e312f0d37953e53cd4db898e8f38c51b4a8b Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Mon, 16 Jul 2018 18:47:20 +0800 Subject: [PATCH] fix : AliForExcel --- .../dev/core/impl/AliforexcelServiceImpl.java | 17 ++++++----------- .../manage/mappers/system/ClientMapper.xml | 2 +- 2 files changed, 7 insertions(+), 12 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..02ec2bb27 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; @@ -25,8 +26,8 @@ public class AliforexcelServiceImpl implements AliforexcelService { public JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query) { OutputStream ous = null; try{ - JSONObject params = query.toJsonParam(); - List partners = clientMapper.passPartners(params); + JSONObject params = query.toJsonParam(); + List partners = clientMapper.passPartners(params); httpResponse.setContentType("application/octet-stream;"); httpResponse.setCharacterEncoding("utf-8"); String fileName = "支付宝进件专用--"; @@ -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]); } 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 @@