|
|
@@ -1,5 +1,9 @@
|
|
|
package com.ssj.sys.controller;
|
|
|
|
|
|
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|
|
+import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
|
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
|
|
|
import com.ssj.framework.basic.common.bean.SplitPage;
|
|
|
import com.ssj.framework.basic.utils.DateHelper;
|
|
|
@@ -22,6 +26,7 @@ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.apache.poi.xssf.usermodel.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -210,27 +215,38 @@ public class ReportController extends BaseController {
|
|
|
searchParams.put("libId", request.getParameter("libId")==null?"":request.getParameter("libId"));
|
|
|
searchParams.put("order_no", request.getParameter("order_no")==null?"":request.getParameter("order_no"));
|
|
|
List<Map<String, Object>> list = libOrderDetailsService.getOrderDetailByOrgCode(searchParams); //数据源
|
|
|
- List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
|
|
|
-
|
|
|
- myColumns3.add(new ExcelColumn("图书馆", "league_name", 20));
|
|
|
- myColumns3.add(new ExcelColumn("订单编号", "order_no", 20));
|
|
|
- myColumns3.add(new ExcelColumn("微信支付业务单号", "transaction_id", 20));
|
|
|
- myColumns3.add(new ExcelColumn("家长姓名", "parent_name", 20));
|
|
|
- myColumns3.add(new ExcelColumn("宝宝姓名", "child_name", 20));
|
|
|
- myColumns3.add(new ExcelColumn("联系方式", "phone", 20));
|
|
|
- myColumns3.add(new ExcelColumn("就读学校", "school", 20));
|
|
|
- myColumns3.add(new ExcelColumn("就读年级", "grade", 20));
|
|
|
- myColumns3.add(new ExcelColumn("支付时间", "create_time", 20));
|
|
|
- myColumns3.add(new ExcelColumn("结束时间", "end_time", 20));
|
|
|
- myColumns3.add(new ExcelColumn("产品类型", "species", 20));
|
|
|
- myColumns3.add(new ExcelColumn("产品明细", "type", 20));
|
|
|
-// myColumns3.add(new ExcelColumn("新签/续费", "d_type", 20));
|
|
|
- myColumns3.add(new ExcelColumn("金额", "price", 20));
|
|
|
-// myColumns3.add(new ExcelColumn("销售人员姓名", "name", 20));
|
|
|
- myColumns3.add(new ExcelColumn("订单来源", "know", 20));
|
|
|
-// myColumns3.add(new ExcelColumn("订单模式", "d_libtype", 20));
|
|
|
-
|
|
|
- CustomizeToExcel.downFile(myColumns3, list, os);
|
|
|
+ List<ExcelExportEntity> myColumns3 = new ArrayList<>();
|
|
|
+ myColumns3.add(new ExcelExportEntity("机构", "league_name", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("订单编号", "order_no", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("微信支付业务单号", "transaction_id", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("家长姓名", "parent_name", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("宝宝姓名", "child_name", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("联系方式", "phone", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("就读学校", "school", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("就读年级", "grade", 20));
|
|
|
+ ExcelExportEntity ee2 = new ExcelExportEntity("支付时间", "create_time", 20);
|
|
|
+ ee2.setFormat("yyyy-MM-dd HH:mm");
|
|
|
+ myColumns3.add(ee2);
|
|
|
+ myColumns3.add(new ExcelExportEntity("产品类型", "describe", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("产品明细", "details", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("金额", "price", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("订单来源", "know", 20));
|
|
|
+ ExcelExportEntity ee1 = new ExcelExportEntity("订单状态", "order_status", 20);
|
|
|
+ ee1.setReplace(new String[]{"已支付_1","已退款_2","财务手动_3","其他_4"});
|
|
|
+ myColumns3.add(ee1);
|
|
|
+ ExcelExportEntity ee3 = new ExcelExportEntity("产品使用开始日", "start_time", 20);
|
|
|
+ ee3.setFormat("yyyy-MM-dd HH:mm");
|
|
|
+ myColumns3.add(ee3);
|
|
|
+ ExcelExportEntity ee4 = new ExcelExportEntity("产品使用结束日", "end_time", 20);
|
|
|
+ ee4.setFormat("yyyy-MM-dd HH:mm");
|
|
|
+ myColumns3.add(ee4);
|
|
|
+ myColumns3.add(new ExcelExportEntity("产品购买单价", "p_price", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("产品购买数量(月份)", "number", 20));
|
|
|
+ myColumns3.add(new ExcelExportEntity("产品总金额", "t_pirce", 20));
|
|
|
+ //产品使用开始日 产品使用结束日 产品购买单价 产品购买数量(月份) 产品总金额
|
|
|
+ Workbook workbook2 = ExcelExportUtil.exportExcel(new ExportParams("", "", ExcelType.XSSF), myColumns3,
|
|
|
+ list);
|
|
|
+ workbook2.write(os);
|
|
|
}else{
|
|
|
XSSFSheet sheet = workbook.getSheetAt(0); //读取第一个工作簿
|
|
|
XSSFRow row;
|