Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-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 36b10e41
authored
Jun 30, 2026
by
潘诗林
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:更换查询活动套餐明细方法
1 parent
8f3af3cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
19 deletions
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/MarketingActivityService.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/MarketingActivityService.java
View file @
36b10e4
...
@@ -904,30 +904,16 @@ public class MarketingActivityService {
...
@@ -904,30 +904,16 @@ public class MarketingActivityService {
// 4. 批量查询套餐子商品
// 4. 批量查询套餐子商品
List
<
Integer
>
productIds
=
products
.
stream
().
map
(
MarketingActivityProduct:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
productIds
=
products
.
stream
().
map
(
MarketingActivityProduct:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
MarketingActivityProductItem
>
allItems
=
marketingActivityProductItemMapper
.
select
ByActivityProductIds
(
productIds
);
List
<
MarketingActivityProductItem
RespDTO
>
allItems
=
marketingActivityProductItemMapper
.
selectItemDTO
ByActivityProductIds
(
productIds
);
Map
<
Integer
,
List
<
MarketingActivityProductItem
>>
itemMap
=
allItems
.
stream
()
Map
<
Integer
,
List
<
MarketingActivityProductItem
RespDTO
>>
itemMap
=
allItems
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
MarketingActivityProductItem:
:
getActivityProductId
));
.
collect
(
Collectors
.
groupingBy
(
MarketingActivityProductItem
RespDTO
:
:
getActivityProductId
));
// 5. 构建商品/套餐DTO列表
// 5. 构建商品/套餐DTO列表
List
<
MarketingActivityProductRespDTO
>
productDTOs
=
products
.
stream
().
map
(
p
->
{
List
<
MarketingActivityProductRespDTO
>
productDTOs
=
products
.
stream
().
map
(
p
->
{
MarketingActivityProductRespDTO
pd
=
convertToActivityProductDTO
(
p
);
MarketingActivityProductRespDTO
pd
=
convertToActivityProductDTO
(
p
);
// 子商品列表(仅套餐类型有值)
// 子商品列表(仅套餐类型有值)
List
<
MarketingActivityProductItem
>
items
=
itemMap
.
getOrDefault
(
p
.
getId
(),
Collections
.
emptyList
());
List
<
MarketingActivityProductItemRespDTO
>
items
=
itemMap
.
getOrDefault
(
p
.
getId
(),
Collections
.
emptyList
());
pd
.
setPackageItems
(
items
.
stream
().
map
(
i
->
{
pd
.
setPackageItems
(
items
);
MarketingActivityProductItemRespDTO
itemRespDTO
=
new
MarketingActivityProductItemRespDTO
();
itemRespDTO
.
setItemId
(
i
.
getId
());
itemRespDTO
.
setGoodsCode
(
i
.
getGoodsCode
());
itemRespDTO
.
setUpgradeProductId
(
i
.
getUpgradeProductId
());
itemRespDTO
.
setGoodsName
(
i
.
getGoodsName
());
itemRespDTO
.
setGoodsAlias
(
i
.
getGoodsAlias
());
itemRespDTO
.
setGoodsType
(
i
.
getGoodsType
());
itemRespDTO
.
setGoodsTypeName
(
i
.
getGoodsTypeName
());
itemRespDTO
.
setCurrentPrice
(
i
.
getCurrentPrice
());
itemRespDTO
.
setMinimumPrice
(
i
.
getMinimumPrice
());
itemRespDTO
.
setDiscountPrice
(
i
.
getDiscountPrice
());
itemRespDTO
.
setSalesIncentive
(
i
.
getSalesIncentive
());
return
itemRespDTO
;
}).
collect
(
Collectors
.
toList
()));
return
pd
;
return
pd
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
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