Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
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
liyang
sts网站
Commits
fd831d5a
Commit
fd831d5a
authored
Nov 28, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excel支持导入Boolean型数据
parent
e83412b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
ExcelUtil.java
...n/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+4
-0
ReflectUtils.java
...ain/java/com/ruoyi/common/utils/reflect/ReflectUtils.java
+4
-0
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
View file @
fd831d5a
...
@@ -274,6 +274,10 @@ public class ExcelUtil<T>
...
@@ -274,6 +274,10 @@ public class ExcelUtil<T>
val
=
DateUtil
.
getJavaDate
((
Double
)
val
);
val
=
DateUtil
.
getJavaDate
((
Double
)
val
);
}
}
}
}
else
if
(
Boolean
.
TYPE
==
fieldType
||
Boolean
.
class
==
fieldType
)
{
val
=
Convert
.
toBool
(
val
,
false
);
}
if
(
StringUtils
.
isNotNull
(
fieldType
))
if
(
StringUtils
.
isNotNull
(
fieldType
))
{
{
Excel
attr
=
field
.
getAnnotation
(
Excel
.
class
);
Excel
attr
=
field
.
getAnnotation
(
Excel
.
class
);
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java
View file @
fd831d5a
...
@@ -204,6 +204,10 @@ public class ReflectUtils
...
@@ -204,6 +204,10 @@ public class ReflectUtils
args
[
i
]
=
DateUtil
.
getJavaDate
((
Double
)
args
[
i
]);
args
[
i
]
=
DateUtil
.
getJavaDate
((
Double
)
args
[
i
]);
}
}
}
}
else
if
(
cs
[
i
]
==
boolean
.
class
||
cs
[
i
]
==
Boolean
.
class
)
{
args
[
i
]
=
Convert
.
toBool
(
args
[
i
]);
}
}
}
}
}
return
(
E
)
method
.
invoke
(
obj
,
args
);
return
(
E
)
method
.
invoke
(
obj
,
args
);
...
...
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