diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/advertRound/AdRoundStoreBoughtResVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/advertRound/AdRoundStoreBoughtResVO.java index ed1b69a49..1de067b64 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/advertRound/AdRoundStoreBoughtResVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/advertRound/AdRoundStoreBoughtResVO.java @@ -50,5 +50,7 @@ public class AdRoundStoreBoughtResVO { private String biddingStatusName; @ApiModelProperty(value = "当前播放状态") private Integer launchStatus; + @ApiModelProperty(value = "正在播放 或 即将播放") + private Boolean activePlay; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/AdType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/AdType.java index ed19c2066..7c6d4e3ed 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/AdType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/AdType.java @@ -76,12 +76,14 @@ public enum AdType { PIC_SEARCH_PRODUCT(300, "以图搜款商品"), - // PC搜索结果 - PC_SEARCH_RESULT(401, "电脑端搜索结果"), + // PC搜索右侧商品 + PC_SEARCH_RIGHT_PRODUCT(401, "电脑端搜索右侧商品"), // PC用户中心 18个位置 PC_USER_CENTER(402, "电脑端用户中心"), // PC下载页 PC_DOWNLOAD(403, "电脑端下载页"), + // PC搜索结果商品 + PC_SEARCH_RESULT_PRODUCT(404, "电脑端搜索结果商品"), // APP首页顶部轮播图 @@ -96,8 +98,8 @@ public enum AdType { APP_HOME_POP_RECOMMEND_PROD(505, "APP首页人气榜商品列表"), // APP首页新品榜 商品列表 APP_HOME_NEW_PROD_RECOMMEND_PROD(506, "APP首页新品榜商品列表"), - // APP搜索结果 - APP_SEARCH_RESULT(507, "APP搜索结果"), + // APP搜索结果商品 + APP_SEARCH_RESULT_PRODUCT(507, "APP搜索结果商品"), // APP分类页轮播图 diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/advertRound/AdRoundStoreBoughtResDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/advertRound/AdRoundStoreBoughtResDTO.java index 6d5cb1e39..3038bb655 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/dto/advertRound/AdRoundStoreBoughtResDTO.java +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/advertRound/AdRoundStoreBoughtResDTO.java @@ -50,5 +50,7 @@ public class AdRoundStoreBoughtResDTO { private String biddingStatusName; @ApiModelProperty(value = "当前播放状态") private Integer launchStatus; + @ApiModelProperty(value = "正在播放 或 即将播放") + private Boolean activePlay; } 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 11f78a7d1..7ae795afd 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 @@ -387,14 +387,26 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService { .map(x -> { // 如果是最近的播放轮次,且当前时间在 晚上10:00:01 之后到 当天23:59:59 都显示 biddingTempStatus 字段 final Integer biddingStatus = tenClockAfter && roundIdList.contains(x.getRoundId()) ? x.getBiddingTempStatus() : x.getBiddingStatus(); - return BeanUtil.toBean(x, AdRoundStoreBoughtResDTO.class).setAdvertRoundId(x.getId()) - .setBiddingStatus(biddingStatus).setLaunchStatus(x.getLaunchStatus()) + AdRoundStoreBoughtResDTO boughtResDTO = BeanUtil.toBean(x, AdRoundStoreBoughtResDTO.class).setAdvertRoundId(x.getId()) + .setBiddingStatus(biddingStatus).setLaunchStatus(x.getLaunchStatus()).setActivePlay(Boolean.FALSE) // 如果是已出价,则显示 "已出价:50" .setBiddingStatusName(AdBiddingStatus.of(biddingStatus).getLabel() + (Objects.equals(biddingStatus, AdBiddingStatus.BIDDING.getValue()) ? ":" + x.getPayPrice() : "")) .setTypeName(AdType.of(x.getTypeId()).getLabel()) // 如果是时间范围则不返回position .setPosition(Objects.equals(x.getShowType(), AdShowType.TIME_RANGE.getValue()) ? null : x.getPosition()); + + // 当前为播放轮 或 当前为第二轮且开始时间为明天 + if (Objects.equals(x.getRoundId(), AdRoundType.PLAY_ROUND.getValue())) { + boughtResDTO.setActivePlay(Boolean.TRUE); + // 如果是第二轮且开始时间为明天 + } else if (Objects.equals(x.getRoundId(), AdRoundType.SECOND_ROUND.getValue())) { + LocalDate startTimeDate = x.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + if (LocalDate.now().plusDays(1).equals(startTimeDate)) { + boughtResDTO.setActivePlay(Boolean.TRUE); + } + } + return boughtResDTO; }) .collect(Collectors.toList()); // showType 为 时间范围的 每一轮最高的出价map diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreSaleServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreSaleServiceImpl.java index e6400f331..b5c0a1d24 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreSaleServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreSaleServiceImpl.java @@ -216,19 +216,21 @@ public class StoreSaleServiceImpl implements IStoreSaleService { if (CollectionUtils.isNotEmpty(exportDTO.getStoreSaleIdList())) { return this.storeSaleMapper.selectExportList(exportDTO.getStoreSaleIdList()); } else { - // 如果是全量导出,则开始时间 和 结束时间 不能为空 + // 没有传时间,则设置当前时间往前推半年 if (ObjectUtils.isEmpty(exportDTO.getVoucherDateStart()) && ObjectUtils.isEmpty(exportDTO.getVoucherDateEnd())) { - throw new ServiceException("全量导出时,开始时间和结束时间不能为空!", HttpStatus.ERROR); - } - // 开始时间和结束时间,相间隔不能超过6个月 - LocalDate start = exportDTO.getVoucherDateStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - LocalDate end = exportDTO.getVoucherDateEnd().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - // 计算两个日期之间的年、月、日差值 - Period period = Period.between(start, end); - // 如果总月数超过6个月,则返回 true - int totalMonths = period.getYears() * 12 + period.getMonths(); - if (Math.abs(totalMonths) > 6) { - throw new ServiceException("导出时间间隔不能超过6个月!", HttpStatus.ERROR); + exportDTO.setVoucherDateEnd(java.sql.Date.valueOf(LocalDate.now())); + exportDTO.setVoucherDateEnd(java.sql.Date.valueOf(LocalDate.now().minusMonths(6))); + } else { + // 开始时间和结束时间,相间隔不能超过6个月 + LocalDate start = exportDTO.getVoucherDateStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate end = exportDTO.getVoucherDateEnd().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + // 计算两个日期之间的年、月、日差值 + Period period = Period.between(start, end); + // 如果总月数超过6个月,则返回 true + int totalMonths = period.getYears() * 12 + period.getMonths(); + if (Math.abs(totalMonths) > 6) { + throw new ServiceException("导出时间间隔不能超过6个月!", HttpStatus.ERROR); + } } return this.storeSaleMapper.selectExportListVoucherDateBetween(exportDTO.getVoucherDateStart(), exportDTO.getVoucherDateEnd()); } diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsiteAPPServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsiteAPPServiceImpl.java index 71ee26786..5247c8a04 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsiteAPPServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsiteAPPServiceImpl.java @@ -359,7 +359,7 @@ public class WebsiteAPPServiceImpl implements IWebsiteAPPService { // 从数据库查首页 新品榜 推广(精准搜索是否存在推广,不存在从已过期的数据中拉数据来凑数) List advertRoundList = this.advertRoundMapper.selectList(new LambdaQueryWrapper() .isNotNull(AdvertRound::getStoreId).eq(AdvertRound::getDelFlag, Constants.UNDELETED) - .eq(AdvertRound::getTypeId, AdType.APP_SEARCH_RESULT.getValue()) + .eq(AdvertRound::getTypeId, AdType.APP_SEARCH_RESULT_PRODUCT.getValue()) .eq(AdvertRound::getLaunchStatus, AdLaunchStatus.LAUNCHING.getValue()) .eq(AdvertRound::getBiddingStatus, AdBiddingStatus.BIDDING_SUCCESS.getValue())); if (CollectionUtils.isNotEmpty(advertRoundList)) { diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsitePCServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsitePCServiceImpl.java index d5f049d60..3cbddf9c8 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsitePCServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/WebsitePCServiceImpl.java @@ -424,7 +424,7 @@ public class WebsitePCServiceImpl implements IWebsitePCService { if (ObjectUtils.isNotEmpty(searchResultAdvertList)) { return searchResultAdvertList; } - List oneMonthList = this.getOneMonthAdvertList(Collections.singletonList(AdType.PC_SEARCH_RESULT.getValue())); + List oneMonthList = this.getOneMonthAdvertList(Collections.singletonList(AdType.PC_SEARCH_RIGHT_PRODUCT.getValue())); if (CollectionUtils.isEmpty(oneMonthList)) { return new ArrayList<>(); }