master
kira 6 years ago
commit 1cceedf15a

@ -5,9 +5,10 @@ import au.com.royalpay.payment.manage.dev.core.AliforexcelService;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; 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 org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -25,8 +26,8 @@ public class AliforexcelServiceImpl implements AliforexcelService {
public JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query) { public JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query) {
OutputStream ous = null; OutputStream ous = null;
try{ try{
JSONObject params = query.toJsonParam(); JSONObject params = query.toJsonParam();
List<JSONObject> partners = clientMapper.passPartners(params); List<JSONObject> partners = clientMapper.passPartners(params);
httpResponse.setContentType("application/octet-stream;"); httpResponse.setContentType("application/octet-stream;");
httpResponse.setCharacterEncoding("utf-8"); httpResponse.setCharacterEncoding("utf-8");
String fileName = "支付宝进件专用--"; String fileName = "支付宝进件专用--";
@ -34,18 +35,12 @@ public class AliforexcelServiceImpl implements AliforexcelService {
httpResponse.addHeader("Content-Disposition", "attachment; filename=" + codedFileName +query.getDatefrom() + "~" +query.getDateto() + ".xls"); httpResponse.addHeader("Content-Disposition", "attachment; filename=" + codedFileName +query.getDatefrom() + "~" +query.getDateto() + ".xls");
ous = httpResponse.getOutputStream(); ous = httpResponse.getOutputStream();
HSSFWorkbook wb = new HSSFWorkbook(); 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 sheet = wb.createSheet("支付宝进件专用" );
sheet.createFreezePane(1, 2); sheet.createFreezePane(1, 2);
sheet.setDefaultColumnWidth((short) 25); sheet.setDefaultColumnWidth((short) 25);
int rowNum = 0; int rowNum = 0;
Row row = sheet.createRow(rowNum); Row row = sheet.createRow(rowNum);
String[] title = {"公司注册名称", "对外营业名称", "","所属行业(数字代码即可)","地址","eg. Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00\n请注意格式","+61 452296105\n" + String[] title = {"Company name", "Store name", "Partner Code","Industry","Store address","Business hours","Contact information","Video link (optional)","Store description","Tags"};
"请注意格式","youtube视频介绍链接若有","门店介绍","标签"};
for (int i = 0; i < title.length; i++) { for (int i = 0; i < title.length; i++) {
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
} }

@ -168,7 +168,7 @@
</select> </select>
<select id="passPartners" resultType="com.alibaba.fastjson.JSONObject"> <select id="passPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT
company_name,short_name,client_moniker,alipayindustry,address,suburb,state,postcode,business_hours,company_phone,description company_name,short_name,client_moniker,alipayindustry,address,suburb,state,postcode,business_hours,company_phone,merchant_introduction
from sys_clients from sys_clients
<where> <where>
(approve_result=1 or (approve_result=2 and (source=1 or source=2))) (approve_result=1 or (approve_result=2 and (source=1 or source=2)))

Loading…
Cancel
Save