Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
8c1d679e
Commit
8c1d679e
authored
Sep 14, 2022
by
宋珺琪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改以车侦察导出人员轨迹接口bug
parent
e0296fea
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
7 deletions
+40
-7
common/common_utils/src/main/java/com/founder/commonutils/util/ExportExcelUtil.java
+13
-5
pom.xml
+25
-0
service/pom.xml
+2
-2
No files found.
common/common_utils/src/main/java/com/founder/commonutils/util/ExportExcelUtil.java
View file @
8c1d679e
...
@@ -40,19 +40,27 @@ public class ExportExcelUtil<T> {
...
@@ -40,19 +40,27 @@ public class ExportExcelUtil<T> {
value
++;
value
++;
}
}
}
}
//创建Excel工作薄对象
HSSFWorkbook
wb
=
new
HSSFWorkbook
();
HSSFWorkbook
wb
=
new
HSSFWorkbook
();
//创建Excel工作表对象
HSSFSheet
sheet
=
wb
.
createSheet
(
title
);
HSSFSheet
sheet
=
wb
.
createSheet
(
title
);
// 设置列宽
sheet
.
setDefaultColumnWidth
((
short
)
15
);
sheet
.
setDefaultColumnWidth
((
short
)
15
);
//
生成一个
样式
//
创建单元格
样式
HSSFCellStyle
style
=
wb
.
createCellStyle
();
HSSFCellStyle
style
=
wb
.
createCellStyle
();
//创建Excel工作表的行
HSSFRow
row
=
sheet
.
createRow
(
0
);
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
;
HSSFCell
cell
;
Collection
<
String
>
c
=
headersNameMap
.
values
();
// 拿到表格所有标题的value的集合
// 拿到表格所有标题的value的集合
Collection
<
String
>
c
=
headersNameMap
.
values
();
Iterator
<
String
>
it
=
c
.
iterator
();
// 表格标题的迭代器
Iterator
<
String
>
it
=
c
.
iterator
();
// 表格标题的迭代器
// 根据选择的字段生成表头
// 根据选择的字段生成表头
shor
t
size
=
0
;
in
t
size
=
0
;
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
System
.
out
.
println
(
it
);
String
s
=
it
.
toString
();
cell
=
row
.
createCell
(
size
);
cell
=
row
.
createCell
(
size
);
cell
.
setCellValue
(
it
.
next
().
toString
());
cell
.
setCellValue
(
it
.
next
().
toString
());
cell
.
setCellStyle
(
style
);
cell
.
setCellStyle
(
style
);
...
@@ -107,7 +115,7 @@ public class ExportExcelUtil<T> {
...
@@ -107,7 +115,7 @@ public class ExportExcelUtil<T> {
}
else
{
}
else
{
textVal
=
null
;
textVal
=
null
;
}
}
row
.
createCell
(
(
short
)
zdCell
)
row
.
createCell
(
zdCell
)
.
setCellValue
(
textVal
);
.
setCellValue
(
textVal
);
zdCell
++;
zdCell
++;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
pom.xml
View file @
8c1d679e
...
@@ -278,10 +278,35 @@
...
@@ -278,10 +278,35 @@
<artifactId>
poi-scratchpad
</artifactId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
3.17
</version>
<version>
3.17
</version>
</dependency>
</dependency>
<!-- <dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
</dependency>-->
<!--集成EasyExcel -->
<!-- 引入easyExcel的时候,排除easyExcel中自带的poi依赖-->
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel
</artifactId>
<artifactId>
easyexcel
</artifactId>
<version>
2.2.6
</version>
<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>
</dependency>
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
...
...
service/pom.xml
View file @
8c1d679e
...
@@ -77,11 +77,11 @@
...
@@ -77,11 +77,11 @@
<scope>system</scope>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/ojdbc6-10.jar</systemPath>
<systemPath>${project.basedir}/../lib/ojdbc6-10.jar</systemPath>
</dependency>-->
</dependency>-->
<dependency>
<!--
<dependency>
<groupId>org.oracle</groupId>
<groupId>org.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<artifactId>ojdbc6</artifactId>
<version>10</version>
<version>10</version>
</dependency>
</dependency>
-->
<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 -->
<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 -->
<dependency>
<dependency>
<groupId>
org.apache.velocity
</groupId>
<groupId>
org.apache.velocity
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment