zoujiajian 11 miesięcy temu
rodzic
commit
34baeb5d69

+ 8 - 1
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -1605,11 +1605,18 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			clearRelation.setNewRelationId(newRelation.getId());
 			clearService.clearTicket(clearRelation, UserTicketClearedRecord.Source.ticket_replace);
 		}
+		//校验座位
+		int update = groupsRelationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
+				.set(GroupsRelation::getUserId, userId)
+				.eq(GroupsRelation::getUserId, 0)
+				.eq(GroupsRelation::getId, newRelation.getId()));
+		if (update == 0) {
+			throw BusinessRuntimeException.getInstance("申请恢复账号失败,请重试");
+		}
 		//恢复状态
 		newRelation.setStartTime(oldRelation.getStartTime());
 		newRelation.setExpiryTime(DateUtil.offsetDay(DateTime.now(), oldRelation.getReservedDays()));
 		newRelation.setStatus(GroupsRelation.Status.validity);
-		newRelation.setUserId(userId);
 		groupsRelationMapper.updateById(newRelation);
 
 		//原订单座位id更新