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