Commit 26d55274 authored by zhangfeng's avatar zhangfeng

Merge branch 'release-bugfix-zhangfeng' into 'release'

Release bugfix zhangfeng

See merge request !20
parents 79c85620 a939279d
......@@ -19,7 +19,6 @@ import cn.iocoder.yudao.module.member.vo.memberUserScoreLog.MemberUserScoreLogQu
import cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleBackDetailVO;
import cn.iocoder.yudao.module.reward.api.reward.RedeemRewardApi;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemDetailForUserDTO;
import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;
......@@ -30,6 +29,8 @@ import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addDays;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.getNextNDayStart;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.MEMBER_ID_IS_NULL;
/**
......@@ -56,6 +57,11 @@ public class MemberUserScoreLogServiceImpl extends AbstractService<MemberUserSco
int start = (query.getPageNo() - 1) * query.getPageSize();
int size = query.getPageSize();
List<MemberUserScoreLogBackVO> list = userScoreLogMapper.getPageRecordList(start, size, query);
list.forEach(vo->{
if (vo.getScorePeriod() != null) {
vo.setExpireTime(addDays(getNextNDayStart(vo.getCreateTime(), 1), vo.getScorePeriod()));
}
});
int total = userScoreLogMapper.getPageCount(query);
return new PageResult<>(list, total, query.getPageSize(), query.getPageNo(), (total + query.getPageSize() - 1) / query.getPageSize());
}
......
......@@ -272,6 +272,10 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
ScoreRuleBackDetailVO scoreRuleBackDetailVO = new ScoreRuleBackDetailVO();
BeanUtils.copyProperties(scoreRuleDO, scoreRuleBackDetailVO);
setExtraVO(scoreRuleBackDetailVO);
String creator = adminUserApi.getUserName(scoreRuleDO.getCreator());
scoreRuleBackDetailVO.setCreator(creator);
String updater = adminUserApi.getUserName(scoreRuleDO.getUpdater());
scoreRuleBackDetailVO.setUpdater(updater);
return scoreRuleBackDetailVO;
}
......
......@@ -9,9 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import java.util.Collections;
import java.util.Date;
import java.util.Map;
/**
* @author zhaobiyan
......@@ -50,6 +48,11 @@ public class MemberUserScoreLogBackVO {
private Date createTime;
@ApiModelProperty(value = "扩展参数")
private String extParam;
@ApiModelProperty(value = "积分有效期")
private Integer scorePeriod;
@ApiModelProperty(value = "积分过期时间")
private Date expireTime;
......
......@@ -18,6 +18,7 @@
sr.desc_en as ruleDescEn,
sr.cover_image_zh as coverImageZh,
sr.cover_image_en as coverImageEn,
sr.score_period as scorePeriod,
musl.create_time as createTime,
musl.ext_param as extParam
from member_user_score_log musl
......
......@@ -31,8 +31,6 @@ public class AppRewardRedeemListRespVO {
private String rewardTitleZh;
@ApiModelProperty(value = "礼品名称(英文)")
private String rewardTitleEn;
@ApiModelProperty(value = "礼品名称(法文)")
private String rewardTitleFr;
@ApiModelProperty(value = "中文礼品图片")
private String imgZh;
@ApiModelProperty(value = "英文礼品图片")
......@@ -44,4 +42,10 @@ public class AppRewardRedeemListRespVO {
@ApiModelProperty(value = "日志时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date createTime;
@ApiModelProperty(value = "兑换状态")
private Integer status;
@ApiModelProperty(value = "兑换状态中文")
private String statusZh;
@ApiModelProperty(value = "兑换状态英文")
private String statusEn;
}
......@@ -322,18 +322,21 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
// 获得兑换记录列表,并根据时间倒序
return rewardRedeemDOList.stream().map(rewardRedeemDO -> {
RewardDO rewardDO = rewardService.getById(rewardRedeemDO.getRewardId());
String status = rewardRedeemDO.getStatus().toString();
return AppRewardRedeemListRespVO.builder()
.id(rewardRedeemDO.getId())
.redemptionNumber(rewardRedeemDO.getRedemptionNumber())
.createTime(rewardRedeemDO.getCreateTime())
.rewardCode(rewardRedeemDO.getRewardId())
.rewardTitleEn(rewardDO.getTitleEn())
.rewardTitleFr(rewardDO.getTitleFr())
.rewardTitleZh(rewardDO.getTitleZh())
.imgZh(rewardDO.getImgZh())
.imgEn(rewardDO.getImgEn())
.rewardCount(rewardRedeemDO.getRewardCount())
.scoreCount(rewardRedeemDO.getScoreCount())
.status(rewardRedeemDO.getStatus())
.statusEn(DictFrameworkUtils.getDictDataFromCache("reward_redeem_status", status).getLabelEn())
.statusZh(DictFrameworkUtils.getDictDataFromCache("reward_redeem_status", status).getLabel())
.build();
}).sorted(Comparator.comparing(AppRewardRedeemListRespVO::getCreateTime).reversed()).collect(Collectors.toList());
}
......
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