Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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
base_platform_enterprise
gic-webapp-plug
Commits
abc230b6
Commit
abc230b6
authored
Jan 28, 2021
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码结构调整
parent
87784320
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
ScreeningController.java
...java/com/gic/plug/web/controller/ScreeningController.java
+12
-9
No files found.
src/main/java/com/gic/plug/web/controller/ScreeningController.java
View file @
abc230b6
...
...
@@ -13,6 +13,7 @@ import com.gic.widget.screening.api.dto.EsScreeningEnterpriseCategorySceneInfoDT
import
com.gic.widget.screening.api.dto.EsScreeningTemplateDTO
;
import
com.gic.widget.screening.api.service.EsScreeningInitService
;
import
com.gic.widget.screening.api.service.EsScreeningTemplateService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -110,13 +111,15 @@ public class ScreeningController {
public
RestResponse
getScreeningData
(
String
widgetChainId
)
{
List
<
EsScreeningChainDetailDTO
>
list
=
this
.
esScreeningInitService
.
queryEsScreeningByParentChainId
(
widgetChainId
);
list
=
list
.
stream
().
peek
(
item
->
{
if
(
StringUtils
.
isNotBlank
(
item
.
getWidget
().
getWidgetValues
()))
{
List
<
WidgetValuesOldVO
>
oldVOS
=
JSONObject
.
parseArray
(
item
.
getWidget
().
getWidgetValues
(),
WidgetValuesOldVO
.
class
);
List
<
WidgetValuesNewVO
>
newVOList
=
oldVOS
.
stream
().
map
(
data
->
new
WidgetValuesNewVO
(
data
.
getKey
(),
data
.
getValue
(),
data
.
getName
())).
collect
(
Collectors
.
toList
());
item
.
getWidget
().
setWidgetValues
(
JSON
.
toJSONString
(
newVOList
));
}
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
=
list
.
stream
().
peek
(
item
->
{
if
(
StringUtils
.
isNotBlank
(
item
.
getWidget
().
getWidgetValues
()))
{
List
<
WidgetValuesOldVO
>
oldVOS
=
JSONObject
.
parseArray
(
item
.
getWidget
().
getWidgetValues
(),
WidgetValuesOldVO
.
class
);
List
<
WidgetValuesNewVO
>
newVOList
=
oldVOS
.
stream
().
map
(
data
->
new
WidgetValuesNewVO
(
data
.
getKey
(),
data
.
getValue
(),
data
.
getName
())).
collect
(
Collectors
.
toList
());
item
.
getWidget
().
setWidgetValues
(
JSON
.
toJSONString
(
newVOList
));
}
}).
collect
(
Collectors
.
toList
());
}
return
RestResponse
.
success
(
list
);
}
...
...
@@ -124,7 +127,7 @@ public class ScreeningController {
@ResponseBody
public
RestResponse
getScreeningChainDetail
(
String
parentChainId
,
String
widgetFieldKey
)
{
EsScreeningChainDetailDTO
dto
=
this
.
esScreeningInitService
.
findChainDetail
(
parentChainId
,
widgetFieldKey
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getWidget
().
getWidgetValues
()))
{
if
(
dto
!=
null
&&
StringUtils
.
isNotBlank
(
dto
.
getWidget
().
getWidgetValues
()))
{
List
<
WidgetValuesOldVO
>
oldVOS
=
JSONObject
.
parseArray
(
dto
.
getWidget
().
getWidgetValues
(),
WidgetValuesOldVO
.
class
);
List
<
WidgetValuesNewVO
>
newVOList
=
oldVOS
.
stream
().
map
(
data
->
new
WidgetValuesNewVO
(
data
.
getKey
(),
data
.
getValue
(),
data
.
getName
())).
collect
(
Collectors
.
toList
());
dto
.
getWidget
().
setWidgetValues
(
JSON
.
toJSONString
(
newVOList
));
...
...
@@ -137,7 +140,7 @@ public class ScreeningController {
@ResponseBody
public
Object
getScreeningWidgetDetail
(
String
widgetChainId
)
{
EsScreeningChainDetailDTO
dto
=
this
.
esScreeningInitService
.
findChainDetail
(
widgetChainId
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getWidget
().
getWidgetValues
()))
{
if
(
dto
!=
null
&&
StringUtils
.
isNotBlank
(
dto
.
getWidget
().
getWidgetValues
()))
{
List
<
WidgetValuesOldVO
>
oldVOS
=
JSONObject
.
parseArray
(
dto
.
getWidget
().
getWidgetValues
(),
WidgetValuesOldVO
.
class
);
List
<
WidgetValuesNewVO
>
newVOList
=
oldVOS
.
stream
().
map
(
data
->
new
WidgetValuesNewVO
(
data
.
getKey
(),
data
.
getValue
(),
data
.
getName
())).
collect
(
Collectors
.
toList
());
dto
.
getWidget
().
setWidgetValues
(
JSON
.
toJSONString
(
newVOList
));
...
...
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