Commit 8aa7bcf4 authored by zhangfeng's avatar zhangfeng

客户端会员积分基本信息

parent 7ac47779
......@@ -104,7 +104,7 @@ public class MemberUserLevelConfigServiceImpl extends AbstractService<MemberUser
List<MemberUserLevelConfigDO> sortLevelConfig = levelConfigList.stream()
.sorted(Comparator.comparing(MemberUserLevelConfigDO::getLowerCount))
.collect(Collectors.toList());
MemberUserLevelConfigDO memberUserLevelConfigDO = sortLevelConfig.stream().filter(config -> config.getLowerCount() >= scoreCount && config.getUpperCount() <= scoreCount)
MemberUserLevelConfigDO memberUserLevelConfigDO = sortLevelConfig.stream().filter(config -> config.getLowerCount() <= scoreCount && config.getUpperCount() >= scoreCount)
.findAny().orElse(sortLevelConfig.get(sortLevelConfig.size() - 1));
return BeanUtil.copyProperties(memberUserLevelConfigDO, MemberUserLevelConfigBaseRespVO.class);
}
......
......@@ -112,16 +112,24 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
@Override
public AppMemberUserScoreInfoRespVO getUserScoreInfo(AppMemberUserIdQueryVO id) {
MemberUserScoreDO userScoreDO = userScoreMapper.getByMemberId(id.getId());
Integer userScoreTotal = 0;
AppMemberUserScoreInfoRespVO infoRespVO;
if (userScoreDO == null) {
throw exception(MEMBER_ID_IS_NULL);
infoRespVO = AppMemberUserScoreInfoRespVO.builder()
.holdScore(0)
.id(id.getId())
.totalScore(userScoreTotal)
.usedScore(0)
.build();
} else {
userScoreTotal = userScoreDO.getHoldScore() + userScoreDO.getUsedScore() + userScoreDO.getExpiredScore();
infoRespVO = AppMemberUserScoreInfoRespVO.builder()
.holdScore(userScoreDO.getHoldScore())
.id(id.getId())
.totalScore(userScoreTotal)
.usedScore(userScoreDO.getUsedScore())
.build();
}
Integer userScoreTotal = userScoreDO.getHoldScore() + userScoreDO.getUsedScore() + userScoreDO.getExpiredScore();
AppMemberUserScoreInfoRespVO infoRespVO = AppMemberUserScoreInfoRespVO.builder()
.holdScore(userScoreDO.getHoldScore())
.id(userScoreDO.getId())
.totalScore(userScoreTotal)
.usedScore(userScoreDO.getUsedScore())
.build();
MemberUserLevelConfigBaseRespVO level = memberUserLevelConfigService.getLevelByCount(userScoreTotal);
if (level != null) {
infoRespVO.setLevelName(level.getName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment