BUG修改
This commit is contained in:
parent
a73d8eda37
commit
54174e1805
|
|
@ -1,9 +1,14 @@
|
|||
package com.bonus.gzgqj.business.plan.controller;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartBackVo;
|
||||
import com.bonus.gzgqj.business.plan.entity.AuditBean;
|
||||
import com.bonus.gzgqj.business.plan.entity.PlanApplyAuditBean;
|
||||
import com.bonus.gzgqj.business.plan.entity.PlanApplyBean;
|
||||
|
|
@ -15,11 +20,16 @@ import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* 计划审核
|
||||
|
|
@ -64,11 +74,37 @@ public class PlanAuditController {
|
|||
public ServerResponse planAudit(EncryptedReq<AuditBean> dto) {
|
||||
return service.planAudit(dto.getData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出需求计划
|
||||
* @param
|
||||
* @param
|
||||
* @param
|
||||
*/
|
||||
@PostMapping("export")
|
||||
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody PlanApplyAuditBean dto) {
|
||||
try {
|
||||
List<PlanApplyAuditBean> list = service.findByPage(dto);;
|
||||
final int[] num = {1};
|
||||
list.forEach(vo->{
|
||||
vo.setXh(num[0]);
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("配件退回", "配件退回", ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyAuditBean.class, list);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -7,13 +10,16 @@ import java.util.List;
|
|||
* @author xj
|
||||
|
||||
*/
|
||||
@Data
|
||||
public class PlanApplyAuditBean {
|
||||
|
||||
|
||||
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int xh;
|
||||
private String id;
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@Excel(name = "计划单号", width = 10.0, orderNum = "1")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
|
|
@ -24,6 +30,7 @@ public class PlanApplyAuditBean {
|
|||
/**
|
||||
* 工程id
|
||||
*/
|
||||
@Excel(name = "工程名称", width = 10.0, orderNum = "1")
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
|
|
@ -93,163 +100,6 @@ public class PlanApplyAuditBean {
|
|||
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue