Commit 40b5e282 authored by zengtianlai3's avatar zengtianlai3

下载格式修改

parent 3d53b9e4
...@@ -50,27 +50,23 @@ public class ResourceManager { ...@@ -50,27 +50,23 @@ public class ResourceManager {
//第四步创建单元格 //第四步创建单元格
HSSFCell cell = row.createCell((short)0); //第一个单元格 HSSFCell cell = row.createCell((short)0); //第一个单元格
cell.setCellValue("用户"); //设定值
cell.setCellStyle(style); //内容居中
cell = row.createCell((short)1); //第二个单元格
cell.setCellValue("密码");
cell.setCellStyle(style);
cell = row.createCell((short)2); //第三个单元格
cell.setCellValue("公司名称"); cell.setCellValue("公司名称");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)3); //第四个单元格 cell = row.createCell((short)1); //第二个单元格
cell.setCellValue("应用名称"); cell.setCellValue("应用名称");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)4); //第五个单元格 cell = row.createCell((short)2); //第五个单元格
cell.setCellValue("appKey"); cell.setCellValue("app_id");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)5); //第六个单元格 cell = row.createCell((short)3); //第五个单元格
cell.setCellValue("SN"); cell.setCellValue("app_key");
cell.setCellStyle(style);
cell = row.createCell((short)4); //第六个单元格
cell.setCellValue("sn");
cell.setCellStyle(style); cell.setCellStyle(style);
//第五步插入数据 //第五步插入数据
List<ResourceVo> resourceList = resourceService.getResource(userId); List<ResourceVo> resourceList = resourceService.getResource(userId);
...@@ -79,27 +75,24 @@ public class ResourceManager { ...@@ -79,27 +75,24 @@ public class ResourceManager {
//创建行 //创建行
row = sheet.createRow((short)(i + 1)); row = sheet.createRow((short)(i + 1));
//创建单元格并且添加数据 //创建单元格并且添加数据
cell = row.createCell((short)0); //第一个单元格
cell.setCellValue(resourceVo.getUserName()); cell = row.createCell((short)0); // 第一个单元格
cell.setCellValue(resourceVo.getCompany());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)1); // 第二个单元格 cell = row.createCell((short)1); // 第二个单元格
cell.setCellValue(resourceVo.getPassword()); cell.setCellValue(resourceVo.getAppName());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)2); // 第三个单元格 cell = row.createCell((short)2); // 第三个单元格
cell.setCellValue(resourceVo.getCompany()); cell.setCellValue(resourceVo.getAppKey());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)3); // 第四个单元格 cell = row.createCell((short)3); // 第四个单元格
cell.setCellValue(resourceVo.getAppName());
cell.setCellStyle(style);
cell = row.createCell((short)4); // 第五个单元格
cell.setCellValue(resourceVo.getAppKey()); cell.setCellValue(resourceVo.getAppKey());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell((short)5); // 第六个单元格 cell = row.createCell((short)4); // 第五个单元格
cell.setCellValue(resourceVo.getSn()); cell.setCellValue(resourceVo.getSn());
cell.setCellStyle(style); cell.setCellStyle(style);
} }
...@@ -108,7 +101,6 @@ public class ResourceManager { ...@@ -108,7 +101,6 @@ public class ResourceManager {
sheet.autoSizeColumn((short)2); //调整第三列宽度 sheet.autoSizeColumn((short)2); //调整第三列宽度
sheet.autoSizeColumn((short)3); //调整第四列宽度 sheet.autoSizeColumn((short)3); //调整第四列宽度
sheet.autoSizeColumn((short)4); //调整第五列宽度 sheet.autoSizeColumn((short)4); //调整第五列宽度
sheet.autoSizeColumn((short)5); //调整第六列宽度
wb.write(os); wb.write(os);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment