Sfoglia il codice sorgente

fix 修改购买chatGPT账号下单流程

zoujiajian 3 anni fa
parent
commit
867917f732

+ 9 - 3
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -248,11 +248,17 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 					}
 
 				} else {
-					//寻找差不多过期时间规格的车位
-					relation = groupRelationFrontService.getSimilarExpiredGroupRelation(sku.getId(), sku.getMonths(), null);
+					if (goodsDon.getId() != 18) {
+						//寻找差不多过期时间规格的车位
+						relation = groupRelationFrontService.getSimilarExpiredGroupRelation(sku.getId(), sku.getMonths(), null);
+					}
 					if (relation == null) {
 						//TODO 如果没指定座位,等待逻辑确认
-						GroupsTrips groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getSkuId, payRequest.getSkuId()).gt(GroupsTrips::getAvailableNum, 0).last("limit 1").orderByAsc(GroupsTrips::getAvailableNum));
+						LambdaQueryWrapper<GroupsTrips> queryWrapper = Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getSkuId, payRequest.getSkuId()).gt(GroupsTrips::getAvailableNum, 0).last("limit 1").orderByAsc(GroupsTrips::getAvailableNum);
+						if (goodsDon.getId() == 18) {
+							queryWrapper.isNull(GroupsTrips::getAccountId);
+						}
+						GroupsTrips groups = groupsMapper.selectOne(queryWrapper);
 						if (groups == null) {
 							relation = createNewGroupsTrips(sku);
 							isNew = true;