Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
be54188b
Commit
be54188b
authored
Aug 26, 2020
by
RuoYi
Browse files
导出Excel调整targetAttr获取值方法,防止get方法不规范
parent
a4e2339f
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
View file @
be54188b
...
...
@@ -6,7 +6,6 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
...
...
@@ -864,9 +863,9 @@ public class ExcelUtil<T>
if
(
StringUtils
.
isNotEmpty
(
name
))
{
Class
<?>
clazz
=
o
.
getClass
();
String
methodName
=
"get"
+
name
.
substring
(
0
,
1
).
toUpperCase
()
+
name
.
substring
(
1
);
Method
method
=
clazz
.
getMethod
(
methodNam
e
);
o
=
method
.
invoke
(
o
);
Field
field
=
clazz
.
getDeclaredField
(
name
);
field
.
setAccessible
(
tru
e
);
o
=
field
.
get
(
o
);
}
return
o
;
}
...
...
Write
Preview
Supports
Markdown
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