package com.chinaztt.mes.report.service;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.chinaztt.mes.report.entity.Template;
|
|
import java.util.Map;
|
|
|
/**
|
* @Author: zhangxy
|
* @Date: 2021-06-03 11:08
|
*/
|
|
public interface JasperReportService extends IService<Template> {
|
|
/**
|
* 报表类型
|
*/
|
enum ReportType {
|
/**
|
* PDF
|
*/
|
PDF("application/pdf", "pdf"),
|
/**
|
* CSV
|
*/
|
CSV("text/csv", "csv"),
|
/**
|
* XLS
|
*/
|
XLS("application/vnd.ms-excel", "xls"),
|
/**
|
* XLSX
|
*/
|
XLSX("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx");
|
|
private final String mimeType;
|
|
private final String extension;
|
|
ReportType(final String mimeType, final String extension) {
|
this.mimeType = mimeType;
|
this.extension = extension;
|
}
|
|
public String getMimeType() {
|
return mimeType;
|
}
|
|
public String getExtension() {
|
return extension;
|
}
|
}
|
|
|
/**
|
* 根据类型生成报表
|
* @param templatePath
|
* @param type
|
* @param params
|
* @return
|
*/
|
public byte[] gen(final String templatePath, final ReportType type, final Map<String, Object> params);
|
}
|