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