From 9e8c542caf11c0b72639a8e323fa81fd3b4f594e Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期二, 01 四月 2025 19:00:09 +0800 Subject: [PATCH] 首页 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java | 18 ++++-------------- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java index 11a1be8..ac7cea1 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java @@ -52,37 +52,27 @@ @GetMapping("/list") @ApiOperation(value = "banner列表", tags = {"小程序-banner"}) public R<List<Banner>> list(@ApiParam("名称") String name, - @ApiParam("跳转类型(1=无跳转,2=外部链接,3=商品详情,4=秒杀商品详情,5=领券中心)") Integer jumpType, + @ApiParam("跳转类型(1=无跳转,2=外部链接,3=商品详情,4=秒杀商品详情)") Integer jumpType, @ApiParam("位置(1=首页,2=商城首页)") Integer position){ List<Banner> list = bannerService.lambdaQuery().like(StringUtils.isNotEmpty(name), Banner::getName, name) .eq(jumpType!=null,Banner::getJumpType, jumpType) .eq(position!=null,Banner::getPosition, position) .list(); - Integer vipId = 0; - String token = SecurityUtils.getToken(ServletUtils.getRequest()); - if(StringUtils.isNotEmpty(token)){ - Long userid = tokenService.getLoginUserApplet().getUserid(); - AppUser appUser = appUserClient.getAppUserById(userid); - vipId = appUser.getVipId(); - } for (Banner banner : list) { Integer jumpType1 = banner.getJumpType(); //商品详情 if(null != jumpType1 && 3 == jumpType1){ Goods goods = goodsService.getById(banner.getContent()); if(null == goods || goods.getDelFlag() == 1){ - banner.setJumpType(1); - } else if(!goods.getCommodityAuthority().contains("-1") && !goods.getCommodityAuthority().contains(vipId.toString())){ - banner.setJumpType(1); + banner.setJumpType(1);//商品不存在 } } //秒杀活动 if(null != jumpType1 && 4 == jumpType1){ SeckillActivityInfo activityInfo = seckillActivityInfoService.getById(banner.getContent()); - if(null == activityInfo || activityInfo.getDelFlag() == 1 || !activityInfo.getVipIds().contains(vipId.toString())){ - banner.setJumpType(1); + if(null == activityInfo || activityInfo.getDelFlag() == 1 ){ + banner.setJumpType(1);//秒杀活动不存在 } - } } return R.ok(list); -- Gitblit v1.7.1