修改导出 及明细
This commit is contained in:
parent
bfcba4bc5b
commit
e8a745695f
|
|
@ -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<ProNeedInfo> list = service.getDfhList(o);
|
||||
List<ProNeedInfoWfhExport> 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<ProNeedInfo> 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();
|
||||
|
|
|
|||
|
|
@ -158,7 +158,8 @@ public class PlanOutController {
|
|||
@DecryptAndVerify(decryptedClass = ProNeedInfo.class)
|
||||
public PageInfo<ProNeedInfo> getDfhList(EncryptedReq<ProNeedInfo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
PageInfo<ProNeedInfo> pageInfo = service.getDfhList(dto.getData());;
|
||||
List<ProNeedInfo> list = service.getDfhList(dto.getData());
|
||||
PageInfo<ProNeedInfo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ public class PlanApplyBean {
|
|||
* 工程id
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String needNum;
|
||||
|
||||
/**
|
||||
* 项目部分
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ public class ProNeedInfo extends PageInfo {
|
|||
*/
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String curryDay;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ public interface PlanOutService {
|
|||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PageInfo<ProNeedInfo> getDfhList(ProNeedInfo data);
|
||||
List<ProNeedInfo> getDfhList(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 查询工程计划 想去
|
||||
|
|
|
|||
|
|
@ -113,15 +113,14 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<ProNeedInfo> getDfhList(ProNeedInfo data) {
|
||||
public List<ProNeedInfo> getDfhList(ProNeedInfo data) {
|
||||
List<ProNeedInfo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDfhList(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
PageInfo<ProNeedInfo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue