修改导出 及明细
This commit is contained in:
parent
0159f76e77
commit
c2282eed91
|
|
@ -161,7 +161,34 @@ public class ExportController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据 概览-导出
|
||||
* @param request
|
||||
* @param response
|
||||
* @param o
|
||||
*/
|
||||
@PostMapping("exportDataInfo")
|
||||
public void exportDataInfo(HttpServletRequest request, HttpServletResponse response, ProNeedInfo o) {
|
||||
try {
|
||||
List<ProNeedInfo> list = service.getDataInfoByPage(o);
|
||||
List<ProNeedEXportInfo> exports=new ArrayList<>();
|
||||
list.forEach(vo->{
|
||||
ProNeedEXportInfo voo=new ProNeedEXportInfo();
|
||||
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
|
||||
|
|
@ -178,11 +205,10 @@ public class ExportController {
|
|||
BeanUtils.copyProperties(vo, voo);
|
||||
exports.add(voo);
|
||||
});
|
||||
|
||||
ExportParams exportParams = new ExportParams("待发货", "待发货", ExcelType.XSSF);
|
||||
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"));
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("需求计划量" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
|
|
@ -192,6 +218,34 @@ public class ExportController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 来源,明细导出
|
||||
* @param request
|
||||
* @param response
|
||||
* @param o
|
||||
*/
|
||||
@PostMapping("exportDetails")
|
||||
public void exportDetails(HttpServletRequest request, HttpServletResponse response, ProNeedInfo o) {
|
||||
try {
|
||||
List<PlanApplyBean> list = service.getDataPlanByPage(o);
|
||||
List<PlanApplyBeanExport> exports=new ArrayList<>();
|
||||
list.forEach(vo->{
|
||||
PlanApplyBeanExport voo=new PlanApplyBeanExport();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,18 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.http.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 出库 控制层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,284 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*计划申请实体类
|
||||
* @author xj
|
||||
*/
|
||||
@Data
|
||||
public class PlanApplyBeanExport {
|
||||
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private String id;
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@Excel(name = "计划编号", width = 10.0,height = 20.0, orderNum = "1")
|
||||
private String code;
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称", width = 10.0,height = 20.0, orderNum = "2")
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 需要时间
|
||||
*/
|
||||
@Excel(name = "需用日期", width = 10.0,height = 20.0, orderNum = "3")
|
||||
private String needTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "申请人", width = 10.0,height = 20.0, orderNum = "4")
|
||||
private String creator;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "申请时间", width = 10.0,height = 20.0, orderNum = "5")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 项目的
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 树妖数量
|
||||
*/
|
||||
@Excel(name = "需要数量", width = 10.0,height = 20.0, orderNum = "6")
|
||||
private String needNum;
|
||||
|
||||
/**
|
||||
* 项目部分
|
||||
*/
|
||||
@Excel(name = "项目部分", width = 10.0,height = 20.0, orderNum = "7")
|
||||
private String projectPart;
|
||||
|
||||
/**
|
||||
* 施工地点
|
||||
*/
|
||||
@Excel(name = "施工地点", width = 10.0,height = 20.0, orderNum = "8")
|
||||
private String projectContent;
|
||||
|
||||
|
||||
/**
|
||||
* 施工地点
|
||||
*/
|
||||
@Excel(name = "备注", width = 10.0,height = 20.0, orderNum = "9")
|
||||
private String remark;
|
||||
|
||||
private String statusName;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updater;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
|
||||
private String keyWord;
|
||||
|
||||
|
||||
private String statusType;
|
||||
|
||||
|
||||
private String moduleId;
|
||||
|
||||
private String jsonData;
|
||||
|
||||
private List<PlanDataDetailBean> details;
|
||||
|
||||
|
||||
private List<AuditBean> auditList;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
public String getProId() {
|
||||
return proId;
|
||||
}
|
||||
|
||||
public void setProId(String proId) {
|
||||
this.proId = proId;
|
||||
}
|
||||
|
||||
public String getAuditStatus() {
|
||||
return auditStatus;
|
||||
}
|
||||
|
||||
public void setAuditStatus(String auditStatus) {
|
||||
this.auditStatus = auditStatus;
|
||||
}
|
||||
|
||||
public List<AuditBean> getAuditList() {
|
||||
return auditList;
|
||||
}
|
||||
|
||||
public void setAuditList(List<AuditBean> auditList) {
|
||||
this.auditList = auditList;
|
||||
}
|
||||
|
||||
public List<PlanDataDetailBean> getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setDetails(List<PlanDataDetailBean> details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getJsonData() {
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
public void setJsonData(String jsonData) {
|
||||
this.jsonData = jsonData;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getProjectPart() {
|
||||
return projectPart;
|
||||
}
|
||||
|
||||
public void setProjectPart(String projectPart) {
|
||||
this.projectPart = projectPart;
|
||||
}
|
||||
|
||||
public String getProjectContent() {
|
||||
return projectContent;
|
||||
}
|
||||
|
||||
public void setProjectContent(String projectContent) {
|
||||
this.projectContent = projectContent;
|
||||
}
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
public String getNeedTime() {
|
||||
return needTime;
|
||||
}
|
||||
|
||||
public void setNeedTime(String needTime) {
|
||||
this.needTime = needTime;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getUpdater() {
|
||||
return updater;
|
||||
}
|
||||
|
||||
public void setUpdater(String updater) {
|
||||
this.updater = updater;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getKeyWord() {
|
||||
return keyWord;
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
public String getStatusType() {
|
||||
return statusType;
|
||||
}
|
||||
|
||||
public void setStatusType(String statusType) {
|
||||
this.statusType = statusType;
|
||||
}
|
||||
|
||||
public String getProName() {
|
||||
return proName;
|
||||
}
|
||||
|
||||
public void setProName(String proName) {
|
||||
this.proName = proName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
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 ProNeedEXportInfo extends PageInfo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private String id;
|
||||
/**
|
||||
* 计划内外
|
||||
*/
|
||||
|
||||
private String typeName;
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String curryDay;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
/**
|
||||
* 未发货量
|
||||
*/
|
||||
private int wfhNum;
|
||||
/**
|
||||
* 库存量
|
||||
*/
|
||||
private int kuNum;
|
||||
/**
|
||||
* 差量
|
||||
*/
|
||||
private int clNum;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@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 = "10")
|
||||
private int diff;
|
||||
/**
|
||||
* 工程数量
|
||||
*/
|
||||
@Excel(name = "工程数", width = 10.0,height = 20.0, orderNum = "11")
|
||||
private String proNum;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
@Excel(name = "需求计划数", width = 10.0,height = 20.0, orderNum = "12")
|
||||
private String planNum;
|
||||
/**
|
||||
* 调整量
|
||||
*/
|
||||
|
||||
private int tzNum;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 10.0,height = 20.0, orderNum = "13")
|
||||
private String remarks;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String outId;
|
||||
|
||||
/**
|
||||
* 数据源 1 计划 2 新增
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
|
||||
/**
|
||||
* 调整数量
|
||||
*/
|
||||
private int num;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String typeSource;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -219,21 +219,21 @@
|
|||
t_plan_apply plan
|
||||
left join bm_project pro on plan.project_id=pro.ID
|
||||
<where>
|
||||
plan.project_id=#{proId} and plan.status_type=1
|
||||
<if test="param.keyWord !=null and param.keyWord !=''">
|
||||
plan.project_id=#{proId} and plan.status_type=1
|
||||
<if test="keyWord !=null and keyWord !=''">
|
||||
and (
|
||||
pro.name like concat('%',#{param.keyWord},'%') or
|
||||
plan.creator like concat('%',#{param.keyWord},'%') or
|
||||
plan.CODE like concat('%',#{param.keyWord},'%') or
|
||||
plan.need_time like concat('%',#{param.keyWord},'%') or
|
||||
plan.project_part like concat('%',#{param.keyWord},'%') or
|
||||
plan.project_content like concat('%',#{param.keyWord},'%') or
|
||||
plan.remark like concat('%',#{param.keyWord},'%')
|
||||
pro.name like concat('%',#{keyWord},'%') or
|
||||
plan.creator like concat('%',#{keyWord},'%') or
|
||||
plan.CODE like concat('%',#{keyWord},'%') or
|
||||
plan.need_time like concat('%',#{keyWord},'%') or
|
||||
plan.project_part like concat('%',#{keyWord},'%') or
|
||||
plan.project_content like concat('%',#{keyWord},'%') or
|
||||
plan.remark like concat('%',#{keyWord},'%')
|
||||
)
|
||||
|
||||
</if>
|
||||
<if test="param.auditStatus !=null and param.auditStatus !=''">
|
||||
and plan.STATUS=#{param.auditStatus}
|
||||
<if test="auditStatus !=null and auditStatus !=''">
|
||||
and plan.STATUS=#{auditStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by plan.update_time DESC
|
||||
|
|
@ -260,6 +260,12 @@
|
|||
<if test='typeSource=="2"'>
|
||||
and pni.fh_num>0
|
||||
</if>
|
||||
<if test="module!=null and module!=''">
|
||||
and pni.`module` like concat('%',#{module},'%')
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
and pni.`name` like concat('%',#{name},'%')
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue