Commit c338e444 by 吕明尚

修改退款

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