zoujiajian 1 tahun lalu
induk
melakukan
a03082aa1f

+ 24 - 0
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -908,6 +908,12 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				//体验规格
 				Long gptMirrorSkuId = Constant.GPT_MIRROR_SKU_ID;
 				GroupsTrips groups = groupsMapper.selectCollegeStudentUserGptTicket(gptMirrorSkuId);
+				if (groups == null) {
+					groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
+							.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
+							.eq(GroupsTrips::getSkuId, gptMirrorSkuId)
+							.last("limit 1"));
+				}
 				GroupsRelation relation = null;
 				if (groups != null) {
 					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());
@@ -1307,6 +1313,12 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				//体验规格
 				GroupsTrips groups = groupsMapper.selectCollegeStudentUserGptTicket(trialSkuId);
 				GroupsRelation relation = null;
+				if (groups == null) {
+					groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
+							.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
+							.eq(GroupsTrips::getSkuId, trialSkuId)
+							.last("limit 1"));
+				}
 				if (groups != null) {
 					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());
 				}
@@ -1384,6 +1396,12 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			return build.call(() -> {
 				GroupsTrips groups = groupsMapper.selectCollegeStudentUserGptTicket(skuId);
 				GroupsRelation relation = null;
+				if (groups == null) {
+					groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
+							.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
+							.eq(GroupsTrips::getSkuId, skuId)
+							.last("limit 1"));
+				}
 				if (groups != null) {
 					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());
 				}
@@ -1982,6 +2000,12 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		try {
 			return build.call(() -> {
 				GroupsTrips groups = groupsMapper.selectCollegeStudentUserGptTicket(skuId);
+				if (groups == null) {
+					groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
+							.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
+							.eq(GroupsTrips::getSkuId, skuId)
+							.last("limit 1"));
+				}
 				GroupsRelation relation = null;
 				if (groups != null) {
 					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());