v1.2 转赠礼物明细返回礼物名称、图片
This commit is contained in:
@@ -47,6 +47,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户转赠钻石记录表
|
||||
@@ -384,6 +386,20 @@ public class DiamondGiveHistoryService extends ServiceImpl<DiamondGiveHistoryMap
|
||||
}
|
||||
Date date = DateTimeUtil.addMonth(new Date(), -3);
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
return diamondGiveHistoryMapper.giveRecordVoByType(uid,toUid,date,type);
|
||||
List<DiamondGiveHistoryVo> vos = diamondGiveHistoryMapper.giveRecordVoByType(uid, toUid, date, type);
|
||||
if (CollectionUtils.isNotEmpty(vos) && Constant.UserGiveType.gift.equals(type)) {
|
||||
List<Integer> giftIds = vos.stream().map(DiamondGiveHistoryVo::getGiftId).distinct().collect(Collectors.toList());
|
||||
List<Gift> giftList = giftService.getGiftByIdsFromDb(giftIds);
|
||||
Map<Integer, Gift> giftMap = giftList.stream().collect(Collectors.toMap(Gift::getGiftId, a -> a));
|
||||
vos.forEach(it -> {
|
||||
Gift gift = giftMap.get(it.getGiftId());
|
||||
if (gift == null) {
|
||||
return;
|
||||
}
|
||||
it.setGiftUrl(gift.getPicUrl());
|
||||
it.setGiftName(gift.getGiftName());
|
||||
});
|
||||
}
|
||||
return vos;
|
||||
}
|
||||
}
|
@@ -47,5 +47,10 @@ public class DiamondGiveHistoryVo {
|
||||
private Long giftGoldNum;
|
||||
@ApiModelProperty("转赠礼物总价值")
|
||||
private Long totalGiftGoldNum;
|
||||
@ApiModelProperty("礼物图片")
|
||||
@ReplaceDomain
|
||||
private String giftUrl;
|
||||
@ApiModelProperty("礼物名称")
|
||||
private String giftName;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user