Commit 2c8ee014 authored by alex yao's avatar alex yao

fix:创建积分包异常

parent 1e89de7a
...@@ -47,10 +47,11 @@ public class EquityOrderRestImpl implements EquityOrderRest { ...@@ -47,10 +47,11 @@ public class EquityOrderRestImpl implements EquityOrderRest {
throw new I18nMessageException("exception/user.not.login"); throw new I18nMessageException("exception/user.not.login");
} }
// 获取用户当前权益 // 校验用户当前权益是否比当前要购买的权益低,如果是权益购买,则不允许用户购买比自己等级低的权益
MemberEquityInfo equityInfo = memberEquityService.getEquityInfo(currentUser.getUserId()); MemberEquityInfo equityInfo = memberEquityService.getEquityInfo(currentUser.getUserId());
EquityEnum.TYPE currentEquityLevel = equityInfo.getEquityLevel(); EquityEnum.TYPE currentEquityLevel = equityInfo.getEquityLevel();
if (currentEquityLevel.getLevel() > EquityEnum.TYPE.valueOf(createDto.getType()).getLevel()) { if (createDto.getDomain().equals(EquityEnum.DOMAIN.equity.name()) &&
currentEquityLevel.getLevel() > EquityEnum.TYPE.valueOf(createDto.getType()).getLevel()) {
throw new I18nMessageException("equity/target.equity.is.lower.current.equity"); throw new I18nMessageException("equity/target.equity.is.lower.current.equity");
} }
......
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