|
|
@@ -399,17 +399,20 @@ public class AuctionOrderService {
|
|
|
List<AuctionActivity> purchased = auctionActivityRepo.findAllByStatus(AuctionStatus.PURCHASED);
|
|
|
if (purchased != null) {
|
|
|
purchased.forEach(act -> {
|
|
|
- List<AuctionOrder> auctionOrders = auctionOrderRepo.findAllByAuctionIdAndPaymentTypeAndStatus(act
|
|
|
- .getId(), AuctionPaymentType.PURCHASE_PRICE, AuctionOrderStatus.NOT_PAID);
|
|
|
- auctionOrders.forEach(this::cancel);
|
|
|
- act.setStatus(AuctionStatus.PASS);
|
|
|
- auctionActivityRepo.save(act);
|
|
|
- //添加到流拍记录表里
|
|
|
- auctionPassRecordRepo.save(AuctionPassRecord.builder()
|
|
|
- .auctionId(act.getId())
|
|
|
- .userId(act.getPurchaserId())
|
|
|
- .purchasePrice(act.getPurchasePrice())
|
|
|
- .build());
|
|
|
+ int time = sysConfigService.getInt("auction_cancel_time");
|
|
|
+ if (LocalDateTime.now().isAfter(act.getEndTime().plusMinutes(time))) {
|
|
|
+ List<AuctionOrder> auctionOrders = auctionOrderRepo.findAllByAuctionIdAndPaymentTypeAndStatus(act
|
|
|
+ .getId(), AuctionPaymentType.PURCHASE_PRICE, AuctionOrderStatus.NOT_PAID);
|
|
|
+ auctionOrders.forEach(this::cancel);
|
|
|
+ act.setStatus(AuctionStatus.PASS);
|
|
|
+ auctionActivityRepo.save(act);
|
|
|
+ //添加到流拍记录表里
|
|
|
+ auctionPassRecordRepo.save(AuctionPassRecord.builder()
|
|
|
+ .auctionId(act.getId())
|
|
|
+ .userId(act.getPurchaserId())
|
|
|
+ .purchasePrice(act.getPurchasePrice())
|
|
|
+ .build());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|