为空修复

This commit is contained in:
tianfeng 2025-10-24 15:12:34 +08:00
parent ac0c8fe4de
commit 810d4ea1d0

View File

@ -14,6 +14,7 @@ import com.red.circle.other.infra.database.rds.service.activity.LotteryPrizeServ
import com.red.circle.other.infra.database.rds.service.activity.LotteryRecordService;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@ -56,6 +57,9 @@ public class LotteryRecordQryExe {
}
IPage<LotteryRecord> recordPage = query.orderByDesc(LotteryRecord::getDrawTime).page(page);
if (recordPage.getRecords().isEmpty()) {
return new PageResult<>();
}
// 查询关联数据
List<Long> activityIds = recordPage.getRecords().stream()
@ -65,7 +69,7 @@ public class LotteryRecordQryExe {
List<Long> prizeIds = recordPage.getRecords().stream()
.map(LotteryRecord::getPrizeId)
.filter(id -> id != null)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toList());