Commit c338e444 by 吕明尚

修改退款

parent cae68e30
......@@ -1142,7 +1142,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() + 1L));
if (membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
if (ObjectUtil.isNotEmpty(one) && membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() + 1L);
consumerMember.setMemberConfigId(one.getId());
}
......@@ -1151,7 +1151,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() + 1L));
if (membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
if (ObjectUtil.isNotEmpty(one) && membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() + 1L);
consumerMember.setMemberConfigId(one.getId());
}
......@@ -1163,7 +1163,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() + 1L));
if (ObjectUtil.isNotEmpty(one)) {
//判断是否升级
if (membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
if (ObjectUtil.isNotEmpty(one) && membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) >= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() + 1L);
consumerMember.setMemberConfigId(one.getId());
}
......@@ -1287,34 +1287,40 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
memberProgressLog.setCurrentProgress(consumerMember.getMembershipProgress());
if (consumerMember.getMemberType().equals(MemberTypeEnum.NORMAL.getIndex())) {
if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
if (consumerMember.getMembershipLevel().compareTo(0L) > 0) {
consumerMember.setMemberType(MemberTypeEnum.RECHARGE.getIndex());
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() - 1L));
if (membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) <= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() - 1L);
consumerMember.setMemberConfigId(one.getId());
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() - 1L));
if (ObjectUtil.isNotEmpty(one) && membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) < 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() - 1L);
consumerMember.setMemberConfigId(one.getId());
}
}
} else if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() - 1L));
if (membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) <= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() - 1L);
consumerMember.setMemberConfigId(one.getId());
if (consumerMember.getMembershipLevel().compareTo(0L) > 0) {
consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() - 1L));
if (ObjectUtil.isNotEmpty(one) && membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) < 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() - 1L);
consumerMember.setMemberConfigId(one.getId());
}
}
}
} else {
//查询当前会员类型和下一级的会员配置
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() - 1L));
if (ObjectUtil.isNotEmpty(one)) {
//判断是否升级
if (membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) <= 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() - 1L);
consumerMember.setMemberConfigId(one.getId());
if (consumerMember.getMembershipLevel().compareTo(0L) > 0) {
//查询当前会员类型和下一级的会员配置
MemberConfig one = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, consumerMember.getMemberType())
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel() - 1L));
if (ObjectUtil.isNotEmpty(one)) {
//判断是否升级
if (ObjectUtil.isNotEmpty(one) && membershipProgress.compareTo(BigDecimal.valueOf(one.getLimitRequirements())) < 0) {
consumerMember.setMembershipLevel(consumerMember.getMembershipLevel() - 1L);
consumerMember.setMemberConfigId(one.getId());
}
}
}
}
......
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