Commit 105a5a11 by 王军业

11351

1 parent c6cb30fc
package com.vion.financial.excel;
import java.util.Date;
import cn.afterturn.easypoi.excel.annotation.Excel;
public class ExportModel {
@Excel(name="合同编号",orderNum="0")
private String contract_unid; //合同编号
@Excel(name="所属年份")
private String year; //所属年份
@Excel(name="产品线类型")
private String product_line_type; //产品线类型
@Excel(name="签订日期",format="yyyy-MM-dd")
private Date sign_date; //签订日期
@Excel(name="所属月份")
private String month; //所属月份
@Excel(name="销售员")
private String salesperson_name="-"; //销售员名称
@Excel(name="省")
private String province="-"; //省份
@Excel(name="市")
private String city="-"; //城市
@Excel(name="县")
private String county="-"; //县
@Excel(name="客户名称")
private String customer_name="-"; //顾客名称
@Excel(name="项目名称")
private String project_name="-"; //项目名称
@Excel(name="合同金额")
private Double contract_amount; //合同金额
@Excel(name="暂停金额")
private Double stop_amount; //暂停金额
@Excel(name="坏账金额")
private Double bad_amount; //坏账金额
@Excel(name="豁免金额")
private Double exemptions_amount; //豁免金额
@Excel(name="折扣金额")
private Double deduct_amount; //折扣金额
@Excel(name="累计已收款")
private Double total_reback_amount; //累计已收款
@Excel(name="合同余额")
private Double contract_remain; //合同余额
@Excel(name="合同状态")
private String contract_type; //合同性质,合同 状态
@Excel(name="累计应收款")
private Double total_receive_amount; //累计应收款
@Excel(name="应收账款余额")
private Double total_amount_remain; //应收账款余额
@Excel(name="逾期天数")
private Integer over_days; //逾期天数
@Excel(name="预付款金额")
private Double advance_pay; //预付款金额
@Excel(name="预付款到期日")
private Date advance_pay_date; //预付款到期日
@Excel(name="到货款金额")
private Double arrive_pay; //到货款金额
@Excel(name="发货日期")
private Date deliver_date; //发货日期
@Excel(name="到货款到期日",format="yyyy-MM-dd")
private Date arrive_pay_date; //到货款到期日
@Excel(name="验收款金额")
private Double acceptanc_pay; //验收款金额
@Excel(name="验收日期",format="yyyy-MM-dd")
private Date acceptanc_date; //验收日期
@Excel(name="验收款到期日",format="yyyy-MM-dd")
private Date acceptanc_pay_date; //验货款到期日
@Excel(name="质保金额")
private Double mainten_pay; //质保金额
@Excel(name="质保款到期日",format="yyyy-MM-dd")
private Date mainten_pay_date; //质保款到期日
private String salesperson_unid;
public String getContract_unid() {
return contract_unid;
}
public void setContract_unid(String contract_unid) {
this.contract_unid = contract_unid;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getProduct_line_type() {
return product_line_type;
}
public void setProduct_line_type(String product_line_type) {
this.product_line_type = product_line_type;
}
public Date getSign_date() {
return sign_date;
}
public void setSign_date(Date sign_date) {
this.sign_date = sign_date;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getSalesperson_name() {
return salesperson_name;
}
public void setSalesperson_name(String salesperson_name) {
this.salesperson_name = salesperson_name;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCounty() {
return county;
}
public void setCounty(String county) {
this.county = county;
}
public String getCustomer_name() {
return customer_name;
}
public void setCustomer_name(String customer_name) {
this.customer_name = customer_name;
}
public String getProject_name() {
return project_name;
}
public void setProject_name(String project_name) {
this.project_name = project_name;
}
public Double getContract_amount() {
return contract_amount;
}
public void setContract_amount(Double contract_amount) {
this.contract_amount = contract_amount;
}
public Double getStop_amount() {
return stop_amount;
}
public void setStop_amount(Double stop_amount) {
this.stop_amount = stop_amount;
}
public Double getBad_amount() {
return bad_amount;
}
public void setBad_amount(Double bad_amount) {
this.bad_amount = bad_amount;
}
public Double getExemptions_amount() {
return exemptions_amount;
}
public void setExemptions_amount(Double exemptions_amount) {
this.exemptions_amount = exemptions_amount;
}
public Double getDeduct_amount() {
return deduct_amount;
}
public void setDeduct_amount(Double deduct_amount) {
this.deduct_amount = deduct_amount;
}
public Double getTotal_reback_amount() {
return total_reback_amount;
}
public void setTotal_reback_amount(Double total_reback_amount) {
this.total_reback_amount = total_reback_amount;
}
public Double getContract_remain() {
return contract_remain;
}
public void setContract_remain(Double contract_remain) {
this.contract_remain = contract_remain;
}
public String getContract_type() {
return contract_type;
}
public void setContract_type(String contract_type) {
this.contract_type = contract_type;
}
public Double getTotal_receive_amount() {
return total_receive_amount;
}
public void setTotal_receive_amount(Double total_receive_amount) {
this.total_receive_amount = total_receive_amount;
}
public Double getTotal_amount_remain() {
return total_amount_remain;
}
public void setTotal_amount_remain(Double total_amount_remain) {
this.total_amount_remain = total_amount_remain;
}
public Integer getOver_days() {
return over_days;
}
public void setOver_days(Integer over_days) {
this.over_days = over_days;
}
public Double getAdvance_pay() {
return advance_pay;
}
public void setAdvance_pay(Double advance_pay) {
this.advance_pay = advance_pay;
}
public Date getAdvance_pay_date() {
return advance_pay_date;
}
public void setAdvance_pay_date(Date advance_pay_date) {
this.advance_pay_date = advance_pay_date;
}
public Double getArrive_pay() {
return arrive_pay;
}
public void setArrive_pay(Double arrive_pay) {
this.arrive_pay = arrive_pay;
}
public Date getDeliver_date() {
return deliver_date;
}
public void setDeliver_date(Date deliver_date) {
this.deliver_date = deliver_date;
}
public Date getArrive_pay_date() {
return arrive_pay_date;
}
public void setArrive_pay_date(Date arrive_pay_date) {
this.arrive_pay_date = arrive_pay_date;
}
public Double getAcceptanc_pay() {
return acceptanc_pay;
}
public void setAcceptanc_pay(Double acceptanc_pay) {
this.acceptanc_pay = acceptanc_pay;
}
public Date getAcceptanc_date() {
return acceptanc_date;
}
public void setAcceptanc_date(Date acceptanc_date) {
this.acceptanc_date = acceptanc_date;
}
public Date getAcceptanc_pay_date() {
return acceptanc_pay_date;
}
public void setAcceptanc_pay_date(Date acceptanc_pay_date) {
this.acceptanc_pay_date = acceptanc_pay_date;
}
public Double getMainten_pay() {
return mainten_pay;
}
public void setMainten_pay(Double mainten_pay) {
this.mainten_pay = mainten_pay;
}
public Date getMainten_pay_date() {
return mainten_pay_date;
}
public void setMainten_pay_date(Date mainten_pay_date) {
this.mainten_pay_date = mainten_pay_date;
}
public String getSalesperson_unid() {
return salesperson_unid;
}
public void setSalesperson_unid(String salesperson_unid) {
this.salesperson_unid = salesperson_unid;
}
}
package com.vion.financial.handler;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.ss.usermodel.Workbook;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
public class DownLoad {
private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
ExportParams exportParams) throws Exception {
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
if (workbook != null)
downLoadExcel(fileName, response, workbook);
}
private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws Exception {
try {
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
workbook.write(response.getOutputStream());
} catch (IOException e) {
throw new Exception(e.getMessage());
}
}
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
HttpServletResponse response) throws Exception {
defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!