Browse Source

fix 非镜像续费

zoujiajian 1 year ago
parent
commit
1d9eb86615

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonSkuView.java

@@ -58,4 +58,7 @@ public class GoodsDonSkuView {
 
 	@DbField("gdk.num")
 	private Integer num;
+
+	@DbField("gdk.is_mirror")
+	private Boolean isMirror;
 }

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

@@ -1192,11 +1192,15 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		}
 		//用户车票规格
 		Long tripsSkuId = groupsTrips.getSkuId();
-		GoodsDonSkuView goodsDonSkuView = beanSearcher.searchFirst(GoodsDonSkuView.class, MapUtils.builder().field(GoodsDonSkuView::getGoodsId, goodsDon.getId())
+		GoodsDonSkuView tripGoodsDonSkuView = beanSearcher.searchFirst(GoodsDonSkuView.class, MapUtils.builder().field(GoodsDonSkuView::getGoodsId, goodsDon.getId())
 				.field(GoodsDonSkuView::getSkuId, tripsSkuId).build());
-		if (goodsDonSkuView == null) {
+		if (tripGoodsDonSkuView == null) {
 			throw BusinessRuntimeException.getInstance("该续费规格不属于该车队");
 		}
+		//非镜像规格 不能续费镜像规格
+		if (tripGoodsDonSkuView.getIsMirror() != sku.getIsMirror()) {
+			throw BusinessRuntimeException.getInstance("续费规格错误");
+		}
 
 		if (GroupsTrips.Status.waiting.equals(groupsTrips.getStatus())) {
 			if (!noChekGoodsTemp.contains(goodsDon.getTitle())) {
@@ -1214,7 +1218,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 					throw BusinessRuntimeException.getInstance("年付车票只能续费年付");
 				} else {
 					//天数可续费其他规格
-					if (goodsDonSkuView.getDays() == null || goodsDonSkuView.getDays() <= 0) {
+					if (tripGoodsDonSkuView.getDays() == null || tripGoodsDonSkuView.getDays() <= 0) {
 						throw BusinessRuntimeException.getInstance("请选择对应规格的车票续费");
 					}
 				}