Commit 855d2135 authored by zhangfeng's avatar zhangfeng

批量兑换校验修改

parent 75f42651
...@@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.member.api.score.MemberUserScoreApi; ...@@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.member.api.score.MemberUserScoreApi;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateReqDTO; import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateReqDTO;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO;
import cn.iocoder.yudao.module.member.enums.PlatformTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum; import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO; import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO; import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO;
...@@ -135,11 +136,13 @@ public class RedeemRewardApiImpl implements RedeemRewardApi { ...@@ -135,11 +136,13 @@ public class RedeemRewardApiImpl implements RedeemRewardApi {
int totalCount = 0; int totalCount = 0;
for (RedeemRewardReqVO redeemRewardReqVO : redeemRewardReqVOList) { for (RedeemRewardReqVO redeemRewardReqVO : redeemRewardReqVOList) {
// 每个兑换VO校验一遍 // 每个兑换VO校验一遍
// 兑换方式不匹配 // 兑换方式不匹配,后台不校验
String pickMethod = rewardDO.getPickMethod(); if (redeemRewardReqVO.getEntrance() != PlatformTypeEnum.BACKEND.getValue()) {
String[] split = pickMethod.split(","); String pickMethod = rewardDO.getPickMethod();
if (!Arrays.asList(split).contains(String.valueOf(redeemRewardReqVO.getRedeemType()))) { String[] split = pickMethod.split(",");
throw exception(REWARD_PICK_METHOD_NOT_ALLOW_CREATE); if (!Arrays.asList(split).contains(String.valueOf(redeemRewardReqVO.getRedeemType()))) {
throw exception(REWARD_PICK_METHOD_NOT_ALLOW_CREATE);
}
} }
verifyMemberUser(redeemRewardReqVO, rewardDO); verifyMemberUser(redeemRewardReqVO, rewardDO);
// 记录兑换总数 // 记录兑换总数
......
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