|
@@ -432,12 +432,19 @@ public class PayCenterWebhookServiceImpl implements PayCenterWebhookService {
|
|
|
break;
|
|
|
}
|
|
|
BeanUtil.copyProperties(collect.get(0), userSubscriptionInfo1);
|
|
|
- Date date = new Date(nextBillingTime);
|
|
|
- userSubscriptionInfo1.setEndDate(date);
|
|
|
+ // 获取当前时间
|
|
|
+ Date currentDate = new Date();
|
|
|
+ // 根据产品周期添加订阅信息记录的结束时间
|
|
|
+ if (currentDate.compareTo(userSubscriptionInfo1.getEndDate()) < 0) {
|
|
|
+ // 订阅未过期,设置结束时间为当前时间加产品周期
|
|
|
+ currentDate = userSubscriptionInfo1.getEndDate();
|
|
|
+ }
|
|
|
+ Date endDate = getDateByCycle(currentDate, productVO.getCycle());
|
|
|
+ userSubscriptionInfo1.setEndDate(endDate);
|
|
|
userSubscriptionInfoApi.update(userSubscriptionInfo1);
|
|
|
// 订阅过期信息
|
|
|
// 发送订阅过期消息
|
|
|
- SubscriptionUtil.subscriptionExpiredSendNews(rabbitTemplate, userSubscriptionInfo1.getId(), date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
|
|
+ SubscriptionUtil.subscriptionExpiredSendNews(rabbitTemplate, userSubscriptionInfo1.getId(), endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
|
|
case "4":
|
|
|
// 订阅扣款失败,有延时队列暂不处理
|
|
|
log.info("订阅扣款失败,有延时队列暂不处理,thirdTradeId:{}", thirdTradeId);
|