赠送的勋章最多显示8个
This commit is contained in:
parent
8b2b7e9d47
commit
e4d525eaac
@ -460,13 +460,7 @@ public class PropsActivitySendCommon {
|
|||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(useBadges) && useBadges.size() >= 8) {
|
if (CollectionUtils.isNotEmpty(useBadges) && useBadges.size() >= 8) {
|
||||||
//卸下部分佩戴中的徽章
|
//卸下部分佩戴中的徽章
|
||||||
Set<Long> ids = Sets.newHashSet();
|
removeWears(useBadges, 8);
|
||||||
for (int i = 0; i < useBadges.size(); i++) {
|
|
||||||
if (i > 3) {
|
|
||||||
ids.add(useBadges.get(i).getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
badgeBackpackService.removeWearByIds(ids);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects.equals(prize.getQuantity(), BigDecimal.ZERO)) {
|
if (Objects.equals(prize.getQuantity(), BigDecimal.ZERO)) {
|
||||||
@ -481,8 +475,18 @@ public class PropsActivitySendCommon {
|
|||||||
// userProfileRepository.removeCache(userId);
|
// userProfileRepository.removeCache(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeWears(List<BadgeBackpack> useBadges, Integer maxDisplay) {
|
||||||
|
Set<Long> ids = Sets.newHashSet();
|
||||||
|
for (int i = 0; i < useBadges.size(); i++) {
|
||||||
|
if (i > maxDisplay) {
|
||||||
|
ids.add(useBadges.get(i).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
badgeBackpackService.removeWearByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendRoomBadge(SendRewardAbstract param, List<PrizeDescribe> val) {
|
|
||||||
|
private void sendRoomBadge(SendRewardAbstract param, List<PrizeDescribe> val) {
|
||||||
Long roomId = roomProfileManagerService.getRoomId(param.getAcceptUserId());
|
Long roomId = roomProfileManagerService.getRoomId(param.getAcceptUserId());
|
||||||
if (Objects.isNull(roomId)) {
|
if (Objects.isNull(roomId)) {
|
||||||
log.warn("领取房间徽章错误,没有找到用户房间信息:{}", roomId);
|
log.warn("领取房间徽章错误,没有找到用户房间信息:{}", roomId);
|
||||||
|
|||||||
@ -395,16 +395,20 @@ public class BadgeBackpackClientServiceImpl implements BadgeBackpackClientServic
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Long> ids = Sets.newHashSet();
|
removeWears(usePropsList, 8);
|
||||||
|
|
||||||
for (int i = 0; i < usePropsList.size(); i++) {
|
|
||||||
|
|
||||||
if (i > 3) {
|
|
||||||
ids.add(usePropsList.get(i).getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
badgeBackpackService.removeWearByIds(ids);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeWears(List<BadgeBackpack> usePropsList, Integer maxDisplay) {
|
||||||
|
Set<Long> ids = Sets.newHashSet();
|
||||||
|
|
||||||
|
for (int i = 0; i < usePropsList.size(); i++) {
|
||||||
|
|
||||||
|
if (i > maxDisplay) {
|
||||||
|
ids.add(usePropsList.get(i).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
badgeBackpackService.removeWearByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user