zoujiajian преди 3 години
родител
ревизия
d29761294a

+ 6 - 1
netflix-service/src/main/java/com/cyksj/service/exchange/impl/ExchangeCodeServiceImpl.java

@@ -368,6 +368,9 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
 				//若是ChatGPT Plus 、MidJourney
 				//获取额外的车位
 				relation = getOutSideRelationIfAi(userId, groups, sku);
+				if (relation != null) {
+					groups = groupsMapper.selectById(relation.getGroupsId());
+				}
 				//待发车
 				if (relation == null) {
 					groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
@@ -381,7 +384,9 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
 				//新增车位 并关联
 				relation = createNewGroupTripsAndRelation(sku, groups, relation);
 				log.info("无合适规格车队,新增新车队,获取车位relationId:{}", relation.getId());
-			} else {
+			}
+
+			if (relation == null) {
 				//寻找快满编车队进行占座
 				relation = groupsRelationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class)
 						.eq(GroupsRelation::getGroupsId, groups.getId())

+ 4 - 1
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -2000,6 +2000,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 								}
 							}
 						}
+						groups = groupsMapper.selectById(groupsId);
 					}
 					if (relation == null) {
 						//待发车
@@ -2013,7 +2014,9 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 
 				if (groups == null) {
 					relation = groupsFuncService.createNewGroupsTrips(sku);
-				} else {
+				}
+
+				if (relation == null) {
 					//寻找快满编车队进行占座
 					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());
 					if (relation == null) {