Commit d93578de by 吕明尚

修改支付回调问题

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