Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
8eebc161
Commit
8eebc161
authored
Dec 29, 2023
by
guojx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业竞赛单项
parent
ac858c38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
StoreRankController.java
...aoban/manage/web/controller/data/StoreRankController.java
+18
-2
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/data/StoreRankController.java
View file @
8eebc161
...
...
@@ -7,9 +7,11 @@ import com.gic.commons.util.EntityUtil;
import
com.gic.commons.web.qo.PageQo
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.api.dto.StoreWidgetDTO
;
import
com.gic.enterprise.api.dto.data.DataIndexExplainDTO
;
import
com.gic.enterprise.api.dto.rank.StoreRankAreaDTO
;
import
com.gic.enterprise.api.dto.rank.StoreRankIndexDTO
;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.enterprise.api.service.data.DataIndexApiService
;
import
com.gic.enterprise.api.service.rank.StoreRankApiService
;
import
com.gic.enterprise.service.CustomSettingApiService
;
import
com.gic.haoban.manage.web.vo.rank.IndexVO
;
...
...
@@ -39,6 +41,8 @@ public class StoreRankController {
private
CustomSettingApiService
customSettingApiService
;
@Autowired
private
StoreWidgetService
storeWidgetService
;
@Autowired
private
DataIndexApiService
dataIndexApiService
;
public
static
final
String
RANK_INDEX_DB_NAME
=
"tab_store_pk_index_dict"
;
public
static
final
String
ORDER_FIELD
=
"custom_order_field_name"
;
...
...
@@ -58,13 +62,25 @@ public class StoreRankController {
Page
<
JSONObject
>
page
=
customSettingApiService
.
page
(
RANK_INDEX_DB_NAME
,
queryMap
,
1
,
100
).
getResult
();
List
<
JSONObject
>
list
=
page
.
getResult
();
List
<
IndexVO
>
indexList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
list
),
IndexVO
.
class
);
List
<
DataIndexExplainDTO
>
dictIndex
=
dataIndexApiService
.
listDataIndexExplain
();
Map
<
String
,
DataIndexExplainDTO
>
map
=
dictIndex
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getIndexCode
(),
e
->
e
));
for
(
IndexVO
vo
:
indexList
)
{
DataIndexExplainDTO
dto
=
map
.
get
(
vo
.
getIndexCode
());
if
(
dto
!=
null
)
{
vo
.
setIndexExample
(
dto
.
getIndexExample
());
vo
.
setIndexName
(
dto
.
getIndexName
());
vo
.
setApiColName
(
dto
.
getApiColName
());
vo
.
setIndexExplain
(
dto
.
getIndexExplain
());
vo
.
setIndexRemark
(
dto
.
getIndexRemark
());
}
}
List
<
StoreRankIndexDTO
>
enterpriseIndexList
=
storeRankApiService
.
listStoreRankIndex
(
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseIndexList
))
{
return
RestResponse
.
successResult
(
Collections
.
emptyList
());
}
Set
<
String
>
map
=
indexList
.
stream
().
map
(
e
->
e
.
getIndexCode
()).
collect
(
Collectors
.
toSet
());
indexList
=
indexList
.
stream
().
filter
(
e
->
map
.
contains
(
e
.
getIndexCode
())).
collect
(
Collectors
.
toList
());
Set
<
String
>
set
=
indexList
.
stream
().
map
(
e
->
e
.
getIndexCode
()).
collect
(
Collectors
.
toSet
());
indexList
=
indexList
.
stream
().
filter
(
e
->
set
.
contains
(
e
.
getIndexCode
())).
collect
(
Collectors
.
toList
());
return
RestResponse
.
successResult
(
indexList
);
}
...
...
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