wangqifan 4 yıl önce
ebeveyn
işleme
2d4765f7ac

+ 9 - 6
src/main/java/com/izouma/nineth/service/AuctionRecordService.java

@@ -56,12 +56,15 @@ public class AuctionRecordService {
             auctionRecordDTO.setName(record.getName());
             auctionRecordDTO.setUserId(record.getUserId());
             auctionRecordDTO.setType(record.getType());
-            if (auctionActivity.getStatus().equals(AuctionStatus.PURCHASED) || auctionActivity.getStatus()
-                    .equals(AuctionStatus.FINISH)) {
-                if (auctionActivity.getRecordId().equals(record.getId())) {
-                    auctionRecordDTO.setPurchased(true);
-                }
-            }
+            auctionRecordDTO.setPurchased(record.isPurchased());
+//            if (auctionActivity.getStatus().equals(AuctionStatus.PURCHASED) || auctionActivity.getStatus()
+//                    .equals(AuctionStatus.FINISH)) {
+//                if (auctionActivity.getRecordId() != null) {
+//                    if (auctionActivity.getRecordId().equals(record.getId())) {
+//                        auctionRecordDTO.setPurchased(true);
+//                    }
+//                }
+//            }
             if (auctionRecordDTO.getType().equals(AuctionRecordType.DEPOSIT) || auctionRecordDTO.isPurchased()) {
                 AuctionOrder auctionOrder = auctionOrderRepo.findFirstByAuctionRecordIdOrderByCreatedAt(record.getId());
                 auctionRecordDTO.setOrderId(auctionOrder.getId());