Переглянути джерело

界面运营管理(未实现web端的管理)

LiRong 3 місяців тому
батько
коміт
ca69204ac2

+ 7 - 5
leromro-core/src/main/java/com/leromro/core/controller/LSlideshowController.java

@@ -56,6 +56,7 @@ public class LSlideshowController extends BaseController
     /**
      * 导出主页轮播图或后续其他广告图片列表
      */
+/*
     @ApiOperation("导出主页轮播图或后续其他广告图片列表")
   //  @PreAuthorize("@ss.hasPermi('core:slideshow:export')")
     @Log(title = "主页轮播图或后续其他广告图片", businessType = BusinessType.EXPORT)
@@ -66,16 +67,17 @@ public class LSlideshowController extends BaseController
         ExcelUtil<Slideshow> util = new ExcelUtil<Slideshow>(Slideshow.class);
         util.exportExcel(response, list, "主页轮播图或后续其他广告图片数据");
     }
+*/
 
     /**
      * 获取主页轮播图或后续其他广告图片详细信息
      */
-    @ApiOperation("小程序端根据轮播图id查询")
+    @ApiOperation("小程序端根据轮播图类型查询")
  //   @PreAuthorize("@ss.hasPermi('core:slideshow:query')")
-    @GetMapping(value = "/{slideshowId}")
-    public R<Slideshow> getInfo(@PathVariable("slideshowId") Long slideshowId)
+    @GetMapping(value = "/{slideshowType}")
+    public R<Slideshow> getInfo(@PathVariable("slideshowType") Long slideshowType)
     {
-        return R.ok(lSlideshowService.selectLSlideshowBySlideshowId(slideshowId));
+        return R.ok(lSlideshowService.selectLSlideshowBySlideshowType(slideshowType));
     }
 
     /**
@@ -94,7 +96,7 @@ public class LSlideshowController extends BaseController
      * 修改主页轮播图或后续其他广告图片
      */
     @ApiOperation("web修改主页轮播图或后续其他广告图片")
-  //  @PreAuthorize("@ss.hasPermi('core:slideshow:edit')")
+    //@PreAuthorize("@ss.hasPermi('core:slideshow:edit')")
     @Log(title = "主页轮播图或后续其他广告图片", businessType = BusinessType.UPDATE)
     @PostMapping
     public AjaxResult edit(@RequestBody Slideshow slideshow)

+ 32 - 0
leromro-core/src/main/java/com/leromro/core/domain/Slideshow.java

@@ -39,6 +39,38 @@ public class Slideshow extends BaseEntity
     @TableField("slideshow_name")
     @ApiModelProperty("图片的名字和或描述")
     private String slideshowName;
+    /** 图片字符串拼接起来 */
+    @TableField("area_id")
+    @ApiModelProperty("所属区域id")
+    private String areaId;
+
+    /** 图片字符串拼接起来 */
+    @TableField("slideshow_type")
+    @ApiModelProperty("运营文本或图片类型(10首页顶部轮播图 20中间轮播图 30用户列表的广告图 40热门搜索 50通知公告)")
+    private String slideshowType;
+
+    @TableField("province_code")
+    @ApiModelProperty("省级区划编号")
+    private String provinceCode;
+
+    @TableField("province_name")
+    @ApiModelProperty("省级名称")
+    private String provinceName;
+
+    @TableField("city_code")
+    @ApiModelProperty("市级编号")
+    private String cityCode;
+
+    @TableField("city_name")
+    @ApiModelProperty("市级名称")
+    private String cityName;
+
+    @TableField("district_code")
+    @ApiModelProperty("区级区划编号")
+    private String districtCode;
 
+    @TableField("district_name")
+    @ApiModelProperty("区级名称")
+    private String districtName;
 
 }

+ 7 - 3
leromro-core/src/main/java/com/leromro/core/mapper/LSlideshowMapper.java

@@ -2,7 +2,9 @@ package com.leromro.core.mapper;
 
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.leromro.common.core.domain.ListPermission;
 import com.leromro.core.domain.Slideshow;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 主页轮播图或后续其他广告图片Mapper接口
@@ -15,10 +17,10 @@ public interface LSlideshowMapper extends BaseMapper<Slideshow>
     /**
      * 查询主页轮播图或后续其他广告图片
      * 
-     * @param slideshowId 主页轮播图或后续其他广告图片主键
+     * @param slideshowType 主页轮播图或后续其他广告图片主键
      * @return 主页轮播图或后续其他广告图片
      */
-    public Slideshow selectLSlideshowBySlideshowId(Long slideshowId);
+    public Slideshow selectLSlideshowBySlideshowType(ListPermission listPermission ,@Param("slideshowType") Long slideshowType);
 
     /**
      * 查询主页轮播图或后续其他广告图片列表
@@ -26,7 +28,7 @@ public interface LSlideshowMapper extends BaseMapper<Slideshow>
      * @param slideshow 主页轮播图或后续其他广告图片
      * @return 主页轮播图或后续其他广告图片集合
      */
-    public List<Slideshow> selectLSlideshowList(Slideshow slideshow);
+    public List<Slideshow> selectLSlideshowList(ListPermission listPermission,@Param("slideshow") Slideshow slideshow);
 
     /**
      * 新增主页轮播图或后续其他广告图片
@@ -59,4 +61,6 @@ public interface LSlideshowMapper extends BaseMapper<Slideshow>
      * @return 结果
      */
     public int deleteLSlideshowBySlideshowIds(Long[] slideshowIds);
+
+    Slideshow selectDefultSlideshowByType(Long slideshowType);
 }

+ 2 - 2
leromro-core/src/main/java/com/leromro/core/service/ILSlideshowService.java

@@ -15,10 +15,10 @@ public interface ILSlideshowService extends IService<Slideshow>
     /**
      * 查询主页轮播图或后续其他广告图片
      * 
-     * @param slideshowId 主页轮播图或后续其他广告图片主键
+     * @param slideshowType 主页轮播图或后续其他广告图片主键
      * @return 主页轮播图或后续其他广告图片
      */
-    public Slideshow selectLSlideshowBySlideshowId(Long slideshowId);
+    public Slideshow selectLSlideshowBySlideshowType(Long slideshowType);
 
     /**
      * 查询主页轮播图或后续其他广告图片列表

+ 12 - 4
leromro-core/src/main/java/com/leromro/core/service/impl/LSlideshowServiceImpl.java

@@ -2,6 +2,9 @@ package com.leromro.core.service.impl;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.leromro.common.constant.CommonConstants;
+import com.leromro.common.core.domain.ListPermission;
+import com.leromro.common.core.domain.entity.SysUser;
 import com.leromro.core.mapper.LSlideshowMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -23,13 +26,18 @@ public class LSlideshowServiceImpl extends ServiceImpl<LSlideshowMapper, Slidesh
     /**
      * 查询主页轮播图或后续其他广告图片
      * 
-     * @param slideshowId 主页轮播图或后续其他广告图片主键
+     * @param slideshowType 主页轮播图或后续其他广告图片主键
      * @return 主页轮播图或后续其他广告图片
      */
     @Override
-    public Slideshow selectLSlideshowBySlideshowId(Long slideshowId)
+    public Slideshow selectLSlideshowBySlideshowType(Long slideshowType)
     {
-        return lSlideshowMapper.selectLSlideshowBySlideshowId(slideshowId);
+        Slideshow slideshow = lSlideshowMapper.selectLSlideshowBySlideshowType(new ListPermission(Slideshow.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT),slideshowType);
+        if (slideshow==null){
+            return lSlideshowMapper.selectDefultSlideshowByType(slideshowType);
+        }
+
+        return slideshow;
     }
 
     /**
@@ -41,7 +49,7 @@ public class LSlideshowServiceImpl extends ServiceImpl<LSlideshowMapper, Slidesh
     @Override
     public List<Slideshow> selectLSlideshowList(Slideshow slideshow)
     {
-        return lSlideshowMapper.selectLSlideshowList(slideshow);
+        return lSlideshowMapper.selectLSlideshowList(new ListPermission(Slideshow.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT),slideshow);
     }
 
     /**

+ 28 - 8
leromro-core/src/main/resources/mapper/core/LSlideshowMapper.xml

@@ -16,19 +16,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLSlideshowVo">
-        select slideshow_id,slideshow_name, picture, create_time, create_by, update_time, update_by, remark from l_slideshow
+        select slideshow_id,slideshow_name, picture,slideshow_type,status,province_code,province_name,city_code,city_name,district_code,district_name, create_time, create_by, update_time, update_by, remark from l_slideshow
     </sql>
 
     <select id="selectLSlideshowList" parameterType="Slideshow" resultMap="LSlideshowResult">
-        <include refid="selectLSlideshowVo"/>
-        <where>  
-            <if test="picture != null  and picture != ''"> and picture = #{picture}</if>
-        </where>
+        select * from l_slideshow
     </select>
     
-    <select id="selectLSlideshowBySlideshowId" parameterType="Long" resultMap="LSlideshowResult">
-        <include refid="selectLSlideshowVo"/>
-        where slideshow_id = #{slideshowId}
+
+    <select id="selectLSlideshowBySlideshowType" resultType="com.leromro.core.domain.Slideshow">
+        select * from l_slideshow
+        where slideshow_type = #{slideshowType} and status = 1
+    </select>
+    <select id="selectDefultSlideshowByType" resultType="com.leromro.core.domain.Slideshow"
+            parameterType="java.lang.Long">
+        select * from l_slideshow
+        where slideshow_type = #{slideshowType} and area_id = 100 and status = 1
     </select>
 
     <insert id="insertLSlideshow" parameterType="Slideshow" useGeneratedKeys="true" keyProperty="slideshowId">
@@ -36,6 +39,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="slideshowName != null">slideshow_name,</if>
             <if test="picture != null">picture,</if>
+            <if test="slideshowType != null">slideshow_type,</if>
+            <if test="status != null">status,</if>
+            <if test="provincecode != null">province_code,</if>
+            <if test="provinceName != null">province_name,</if>
+            <if test="cityCode != null">city_code,</if>
+            <if test="cityName != null">city_name,</if>
+            <if test="districtCode != null">district_code,</if>
+            <if test="districtName != null">district_name,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateTime != null">update_time,</if>
@@ -45,6 +56,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="slideshowName != null">#{slideshowName},</if>
             <if test="picture != null">#{picture},</if>
+            <if test="slideshowType != null">#{slideshowType},</if>
+            <if test="status != null">#{status},</if>
+            <if test="provincecode != null">#{provincecode},</if>
+            <if test="provinceName != null">#{provinceName},</if>
+            <if test="cityCode != null">#{cityCode},</if>
+            <if test="cityName != null">#{cityName},</if>
+            <if test="districtCode != null">#{districtCode},</if>
+            <if test="districtName != null">#{districtName},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
@@ -77,4 +96,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{slideshowId}
         </foreach>
     </delete>
+
 </mapper>