|
@@ -664,14 +664,15 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//netflix月付 续费其他规格 更换车队车位
|
|
//netflix月付 续费其他规格 更换车队车位
|
|
|
Boolean isChangeTicket = false;
|
|
Boolean isChangeTicket = false;
|
|
|
if (goodsDon.getType() == 1 && goodsDon.getId() == 1) {
|
|
if (goodsDon.getType() == 1 && goodsDon.getId() == 1) {
|
|
|
- if (groupsTrips.getSkuId() != 4 && tripsSkuId != renewSkuId) {
|
|
|
|
|
- if (groupsTrips.getSkuId() == 5) {
|
|
|
|
|
|
|
+ if (tripsSkuId != 4 && tripsSkuId != renewSkuId) {
|
|
|
|
|
+ if (tripsSkuId == 5) {
|
|
|
throw BusinessRuntimeException.getInstance("季付车票只能续费季付");
|
|
throw BusinessRuntimeException.getInstance("季付车票只能续费季付");
|
|
|
- } else if (groupsTrips.getSkuId() == 6) {
|
|
|
|
|
|
|
+ } else if (tripsSkuId == 6) {
|
|
|
throw BusinessRuntimeException.getInstance("年付车票只能续费年付");
|
|
throw BusinessRuntimeException.getInstance("年付车票只能续费年付");
|
|
|
} else throw BusinessRuntimeException.getInstance("请选择对应规格的车票续费");
|
|
} else throw BusinessRuntimeException.getInstance("请选择对应规格的车票续费");
|
|
|
|
|
+ } else if (tripsSkuId == 4 && tripsSkuId != renewSkuId) {
|
|
|
|
|
+ isChangeTicket = true;
|
|
|
}
|
|
}
|
|
|
- isChangeTicket = true;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String payOpenId = user.getOpenId();
|
|
String payOpenId = user.getOpenId();
|
|
@@ -1014,15 +1015,26 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (goodsDon != null && goodsDon.getType() == 1) {
|
|
if (goodsDon != null && goodsDon.getType() == 1) {
|
|
|
//清出车队,车位变为已过期
|
|
//清出车队,车位变为已过期
|
|
|
Long relationId = orderDon.getRelationId();
|
|
Long relationId = orderDon.getRelationId();
|
|
|
|
|
+ //更换车票前后的座位id集合
|
|
|
|
|
+ List<Long> relationIds = List.of(orderDon.getRelationId());
|
|
|
Integer months = sku.getMonths();
|
|
Integer months = sku.getMonths();
|
|
|
Integer num = orderDon.getNum();
|
|
Integer num = orderDon.getNum();
|
|
|
DateTime now = DateTime.now();
|
|
DateTime now = DateTime.now();
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(relationId);
|
|
GroupsRelation relation = groupsRelationMapper.selectById(relationId);
|
|
|
|
|
+ //车票变更之后
|
|
|
|
|
+ if (relation == null || orderDon.getIsChangeTicket()) {
|
|
|
|
|
+ UserRenewChangeTicketRecord record = userRenewChangeTicketRecordMapper.selectOne(Wrappers.lambdaQuery(UserRenewChangeTicketRecord.class)
|
|
|
|
|
+ .eq(UserRenewChangeTicketRecord::getRenewOrderId, orderDon.getId()).last("limit 1"));
|
|
|
|
|
+ if (record != null && relationId.equals(record.getPreRelationId())) {
|
|
|
|
|
+ relation = groupsRelationMapper.selectById(record.getAfterRelationId());
|
|
|
|
|
+ relationIds.add(relation.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
Boolean isFlag = true;
|
|
Boolean isFlag = true;
|
|
|
if (orderDon.getOrderType() == 2) {
|
|
if (orderDon.getOrderType() == 2) {
|
|
|
//是否有其他付款订单是否过期
|
|
//是否有其他付款订单是否过期
|
|
|
OrderDon otherOrder = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
OrderDon otherOrder = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
- .eq(OrderDon::getRelationId, relationId)
|
|
|
|
|
|
|
+ .eq(OrderDon::getRelationId, relationIds)
|
|
|
.eq(OrderDon::getUserId, orderDon.getUserId())
|
|
.eq(OrderDon::getUserId, orderDon.getUserId())
|
|
|
.ne(OrderDon::getId, orderDon.getId())
|
|
.ne(OrderDon::getId, orderDon.getId())
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
@@ -1039,14 +1051,6 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
}
|
|
|
if (relation != null) {
|
|
if (relation != null) {
|
|
|
Date expiryTime = relation.getExpiryTime();
|
|
Date expiryTime = relation.getExpiryTime();
|
|
|
-
|
|
|
|
|
- if (orderDon.getIsChangeTicket()) {
|
|
|
|
|
- UserRenewChangeTicketRecord record = userRenewChangeTicketRecordMapper.selectOne(Wrappers.lambdaQuery(UserRenewChangeTicketRecord.class)
|
|
|
|
|
- .eq(UserRenewChangeTicketRecord::getRenewOrderId, orderDon.getId()).last("limit 1"));
|
|
|
|
|
- if (record != null && relationId.equals(record.getPreRelationId())) {
|
|
|
|
|
- relation = groupsRelationMapper.selectById(record.getAfterRelationId());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
if (isFlag) {
|
|
if (isFlag) {
|
|
|
relation.setUserId(0l);
|
|
relation.setUserId(0l);
|
|
|
relation.setStatus(GroupsRelation.Status.none);
|
|
relation.setStatus(GroupsRelation.Status.none);
|