|
@@ -1,6 +1,8 @@
|
|
|
package com.cyksj.service.exchange.impl;
|
|
package com.cyksj.service.exchange.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -29,7 +31,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
*项目名: netflix
|
|
*项目名: netflix
|
|
@@ -201,7 +205,12 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
|
|
|
getGroupTripsTicket(sku, userId);
|
|
getGroupTripsTicket(sku, userId);
|
|
|
}
|
|
}
|
|
|
relation.setUserId(userId);
|
|
relation.setUserId(userId);
|
|
|
- relation.setStatus(GroupsRelation.Status.locking);
|
|
|
|
|
|
|
+ relation.setStatus(GroupsRelation.Status.validity);
|
|
|
|
|
+ //如果续费增加时间,如果首次则设置当前时间为初始时间
|
|
|
|
|
+ Date expiryTime = Optional.ofNullable(relation.getExpiryTime()).orElse(new Date());
|
|
|
|
|
+ Date newDate = DateUtil.offset(expiryTime, DateField.MONTH, sku.getMonths() * 1);
|
|
|
|
|
+ relation.setExpiryTime(newDate);
|
|
|
|
|
+ relation.setStartTime(relation.getStartTime() == null ? new Date() : null);
|
|
|
groupsRelationMapper.updateById(relation);
|
|
groupsRelationMapper.updateById(relation);
|
|
|
Long relationId = relation.getId();
|
|
Long relationId = relation.getId();
|
|
|
|
|
|