zoujiajian пре 3 година
родитељ
комит
2d3e863134

+ 13 - 2
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -254,8 +254,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 					}
 
 				} else {
-					//寻找差不多过期时间规格的车位
-					relation = groupRelationFrontService.getSimilarExpiredGroupRelation(sku.getId(), sku.getMonths(), null);
+					if (goodsDon.getId() != 26) {
+						//寻找差不多过期时间规格的车位
+						relation = groupRelationFrontService.getSimilarExpiredGroupRelation(sku.getId(), sku.getMonths(), null);
+					}
 					if (relation == null) {
 						//TODO 如果没指定座位,等待逻辑确认
 						LambdaQueryWrapper<GroupsTrips> queryWrapper = Wrappers.lambdaQuery(GroupsTrips.class)
@@ -263,7 +265,16 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 								.gt(GroupsTrips::getAvailableNum, 0).last("limit 1")
 								.ne(GroupsTrips::getStatus, GroupsTrips.Status.down)
 								.orderByAsc(GroupsTrips::getAvailableNum);
+						if (goodsDon.getId() == 26) {
+							if (!List.of(209l, 210l).contains(sku.getId())) {
+								queryWrapper.gt(GroupsTrips::getAvailableNum, 5);
+							}
+						}
 						GroupsTrips groups = groupsMapper.selectOne(queryWrapper);
+						if (goodsDon.getId() == 26 && groups == null) {
+							queryWrapper.gt(GroupsTrips::getAvailableNum, 0);
+							groups = groupsMapper.selectOne(queryWrapper);
+						}
 						if (groups == null) {
 							relation = createNewGroupsTrips(sku);
 							isNew = true;