|
|
@@ -82,6 +82,14 @@ public class OrderService {
|
|
|
if (qty > collection.getStock()) {
|
|
|
throw new BusinessException("库存不足");
|
|
|
}
|
|
|
+ if (!collection.isCanResale()) {
|
|
|
+ throw new BusinessException("该藏品当前不可购买");
|
|
|
+ }
|
|
|
+ if (collection.getType() == CollectionType.BLIND_BOX) {
|
|
|
+ if (collection.getStartTime().isAfter(LocalDateTime.now())) {
|
|
|
+ throw new BusinessException("盲盒未开售");
|
|
|
+ }
|
|
|
+ }
|
|
|
UserAddress userAddress = null;
|
|
|
if (addressId != null) {
|
|
|
userAddress = userAddressRepo.findById(addressId).orElseThrow(new BusinessException("地址信息不存在"));
|