diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java index 6970c9dde..8796365bf 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java @@ -448,16 +448,16 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService { .filter(x -> Objects.equals(x.getShowType(), AdShowType.POSITION_ENUM.getValue())) .filter(x -> ObjectUtils.isNotEmpty(x.getPayPrice())) .collect(Collectors.toMap(AdvertRound::getId, AdvertRound::getPayPrice)); - // 已购买的 时间范围播放轮次 的roundId列表 - final List boughtTimeRangeRoundIdList = boughtRoundList.stream().filter(x -> Objects.equals(x.getShowType(), AdShowType.TIME_RANGE.getValue())) - .map(AdRoundStoreBoughtResDTO::getRoundId).collect(Collectors.toList()); + // 已购买的 时间范围播放轮次 的 typeId 和 roundId 列表 + final List boughtTimeRangeMultiKeyList = boughtRoundList.stream().filter(x -> Objects.equals(x.getShowType(), AdShowType.TIME_RANGE.getValue())) + .map(x -> x.getTypeId().toString() + ":" + x.getRoundId().toString()).collect(Collectors.toList()); // 已购买的 位置枚举 的 advertRoundId 列表 final List boughtPositionAdvertRoundIdList = boughtRoundList.stream().filter(x -> Objects.equals(x.getShowType(), AdShowType.POSITION_ENUM.getValue())) .map(AdRoundStoreBoughtResDTO::getAdvertRoundId).collect(Collectors.toList()); // 购买失败的 时间范围播放轮次的 列表 Map boughtFailTimeRangeMap = allRecordList.stream() .filter(x -> Objects.equals(x.getShowType(), AdShowType.TIME_RANGE.getValue())) - .filter(x -> !boughtTimeRangeRoundIdList.contains(x.getRoundId())) + .filter(x -> !boughtTimeRangeMultiKeyList.contains(x.getTypeId().toString() + ":" + x.getRoundId().toString())) .collect(Collectors.toMap(AdvertRoundRecord::getRoundId, Function.identity(), BinaryOperator.maxBy(Comparator.comparingLong(AdvertRoundRecord::getId)))); // 购买失败的 位置枚举播放轮次的 列表