Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-product
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-product
Commits
b0673f13
Commit
b0673f13
authored
Dec 09, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
d408c720
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiSpeciesSettingServiceImpl.java
+13
-4
No files found.
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiSpeciesSettingServiceImpl.java
View file @
b0673f13
...
...
@@ -62,13 +62,22 @@ public class ApiSpeciesSettingServiceImpl implements ApiSpeciesSettingService {
@Override
public
List
<
ApiSpeciesTypeDto
>
querySpeciesTypeDtoList
(
String
productLaunchBizId
)
{
List
<
ApiSpeciesTypeDto
>
apiSpeciesTypeDtoList
=
new
ArrayList
<>();
List
<
SpeciesSetting
>
speciesSettingList
=
iSpeciesSettingService
.
queryList
(
SpeciesSettingDto
.
builder
().
productLaunchBizId
(
productLaunchBizId
).
build
());
List
<
SpeciesSetting
>
speciesSettingList
=
iSpeciesSettingService
.
queryList
(
SpeciesSettingDto
.
builder
().
productLaunchBizId
(
productLaunchBizId
).
build
());
if
(!
CollectionUtils
.
isEmpty
(
speciesSettingList
))
{
//
按规格类型分组
Map
<
String
,
List
<
SpeciesSetting
>>
speciesSettingByType
=
speciesSettingList
.
stream
()
//
首先按ID排序
List
<
SpeciesSetting
>
sortedList
=
speciesSettingList
.
stream
()
.
sorted
(
Comparator
.
comparing
(
SpeciesSetting:
:
getId
))
.
collect
(
Collectors
.
groupingBy
(
SpeciesSetting:
:
getTypeName
));
.
collect
(
Collectors
.
toList
());
// 使用LinkedHashMap保持插入顺序,按规格类型分组
Map
<
String
,
List
<
SpeciesSetting
>>
speciesSettingByType
=
new
LinkedHashMap
<>();
for
(
SpeciesSetting
setting
:
sortedList
)
{
String
typeName
=
setting
.
getTypeName
();
speciesSettingByType
.
computeIfAbsent
(
typeName
,
k
->
new
ArrayList
<>()).
add
(
setting
);
}
// 为每个规格类型创建DTO
apiSpeciesTypeDtoList
=
speciesSettingByType
.
entrySet
().
stream
().
map
(
entry
->
{
...
...
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