Prechádzať zdrojové kódy

双击

(cherry picked from commit 3f85b9a3708e7b62d3333a8992176e75edd8116b)
xiongzhu 4 rokov pred
rodič
commit
a67bc99961

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

@@ -110,7 +110,12 @@ public class OrderService {
         if (!collection.isSalable()) {
             throw new BusinessException("该藏品当前不可购买");
         }
-
+        if (collection.getAssetId() != null) {
+            Asset asset = assetRepo.findById(collection.getAssetId()).orElseThrow(new BusinessException("藏品不存在"));
+            if (asset.getStatus() != AssetStatus.NORMAL) {
+                throw new BusinessException("藏品已下架");
+            }
+        }
         UserAddress userAddress = null;
         if (addressId != null) {
             userAddress = userAddressRepo.findById(addressId).orElseThrow(new BusinessException("地址信息不存在"));