Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit da8bd5f4
authored
Jan 26, 2026
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]品牌处理
1 parent
fa2417a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantAnalysisController.java
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantAnalysisController.java
View file @
da8bd5f
...
...
@@ -39,6 +39,7 @@ import com.rop.annotation.ServiceMethodBean;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.LinkedHashMap
;
import
java.util.Objects
;
import
java.util.function.Function
;
import
java.util.stream.Stream
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -221,6 +222,10 @@ public class MerchantAnalysisController {
if
(
merchantDetailResponse
!=
null
)
{
itemResponse
.
setMainBrands
(
merchantDetailResponse
.
getCarBrandResponses
().
stream
()
// 1. 过滤掉 null 的 CarBrandDTO
.
filter
(
Objects:
:
nonNull
)
// 2. 过滤掉 id 为 null 的(避免 toMap 报错)
.
filter
(
carBrand
->
carBrand
.
getId
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
CarBrandDTO:
:
getId
,
// 按 id 去重(唯一标识)
Function
.
identity
(),
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment