|
|
@@ -45,7 +45,6 @@ import org.apache.commons.lang3.RandomUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.rocketmq.client.producer.SendResult;
|
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
|
-import org.junit.Test;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.context.event.EventListener;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
@@ -237,6 +236,9 @@ public class OrderService {
|
|
|
throw new BusinessException("很遗憾,藏品已售罄", ErrorCode.SOLD_OUT);
|
|
|
}
|
|
|
Collection collection = collectionRepo.findById(collectionId).orElseThrow(new BusinessException("藏品不存在"));
|
|
|
+ if (collection.isInPaying()) {
|
|
|
+ throw new BusinessException("当然藏品正在支付中");
|
|
|
+ }
|
|
|
if (collection.getAssetId() != null && collection.getAssetId().equals(778359L)) {
|
|
|
throw new BusinessException("很遗憾,藏品已售罄", ErrorCode.SOLD_OUT);
|
|
|
}
|
|
|
@@ -390,8 +392,8 @@ public class OrderService {
|
|
|
Asset asset = assetRepo.findById(collection.getAssetId()).orElseThrow(new BusinessException("资产不存在"));
|
|
|
asset.setStatus(AssetStatus.TRADING);
|
|
|
assetRepo.save(asset);
|
|
|
- collectionRepo.setOnShelf(collectionId, false);
|
|
|
-
|
|
|
+// collectionRepo.setOnShelf(collectionId, false);
|
|
|
+ collectionRepo.setInPaying(collectionId, true);
|
|
|
//拥有指定藏品降税
|
|
|
order.setRoyalties(assetService.getRoyalties(minter.getId(), collection.getRoyalties(), userId));
|
|
|
}
|
|
|
@@ -864,7 +866,8 @@ public class OrderService {
|
|
|
asset.setStatus(AssetStatus.NORMAL);
|
|
|
assetRepo.save(asset);
|
|
|
}
|
|
|
- collectionRepo.setOnShelf(order.getCollectionId(), true);
|
|
|
+// collectionRepo.setOnShelf(order.getCollectionId(), true);
|
|
|
+ collectionRepo.setInPaying(order.getCollectionId(), false);
|
|
|
}
|
|
|
collectionService.increaseStock(order.getCollectionId(), order.getQty());
|
|
|
|