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
a7b39750
Commit
a7b39750
authored
Oct 14, 2024
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
奖励明细
parent
1f1fc014
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
26 deletions
+37
-26
GroupChatActivityRewardBaseDTO.java
...n/manage/api/dto/chat/GroupChatActivityRewardBaseDTO.java
+37
-26
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/chat/GroupChatActivityRewardBaseDTO.java
View file @
a7b39750
...
...
@@ -151,32 +151,43 @@ public class GroupChatActivityRewardBaseDTO implements Serializable {
return
list
;
}
public
static
Map
<
Integer
,
List
<
GroupChatActivityRewardDTO
>>
reverseMapConvert
(
List
<
GroupChatActivityRewardBaseDTO
>
baseList
)
{
return
baseList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
GroupChatActivityRewardBaseDTO:
:
getRewardInvite
,
Collectors
.
mapping
(
baseDTO
->
{
GroupChatActivityRewardDTO
rewardDTO
=
new
GroupChatActivityRewardDTO
();
rewardDTO
.
setChatActivityId
(
baseDTO
.
getChatActivityId
());
rewardDTO
.
setInviteNumber
(
baseDTO
.
getInviteNumber
());
rewardDTO
.
setInviteLevel
(
baseDTO
.
getInviteLevel
());
rewardDTO
.
setLimitReward
(
baseDTO
.
getLimitReward
());
rewardDTO
.
setRewardInvite
(
baseDTO
.
getRewardInvite
());
GroupChatActivityRewardDetailDTO
detailDTO
=
new
GroupChatActivityRewardDetailDTO
();
detailDTO
.
setChatActivityRewardId
(
baseDTO
.
getChatActivityRewardId
());
detailDTO
.
setRewardType
(
baseDTO
.
getRewardType
());
detailDTO
.
setRewardValue
(
baseDTO
.
getRewardValue
());
detailDTO
.
setRewardName
(
baseDTO
.
getRewardName
());
if
(
rewardDTO
.
getDetailList
()
==
null
)
{
rewardDTO
.
setDetailList
(
new
ArrayList
<>());
}
rewardDTO
.
getDetailList
().
add
(
detailDTO
);
return
rewardDTO
;
},
Collectors
.
toList
())
));
public
static
Map
<
Integer
,
List
<
GroupChatActivityRewardDTO
>>
reverseMapConvert
(
List
<
GroupChatActivityRewardBaseDTO
>
baseDTOList
)
{
Map
<
Integer
,
List
<
GroupChatActivityRewardDTO
>>
rewardMap
=
new
HashMap
<>();
// 按 rewardInvite 分组
Map
<
Integer
,
Map
<
Long
,
GroupChatActivityRewardDTO
>>
groupedMap
=
new
HashMap
<>();
for
(
GroupChatActivityRewardBaseDTO
baseDTO
:
baseDTOList
)
{
int
rewardInvite
=
baseDTO
.
getRewardInvite
();
Long
chatActivityId
=
baseDTO
.
getChatActivityId
();
groupedMap
.
putIfAbsent
(
rewardInvite
,
new
HashMap
<>());
Map
<
Long
,
GroupChatActivityRewardDTO
>
rewardDTOMap
=
groupedMap
.
get
(
rewardInvite
);
GroupChatActivityRewardDTO
rewardDTO
=
rewardDTOMap
.
computeIfAbsent
(
chatActivityId
,
id
->
{
GroupChatActivityRewardDTO
newRewardDTO
=
new
GroupChatActivityRewardDTO
();
newRewardDTO
.
setChatActivityId
(
baseDTO
.
getChatActivityId
());
newRewardDTO
.
setInviteNumber
(
baseDTO
.
getInviteNumber
());
newRewardDTO
.
setInviteLevel
(
baseDTO
.
getInviteLevel
());
newRewardDTO
.
setLimitReward
(
baseDTO
.
getLimitReward
());
newRewardDTO
.
setDetailList
(
new
ArrayList
<>());
return
newRewardDTO
;
});
GroupChatActivityRewardDetailDTO
detailDTO
=
new
GroupChatActivityRewardDetailDTO
();
detailDTO
.
setChatActivityRewardId
(
baseDTO
.
getChatActivityRewardId
());
detailDTO
.
setRewardType
(
baseDTO
.
getRewardType
());
detailDTO
.
setRewardValue
(
baseDTO
.
getRewardValue
());
detailDTO
.
setRewardName
(
baseDTO
.
getRewardName
());
rewardDTO
.
getDetailList
().
add
(
detailDTO
);
}
groupedMap
.
forEach
((
rewardInvite
,
rewardDTOMap
)
->
{
List
<
GroupChatActivityRewardDTO
>
rewardDTOList
=
new
ArrayList
<>(
rewardDTOMap
.
values
());
rewardMap
.
put
(
rewardInvite
,
rewardDTOList
);
});
return
rewardMap
;
}
...
...
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