diff --git a/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java b/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java index a89765c..d7cbefb 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java @@ -148,7 +148,6 @@ public class ExportController { BeanUtils.copyProperties(vo, voo); exports.add(voo); }); - ExportParams exportParams = new ExportParams("全部发货", "全部发货", ExcelType.XSSF); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyBean.class, exports); response.setContentType("application/vnd.ms-excel"); @@ -163,9 +162,40 @@ public class ExportController { } + /** + * 导出 待发货-接口 + * @param request + * @param response + * @param o + */ + @PostMapping("exportDfhList") + public void exportDfhList(HttpServletRequest request, HttpServletResponse response, ProNeedInfo o) { + try { + List list = service.getDfhList(o); + List exports=new ArrayList<>(); + list.forEach(vo->{ + ProNeedInfoWfhExport voo=new ProNeedInfoWfhExport(); + BeanUtils.copyProperties(vo, voo); + exports.add(voo); + }); + + ExportParams exportParams = new ExportParams("待发货", "待发货", ExcelType.XSSF); + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyBean.class, exports); + response.setContentType("application/vnd.ms-excel"); + response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("待发货" + ".xlsx", "UTF-8")); + ServletOutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + outputStream.close(); + workbook.close(); + } catch (Exception e) { + log.error(e.toString(), e); + } + } + + /** - * 导出 全部发货 -批次 + * 导出 批次发货 -批次 * @param request * @param response * @param o @@ -174,13 +204,11 @@ public class ExportController { public void exportPcList(HttpServletRequest request, HttpServletResponse response, ProNeedInfo o) { try { List list = service.getOutDetailList(o); - - - - ExportParams exportParams = new ExportParams("全部发货", "全部发货", ExcelType.XSSF); + String day=o.getCurryDay(); + ExportParams exportParams = new ExportParams(day+"批次发货", day+"批次发货", ExcelType.XSSF); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyBean.class, list); 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(day+"批次发货" + ".xlsx", "UTF-8")); ServletOutputStream outputStream = response.getOutputStream(); workbook.write(outputStream); outputStream.close(); diff --git a/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanOutController.java b/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanOutController.java index 4be6a00..0644444 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanOutController.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanOutController.java @@ -158,7 +158,8 @@ public class PlanOutController { @DecryptAndVerify(decryptedClass = ProNeedInfo.class) public PageInfo getDfhList(EncryptedReq dto) { PageHelper.startPage(dto.getPageNum(),dto.getPageSize()); - PageInfo pageInfo = service.getDfhList(dto.getData());; + List list = service.getDfhList(dto.getData()); + PageInfo pageInfo = new PageInfo<>(list); return pageInfo; } diff --git a/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanApplyBean.java b/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanApplyBean.java index 6888d0a..a8787d2 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanApplyBean.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanApplyBean.java @@ -52,6 +52,11 @@ public class PlanApplyBean { * 工程id */ private String projectId; + + /** + * 工程id + */ + private String needNum; /** * 项目部分 diff --git a/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfo.java b/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfo.java index c551203..7a4a348 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfo.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfo.java @@ -26,6 +26,11 @@ public class ProNeedInfo extends PageInfo { */ private String proId; + /** + * 工程id + */ + private String curryDay; + /** * 工程名称 */ diff --git a/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfoWfhExport.java b/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfoWfhExport.java new file mode 100644 index 0000000..cec78d4 --- /dev/null +++ b/src/main/java/com/bonus/gzgqj/business/plan/entity/ProNeedInfoWfhExport.java @@ -0,0 +1,129 @@ +package com.bonus.gzgqj.business.plan.entity; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工程需要数据 + * @author 黑子 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class ProNeedInfoWfhExport extends PageInfo { + /** + * 主键 + */ + @Excel(name = "序号", width = 10.0, orderNum = "0") + private String id; + /** + * 计划内外 + */ + private String typeName; + /** + * 工程id + */ + private String proId; + + /** + * 工程名称 + */ + private String proName; + /** + * 类型 + */ + @Excel(name = "物机类型", width = 10.0,height = 20.0, orderNum = "3") + private String type; + /** + * 名称 + */ + @Excel(name = "物机名称", width = 10.0,height = 20.0, orderNum = "4") + private String name; + /** + * 规格型号 + */ + @Excel(name = "规格型号", width = 10.0,height = 20.0, orderNum = "5") + private String module; + + /** + * 单位 + */ + @Excel(name = "单位", width = 10.0,height = 20.0, orderNum = "6") + private String unit; + + /** + * 进度 + */ + private String progress; + /** + * 规格id + */ + private String moduleId; + /** + * 需求类型 1计划 2新增 + */ + private String needType; + + + + /** + * 需要数量 + */ + @Excel(name = "需要量", width = 10.0,height = 20.0, orderNum = "8") + private int needNum; + /** + * 发货数量 + */ + @Excel(name = "已发货量", width = 10.0,height = 20.0, orderNum = "9") + private int fhNum; + /** + * 差额 + */ + @Excel(name = "未发货量", width = 10.0,height = 20.0, orderNum = "9") + private int diff; + + /** + * 调整量 + */ + @Excel(name = "不发货量", width = 10.0,height = 20.0, orderNum = "11") + private int tzNum; + /** + * 备注 + */ + @Excel(name = "备注", width = 10.0,height = 20.0, orderNum = "12") + private String remarks; + + + /** + * 备注 + */ + private String outId; + + /** + * 数据源 1 计划 2 新增 + */ + private String dataType; + + + /** + * 调整数量 + */ + private int num; + + + /** + * 计划数量 + */ + private String planNum; + /** + * 工程数量 + */ + private String proNum; + + /** + * 工程数量 + */ + private String typeSource; + + +} diff --git a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutService.java b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutService.java index 118bf5d..e60debf 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutService.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutService.java @@ -81,7 +81,7 @@ public interface PlanOutService { * @param data * @return */ - PageInfo getDfhList(ProNeedInfo data); + List getDfhList(ProNeedInfo data); /** * 查询工程计划 想去 diff --git a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutServiceImpl.java b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutServiceImpl.java index 0fb6c9d..aec76b9 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutServiceImpl.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanOutServiceImpl.java @@ -113,15 +113,14 @@ public class PlanOutServiceImpl implements PlanOutService{ * @return */ @Override - public PageInfo getDfhList(ProNeedInfo data) { + public List getDfhList(ProNeedInfo data) { List list = new ArrayList<>(); try { list = mapper.getDfhList(data); } catch (Exception e) { log.error(e.toString(),e); } - PageInfo pageInfo = new PageInfo<>(list); - return pageInfo; + return list; } @Override diff --git a/src/main/resources/mappers/plan/PlanOutMapper.xml b/src/main/resources/mappers/plan/PlanOutMapper.xml index 83f1837..1178732 100644 --- a/src/main/resources/mappers/plan/PlanOutMapper.xml +++ b/src/main/resources/mappers/plan/PlanOutMapper.xml @@ -275,8 +275,8 @@ plan.create_time createTime, plan.remark, plan.STATUS, - plan.updater, - plan.status_type statusType ,tdd.model_id + plan.updater,,tdd.need_num needNum , + plan.status_type statusType ,tdd.model_id moduleId FROM t_plan_apply plan left join bm_project pro on plan.project_id=pro.ID