|
|
@@ -251,6 +251,9 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
|
|
|
orderDon.setNum(1);
|
|
|
orderDon.setGoodsId(sku.getGoodsId());
|
|
|
orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
|
|
|
+ if (relation.getStartTime() == null || relation.getExpiryTime() == null) {
|
|
|
+ orderDon.setStatus(OrderDon.Status.hasPayment);
|
|
|
+ }
|
|
|
//兑换码兑换
|
|
|
orderDon.setType(orderDonTye);
|
|
|
orderDon.setUserId(user.getId());
|
|
|
@@ -339,17 +342,20 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
|
|
|
//锁定座位
|
|
|
setRelation(relation.getId(), userId);
|
|
|
relation.setUserId(userId);
|
|
|
- relation.setStatus(GroupsRelation.Status.validity);
|
|
|
- //如果续费增加时间,如果首次则设置当前时间为初始时间
|
|
|
- Date expiryTime = Optional.ofNullable(relation.getExpiryTime()).orElse(new Date());
|
|
|
- Date newDate;
|
|
|
- if (sku.getDays() != null && sku.getDays() > 0) {
|
|
|
- newDate = DateUtil.offsetDay(expiryTime, sku.getDays() * 1);
|
|
|
- } else {
|
|
|
- newDate = DateUtil.offset(expiryTime, DateField.MONTH, sku.getMonths() * 1);
|
|
|
+ GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
|
|
|
+ if (GroupsTrips.Status.validity.equals(groupsTrips.getStatus())) {
|
|
|
+ //如果续费增加时间,如果首次则设置当前时间为初始时间
|
|
|
+ Date expiryTime = Optional.ofNullable(relation.getExpiryTime()).orElse(new Date());
|
|
|
+ Date newDate;
|
|
|
+ if (sku.getDays() != null && sku.getDays() > 0) {
|
|
|
+ newDate = DateUtil.offsetDay(expiryTime, sku.getDays() * 1);
|
|
|
+ } else {
|
|
|
+ newDate = DateUtil.offset(expiryTime, DateField.MONTH, sku.getMonths() * 1);
|
|
|
+ }
|
|
|
+ relation.setExpiryTime(newDate);
|
|
|
+ relation.setStartTime(relation.getStartTime() == null ? new Date() : null);
|
|
|
}
|
|
|
- relation.setExpiryTime(newDate);
|
|
|
- relation.setStartTime(relation.getStartTime() == null ? new Date() : null);
|
|
|
+ relation.setStatus(GroupsRelation.Status.validity);
|
|
|
|
|
|
int isSuccess = groupsRelationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
.set(GroupsRelation::getUserId, userId)
|