This commit is contained in:
parent
127b0bc0bc
commit
dc021a35fd
|
|
@ -89,8 +89,13 @@ public class ExportController {
|
|||
public void exportDetail(HttpServletRequest request, HttpServletResponse response,@RequestBody PlanApplyBean o) {
|
||||
try {
|
||||
List<PlanDataDetailBean> results = planService.getDetailsList(o);
|
||||
final int[] num = {1};
|
||||
results.forEach(vo->{
|
||||
vo.setXh(num[0]);
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("机具明细", "机具明细", ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyBean.class, results);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanDataDetailBean.class, results);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("机具明细" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 新增内容详情
|
||||
|
|
@ -8,12 +9,15 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class PlanDataDetailBean {
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int xh;
|
||||
|
||||
private String applyId;
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +53,7 @@ public class PlanDataDetailBean {
|
|||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 10.0,height = 20.0, orderNum = "1")
|
||||
@Excel(name = "备注", width = 10.0,height = 20.0, orderNum = "9")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@
|
|||
<select id="getDetailsList" parameterType="com.bonus.gzgqj.business.plan.entity.PlanApplyBean" resultType="com.bonus.gzgqj.business.plan.entity.PlanDataDetailBean">
|
||||
select id,apply_id applyId,model_id moduleId,
|
||||
need_num needNum,need_day times,
|
||||
remark,type,name typeName,
|
||||
remark remarks,type,name typeName,
|
||||
module,unit
|
||||
from t_plan_details
|
||||
where apply_id=#{id} ORDER BY id asc
|
||||
|
|
|
|||
Loading…
Reference in New Issue