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
cb79c2a7
Commit
cb79c2a7
authored
Aug 25, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉root
parent
a67f26cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
84 deletions
+41
-84
AbstractCommonResource.java
...om/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
+41
-45
RequestCommonVo.java
...ain/java/com/ceb/gjjs/mda/special/vo/RequestCommonVo.java
+0
-16
RespondRoot.java
...java/com/brilliance/mda/runtime/response/RespondRoot.java
+0
-23
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
View file @
cb79c2a7
...
...
@@ -2,14 +2,12 @@ package com.ceb.gjjs.mda.resource.base;
import
com.brilliance.mda.runtime.mda.driver.MdaEnv
;
import
com.brilliance.mda.runtime.request.BaseVO
;
import
com.brilliance.mda.runtime.response.RespondRoot
;
import
com.brilliance.mda.runtime.response.ResponseSet
;
import
com.brilliance.mda.support.service.ICommonService
;
import
com.brilliance.mda.support.td.BDAuthInfo
;
import
com.ceb.gjjs.mda.bo.Usr
;
import
com.ceb.gjjs.mda.dao.UsrMapper
;
import
com.ceb.gjjs.mda.special.vo.RequestBaseVo
;
import
com.ceb.gjjs.mda.special.vo.RequestCommonVo
;
import
com.ceb.gjjs.mda.util.ReflectUtil
;
import
com.ceb.gjjs.mda.util.ValidatorUtil
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -38,116 +36,116 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
@Path
(
"/init"
)
@POST
public
Respon
dRoo
t
<
V
>
init
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
init
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
init
(
req
)
);
return
getCommonService
().
init
(
req
);
}
@Path
(
"/checkAll"
)
@POST
public
Respon
dRoo
t
checkAll
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
checkAll
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
(
getCommonService
().
checkAll
(
req
)
);
return
getCommonService
().
checkAll
(
req
);
}
@Path
(
"/saveData"
)
@POST
public
Respon
dRoo
t
<
V
>
saveData
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
saveData
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
saveData
(
req
)
);
return
getCommonService
().
saveData
(
req
);
}
@Path
(
"/confirmData"
)
@POST
public
Respon
dRoo
t
<
V
>
confirmData
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
confirmData
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
confirmData
(
req
)
);
return
getCommonService
().
confirmData
(
req
);
}
@Path
(
"/pending"
)
@POST
public
Respon
dRoo
t
<
V
>
pending
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
pending
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
pending
(
req
)
);
return
getCommonService
().
pending
(
req
);
}
@Path
(
"/executeCheck/{rule}"
)
@POST
public
Respon
dRoo
t
<
V
>
executeCheck
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
executeCheck
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
String
[]
ruleArr
=
rule
.
split
(
","
);
return
new
RespondRoot
<>(
getCommonService
().
executeCheck
(
req
,
ruleArr
)
);
return
getCommonService
().
executeCheck
(
req
,
ruleArr
);
}
@Path
(
"/executeRule/{rule}"
)
@POST
public
Respon
dRoo
t
<
V
>
executeRule
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
executeRule
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
String
[]
ruleArr
=
rule
.
split
(
","
);
return
new
RespondRoot
<>(
getCommonService
().
executeRule
(
req
,
ruleArr
)
);
return
getCommonService
().
executeRule
(
req
,
ruleArr
);
}
@Path
(
"/executeDefault/{rule}"
)
@POST
public
Respon
dRoo
t
<
V
>
executeDefault
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
executeDefault
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
String
[]
ruleArr
=
rule
.
split
(
","
);
return
new
RespondRoot
<>(
getCommonService
().
executeDefault
(
req
,
ruleArr
)
);
return
getCommonService
().
executeDefault
(
req
,
ruleArr
);
}
@Path
(
"/executeNotify"
)
@POST
public
Respon
dRoo
t
<
V
>
executeNotify
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
executeNotify
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
executeNotify
(
req
)
);
return
getCommonService
().
executeNotify
(
req
);
}
@Path
(
"/executeDocpan"
)
@POST
public
Respon
dRoo
t
<
V
>
executeDocpan
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
executeDocpan
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
executeDocpan
(
req
)
);
return
getCommonService
().
executeDocpan
(
req
);
}
@Path
(
"/executeDocpanDetail"
)
@POST
public
Respon
dRoo
t
<
V
>
executeDocpanDetail
(
@RequestBody
V
req
)
{
public
Respon
seSe
t
<
V
>
executeDocpanDetail
(
@RequestBody
V
req
)
{
String
checkResult
=
resetAndcheckParam
(
req
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
req
);
}
return
new
RespondRoot
<>(
getCommonService
().
executeDocpanDetail
(
req
)
);
return
getCommonService
().
executeDocpanDetail
(
req
);
}
...
...
@@ -162,9 +160,8 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
}
protected
<
T
>
Respon
dRoot
<
T
>
executeRule
(
RequestCommonVo
requestCommon
Vo
,
Class
<
T
>
respondVoClass
,
String
rule
)
{
protected
<
T
>
Respon
seSet
<
T
>
executeRule
(
RequestBaseVo
requestBase
Vo
,
Class
<
T
>
respondVoClass
,
String
rule
)
{
V
baseVO
=
getVo
();
RequestBaseVo
requestBaseVo
=
requestCommonVo
.
getRoot
();
T
t
=
null
;
try
{
t
=
respondVoClass
.
newInstance
();
...
...
@@ -172,11 +169,11 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
}
String
s
=
resetAndcheckBaseParam
(
requestBaseVo
,
baseVO
);
if
(!
StringUtils
.
isBlank
(
s
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
s
,
t
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
s
,
t
);
}
String
checkResult
=
resetAndcheckParam
(
requestBaseVo
,
baseVO
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
t
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
checkResult
,
t
);
}
String
[]
ruleArr
=
new
String
[]{
rule
};
ResponseSet
responseSet
=
getCommonService
().
executeRule
(
baseVO
,
ruleArr
);
...
...
@@ -184,13 +181,12 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
ReflectUtil
.
setValue2RespondVo
(
t
,
respondVoClass
,
data
,
baseVO
.
getClass
());
setTotal
(
t
,
baseVO
);
responseSet
.
setData
(
t
);
return
new
RespondRoot
<>(
responseSet
)
;
return
responseSet
;
}
protected
<
T
>
Respon
dRoot
<
T
>
executeCheck
(
RequestCommonVo
<
RequestBaseVo
>
requestCommon
Vo
,
Class
<
T
>
respondVoClass
,
String
rule
)
{
protected
<
T
>
Respon
seSet
<
T
>
executeCheck
(
RequestBaseVo
requestBase
Vo
,
Class
<
T
>
respondVoClass
,
String
rule
)
{
V
baseVO
=
getVo
();
RequestBaseVo
requestBaseVo
=
requestCommonVo
.
getRoot
();
T
t
=
null
;
try
{
t
=
respondVoClass
.
newInstance
();
...
...
@@ -198,11 +194,11 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
}
String
s
=
resetAndcheckBaseParam
(
requestBaseVo
,
baseVO
);
if
(!
StringUtils
.
isBlank
(
s
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
s
,
t
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
s
,
t
);
}
String
checkResult
=
resetAndcheckParam
(
requestBaseVo
,
baseVO
);
if
(
StringUtils
.
isNotBlank
(
checkResult
))
{
return
new
Respon
dRoot
<>(
new
ResponseSet
<>(
ResponseSet
.
CODE_FAILURE
,
s
,
t
)
);
return
new
Respon
seSet
<>(
ResponseSet
.
CODE_FAILURE
,
s
,
t
);
}
String
[]
ruleArr
=
new
String
[]{
rule
};
ResponseSet
responseSet
=
getCommonService
().
executeCheck
(
baseVO
,
ruleArr
);
...
...
@@ -210,7 +206,7 @@ public abstract class AbstractCommonResource<V extends BaseVO> {
ReflectUtil
.
setValue2RespondVo
(
t
,
respondVoClass
,
data
,
baseVO
.
getClass
());
setTotal
(
t
,
baseVO
);
responseSet
.
setData
(
t
);
return
new
RespondRoot
<>(
responseSet
)
;
return
responseSet
;
}
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/special/vo/RequestCommonVo.java
deleted
100644 → 0
View file @
a67f26cd
package
com
.
ceb
.
gjjs
.
mda
.
special
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/17
*/
@Data
public
class
RequestCommonVo
<
T
extends
RequestBaseVo
>
implements
Serializable
{
private
T
root
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/response/RespondRoot.java
deleted
100644 → 0
View file @
a67f26cd
package
com
.
brilliance
.
mda
.
runtime
.
response
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/18
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
RespondRoot
<
T
>
implements
Serializable
{
private
ResponseSet
<
T
>
root
;
public
RespondRoot
(
ResponseSet
<
T
>
root
)
{
this
.
root
=
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