15143018065 hace 2 años
padre
commit
dc04e09b19

+ 28 - 0
okc/pom.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>ruoyi</artifactId>
+        <groupId>com.ruoyi</groupId>
+        <version>3.8.4</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>okc</artifactId>
+
+    <description>
+        OKC模块
+    </description>
+
+    <dependencies>
+
+        <!-- 通用工具-->
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>ruoyi-common</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

+ 197 - 0
okc/src/main/java/com/ruoyi/okc/domain/OkcVideoPro.java

@@ -0,0 +1,197 @@
+package com.ruoyi.okc.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 视频项目信息对象 okc_videopro
+ * 
+ * @author sun
+ * @date 2022-12-28
+ */
+public class OkcVideoPro extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键标识 */
+    private String id;
+
+    /** 视频名称 */
+    @Excel(name = "视频名称")
+    private String videoName;
+
+    /** 视频本地绝对路径 */
+    @Excel(name = "视频本地绝对路径")
+    private String videoUrl;
+
+    /** 创建时间 */
+    private String createTimeStr;
+
+    /** 创建用户Id */
+    private String createUserId;
+
+    /** 创建人用户类型 */
+    private String createUserType;
+
+    /** 创建单位Id */
+    private String createUnit;
+
+    /** 创建单位 */
+    private String createUnitName;
+
+    /** 更新时间 */
+    private String updateTimeStr;
+
+    /** 更新用户Id */
+    private String updateUserId;
+
+    /** 更新单位Id */
+    private String updateUnit;
+
+    /** 更新单位 */
+    private String updateUnitName;
+
+    /** 数据状态 */
+    private String status;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setVideoName(String videoName) 
+    {
+        this.videoName = videoName;
+    }
+
+    public String getVideoName() 
+    {
+        return videoName;
+    }
+    public void setVideoUrl(String videoUrl) 
+    {
+        this.videoUrl = videoUrl;
+    }
+
+    public String getVideoUrl() 
+    {
+        return videoUrl;
+    }
+    public void setCreateTimeStr(String createTimeStr) 
+    {
+        this.createTimeStr = createTimeStr;
+    }
+
+    public String getCreateTimeStr() 
+    {
+        return createTimeStr;
+    }
+    public void setCreateUserId(String createUserId) 
+    {
+        this.createUserId = createUserId;
+    }
+
+    public String getCreateUserId() 
+    {
+        return createUserId;
+    }
+    public void setCreateUserType(String createUserType) 
+    {
+        this.createUserType = createUserType;
+    }
+
+    public String getCreateUserType() 
+    {
+        return createUserType;
+    }
+    public void setCreateUnit(String createUnit) 
+    {
+        this.createUnit = createUnit;
+    }
+
+    public String getCreateUnit() 
+    {
+        return createUnit;
+    }
+    public void setCreateUnitName(String createUnitName) 
+    {
+        this.createUnitName = createUnitName;
+    }
+
+    public String getCreateUnitName() 
+    {
+        return createUnitName;
+    }
+    public void setUpdateTimeStr(String updateTimeStr) 
+    {
+        this.updateTimeStr = updateTimeStr;
+    }
+
+    public String getUpdateTimeStr() 
+    {
+        return updateTimeStr;
+    }
+    public void setUpdateUserId(String updateUserId) 
+    {
+        this.updateUserId = updateUserId;
+    }
+
+    public String getUpdateUserId() 
+    {
+        return updateUserId;
+    }
+    public void setUpdateUnit(String updateUnit) 
+    {
+        this.updateUnit = updateUnit;
+    }
+
+    public String getUpdateUnit() 
+    {
+        return updateUnit;
+    }
+    public void setUpdateUnitName(String updateUnitName) 
+    {
+        this.updateUnitName = updateUnitName;
+    }
+
+    public String getUpdateUnitName() 
+    {
+        return updateUnitName;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("videoName", getVideoName())
+            .append("videoUrl", getVideoUrl())
+            .append("createTimeStr", getCreateTimeStr())
+            .append("createUserId", getCreateUserId())
+            .append("createBy", getCreateBy())
+            .append("createUserType", getCreateUserType())
+            .append("createUnit", getCreateUnit())
+            .append("createUnitName", getCreateUnitName())
+            .append("updateTimeStr", getUpdateTimeStr())
+            .append("updateUserId", getUpdateUserId())
+            .append("updateBy", getUpdateBy())
+            .append("updateUnit", getUpdateUnit())
+            .append("updateUnitName", getUpdateUnitName())
+            .append("status", getStatus())
+            .toString();
+    }
+}

+ 61 - 0
okc/src/main/java/com/ruoyi/okc/mapper/OkcVideoProMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.okc.mapper;
+
+import java.util.List;
+import com.ruoyi.okc.domain.OkcVideoPro;
+
+/**
+ * 视频项目信息Mapper接口
+ * 
+ * @author sun
+ * @date 2022-12-28
+ */
+public interface OkcVideoProMapper 
+{
+    /**
+     * 查询视频项目信息
+     * 
+     * @param id 视频项目信息主键
+     * @return 视频项目信息
+     */
+    public OkcVideoPro selectOkcVideoProById(String id);
+
+    /**
+     * 查询视频项目信息列表
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 视频项目信息集合
+     */
+    public List<OkcVideoPro> selectOkcVideoProList(OkcVideoPro okcVideoPro);
+
+    /**
+     * 新增视频项目信息
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 结果
+     */
+    public int insertOkcVideoPro(OkcVideoPro okcVideoPro);
+
+    /**
+     * 修改视频项目信息
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 结果
+     */
+    public int updateOkcVideoPro(OkcVideoPro okcVideoPro);
+
+    /**
+     * 删除视频项目信息
+     * 
+     * @param id 视频项目信息主键
+     * @return 结果
+     */
+    public int deleteOkcVideoProById(String id);
+
+    /**
+     * 批量删除视频项目信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteOkcVideoProByIds(String[] ids);
+}

+ 61 - 0
okc/src/main/java/com/ruoyi/okc/service/IOkcVideoProService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.okc.service;
+
+import java.util.List;
+import com.ruoyi.okc.domain.OkcVideoPro;
+
+/**
+ * 视频项目信息Service接口
+ * 
+ * @author sun
+ * @date 2022-12-28
+ */
+public interface IOkcVideoProService 
+{
+    /**
+     * 查询视频项目信息
+     * 
+     * @param id 视频项目信息主键
+     * @return 视频项目信息
+     */
+    public OkcVideoPro selectOkcVideoProById(String id);
+
+    /**
+     * 查询视频项目信息列表
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 视频项目信息集合
+     */
+    public List<OkcVideoPro> selectOkcVideoProList(OkcVideoPro okcVideoPro);
+
+    /**
+     * 新增视频项目信息
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 结果
+     */
+    public int insertOkcVideoPro(OkcVideoPro okcVideoPro);
+
+    /**
+     * 修改视频项目信息
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 结果
+     */
+    public int updateOkcVideoPro(OkcVideoPro okcVideoPro);
+
+    /**
+     * 批量删除视频项目信息
+     * 
+     * @param ids 需要删除的视频项目信息主键集合
+     * @return 结果
+     */
+    public int deleteOkcVideoProByIds(String[] ids);
+
+    /**
+     * 删除视频项目信息信息
+     * 
+     * @param id 视频项目信息主键
+     * @return 结果
+     */
+    public int deleteOkcVideoProById(String id);
+}

+ 108 - 0
okc/src/main/java/com/ruoyi/okc/service/impl/OkcVideoProServiceImpl.java

@@ -0,0 +1,108 @@
+package com.ruoyi.okc.service.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.okc.mapper.OkcVideoProMapper;
+import com.ruoyi.okc.domain.OkcVideoPro;
+import com.ruoyi.okc.service.IOkcVideoProService;
+
+import static com.ruoyi.common.utils.DateUtils.YYYYMMDDHHMMSS;
+
+/**
+ * 视频项目信息Service业务层处理
+ * 
+ * @author sun
+ * @date 2022-12-28
+ */
+@Service
+public class OkcVideoProServiceImpl implements IOkcVideoProService 
+{
+    @Autowired
+    private OkcVideoProMapper okcVideoProMapper;
+
+    /**
+     * 查询视频项目信息
+     * 
+     * @param id 视频项目信息主键
+     * @return 视频项目信息
+     */
+    @Override
+    public OkcVideoPro selectOkcVideoProById(String id)
+    {
+        return okcVideoProMapper.selectOkcVideoProById(id);
+    }
+
+    /**
+     * 查询视频项目信息列表
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 视频项目信息
+     */
+    @Override
+    public List<OkcVideoPro> selectOkcVideoProList(OkcVideoPro okcVideoPro)
+    {
+        okcVideoPro.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
+        return okcVideoProMapper.selectOkcVideoProList(okcVideoPro);
+    }
+
+    /**
+     * 新增视频项目信息
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 结果
+     */
+    @Override
+    public int insertOkcVideoPro(OkcVideoPro okcVideoPro)
+    {
+        okcVideoPro.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
+        okcVideoPro.setCreateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
+        okcVideoPro.setCreateBy(SecurityUtils.getUsername());
+        okcVideoPro.setCreateUnit(String.valueOf(SecurityUtils.getDeptId()));
+        return okcVideoProMapper.insertOkcVideoPro(okcVideoPro);
+    }
+
+    /**
+     * 修改视频项目信息
+     * 
+     * @param okcVideoPro 视频项目信息
+     * @return 结果
+     */
+    @Override
+    public int updateOkcVideoPro(OkcVideoPro okcVideoPro)
+    {
+        okcVideoPro.setUpdateUserId(String.valueOf(SecurityUtils.getUserId()));
+        okcVideoPro.setUpdateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
+        okcVideoPro.setUpdateBy(SecurityUtils.getUsername());
+        okcVideoPro.setUpdateUnit(String.valueOf(SecurityUtils.getDeptId()));
+        return okcVideoProMapper.updateOkcVideoPro(okcVideoPro);
+    }
+
+    /**
+     * 批量删除视频项目信息
+     * 
+     * @param ids 需要删除的视频项目信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteOkcVideoProByIds(String[] ids)
+    {
+        return okcVideoProMapper.deleteOkcVideoProByIds(ids);
+    }
+
+    /**
+     * 删除视频项目信息信息
+     * 
+     * @param id 视频项目信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteOkcVideoProById(String id)
+    {
+        return okcVideoProMapper.deleteOkcVideoProById(id);
+    }
+}

+ 111 - 0
okc/src/main/resources/mapper/okc/OkcVideoProMapper.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.okc.mapper.OkcVideoProMapper">
+    
+    <resultMap type="OkcVideoPro" id="OkcVideoProResult">
+        <result property="id"    column="id"    />
+        <result property="videoName"    column="video_name"    />
+        <result property="videoUrl"    column="video_url"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
+    <sql id="selectOkcVideoProVo">
+        select id, video_name, video_url, create_time_str, create_user_id, create_by, create_user_type, create_unit, create_unit_name, update_time_str, update_user_id, update_by, update_unit, update_unit_name, status from okc_videopro
+    </sql>
+
+    <select id="selectOkcVideoProList" parameterType="OkcVideoPro" resultMap="OkcVideoProResult">
+        <include refid="selectOkcVideoProVo"/>
+        <where>
+            create_user_id = #{createUserId}
+            <if test="videoName != null  and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectOkcVideoProById" parameterType="String" resultMap="OkcVideoProResult">
+        <include refid="selectOkcVideoProVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertOkcVideoPro" parameterType="OkcVideoPro">
+        insert into okc_videopro
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="videoName != null and videoName != ''">video_name,</if>
+            <if test="videoUrl != null and videoUrl != ''">video_url,</if>
+            <if test="createTimeStr != null">create_time_str,</if>
+            <if test="createUserId != null">create_user_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createUserType != null">create_user_type,</if>
+            <if test="createUnit != null">create_unit,</if>
+            <if test="createUnitName != null">create_unit_name,</if>
+            <if test="updateTimeStr != null">update_time_str,</if>
+            <if test="updateUserId != null">update_user_id,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateUnit != null">update_unit,</if>
+            <if test="updateUnitName != null">update_unit_name,</if>
+            <if test="status != null and status != ''">status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="videoName != null and videoName != ''">#{videoName},</if>
+            <if test="videoUrl != null and videoUrl != ''">#{videoUrl},</if>
+            <if test="createTimeStr != null">#{createTimeStr},</if>
+            <if test="createUserId != null">#{createUserId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createUserType != null">#{createUserType},</if>
+            <if test="createUnit != null">#{createUnit},</if>
+            <if test="createUnitName != null">#{createUnitName},</if>
+            <if test="updateTimeStr != null">#{updateTimeStr},</if>
+            <if test="updateUserId != null">#{updateUserId},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateUnit != null">#{updateUnit},</if>
+            <if test="updateUnitName != null">#{updateUnitName},</if>
+            <if test="status != null and status != ''">#{status},</if>
+         </trim>
+    </insert>
+
+    <update id="updateOkcVideoPro" parameterType="OkcVideoPro">
+        update okc_videopro
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="videoName != null and videoName != ''">video_name = #{videoName},</if>
+            <if test="videoUrl != null and videoUrl != ''">video_url = #{videoUrl},</if>
+            <if test="createTimeStr != null">create_time_str = #{createTimeStr},</if>
+            <if test="createUserId != null">create_user_id = #{createUserId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createUserType != null">create_user_type = #{createUserType},</if>
+            <if test="createUnit != null">create_unit = #{createUnit},</if>
+            <if test="createUnitName != null">create_unit_name = #{createUnitName},</if>
+            <if test="updateTimeStr != null">update_time_str = #{updateTimeStr},</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateUnit != null">update_unit = #{updateUnit},</if>
+            <if test="updateUnitName != null">update_unit_name = #{updateUnitName},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteOkcVideoProById" parameterType="String">
+        delete from okc_videopro where id = #{id}
+    </delete>
+
+    <delete id="deleteOkcVideoProByIds" parameterType="String">
+        delete from okc_videopro where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 8 - 0
pom.xml

@@ -171,6 +171,13 @@
                 <version>${ruoyi.version}</version>
             </dependency>
 
+            <!-- OKC模块-->
+            <dependency>
+                <groupId>com.ruoyi</groupId>
+                <artifactId>okc</artifactId>
+                <version>${ruoyi.version}</version>
+            </dependency>
+
             <!-- 通用工具-->
             <dependency>
                 <groupId>com.ruoyi</groupId>
@@ -185,6 +192,7 @@
         <module>ruoyi-admin</module>
         <module>ruoyi-framework</module>
         <module>ruoyi-system</module>
+        <module>okc</module>
         <module>ruoyi-quartz</module>
         <module>ruoyi-generator</module>
         <module>ruoyi-common</module>

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/okc/OkcVideoProController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.okc;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.okc.domain.OkcVideoPro;
+import com.ruoyi.okc.service.IOkcVideoProService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 视频项目信息Controller
+ * 
+ * @author sun
+ * @date 2022-12-28
+ */
+@RestController
+@RequestMapping("/okc/videoPro")
+public class OkcVideoProController extends BaseController
+{
+    @Autowired
+    private IOkcVideoProService okcVideoProService;
+
+    /**
+     * 查询视频项目信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('okc:videoPro:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(OkcVideoPro okcVideoPro)
+    {
+        startPage();
+        List<OkcVideoPro> list = okcVideoProService.selectOkcVideoProList(okcVideoPro);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出视频项目信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('okc:videoPro:export')")
+    @Log(title = "视频项目信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, OkcVideoPro okcVideoPro)
+    {
+        List<OkcVideoPro> list = okcVideoProService.selectOkcVideoProList(okcVideoPro);
+        ExcelUtil<OkcVideoPro> util = new ExcelUtil<OkcVideoPro>(OkcVideoPro.class);
+        util.exportExcel(response, list, "视频项目信息数据");
+    }
+
+    /**
+     * 获取视频项目信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('okc:videoPro:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(okcVideoProService.selectOkcVideoProById(id));
+    }
+
+    /**
+     * 新增视频项目信息
+     */
+    @PreAuthorize("@ss.hasPermi('okc:videoPro:add')")
+    @Log(title = "视频项目信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody OkcVideoPro okcVideoPro)
+    {
+        return toAjax(okcVideoProService.insertOkcVideoPro(okcVideoPro));
+    }
+
+    /**
+     * 修改视频项目信息
+     */
+    @PreAuthorize("@ss.hasPermi('okc:videoPro:edit')")
+    @Log(title = "视频项目信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody OkcVideoPro okcVideoPro)
+    {
+        return toAjax(okcVideoProService.updateOkcVideoPro(okcVideoPro));
+    }
+
+    /**
+     * 删除视频项目信息
+     */
+    @PreAuthorize("@ss.hasPermi('okc:videoPro:remove')")
+    @Log(title = "视频项目信息", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(okcVideoProService.deleteOkcVideoProByIds(ids));
+    }
+}

+ 6 - 0
ruoyi-framework/pom.xml

@@ -59,6 +59,12 @@
             <artifactId>ruoyi-system</artifactId>
         </dependency>
 
+        <!-- OKC模块-->
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>okc</artifactId>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 44 - 0
ruoyi-ui/src/api/okc/videoPro.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询视频项目信息列表
+export function listVideoPro(query) {
+  return request({
+    url: '/okc/videoPro/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询视频项目信息详细
+export function getVideoPro(id) {
+  return request({
+    url: '/okc/videoPro/' + id,
+    method: 'get'
+  })
+}
+
+// 新增视频项目信息
+export function addVideoPro(data) {
+  return request({
+    url: '/okc/videoPro',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改视频项目信息
+export function updateVideoPro(data) {
+  return request({
+    url: '/okc/videoPro',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除视频项目信息
+export function delVideoPro(id) {
+  return request({
+    url: '/okc/videoPro/' + id,
+    method: 'delete'
+  })
+}

+ 271 - 0
ruoyi-ui/src/views/okc/videoPro/index.vue

@@ -0,0 +1,271 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="视频名称" prop="videoName">
+        <el-input
+          v-model="queryParams.videoName"
+          placeholder="请输入视频名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['okc:videoPro:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['okc:videoPro:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['okc:videoPro:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['okc:videoPro:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="videoProList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键标识" align="center" prop="id" />
+      <el-table-column label="视频名称" align="center" prop="videoName" />
+      <el-table-column label="视频本地绝对路径" align="center" prop="videoUrl" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['okc:videoPro:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['okc:videoPro:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改视频项目信息对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="视频名称" prop="videoName">
+          <el-input v-model="form.videoName" placeholder="请输入视频名称" />
+        </el-form-item>
+        <el-form-item label="视频本地绝对路径" prop="videoUrl">
+          <el-input v-model="form.videoUrl" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listVideoPro, getVideoPro, delVideoPro, addVideoPro, updateVideoPro } from "@/api/okc/videoPro";
+
+export default {
+  name: "VideoPro",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 视频项目信息表格数据
+      videoProList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        videoName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        videoName: [
+          { required: true, message: "视频名称不能为空", trigger: "blur" }
+        ],
+        videoUrl: [
+          { required: true, message: "视频本地绝对路径不能为空", trigger: "blur" }
+        ],
+        status: [
+          { required: true, message: "数据状态不能为空", trigger: "change" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询视频项目信息列表 */
+    getList() {
+      this.loading = true;
+      listVideoPro(this.queryParams).then(response => {
+        this.videoProList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        videoName: null,
+        videoUrl: null,
+        createTimeStr: null,
+        createUserId: null,
+        createBy: null,
+        createUserType: null,
+        createUnit: null,
+        createUnitName: null,
+        updateTimeStr: null,
+        updateUserId: null,
+        updateBy: null,
+        updateUnit: null,
+        updateUnitName: null,
+        status: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加视频项目信息";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getVideoPro(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改视频项目信息";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateVideoPro(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addVideoPro(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除视频项目信息编号为"' + ids + '"的数据项?').then(function() {
+        return delVideoPro(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('okc/videoPro/export', {
+        ...this.queryParams
+      }, `videoPro_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>