Jelajahi Sumber

fix 续费排除特定平台未发车情况

zoujiajian 3 tahun lalu
induk
melakukan
e3d4ffc164

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

@@ -166,6 +166,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 
 	private final TemplateCommonService templateCommonService;
 
+	private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
+
 	@Transactional(rollbackFor = Throwable.class)
 	@Override
 	public OrderDon submit(OrderPayRequest payRequest) throws Exception {
@@ -587,11 +589,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
         }
         GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
 
-        if (GroupsTrips.Status.waiting.equals(groupsTrips.getStatus())) {
-            throw new BusinessRuntimeException("亲,该车次还未发车,需等待客服发车才能续费哦.");
-        }
-
 		GoodsDon goodsDon = goodsDonMapper.selectById(sku.getGoodsId());
+
 		if (goodsDon == null || !goodsDon.getStatus()) {
 			throw new BusinessRuntimeException("商品已下架");
 		}
@@ -600,6 +599,12 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			throw new BusinessRuntimeException("实物不支持续费");
 		}
 
+		if (GroupsTrips.Status.waiting.equals(groupsTrips.getStatus())) {
+			if (!noChekGoodsTemp.contains(goodsDon.getTitle())) {
+				throw new BusinessRuntimeException("亲,该车次还未发车,需等待客服发车才能续费哦.");
+			}
+		}
+
 		String payOpenId = user.getOpenId();
 
 		/* 生成订单 */