修改导出 及明细

This commit is contained in:
haozq 2024-11-11 15:04:36 +08:00
parent 0b430c0cc7
commit 65696e950e
2 changed files with 9 additions and 4 deletions

View File

@ -105,7 +105,10 @@ public class ExportController {
public void exportFhList(HttpServletRequest request, HttpServletResponse response,@RequestBody ProPlanInfoVo o) { public void exportFhList(HttpServletRequest request, HttpServletResponse response,@RequestBody ProPlanInfoVo o) {
try { try {
List<ProPlanInfoVo> results = service.getProPlanPage(o); List<ProPlanInfoVo> results = service.getProPlanPage(o);
final int[] num = {1};
results.forEach(vo->{ results.forEach(vo->{
vo.setXh(num[0]);
num[0]++;
if("0".equals(vo.getStatus())){ if("0".equals(vo.getStatus())){
vo.setStatusName("未发货"); vo.setStatusName("未发货");
}else if("1".equals(vo.getStatus())){ }else if("1".equals(vo.getStatus())){
@ -114,10 +117,10 @@ public class ExportController {
vo.setStatusName("全部发货"); vo.setStatusName("全部发货");
} }
vo.setProgress(vo.getProgress()+"%"); vo.setProgress(vo.getProgress()+"%");
});
});
ExportParams exportParams = new ExportParams("发货统计", "发货统计", ExcelType.XSSF); ExportParams exportParams = new ExportParams("发货统计", "发货统计", ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyBean.class, results); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, ProPlanInfoVo.class, results);
response.setContentType("application/vnd.ms-excel"); response.setContentType("application/vnd.ms-excel");
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("发货统计" + ".xlsx", "UTF-8")); response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("发货统计" + ".xlsx", "UTF-8"));
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();

View File

@ -11,6 +11,8 @@ public class ProPlanInfoVo extends PageInfo {
* 工程id * 工程id
*/ */
@Excel(name = "序号", width = 10.0, orderNum = "0") @Excel(name = "序号", width = 10.0, orderNum = "0")
private int xh;
private String proId; private String proId;
/** /**
* 工程名称 * 工程名称
@ -20,7 +22,7 @@ public class ProPlanInfoVo extends PageInfo {
/** /**
* 计划 * 计划
*/ */
@Excel(name = "需求计划数量", width = 10.0,height = 20.0, orderNum = "3") @Excel(name = "需求计划数量", width = 30.0,height = 20.0, orderNum = "3")
private int planNum; private int planNum;
/** /**
* 出库单量 * 出库单量
@ -39,7 +41,7 @@ public class ProPlanInfoVo extends PageInfo {
/** /**
* 最后发货时间 * 最后发货时间
*/ */
@Excel(name = "最后发货时间", width = 10.0,height = 20.0, orderNum = "6") @Excel(name = "最后发货时间", width = 15.0,height = 20.0, orderNum = "6")
private String lastDay; private String lastDay;
/** /**