Commit 61395ada by 吕明尚

完成一笔订房消费的用户,成为等级为0的普通会员,0级会员,能获得消费积分,与会员等级的累计积分不相关

parent fd1f9f6a
...@@ -252,6 +252,7 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap ...@@ -252,6 +252,7 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
queryWrapper.eq(DurationLog::getDurationType, DurationTypeEnum.SHARE.getCode()); queryWrapper.eq(DurationLog::getDurationType, DurationTypeEnum.SHARE.getCode());
List<DurationLog> durationLogs = durationLogService.list(queryWrapper); List<DurationLog> durationLogs = durationLogService.list(queryWrapper);
if (YesNoEnum.yes.getIndex().equals(sOrderList.size()) && YesNoEnum.no.getIndex().equals(durationLogs.size())) { if (YesNoEnum.yes.getIndex().equals(sOrderList.size()) && YesNoEnum.no.getIndex().equals(durationLogs.size())) {
addNewConsumer(sOrder.getConsumerId());
LambdaQueryWrapper<ConsumerWallet> consumerWalletLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ConsumerWallet> consumerWalletLambdaQueryWrapper = new LambdaQueryWrapper<>();
consumerWalletLambdaQueryWrapper.eq(ConsumerWallet::getConsumerId, sharingActivities.getUid()); consumerWalletLambdaQueryWrapper.eq(ConsumerWallet::getConsumerId, sharingActivities.getUid());
ConsumerWallet consumerWallet = consumerWalletService.getOne(consumerWalletLambdaQueryWrapper); ConsumerWallet consumerWallet = consumerWalletService.getOne(consumerWalletLambdaQueryWrapper);
...@@ -344,4 +345,30 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap ...@@ -344,4 +345,30 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
} }
} }
} }
private void addNewConsumer(Long consumerId) {
//新增用户为普通会员
ConsumerWallet wallet = new ConsumerWallet();
wallet.setConsumerId(consumerId);
wallet.setBalance(BigDecimal.ZERO);
wallet.setRechargeAmount(BigDecimal.ZERO);
wallet.setGiftAmount(BigDecimal.ZERO);
wallet.setRemainingDuration(BigDecimal.ZERO);
wallet.setRemainingIntegral(BigDecimal.ZERO);
wallet.setEquityFund(BigDecimal.ZERO);
wallet.setAccumulateEquityFund(BigDecimal.ZERO);
wallet.setCreateTime(new Date());
ConsumerMember consumerMember = new ConsumerMember();
consumerMember.setConsumerId(consumerId);
consumerMember.setMembershipLevel(0L);
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
consumerMember.setExpirationDate(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
consumerMember.setMembershipProgress(BigDecimal.ZERO);
consumerMember.setIsRecharge(YesNoEnum.no.getIndex());
consumerMember.setIsRights(YesNoEnum.no.getIndex());
consumerMember.setCreateTime(new Date());
consumerWalletService.save(wallet);
consumerMemberService.save(consumerMember);
}
} }
...@@ -1259,11 +1259,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1259,11 +1259,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
integralLog.setOperationType(YesNoEnum.yes.getIndex()); integralLog.setOperationType(YesNoEnum.yes.getIndex());
integralLog.setOperationTime(new Date()); integralLog.setOperationTime(new Date());
integralLog.setCreateTime(new Date()); integralLog.setCreateTime(new Date());
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
integralLogService.save(integralLog); integralLogService.save(integralLog);
consumerWalletService.updateById(consumerWallet); consumerWalletService.updateById(consumerWallet);
} }
}
MemberProgressLog memberProgressLog = new MemberProgressLog(); MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(sOrder.getConsumerId()); memberProgressLog.setConsumerId(sOrder.getConsumerId());
memberProgressLog.setCurrentProgress(consumerMember.getMembershipProgress()); memberProgressLog.setCurrentProgress(consumerMember.getMembershipProgress());
...@@ -1477,12 +1475,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1477,12 +1475,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
integralLog.setOperationTime(new Date()); integralLog.setOperationTime(new Date());
integralLog.setCreateTime(new Date()); integralLog.setCreateTime(new Date());
consumerWallet.setRemainingIntegral(integral); consumerWallet.setRemainingIntegral(integral);
if ((consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()))
&& membershipProgress.compareTo(BigDecimal.ZERO) >= 0) {
integralLogService.save(integralLog); integralLogService.save(integralLog);
consumerWalletService.updateById(consumerWallet); consumerWalletService.updateById(consumerWallet);
} }
}
MemberProgressLog memberProgressLog = new MemberProgressLog(); MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(sOrder.getConsumerId()); memberProgressLog.setConsumerId(sOrder.getConsumerId());
memberProgressLog.setCurrentProgress(consumerMember.getMembershipProgress()); memberProgressLog.setCurrentProgress(consumerMember.getMembershipProgress());
......
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