|
|
@@ -179,8 +179,11 @@ public class OrderService {
|
|
|
if (collection.getAssetId() != null && collection.getAssetId().equals(778359L)) {
|
|
|
throw new BusinessException("很遗憾,藏品已售罄", ErrorCode.SOLD_OUT);
|
|
|
}
|
|
|
- if (collection.getAssetId() != null) {
|
|
|
+ if (collection.getSource() == CollectionSource.TRANSFER) {
|
|
|
Asset asset = assetRepo.findById(collection.getAssetId()).orElseThrow(new BusinessException("藏品不存在"));
|
|
|
+ if (Objects.equals(asset.getUserId(), userId)) {
|
|
|
+ throw new BusinessException("不能购买自己的藏品");
|
|
|
+ }
|
|
|
if (asset.getStatus() != AssetStatus.NORMAL) {
|
|
|
throw new BusinessException("藏品已下架");
|
|
|
}
|