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
7e986872
Commit
7e986872
authored
Aug 04, 2023
by
吴佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端请求没有params参数时,获取params子元素前先判空
parent
d22d266a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
15 deletions
+26
-15
CheckedParams.java
...ava/com/brilliance/mda/runtime/request/CheckedParams.java
+8
-5
SelectedParams.java
...va/com/brilliance/mda/runtime/request/SelectedParams.java
+13
-8
AbstractRouteService.java
.../brilliance/mda/support/service/AbstractRouteService.java
+5
-2
No files found.
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/request/CheckedParams.java
View file @
7e986872
...
...
@@ -5,6 +5,7 @@ import com.brilliance.mda.runtime.mda.IDatafield;
import
com.brilliance.mda.runtime.mda.IStream
;
import
com.brilliance.mda.runtime.mda.driver.MdaDriver
;
import
com.brilliance.mda.runtime.mda.impl.StreamImpl
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
import
java.util.List
;
...
...
@@ -19,11 +20,13 @@ public class CheckedParams {
public
static
void
checkedParamsInit
(
BaseVO
req
)
{
List
<
Integer
>
chkIds
=
null
;
String
chkDst
=
null
;
if
(
req
.
getParams
().
containsKey
(
CHK_IDS
)){
chkIds
=
(
List
<
Integer
>)
req
.
getParams
().
get
(
CHK_IDS
);
}
if
(
req
.
getParams
().
containsKey
(
CHK_DST
)){
chkDst
=
(
String
)
req
.
getParams
().
get
(
CHK_DST
);
if
(!
MdaUtils
.
isEmpty
(
req
.
getParams
()))
{
if
(
req
.
getParams
().
containsKey
(
CHK_IDS
))
{
chkIds
=
(
List
<
Integer
>)
req
.
getParams
().
get
(
CHK_IDS
);
}
if
(
req
.
getParams
().
containsKey
(
CHK_DST
))
{
chkDst
=
(
String
)
req
.
getParams
().
get
(
CHK_DST
);
}
}
if
(
chkDst
==
null
){
return
;
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/request/SelectedParams.java
View file @
7e986872
...
...
@@ -4,6 +4,7 @@ import com.brilliance.mda.runtime.mda.*;
import
com.brilliance.mda.runtime.mda.driver.MdaDriver
;
import
com.brilliance.mda.runtime.mda.driver.MdaEnv
;
import
com.brilliance.mda.runtime.mda.impl.StreamImpl
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
import
com.brilliance.mda.runtime.mda.util.Strings
;
import
com.brilliance.mda.runtime.mda.util.Systems
;
...
...
@@ -24,11 +25,13 @@ public class SelectedParams {
public
static
void
selectedParamsInit
(
BaseVO
req
){
List
<
Integer
>
selIds
=
null
;
String
selDst
=
null
;
if
(
req
.
getParams
().
containsKey
(
SEL_IDS
)){
selIds
=
(
List
<
Integer
>)
req
.
getParams
().
get
(
SEL_IDS
);
}
if
(
req
.
getParams
().
containsKey
(
SEL_DST
)){
selDst
=
(
String
)
req
.
getParams
().
get
(
SEL_DST
);
if
(!
MdaUtils
.
isEmpty
(
req
.
getParams
()))
{
if
(
req
.
getParams
().
containsKey
(
SEL_IDS
))
{
selIds
=
(
List
<
Integer
>)
req
.
getParams
().
get
(
SEL_IDS
);
}
if
(
req
.
getParams
().
containsKey
(
SEL_DST
))
{
selDst
=
(
String
)
req
.
getParams
().
get
(
SEL_DST
);
}
}
if
(
selIds
==
null
||
selIds
.
size
()
==
0
){
...
...
@@ -65,9 +68,11 @@ public class SelectedParams {
Systems
.
setAttribute
(
dist
.
getParent
(),
dist
.
getName
(),
ButtonIndex
,
selIds
.
get
(
0
));
String
selBtnId
=
""
;
if
(
req
.
getParams
().
containsKey
(
SEL_BTN_ID
)){
selBtnId
=
(
String
)
req
.
getParams
().
get
(
SEL_BTN_ID
);
Systems
.
setAttribute
(
dist
.
getParent
(),
dist
.
getName
(),
ButtonId
,
selBtnId
);
if
(!
MdaUtils
.
isEmpty
(
req
.
getParams
()))
{
if
(
req
.
getParams
().
containsKey
(
SEL_BTN_ID
))
{
selBtnId
=
(
String
)
req
.
getParams
().
get
(
SEL_BTN_ID
);
Systems
.
setAttribute
(
dist
.
getParent
(),
dist
.
getName
(),
ButtonId
,
selBtnId
);
}
}
}
}
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/support/service/AbstractRouteService.java
View file @
7e986872
...
...
@@ -7,6 +7,7 @@ import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import
com.brilliance.mda.runtime.mda.driver.MdaEnv
;
import
com.brilliance.mda.runtime.mda.impl.AbstractScopeEmitter
;
import
com.brilliance.mda.runtime.mda.impl.Argument
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
import
com.brilliance.mda.runtime.mda.util.Modules
;
import
com.brilliance.mda.runtime.request.BaseVO
;
import
com.brilliance.mda.runtime.request.CheckedParams
;
...
...
@@ -100,8 +101,10 @@ public abstract class AbstractRouteService<V extends BaseVO> {
Map
<
String
,
Object
>
params
=
null
;
if
(
req
!=
null
)
{
params
=
req
.
getParams
();
if
(
req
.
getParams
().
containsKey
(
"trn"
))
{
return
new
ResponseSet
<
V
>(
req
);
if
(!
MdaUtils
.
isEmpty
(
params
))
{
if
(
req
.
getParams
().
containsKey
(
"trn"
))
{
return
new
ResponseSet
<
V
>(
req
);
}
}
}
stopWatch
.
stop
();
...
...
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