xiongzhu 4 anni fa
parent
commit
48eec95ab8

+ 2 - 0
src/main/java/com/izouma/nineth/domain/Collection.java

@@ -138,4 +138,6 @@ public class Collection extends BaseEntity {
     private int soldOut;
 
     private int maxCount;
+
+    private boolean scanCode;
 }

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

@@ -102,7 +102,9 @@ public class OrderService {
             }
         }
         if (!collection.isOnShelf()) {
-            throw new BusinessException("藏品已下架");
+            if (!collection.isScanCode()) {
+                throw new BusinessException("藏品已下架");
+            }
         }
         if (qty > collection.getStock()) {
             throw new BusinessException("库存不足");