Commit a939279d authored by zhangfeng's avatar zhangfeng

feat-482: 积分记录列表,添加积分到期时间

parent 97eb32a8
...@@ -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());
} }
......
...@@ -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
......
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