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
e011f991
Commit
e011f991
authored
Aug 18, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置total
parent
23c485dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
AbstractCommonResource.java
...om/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
+24
-0
RespondBaseVo.java
.../main/java/com/ceb/gjjs/mda/special/vo/RespondBaseVo.java
+1
-1
BaseVO.java
.../main/java/com/brilliance/mda/runtime/request/BaseVO.java
+1
-1
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
View file @
e011f991
...
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
javax.ws.rs.POST
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
java.lang.reflect.Field
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -181,6 +182,7 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
ResponseSet
responseSet
=
getCommonService
().
executeRule
(
baseVO
,
ruleArr
);
Object
data
=
responseSet
.
getData
();
ReflectUtil
.
setValue2RespondVo
(
t
,
respondVoClass
,
data
,
baseVO
.
getClass
());
setTotal
(
t
,
baseVO
);
responseSet
.
setData
(
t
);
return
new
RespondRoot
<>(
responseSet
);
}
...
...
@@ -206,6 +208,7 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
ResponseSet
responseSet
=
getCommonService
().
executeCheck
(
baseVO
,
ruleArr
);
Object
data
=
responseSet
.
getData
();
ReflectUtil
.
setValue2RespondVo
(
t
,
respondVoClass
,
data
,
baseVO
.
getClass
());
setTotal
(
t
,
baseVO
);
responseSet
.
setData
(
t
);
return
new
RespondRoot
<>(
responseSet
);
}
...
...
@@ -289,4 +292,25 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
}
/**
* 设置分页查询返回total
*
* @param t
* @param baseVO
*/
private
void
setTotal
(
Object
t
,
BaseVO
baseVO
)
{
Long
total
=
baseVO
.
getTotal
();
if
(
total
!=
null
)
{
Class
<?>
superclass
=
t
.
getClass
().
getSuperclass
();
Field
totalField
=
null
;
try
{
totalField
=
superclass
.
getDeclaredField
(
"total"
);
totalField
.
setAccessible
(
true
);
totalField
.
set
(
t
,
String
.
valueOf
(
total
));
}
catch
(
Exception
e
)
{
}
}
}
}
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/special/vo/RespondBaseVo.java
View file @
e011f991
...
...
@@ -15,5 +15,5 @@ import java.io.Serializable;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
RespondBaseVo
implements
Serializable
{
private
String
total
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/request/BaseVO.java
View file @
e011f991
...
...
@@ -13,7 +13,7 @@ public class BaseVO {
protected
String
id
;
protected
String
cifno
;
protected
String
pageId
;
public
l
ong
total
;
public
L
ong
total
;
protected
Map
<
String
,
Object
>
params
;
protected
Map
<
String
,
Object
>
root
;
...
...
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