|
|
@@ -28,6 +28,7 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
@@ -105,6 +106,10 @@ public class AssetService {
|
|
|
|
|
|
public void publicShow(Long id) {
|
|
|
Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ if (asset.getName().contains("鬼卒-")
|
|
|
+ && LocalDate.now().equals(LocalDate.of(2022,3,22))) {
|
|
|
+ throw new BusinessException("此藏品当前无法上架");
|
|
|
+ }
|
|
|
if (!asset.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
|
|
|
throw new BusinessException("此藏品不属于你");
|
|
|
}
|
|
|
@@ -149,7 +154,8 @@ public class AssetService {
|
|
|
|
|
|
public void consignment(Long id, BigDecimal price) {
|
|
|
Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
- if (asset.getName().contains("鬼卒-")) {
|
|
|
+ if (asset.getName().contains("鬼卒-")
|
|
|
+ && LocalDate.now().equals(LocalDate.of(2022, 3, 22))) {
|
|
|
throw new BusinessException("此藏品当前无法上架");
|
|
|
}
|
|
|
if (!asset.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
|