Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
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
s_guodong
gjjs-bd-common
Commits
56e9bb2d
Commit
56e9bb2d
authored
Nov 03, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回第三方数据的total
parent
dca7e991
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
ReflectUtil.java
...ness/src/main/java/com/ceb/gjjs/mda/util/ReflectUtil.java
+19
-0
ModuleList.java
.../java/com/brilliance/mda/runtime/mda/impl/ModuleList.java
+5
-0
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/util/ReflectUtil.java
View file @
56e9bb2d
package
com
.
ceb
.
gjjs
.
mda
.
util
;
import
com.brilliance.jrxx.utils.StringUtil
;
import
com.brilliance.mda.runtime.annotation.RelPath
;
import
com.brilliance.mda.runtime.mda.impl.ModuleList
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
...
...
@@ -96,6 +97,7 @@ public class ReflectUtil {
public
static
String
setValue2RespondVo
(
Object
respondVo
,
Class
respondVoClass
,
Object
baseVo
,
Class
baseVoClass
)
{
String
total
=
""
;
Field
[]
declaredFields
=
respondVoClass
.
getDeclaredFields
();
for
(
Field
f
:
declaredFields
)
{
f
.
setAccessible
(
true
);
...
...
@@ -114,6 +116,13 @@ public class ReflectUtil {
if
(
isPrimate
(
type
))
{
f
.
set
(
respondVo
,
o
);
}
else
if
(
"com.brilliance.mda.runtime.mda.impl.ModuleList"
.
equals
(
type
.
getName
()))
{
// 取总条数total
ModuleList
moduleList
=
(
ModuleList
)
o
;
log
.
info
(
"moduleList===="
+
moduleList
.
getFullSize
());
if
(
moduleList
.
getFullSize
()
>=
0
)
{
total
=
String
.
valueOf
(
moduleList
.
getFullSize
());
}
// list数据类型
Class
tType
=
ReflectUtil
.
getTType
(
f
);
if
(
ReflectUtil
.
isPrimate
(
tType
))
{
...
...
@@ -148,6 +157,16 @@ public class ReflectUtil {
}
}
}
if
(
StringUtil
.
isNotEmpty
(
total
))
{
Field
totalField
=
null
;
try
{
totalField
=
respondVoClass
.
getSuperclass
().
getDeclaredField
(
"total"
);
totalField
.
setAccessible
(
true
);
totalField
.
set
(
respondVo
,
total
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
""
;
}
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/impl/ModuleList.java
View file @
56e9bb2d
...
...
@@ -366,4 +366,9 @@ public class ModuleList<T extends IModule> extends ArrayList<T> implements IModu
return
(
size
%
this
.
pageSize
==
0
)
?
(
size
/
this
.
pageSize
)
:
(
size
/
this
.
pageSize
+
1
);
}
public
int
getFullSize
()
{
return
this
.
fullSize
;
}
}
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