|
|
@@ -1,5 +1,6 @@
|
|
|
package com.izouma.nineth.service;
|
|
|
|
|
|
+import com.izouma.nineth.config.RedisKeys;
|
|
|
import com.izouma.nineth.domain.*;
|
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.enums.*;
|
|
|
@@ -9,6 +10,7 @@ import com.izouma.nineth.utils.JpaUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -21,15 +23,16 @@ import java.util.Optional;
|
|
|
@AllArgsConstructor
|
|
|
public class AuctionOrderService {
|
|
|
|
|
|
- private AuctionOrderRepo auctionOrderRepo;
|
|
|
- private SysConfigService sysConfigService;
|
|
|
- private UserRepo userRepo;
|
|
|
- private AssetService assetService;
|
|
|
- private AuctionActivityRepo auctionActivityRepo;
|
|
|
- private AuctionRecordRepo auctionRecordRepo;
|
|
|
- private AssetRepo assetRepo;
|
|
|
- private UserAddressRepo userAddressRepo;
|
|
|
- private AuctionActivityService auctionActivityService;
|
|
|
+ private AuctionOrderRepo auctionOrderRepo;
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+ private UserRepo userRepo;
|
|
|
+ private AssetService assetService;
|
|
|
+ private AuctionActivityRepo auctionActivityRepo;
|
|
|
+ private AuctionRecordRepo auctionRecordRepo;
|
|
|
+ private AssetRepo assetRepo;
|
|
|
+ private UserAddressRepo userAddressRepo;
|
|
|
+ private AuctionActivityService auctionActivityService;
|
|
|
+ private RedisTemplate<String, Object> redisTemplate;
|
|
|
|
|
|
public Page<AuctionOrder> all(PageQuery pageQuery) {
|
|
|
return auctionOrderRepo.findAll(JpaUtils.toSpecification(pageQuery, AuctionOrder.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
@@ -41,7 +44,8 @@ public class AuctionOrderService {
|
|
|
AuctionActivity auction = auctionActivityRepo.findById(auctionId)
|
|
|
.orElseThrow(new BusinessException("无拍卖信息"));
|
|
|
|
|
|
- switch (auction.getStatus()) {
|
|
|
+ String status = (String) redisTemplate.opsForValue().get(RedisKeys.AUCTION_STATUS + auctionId);
|
|
|
+ switch (AuctionStatus.valueOf(status)) {
|
|
|
case NOTSTARTED:
|
|
|
throw new BusinessException("拍卖还未开始");
|
|
|
case PURCHASED:
|