//得到所有分表名
List<String> tableName = aalarmService.findTableNames();
Map<Integer,List<ExportHtml>> htmlMap = new HashMap<Integer,List<ExportHtml>>();
//存放终端用户所有的预警信息
List<ExportHtml> htmlList = new ArrayList<ExportHtml>();
//根据 reginfoCode 查询所有分表 终端用户预警信息
for (int i = 0; i < tableName.size(); i++) {
htmlList = aalarmService.findDocAlardata(tableName.get(i).toString(),reginfoCode);
htmlMap.put(i,htmlList);
}
//开始生成HTML文件
StringBuilder stringHtml = new StringBuilder();
try {
File file = null;
Date now = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd");
String time = dateFormat.format(now);
stringHtml.append("<html>");
stringHtml.append("<head>");
stringHtml.append("<title>报告</title>");
stringHtml.append("<meta http-equiv=\"Content-Type\&#
JAVA 数据导出为HTML
最新推荐文章于 2024-08-01 15:05:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)