Commit 61395ada by 吕明尚

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

parent fd1f9f6a
......@@ -252,6 +252,7 @@ public class EquityFundExcessServiceImpl extends ServiceImpl<EquityFundExcessMap
queryWrapper.eq(DurationLog::getDurationType, DurationTypeEnum.SHARE.getCode());
List<DurationLog> durationLogs = durationLogService.list(queryWrapper);
if (YesNoEnum.yes.getIndex().equals(sOrderList.size()) && YesNoEnum.no.getIndex().equals(durationLogs.size())) {
addNewConsumer(sOrder.getConsumerId());
LambdaQueryWrapper<ConsumerWallet> consumerWalletLambdaQueryWrapper = new LambdaQueryWrapper<>();
consumerWalletLambdaQueryWrapper.eq(ConsumerWallet::getConsumerId, sharingActivities.getUid());
ConsumerWallet consumerWallet = consumerWalletService.getOne(consumerWalletLambdaQueryWrapper);
......@@ -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,10 +1259,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
integralLog.setOperationType(YesNoEnum.yes.getIndex());
integralLog.setOperationTime(new Date());
integralLog.setCreateTime(new Date());
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
integralLogService.save(integralLog);
consumerWalletService.updateById(consumerWallet);
}
integralLogService.save(integralLog);
consumerWalletService.updateById(consumerWallet);
}
MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(sOrder.getConsumerId());
......@@ -1477,11 +1475,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
integralLog.setOperationTime(new Date());
integralLog.setCreateTime(new Date());
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);
}
}
MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(sOrder.getConsumerId());
......
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