Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
17a46be1
Commit
17a46be1
authored
5 years ago
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excel导出功能
parent
f52aa9b7
master
1.0-SNAPSHOT
test
ver1.0
ver1.1
ver1.2
ver1.3
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
ObjectHelper.java
...src/main/java/com/yanzuoguang/util/base/ObjectHelper.java
+1
-1
FileHelper.java
...src/main/java/com/yanzuoguang/util/helper/FileHelper.java
+8
-3
ExcelConsole.java
...-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
+1
-2
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/base/ObjectHelper.java
View file @
17a46be1
...
@@ -559,7 +559,7 @@ public class ObjectHelper {
...
@@ -559,7 +559,7 @@ public class ObjectHelper {
public
static
<
T
>
ArrayList
<
T
>
getList
(
Class
<
T
>
cls
,
Object
froms
)
{
public
static
<
T
>
ArrayList
<
T
>
getList
(
Class
<
T
>
cls
,
Object
froms
)
{
ArrayList
<
T
>
tos
=
new
ArrayList
<
T
>();
ArrayList
<
T
>
tos
=
new
ArrayList
<
T
>();
if
(
froms
instanceof
List
)
{
if
(
froms
instanceof
List
)
{
List
vCodeFrom
=
(
List
)
((
froms
instanceof
List
)
?
froms
:
new
ArrayList
<>())
;
List
vCodeFrom
=
(
List
)
froms
;
for
(
Object
from
:
vCodeFrom
)
{
for
(
Object
from
:
vCodeFrom
)
{
if
(
StringHelper
.
isEmpty
(
from
))
{
if
(
StringHelper
.
isEmpty
(
from
))
{
continue
;
continue
;
...
...
This diff is collapsed.
Click to expand it.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/FileHelper.java
View file @
17a46be1
...
@@ -92,9 +92,14 @@ public class FileHelper {
...
@@ -92,9 +92,14 @@ public class FileHelper {
if
(
file
.
exists
())
{
if
(
file
.
exists
())
{
throw
new
CodeException
(
"文件删除失败"
);
throw
new
CodeException
(
"文件删除失败"
);
}
}
// 创建文件
// 创建文件夹
file
.
getParentFile
().
mkdirs
();
File
parentFile
=
file
.
getParentFile
();
if
(
parentFile
!=
null
&&
!
parentFile
.
exists
())
{
parentFile
.
mkdirs
();
}
if
(!
parentFile
.
exists
())
{
throw
new
CodeException
(
"创建文件夹失败"
);
}
file
.
createNewFile
();
file
.
createNewFile
();
// 写入文件
// 写入文件
RandomAccessFile
raf
=
new
RandomAccessFile
(
file
,
"rwd"
);
RandomAccessFile
raf
=
new
RandomAccessFile
(
file
,
"rwd"
);
...
...
This diff is collapsed.
Click to expand it.
yzg-util-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
View file @
17a46be1
...
@@ -336,8 +336,7 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
...
@@ -336,8 +336,7 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
workbook
=
null
;
workbook
=
null
;
}
}
File
file
=
new
File
(
this
.
getFileName
());
File
file
=
new
File
(
this
.
getFileName
());
if
(
file
.
exists
())
{
if
(
file
.
exists
()
&&
file
.
delete
())
{
file
.
delete
();
}
}
return
this
;
return
this
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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