Pārlūkot izejas kodu

修改文章管理、栏目管理

limeng 6 mēneši atpakaļ
vecāks
revīzija
c0fc1845d4

+ 8 - 63
zhjq-business/src/main/java/com/zhjq/domain/ZhjqAppCarousel.java

@@ -1,5 +1,6 @@
 package com.zhjq.domain;
 
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.zhjq.common.annotation.Excel;
@@ -11,6 +12,7 @@ import com.zhjq.common.core.domain.BaseEntity;
  * @author lc
  * @date 2024-12-16
  */
+@Data
 public class ZhjqAppCarousel extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
@@ -26,6 +28,12 @@ public class ZhjqAppCarousel extends BaseEntity {
     private String appName;
 
     /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    private String sort;
+
+    /**
      * 图片/视频地址
      */
     @Excel(name = "图片/视频地址")
@@ -49,67 +57,4 @@ public class ZhjqAppCarousel extends BaseEntity {
     @Excel(name = "数据状态(1-可用 2-不可用 )")
     private String dataStatus;
 
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setAppName(String appName) {
-        this.appName = appName;
-    }
-
-    public String getAppName() {
-        return appName;
-    }
-
-    public void setAppUrl(String appUrl) {
-        this.appUrl = appUrl;
-    }
-
-    public String getAppUrl() {
-        return appUrl;
-    }
-
-    public void setCreateName(String createName) {
-        this.createName = createName;
-    }
-
-    public String getCreateName() {
-        return createName;
-    }
-
-    public void setUpdateName(String updateName) {
-        this.updateName = updateName;
-    }
-
-    public String getUpdateName() {
-        return updateName;
-    }
-
-    public void setDataStatus(String dataStatus) {
-        this.dataStatus = dataStatus;
-    }
-
-    public String getDataStatus() {
-        return dataStatus;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("id", getId())
-                .append("appName", getAppName())
-                .append("appUrl", getAppUrl())
-                .append("createBy", getCreateBy())
-                .append("createName", getCreateName())
-                .append("createTime", getCreateTime())
-                .append("updateBy", getUpdateBy())
-                .append("updateName", getUpdateName())
-                .append("updateTime", getUpdateTime())
-                .append("dataStatus", getDataStatus())
-                .toString();
-    }
 }

+ 16 - 2
zhjq-business/src/main/java/com/zhjq/service/imp/ZhjqAppCarouselServiceImpl.java

@@ -3,14 +3,19 @@ package com.zhjq.service.imp;
 import java.util.List;
 
 import com.zhjq.common.utils.DateUtils;
+import com.zhjq.common.utils.StringUtils;
 import com.zhjq.domain.ZhjqAppCarousel;
 import com.zhjq.domain.ZhjqAppCarouselDto;
+import com.zhjq.domain.ZhjqArticle;
 import com.zhjq.mapper.ZhjqAppCarouselMapper;
+import com.zhjq.system.service.ISysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.zhjq.service.IZhjqAppCarouselService;
 
+import javax.annotation.Resource;
+
 /**
  * 轮播管理Service业务层处理
  *
@@ -19,7 +24,11 @@ import com.zhjq.service.IZhjqAppCarouselService;
  */
 @Service
 public class ZhjqAppCarouselServiceImpl implements IZhjqAppCarouselService {
-    @Autowired
+
+    @Resource
+    private ISysConfigService configService;
+
+    @Resource
     private ZhjqAppCarouselMapper zhjqAppCarouselMapper;
 
     /**
@@ -101,7 +110,12 @@ public class ZhjqAppCarouselServiceImpl implements IZhjqAppCarouselService {
 
     @Override
     public List<ZhjqAppCarouselDto> selectcarouselList(ZhjqAppCarouselDto zhjqAppCarousel) {
-
+        List<ZhjqAppCarouselDto> zhjqAppCarouselList = zhjqAppCarouselMapper.selectcarouselList(zhjqAppCarousel);
+        for (ZhjqAppCarouselDto carouselDto : zhjqAppCarouselList) {
+            if(StringUtils.isNotEmpty(carouselDto.getAppUrl())){
+                carouselDto.setAppUrl(configService.selectConfigByKey("server_url") + carouselDto.getAppUrl());
+            }
+        }
         return zhjqAppCarouselMapper.selectcarouselList(zhjqAppCarousel);
     }
 }

+ 37 - 68
zhjq-business/src/main/resources/mapper/ZhjqAppCarouselMapper.xml

@@ -7,6 +7,7 @@
     <resultMap type="ZhjqAppCarousel" id="ZhjqAppCarouselResult">
         <result property="id" column="id"/>
         <result property="appName" column="app_name"/>
+        <result property="sort" column="sort"/>
         <result property="appUrl" column="app_url"/>
         <result property="createBy" column="create_by"/>
         <result property="createName" column="create_name"/>
@@ -20,12 +21,14 @@
     <resultMap type="ZhjqAppCarouselDto" id="ZhjqAppCarouselDtoResult">
         <result property="id" column="id"/>
         <result property="appName" column="app_name"/>
+        <result property="sort" column="sort"/>
         <result property="appUrl" column="app_url"/>
     </resultMap>
 
     <sql id="selectZhjqAppCarouselVo">
         select id,
                app_name,
+               sort,
                app_url,
                create_by,
                create_name,
@@ -67,81 +70,46 @@
     <insert id="insertZhjqAppCarousel" parameterType="ZhjqAppCarousel">
         insert into zhjq_app_carousel
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id != null">id,
-            </if>
-            <if test="appName != null">app_name,
-            </if>
-            <if test="appUrl != null">app_url,
-            </if>
-            <if test="createBy != null">create_by,
-            </if>
-            <if test="createName != null">create_name,
-            </if>
-            <if test="createTime != null">create_time,
-            </if>
-            <if test="updateBy != null">update_by,
-            </if>
-            <if test="updateName != null">update_name,
-            </if>
-            <if test="updateTime != null">update_time,
-            </if>
-            <if test="dataStatus != null">data_status,
-            </if>
+            <if test="id != null">id,</if>
+            <if test="appName != null">app_name,</if>
+            <if test="sort != null">sort,</if>
+            <if test="appUrl != null">app_url,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateName != null">update_name,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="dataStatus != null">data_status,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="id != null">#{id},
-            </if>
-            <if test="appName != null">#{appName},
-            </if>
-            <if test="appUrl != null">#{appUrl},
-            </if>
-            <if test="createBy != null">#{createBy},
-            </if>
-            <if test="createName != null">#{createName},
-            </if>
-            <if test="createTime != null">#{createTime},
-            </if>
-            <if test="updateBy != null">#{updateBy},
-            </if>
-            <if test="updateName != null">#{updateName},
-            </if>
-            <if test="updateTime != null">#{updateTime},
-            </if>
-            <if test="dataStatus != null">#{dataStatus},
-            </if>
+            <if test="id != null">#{id},</if>
+            <if test="appName != null">#{appName},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="appUrl != null">#{appUrl},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateName != null">#{updateName},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="dataStatus != null">#{dataStatus},</if>
         </trim>
     </insert>
 
     <update id="updateZhjqAppCarousel" parameterType="ZhjqAppCarousel">
         update zhjq_app_carousel
         <trim prefix="SET" suffixOverrides=",">
-            <if test="appName != null">app_name =
-                #{appName},
-            </if>
-            <if test="appUrl != null">app_url =
-                #{appUrl},
-            </if>
-            <if test="createBy != null">create_by =
-                #{createBy},
-            </if>
-            <if test="createName != null">create_name =
-                #{createName},
-            </if>
-            <if test="createTime != null">create_time =
-                #{createTime},
-            </if>
-            <if test="updateBy != null">update_by =
-                #{updateBy},
-            </if>
-            <if test="updateName != null">update_name =
-                #{updateName},
-            </if>
-            <if test="updateTime != null">update_time =
-                #{updateTime},
-            </if>
-            <if test="dataStatus != null">data_status =
-                #{dataStatus},
-            </if>
+            <if test="appName != null">app_name = #{appName},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="appUrl != null">app_url = #{appUrl},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="dataStatus != null">data_status = #{dataStatus},</if>
         </trim>
         where id = #{id}
     </update>
@@ -162,9 +130,10 @@
     <select id="selectcarouselList" parameterType="ZhjqAppCarouselDto" resultMap="ZhjqAppCarouselDtoResult">
         select id,
                app_name,
+               sort,
                app_url
         from zhjq_app_carousel
         where   data_status = 1
-        order by id
+        order by sort asc
     </select>
 </mapper>

+ 1 - 1
zhjq-business/src/main/resources/mapper/ZhjqArticleMapper.xml

@@ -147,7 +147,7 @@
             zhjq_column b ON a.column_id = b.column_id
         WHERE
             a.column_id = #{columnId}
-        ORDER BY sort DESC, a.create_time DESC
+        ORDER BY sort ASC, a.create_time DESC
         <if test="limit != null and limit != ''">
             LIMIT #{limit}
         </if>

+ 1 - 1
zhjq-ui/src/components/FileUpload/index.vue

@@ -60,7 +60,7 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ['png', 'jpg', 'jpeg', "mp3", "mp4", "doc", "xls", "ppt", "txt", "pdf"],
+      default: () => ['png', 'jpg', 'jpeg', "mp4"],
     },
     // 是否显示提示
     isShowTip: {

+ 6 - 0
zhjq-ui/src/views/system/carousel/index.vue

@@ -94,6 +94,7 @@
           </el-tooltip>
         </template>
       </el-table-column>
+      <el-table-column label="排序" align="center" prop="sort"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -130,6 +131,9 @@
         <el-form-item label="名称" prop="appName">
           <el-input v-model="form.appName" placeholder="请输入名称" maxlength="25"/>
         </el-form-item>
+        <el-form-item label="排序" prop="sort">
+          <el-input-number :min="1" v-model="value" placeholder="请输入排序"/>
+        </el-form-item>
         <el-form-item label="文件" prop="appUrl">
           <file-upload v-model="form.appUrl" :limit="1"/>
         </el-form-item>
@@ -167,6 +171,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      value: 999,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -255,6 +260,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.form.sort = this.value;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {