Commit 0c2521ea by 吕明尚

修改自动任务

parent 57cf320e
...@@ -491,6 +491,7 @@ public class RedisTask { ...@@ -491,6 +491,7 @@ public class RedisTask {
SConsumer sConsumer = sConsumerService.getById(consumerId); SConsumer sConsumer = sConsumerService.getById(consumerId);
logger.debug("手机号为:{}的用户年度权益会员将在3天后失效", sConsumer.getPhone()); logger.debug("手机号为:{}的用户年度权益会员将在3天后失效", sConsumer.getPhone());
smsService.sendOneSms(sConsumer.getPhone(), "年度权益会员将在3天后失效,请及时续约保障权益会员的权益"); smsService.sendOneSms(sConsumer.getPhone(), "年度权益会员将在3天后失效,请及时续约保障权益会员的权益");
redisUtil.delete(key);
} }
}); });
} }
...@@ -509,6 +510,7 @@ public class RedisTask { ...@@ -509,6 +510,7 @@ public class RedisTask {
if (expirationTime.getTime() < new Date().getTime()) { if (expirationTime.getTime() < new Date().getTime()) {
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, consumerId)); ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, consumerId));
ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, consumerId)); ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, consumerId));
if (ObjectUtil.isNotEmpty(consumerMember)) {
if (ObjectUtil.isNotEmpty(consumerWallet)) { if (ObjectUtil.isNotEmpty(consumerWallet)) {
consumerMember.setMemberType(MemberTypeEnum.RECHARGE.getIndex()); consumerMember.setMemberType(MemberTypeEnum.RECHARGE.getIndex());
} else { } else {
...@@ -516,6 +518,8 @@ public class RedisTask { ...@@ -516,6 +518,8 @@ public class RedisTask {
} }
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
} }
redisUtil.delete(key);
}
}); });
} }
...@@ -534,7 +538,7 @@ public class RedisTask { ...@@ -534,7 +538,7 @@ public class RedisTask {
Map<Long, List<MemberProgressLog>> collect = list.stream().collect(Collectors.groupingBy(MemberProgressLog::getConsumerId)); Map<Long, List<MemberProgressLog>> collect = list.stream().collect(Collectors.groupingBy(MemberProgressLog::getConsumerId));
consumerIds.stream().forEach(item -> { consumerIds.stream().forEach(item -> {
List<MemberProgressLog> memberProgressLogs = collect.get(item); List<MemberProgressLog> memberProgressLogs = collect.get(item);
if (memberProgressLogs.size() > 1) { if (memberProgressLogs.size() > 0) {
final BigDecimal[] sum = {BigDecimal.ZERO}; final BigDecimal[] sum = {BigDecimal.ZERO};
memberProgressLogs.stream().forEach(log -> { memberProgressLogs.stream().forEach(log -> {
if (log.getOperationType().equals(YesNoEnum.yes.getIndex())) { if (log.getOperationType().equals(YesNoEnum.yes.getIndex())) {
......
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