Commit d93578de by 吕明尚

修改支付回调问题

parent d0fb39b8
...@@ -169,6 +169,14 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -169,6 +169,14 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue())); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue()));
memberProgressLogService.save(memberProgressLog); memberProgressLogService.save(memberProgressLog);
MemberConfig newOne = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, one.getMemberType())
.eq(MemberConfig::getMembershipLevel, one.getMembershipLevel() + 1L));
if (ObjectUtil.isNotEmpty(newOne) && one.getMembershipProgress().compareTo(BigDecimal.valueOf(newOne.getLimitRequirements())) >= 0) {
one.setMembershipLevel(one.getMembershipLevel() + 1L);
one.setMemberConfigId(one.getId());
consumerMemberService.updateConsumerMember(one);
}
} }
return i == 1; return i == 1;
} }
...@@ -177,13 +185,18 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -177,13 +185,18 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
public boolean editConsumerWallet(ConsumerWallet consumerWallet, Recharge recharge, ConsumerMember one) { public boolean editConsumerWallet(ConsumerWallet consumerWallet, Recharge recharge, ConsumerMember one) {
BigDecimal divide = new BigDecimal(0); BigDecimal divide = new BigDecimal(0);
RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId()); RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId());
MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>() if (one.getMemberType().equals(MemberTypeEnum.RECHARGE.getIndex())) {
.eq(MemberConfig::getMembershipLevel, one.getMembershipLevel()) MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, MemberTypeEnum.RECHARGE.getIndex())); .eq(MemberConfig::getMembershipLevel, one.getMembershipLevel())
one.setExpirationDate(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue())); .eq(MemberConfig::getMemberType, MemberTypeEnum.RECHARGE.getIndex()));
one.setExpirationDate(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue()));
}
logger.debug("修改会员用户"); logger.debug("修改会员用户");
BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount());
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount()).add(rechargeConf.getGiveAmount()); balance.add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance);
} else {
consumerWallet.setBalance(balance); consumerWallet.setBalance(balance);
} }
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
...@@ -249,7 +262,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -249,7 +262,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
//判断是否升级 //判断是否升级
if (one.getMembershipProgress().compareTo(BigDecimal.valueOf(memberConfigServiceOne.getLimitRequirements())) >= 0) { if (one.getMembershipProgress().compareTo(BigDecimal.valueOf(memberConfigServiceOne.getLimitRequirements())) >= 0) {
one.setMembershipLevel(one.getMembershipLevel() + 1L); one.setMembershipLevel(one.getMembershipLevel() + 1L);
one.setMemberConfigId(one.getId()); one.setMemberConfigId(memberConfigServiceOne.getId());
} }
} }
consumerMemberService.updateConsumerMember(one); consumerMemberService.updateConsumerMember(one);
......
...@@ -199,7 +199,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -199,7 +199,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
//修改会员类型为权益会员 //修改会员类型为权益会员
consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex()); consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
consumerMember.setMemberConfigId(memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>() consumerMember.setMemberConfigId(memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMembershipLevel, equityMembersOrderConfig.getDefaultLevel()) .eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel())
.eq(MemberConfig::getMemberType, MemberTypeEnum.RIGHTS.getIndex())).getId()); .eq(MemberConfig::getMemberType, MemberTypeEnum.RIGHTS.getIndex())).getId());
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())),
equityMembersOrderConfig.getValidityPeriod().intValue())); equityMembersOrderConfig.getValidityPeriod().intValue()));
......
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