Эх сурвалжийг харах

时间校验

(cherry picked from commit d6995c802956affa00dbed0c851431a3ff22d4a3)
xiongzhu 4 жил өмнө
parent
commit
44913df51f

+ 5 - 1
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -96,7 +96,11 @@ public class OrderService {
                 throw new BusinessException("该兑换券不可用");
                 throw new BusinessException("该兑换券不可用");
             }
             }
         }
         }
-
+        if (collection.isScheduleSale()) {
+            if (collection.getStartTime().isAfter(LocalDateTime.now())) {
+                throw new BusinessException("当前还未开售");
+            }
+        }
         if (!collection.isOnShelf()) {
         if (!collection.isOnShelf()) {
             throw new BusinessException("藏品已下架");
             throw new BusinessException("藏品已下架");
         }
         }