From ec73339e08669dc5a0d4ff93e6640f51473c08cd Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 11 一月 2025 18:03:50 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BannerController.java |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 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 3493fae..4658fe0 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
@@ -1,6 +1,7 @@
 package com.ruoyi.other.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.StringUtils;
@@ -8,6 +9,7 @@
 import com.ruoyi.other.service.BannerService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -29,7 +31,9 @@
     private BannerService bannerService;
     @GetMapping("/list")
 	@ApiOperation(value = "banner列表", tags = {"小程序-banner"})
-	public R<List<Banner>> list(String name, Integer jumpType, Integer position){
+	public R<List<Banner>> list(@ApiParam("名称") String name,
+                                @ApiParam("跳转类型(1=无跳转,2=外部链接,3=商品详情,4=秒杀商品详情,5=领券中心)") 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)
@@ -52,6 +56,12 @@
 	@ApiOperation(value = "广告管理-banner管理-修改", tags = {"管理后台"})
 	public R edit(@RequestBody Banner banner){
             bannerService.updateById(banner);
+            if (banner.getContentType()==2){
+                LambdaUpdateWrapper<Banner> bannerLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+                bannerLambdaUpdateWrapper.set(Banner::getJumpType,null);
+                bannerLambdaUpdateWrapper.eq(Banner::getId,banner.getId());
+                bannerService.update(bannerLambdaUpdateWrapper);
+            }
             return R.ok();
       }
       @GetMapping("/detail")

--
Gitblit v1.7.1