|
|
@@ -56,10 +56,14 @@ public class AuctionActivityService {
|
|
|
if (Arrays.asList(env.getActiveProfiles()).contains("dev")) {
|
|
|
return;
|
|
|
}
|
|
|
- List<AuctionActivity> activities = auctionActivityRepo.findByStartTimeBeforeAndStatus(LocalDateTime.now(),
|
|
|
- AuctionStatus.NOTSTARTED);
|
|
|
+ List<AuctionActivity> activities = auctionActivityRepo.findByStartTimeBeforeAndStatusIn(LocalDateTime.now(),
|
|
|
+ Arrays.asList(AuctionStatus.NOTSTARTED, AuctionStatus.ONGOING));
|
|
|
for (AuctionActivity activity : activities) {
|
|
|
- onShelfTask(activity);
|
|
|
+ if (AuctionStatus.NOTSTARTED.equals(activity.getStatus())) {
|
|
|
+ onShelfTask(activity);
|
|
|
+ } else {
|
|
|
+ offShelfTask(activity);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -219,16 +223,11 @@ public class AuctionActivityService {
|
|
|
if (recordNew1.getEndTime().minusSeconds(2).isAfter(LocalDateTime.now())) {
|
|
|
Date date = Date.from(record.getEndTime().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
ScheduledFuture<?> future = taskScheduler.schedule(() -> {
|
|
|
- if (recordNew1.getPurchasePrice() != null) {
|
|
|
+ if (ObjectUtils.isNotEmpty(recordNew1.getPurchasePrice())) {
|
|
|
auctionActivityRepo.scheduleOffShelf(recordNew1.getId(), AuctionStatus.PURCHASED);
|
|
|
} else {
|
|
|
+ //没有成交价,无人出价过
|
|
|
auctionActivityRepo.scheduleOffShelf(recordNew1.getId(), AuctionStatus.PASS);
|
|
|
- //添加到流拍记录表里
|
|
|
- auctionPassRecordRepo.save(AuctionPassRecord.builder()
|
|
|
- .auctionId(record.getId())
|
|
|
- .userId(recordNew1.getPurchaserId())
|
|
|
- .purchasePrice(recordNew1.getPurchasePrice())
|
|
|
- .build());
|
|
|
|
|
|
if (record.getAuctionType().equals(AuctionType.NFT)) {
|
|
|
Asset asset = assetRepo.findById(recordNew1.getAssetId())
|
|
|
@@ -247,12 +246,6 @@ public class AuctionActivityService {
|
|
|
auctionActivityRepo.scheduleOffShelf(recordNew1.getId(), AuctionStatus.PURCHASED);
|
|
|
} else {
|
|
|
auctionActivityRepo.scheduleOffShelf(recordNew1.getId(), AuctionStatus.PASS);
|
|
|
- //添加到流拍记录表里
|
|
|
- auctionPassRecordRepo.save(AuctionPassRecord.builder()
|
|
|
- .auctionId(record.getId())
|
|
|
- .userId(recordNew1.getPurchaserId())
|
|
|
- .purchasePrice(recordNew1.getPurchasePrice())
|
|
|
- .build());
|
|
|
|
|
|
if (record.getAuctionType().equals(AuctionType.NFT)) {
|
|
|
Asset asset = assetRepo.findById(recordNew1.getAssetId())
|