Commit d4222bd9 authored by zhangfeng's avatar zhangfeng

Merge branch 'refs/heads/feature_member_score_zhangfeng' into feature_member_score

parents 447ba62c 2c380f55
package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo; package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO; import com.fasterxml.jackson.annotation.JsonInclude;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -17,6 +16,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ ...@@ -17,6 +16,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ToString(callSuper = true) @ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel("客户端 - 积分规则详细信息 Response VO") @ApiModel("客户端 - 积分规则详细信息 Response VO")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AppScoreRuleBackDetailVO extends AppScoreRuleListBackVO { public class AppScoreRuleBackDetailVO extends AppScoreRuleListBackVO {
@ApiModelProperty(value = "单次获取积分数") @ApiModelProperty(value = "单次获取积分数")
private Integer getScoreOnce; private Integer getScoreOnce;
...@@ -30,10 +30,4 @@ public class AppScoreRuleBackDetailVO extends AppScoreRuleListBackVO { ...@@ -30,10 +30,4 @@ public class AppScoreRuleBackDetailVO extends AppScoreRuleListBackVO {
private Date endTime; private Date endTime;
@ApiModelProperty(value = "积分有效期") @ApiModelProperty(value = "积分有效期")
private Integer scorePeriod; private Integer scorePeriod;
//@ApiModelProperty(value = "扩展字段原始")
//private String extra;
//@ApiModelProperty(value = "订单V值扩展字段")
//private ScoreRuleOrderVExtraVO extraOrderV;
//@ApiModelProperty(value = "注册扩展字段")
//private ScoreRuleRegisterExtraVO extraRegister;
} }
package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo; package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO; import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO; import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -47,4 +48,6 @@ public class AppScoreRuleListBackVO { ...@@ -47,4 +48,6 @@ public class AppScoreRuleListBackVO {
private ScoreRulerRecommendExtraVO extraRecommend; private ScoreRulerRecommendExtraVO extraRecommend;
@ApiModelProperty(value = "分享扩展字段") @ApiModelProperty(value = "分享扩展字段")
private ScoreRuleShareExtraVO extraShare; private ScoreRuleShareExtraVO extraShare;
@ApiModelProperty(value = "订单V值扩展字段")
private ScoreRuleOrderVExtraVO extraOrderV;
} }
...@@ -156,8 +156,8 @@ public class RedeemRewardApiImpl implements RedeemRewardApi { ...@@ -156,8 +156,8 @@ public class RedeemRewardApiImpl implements RedeemRewardApi {
if (rewardDO.getQuantityRemain() < rewardCount) { if (rewardDO.getQuantityRemain() < rewardCount) {
throw exception(REWARD_COUNT_NOT_ENOUGH); throw exception(REWARD_COUNT_NOT_ENOUGH);
} }
reward.setExchangeCount(reward.getExchangeCount() + 1); reward.setExchangeCount(rewardDO.getExchangeCount() + 1);
reward.setQuantityRemain(reward.getQuantityRemain() - rewardCount); reward.setQuantityRemain(rewardDO.getQuantityRemain() - rewardCount);
rewardMapper.updateById(reward); rewardMapper.updateById(reward);
} }
......
...@@ -318,6 +318,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper, ...@@ -318,6 +318,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
@Override @Override
public List<AppRewardRedeemListRespVO> recordList(Long memberId) { public List<AppRewardRedeemListRespVO> recordList(Long memberId) {
List<RewardRedeemDO> rewardRedeemDOList = rewardRedeemMapper.selectList("member_id", memberId); List<RewardRedeemDO> rewardRedeemDOList = rewardRedeemMapper.selectList("member_id", memberId);
// 获得兑换记录列表,并根据时间倒序
return rewardRedeemDOList.stream().map(rewardRedeemDO -> { return rewardRedeemDOList.stream().map(rewardRedeemDO -> {
RewardDO rewardDO = rewardService.getById(rewardRedeemDO.getRewardId()); RewardDO rewardDO = rewardService.getById(rewardRedeemDO.getRewardId());
return AppRewardRedeemListRespVO.builder() return AppRewardRedeemListRespVO.builder()
...@@ -332,7 +333,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper, ...@@ -332,7 +333,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
.rewardCount(rewardRedeemDO.getRewardCount()) .rewardCount(rewardRedeemDO.getRewardCount())
.scoreCount(rewardRedeemDO.getScoreCount()) .scoreCount(rewardRedeemDO.getScoreCount())
.build(); .build();
}).collect(Collectors.toList()); }).sorted(Comparator.comparing(AppRewardRedeemListRespVO::getCreateTime).reversed()).collect(Collectors.toList());
} }
private Map<String, String> validate(List<RedeemInfoImportExcelVO> dataList, Map<String, CurrencyRespDTO> titleZhCurrencyMap, private Map<String, String> validate(List<RedeemInfoImportExcelVO> dataList, Map<String, CurrencyRespDTO> titleZhCurrencyMap,
......
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