Commit 8c1d679e by 宋珺琪

修改以车侦察导出人员轨迹接口bug

parent e0296fea
......@@ -40,19 +40,27 @@ public class ExportExcelUtil<T> {
value++;
}
}
//创建Excel工作薄对象
HSSFWorkbook wb = new HSSFWorkbook();
//创建Excel工作表对象
HSSFSheet sheet = wb.createSheet(title);
// 设置列宽
sheet.setDefaultColumnWidth((short) 15);
// 生成一个样式
//创建单元格样式
HSSFCellStyle style = wb.createCellStyle();
//创建Excel工作表的行
HSSFRow row = sheet.createRow(0);
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
System.out.println(HSSFWorkbook.class.getProtectionDomain().getCodeSource().getLocation());
// style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFCell cell;
Collection<String> c = headersNameMap.values();// 拿到表格所有标题的value的集合
// 拿到表格所有标题的value的集合
Collection<String> c = headersNameMap.values();
Iterator<String> it = c.iterator();// 表格标题的迭代器
// 根据选择的字段生成表头
short size = 0;
int size = 0;
while (it.hasNext()) {
System.out.println(it);
String s = it.toString();
cell = row.createCell(size);
cell.setCellValue(it.next().toString());
cell.setCellStyle(style);
......@@ -107,7 +115,7 @@ public class ExportExcelUtil<T> {
} else {
textVal = null;
}
row.createCell((short) zdCell)
row.createCell( zdCell)
.setCellValue(textVal);
zdCell++;
} catch (Exception e) {
......
......@@ -278,10 +278,35 @@
<artifactId>poi-scratchpad</artifactId>
<version>3.17</version>
</dependency>
<!-- <dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
</dependency>-->
<!--集成EasyExcel -->
<!-- 引入easyExcel的时候,排除easyExcel中自带的poi依赖-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
......
......@@ -77,11 +77,11 @@
<scope>system</scope>
<systemPath>${project.basedir}/../lib/ojdbc6-10.jar</systemPath>
</dependency>-->
<dependency>
<!-- <dependency>
<groupId>org.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>10</version>
</dependency>
</dependency>-->
<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 -->
<dependency>
<groupId>org.apache.velocity</groupId>
......
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