Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
ee2dda52
Commit
ee2dda52
authored
Jan 21, 2025
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.大屏业务模块详情api返回处理
parent
a2aed194
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
DPSubServiceImpl.java
...t/module/statistcs/biz/service/impl/DPSubServiceImpl.java
+9
-7
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/DPSubServiceImpl.java
View file @
ee2dda52
...
...
@@ -102,7 +102,7 @@ public class DPSubServiceImpl {
Object
api
=
JsonValueUtils
.
getValueByKey
(
jsonObject
,
"dataConfig"
,
"dataConfig.api"
);
String
renderType
=
jsonObject
.
getString
(
"renderType"
);
Object
apiResult
=
null
;
ResponseModel
responseModel
=
this
.
getApiResult
((
JSONObject
)
api
,
!
ValidationUtil
.
isEmpty
(
resultConvert
)
?
resultConvert
.
toString
()
:
null
);
ResponseModel
responseModel
=
this
.
getApiResult
((
JSONObject
)
api
,
!
ValidationUtil
.
isEmpty
(
resultConvert
)
?
resultConvert
.
toString
()
:
null
,
null
);
if
(!
ValidationUtil
.
isEmpty
(
responseModel
.
getResult
()))
{
apiResult
=
responseModel
.
getResult
();
}
else
{
...
...
@@ -143,7 +143,7 @@ public class DPSubServiceImpl {
if
(!
ValidationUtil
.
isEmpty
(
api
))
{
long
s
=
System
.
currentTimeMillis
();
ResponseModel
responseModel
=
this
.
getApiResult
((
JSONObject
)
api
,
!
ValidationUtil
.
isEmpty
(
resultConvert
)
?
resultConvert
.
toString
()
:
null
);
ResponseModel
responseModel
=
this
.
getApiResult
((
JSONObject
)
api
,
!
ValidationUtil
.
isEmpty
(
resultConvert
)
?
resultConvert
.
toString
()
:
null
,
null
);
if
(!
ValidationUtil
.
isEmpty
(
responseModel
.
getResult
()))
{
apiResult
=
responseModel
.
getResult
();
if
(!
CollectionUtils
.
isEmpty
(
subResultParams
)){
...
...
@@ -700,7 +700,7 @@ public class DPSubServiceImpl {
}
}
else
if
(
"checkbox"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
visualParams
.
getJSONObject
(
"api"
))){
ResponseModel
checkboxResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
);
ResponseModel
checkboxResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
,
apiResult
);
if
(!
ValidationUtil
.
isEmpty
(
checkboxResult
)
&&
checkboxResult
.
getStatus
()
==
200
&&
!
ValidationUtil
.
isEmpty
(
value
))
{
List
<
Object
>
collect
=
((
JSONArray
)
checkboxResult
.
getResult
()).
stream
().
filter
(
y
->
((
JSONArray
)
value
).
contains
(
JsonValueUtils
.
getValueByKey
(
y
,
"valueKey"
,
"valueKey"
))).
collect
(
Collectors
.
toList
());
String
nameKey
=
collect
.
stream
().
map
(
item
->
((
JSONObject
)
item
).
getString
(
"nameKey"
)).
collect
(
Collectors
.
joining
(
"、"
));
...
...
@@ -708,8 +708,8 @@ public class DPSubServiceImpl {
}
}
}
else
if
(
"select"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
visualParams
.
getJSONObject
(
"api"
))){
ResponseModel
selectResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
);
if
(!
ValidationUtil
.
isEmpty
(
visualParams
.
getJSONObject
(
"api"
))
&&
StrUtil
.
isNotEmpty
(
visualParams
.
getJSONObject
(
"api"
).
getString
(
"apiPath"
))
){
ResponseModel
selectResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
,
apiResult
);
if
(!
ValidationUtil
.
isEmpty
(
selectResult
)
&&
selectResult
.
getStatus
()
==
200
&&
!
ValidationUtil
.
isEmpty
(
value
))
{
((
JSONArray
)
selectResult
.
getResult
()).
stream
().
filter
(
y
->
value
.
equals
(
JsonValueUtils
.
getValueByKey
(
y
,
"valueKey"
,
"valueKey"
)+
""
)).
findFirst
().
ifPresent
(
z
->
{
jsonObject
.
put
(
"value"
,
((
JSONObject
)
z
).
getString
(
"nameKey"
));
...
...
@@ -725,7 +725,7 @@ public class DPSubServiceImpl {
}
}
else
if
(
"radio"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
visualParams
.
getJSONObject
(
"api"
))){
ResponseModel
checkboxResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
);
ResponseModel
checkboxResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
,
apiResult
);
if
(!
ValidationUtil
.
isEmpty
(
checkboxResult
)
&&
checkboxResult
.
getStatus
()
==
200
&&
!
ValidationUtil
.
isEmpty
(
value
))
{
List
<
Object
>
collect
=
((
JSONArray
)
checkboxResult
.
getResult
()).
stream
().
filter
(
y
->
((
JSONArray
)
value
).
contains
(
JsonValueUtils
.
getValueByKey
(
y
,
"valueKey"
,
"valueKey"
))).
collect
(
Collectors
.
toList
());
String
nameKey
=
collect
.
stream
().
map
(
item
->
((
JSONObject
)
item
).
getString
(
"nameKey"
)).
collect
(
Collectors
.
joining
(
"、"
));
...
...
@@ -785,7 +785,7 @@ public class DPSubServiceImpl {
return
map
;
}
public
ResponseModel
getApiResult
(
JSONObject
apiObj
,
String
resultConvert
)
{
public
ResponseModel
getApiResult
(
JSONObject
apiObj
,
String
resultConvert
,
JSONObject
detailResult
)
{
String
url
=
apiObj
.
getString
(
"apiPath"
);
if
(
ValidationUtil
.
isEmpty
(
url
)){
return
null
;
...
...
@@ -799,6 +799,8 @@ public class DPSubServiceImpl {
JSONObject
xObj
=
(
JSONObject
)
x
;
if
(
"staticValue"
.
equals
(
JsonValueUtils
.
getValueByKey
(
x
,
"value"
,
"value.source"
))){
queryParam
.
put
(
xObj
.
getString
(
"name"
),
xObj
.
getJSONObject
(
"value"
).
getString
(
"value"
));
}
else
if
(
"sketchProps"
.
equals
(
JsonValueUtils
.
getValueByKey
(
x
,
"value"
,
"value.source"
))){
queryParam
.
put
(
xObj
.
getString
(
"name"
),
detailResult
.
getString
(
xObj
.
getJSONObject
(
"value"
).
getString
(
"value"
)));
}
});
if
(!
ValidationUtil
.
isEmpty
(
queryParam
)){
...
...
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