Commit bf247784 by 吕明尚

权益会员下单增加限制

parent 80eaf171
...@@ -133,6 +133,18 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -133,6 +133,18 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
throw new BaseException("请绑定手机号"); throw new BaseException("请绑定手机号");
} }
} }
ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>()
.eq(ConsumerMember::getConsumerId, user.getId())
.eq(ConsumerMember::getMemberType, MemberTypeEnum.RIGHTS.getIndex())
);
if (ObjectUtil.isNotEmpty(consumerMember)) {
Date expirationDate = consumerMember.getExpirationDate();
//减去当前时间
int i = DateUtils.differentDaysByMillisecond(new Date(), expirationDate);
if (i > 365) {
throw new BaseException("目前只能购买两年权益会员");
}
}
EquityMembersOrder equityMembersOrder = generatEquityMembersOrder(request, user); EquityMembersOrder equityMembersOrder = generatEquityMembersOrder(request, user);
save(equityMembersOrder); save(equityMembersOrder);
EquityMembersResultResponse response = orderPayService.saobeiEquityMembersOrderPayment(equityMembersOrder); EquityMembersResultResponse response = orderPayService.saobeiEquityMembersOrderPayment(equityMembersOrder);
......
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