浏览代码

- 通用附件表基础代码
- 装置信息表装置平面图附件管理
- 装置信息表装置欢迎介绍附件管理
- 装置信息表装置视频介绍附件管理

wangggziwen 10 月之前
父节点
当前提交
05b319fdc3

+ 0 - 6
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TChapterController.java

@@ -43,7 +43,6 @@ public class TChapterController extends BaseController
     /**
      * 查询章节列表
      */
-    @PreAuthorize("@ss.hasPermi('rc:chapter:list')")
     @GetMapping("/list")
     public AjaxResult list(TChapter tChapter)
     {
@@ -53,7 +52,6 @@ public class TChapterController extends BaseController
     /**
      * 导出章节列表
      */
-    @PreAuthorize("@ss.hasPermi('rc:chapter:export')")
     @Log(title = "章节", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, TChapter tChapter)
@@ -66,7 +64,6 @@ public class TChapterController extends BaseController
     /**
      * 获取章节详细信息
      */
-    @PreAuthorize("@ss.hasPermi('rc:chapter:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -76,7 +73,6 @@ public class TChapterController extends BaseController
     /**
      * 新增章节
      */
-    @PreAuthorize("@ss.hasPermi('rc:chapter:add')")
     @Log(title = "章节", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TChapter tChapter)
@@ -90,7 +86,6 @@ public class TChapterController extends BaseController
     /**
      * 修改章节
      */
-    @PreAuthorize("@ss.hasPermi('rc:chapter:edit')")
     @Log(title = "章节", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TChapter tChapter)
@@ -101,7 +96,6 @@ public class TChapterController extends BaseController
     /**
      * 删除章节
      */
-    @PreAuthorize("@ss.hasPermi('rc:chapter:remove')")
     @Log(title = "章节", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 131 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TCommonfileController.java

@@ -0,0 +1,131 @@
+package com.ruoyi.web.controller.rc;
+
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.system.service.ISysDeptService;
+
+import java.io.IOException;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+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.rc.domain.TCommonfile;
+import com.ruoyi.rc.service.ITCommonfileService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 通用附件Controller
+ * 
+ * @author ruoyi
+ * @date 2024-07-29
+ */
+@RestController
+@RequestMapping("/rc/commonfile")
+public class TCommonfileController extends BaseController
+{
+    @Autowired
+    private ITCommonfileService tCommonfileService;
+
+    /**
+     * 通用附件上传
+     */
+    @Log(title = "通用附件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, String pType, String pId) throws IOException
+    {
+        if (!file.isEmpty())
+        {
+            String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/"+ pType), file);
+            long size = file.getSize()/1024;
+            TCommonfile tCommonfile = new TCommonfile();
+            tCommonfile.setFileUrl(url);
+            tCommonfile.setFileName(file.getOriginalFilename());
+            tCommonfile.setCreaterCode(String.valueOf(getUserId()));
+            tCommonfile.setpId(Long.parseLong(pId));
+            tCommonfile.setpType(pType);
+            tCommonfile.setFileSize(String.valueOf(size));
+            tCommonfileService.insertTCommonfile(tCommonfile);
+
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("上传失败,请联系管理员");
+    }
+
+    /**
+     * 查询通用附件列表
+     */
+    @GetMapping("/allFileList")
+    public List<TCommonfile> allFileList(TCommonfile tCommonfile)
+    {
+        List<TCommonfile> list = tCommonfileService.selectAllFileList(tCommonfile);
+        return list;
+    }
+
+    /**
+     * 查询通用附件列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(TCommonfile tCommonfile)
+    {
+        startPage();
+        List<TCommonfile> list = tCommonfileService.selectTCommonfileList(tCommonfile);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出通用附件列表
+     */
+    @Log(title = "通用附件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TCommonfile tCommonfile)
+    {
+        List<TCommonfile> list = tCommonfileService.selectTCommonfileList(tCommonfile);
+        ExcelUtil<TCommonfile> util = new ExcelUtil<TCommonfile>(TCommonfile.class);
+        util.exportExcel(response, list, "通用附件数据");
+    }
+
+    /**
+     * 获取通用附件详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tCommonfileService.selectTCommonfileById(id));
+    }
+
+    /**
+     * 新增通用附件
+     */
+    @Log(title = "通用附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TCommonfile tCommonfile)
+    {
+        return toAjax(tCommonfileService.insertTCommonfile(tCommonfile));
+    }
+
+    /**
+     * 修改通用附件
+     */
+    @Log(title = "通用附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TCommonfile tCommonfile)
+    {
+        return toAjax(tCommonfileService.updateTCommonfile(tCommonfile));
+    }
+
+    /**
+     * 删除通用附件
+     */
+    @Log(title = "通用附件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tCommonfileService.deleteTCommonfileByIds(ids));
+    }
+}

+ 0 - 6
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TProgressController.java

@@ -45,7 +45,6 @@ public class TProgressController extends BaseController
     /**
      * 查询进度列表
      */
-    @PreAuthorize("@ss.hasPermi('rc:progress:list')")
     @GetMapping("/list")
     public TableDataInfo list(TProgress tProgress)
     {
@@ -73,7 +72,6 @@ public class TProgressController extends BaseController
     /**
      * 导出进度列表
      */
-    @PreAuthorize("@ss.hasPermi('rc:progress:export')")
     @Log(title = "进度", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, TProgress tProgress)
@@ -86,7 +84,6 @@ public class TProgressController extends BaseController
     /**
      * 获取进度详细信息
      */
-    @PreAuthorize("@ss.hasPermi('rc:progress:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -96,7 +93,6 @@ public class TProgressController extends BaseController
     /**
      * 新增进度
      */
-    @PreAuthorize("@ss.hasPermi('rc:progress:add')")
     @Log(title = "进度", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TProgress tProgress)
@@ -108,7 +104,6 @@ public class TProgressController extends BaseController
     /**
      * 修改进度
      */
-    @PreAuthorize("@ss.hasPermi('rc:progress:edit')")
     @Log(title = "进度", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TProgress tProgress)
@@ -119,7 +114,6 @@ public class TProgressController extends BaseController
     /**
      * 删除进度
      */
-    @PreAuthorize("@ss.hasPermi('rc:progress:remove')")
     @Log(title = "进度", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 0 - 6
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TQuestionnaireController.java

@@ -44,7 +44,6 @@ public class TQuestionnaireController extends BaseController
     /**
      * 查询问卷列表
      */
-    @PreAuthorize("@ss.hasPermi('rc:questionnaire:list')")
     @GetMapping("/list")
     public TableDataInfo list(TQuestionnaire tQuestionnaire)
     {
@@ -72,7 +71,6 @@ public class TQuestionnaireController extends BaseController
     /**
      * 导出问卷列表
      */
-    @PreAuthorize("@ss.hasPermi('rc:questionnaire:export')")
     @Log(title = "问卷", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, TQuestionnaire tQuestionnaire)
@@ -85,7 +83,6 @@ public class TQuestionnaireController extends BaseController
     /**
      * 获取问卷详细信息
      */
-    @PreAuthorize("@ss.hasPermi('rc:questionnaire:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -100,7 +97,6 @@ public class TQuestionnaireController extends BaseController
     /**
      * 新增问卷
      */
-    @PreAuthorize("@ss.hasPermi('rc:questionnaire:add')")
     @Log(title = "问卷", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TQuestionnaire tQuestionnaire)
@@ -114,7 +110,6 @@ public class TQuestionnaireController extends BaseController
     /**
      * 修改问卷
      */
-    @PreAuthorize("@ss.hasPermi('rc:questionnaire:edit')")
     @Log(title = "问卷", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TQuestionnaire tQuestionnaire)
@@ -125,7 +120,6 @@ public class TQuestionnaireController extends BaseController
     /**
      * 删除问卷
      */
-    @PreAuthorize("@ss.hasPermi('rc:questionnaire:remove')")
     @Log(title = "问卷", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 234 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TCommonfile.java

@@ -0,0 +1,234 @@
+package com.ruoyi.rc.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+
+/**
+ * 通用附件对象 t_commonfile
+ * 
+ * @author ruoyi
+ * @date 2024-07-29
+ */
+public class TCommonfile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 业务id */
+    @Excel(name = "业务id")
+    private Long pId;
+
+    /** 文件名 */
+    @Excel(name = "文件名")
+    private String fileName;
+
+    /** 路径 */
+    @Excel(name = "路径")
+    private String fileUrl;
+
+    /** 删除标识 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 业务类型 */
+    @Excel(name = "业务类型")
+    private String pType;
+
+    /** 文件大小 */
+    @Excel(name = "文件大小")
+    private String fileSize;
+
+    /** 业务字段 */
+    @Excel(name = "业务字段")
+    private String pValue;
+
+    /** 业务时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "业务时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date pDate;
+
+    /** 装置 */
+    @Excel(name = "装置")
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setpId(Long pId) 
+    {
+        this.pId = pId;
+    }
+
+    public Long getpId() 
+    {
+        return pId;
+    }
+    public void setFileName(String fileName) 
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName() 
+    {
+        return fileName;
+    }
+    public void setFileUrl(String fileUrl) 
+    {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl() 
+    {
+        return fileUrl;
+    }
+    public void setDelFlag(Long delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode) 
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode() 
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate) 
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate() 
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode) 
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode() 
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate) 
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() 
+    {
+        return updatedate;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setpType(String pType) 
+    {
+        this.pType = pType;
+    }
+
+    public String getpType() 
+    {
+        return pType;
+    }
+    public void setFileSize(String fileSize) 
+    {
+        this.fileSize = fileSize;
+    }
+
+    public String getFileSize() 
+    {
+        return fileSize;
+    }
+    public void setpValue(String pValue) 
+    {
+        this.pValue = pValue;
+    }
+
+    public String getpValue() 
+    {
+        return pValue;
+    }
+    public void setpDate(Date pDate) 
+    {
+        this.pDate = pDate;
+    }
+
+    public Date getpDate() 
+    {
+        return pDate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("pId", getpId())
+            .append("fileName", getFileName())
+            .append("fileUrl", getFileUrl())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("remarks", getRemarks())
+            .append("pType", getpType())
+            .append("fileSize", getFileSize())
+            .append("pValue", getpValue())
+            .append("pDate", getpDate())
+            .toString();
+    }
+}

+ 69 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TCommonfileMapper.java

@@ -0,0 +1,69 @@
+package com.ruoyi.rc.mapper;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TCommonfile;
+
+/**
+ * 通用附件Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-29
+ */
+public interface TCommonfileMapper 
+{
+    /**
+     * 查询通用附件列表
+     *
+     * @param tCommonfile 通用附件
+     * @return 通用附件集合
+     */
+    List<TCommonfile> selectAllFileList(TCommonfile tCommonfile);
+
+    /**
+     * 查询通用附件
+     * 
+     * @param id 通用附件主键
+     * @return 通用附件
+     */
+    public TCommonfile selectTCommonfileById(Long id);
+
+    /**
+     * 查询通用附件列表
+     * 
+     * @param tCommonfile 通用附件
+     * @return 通用附件集合
+     */
+    public List<TCommonfile> selectTCommonfileList(TCommonfile tCommonfile);
+
+    /**
+     * 新增通用附件
+     * 
+     * @param tCommonfile 通用附件
+     * @return 结果
+     */
+    public int insertTCommonfile(TCommonfile tCommonfile);
+
+    /**
+     * 修改通用附件
+     * 
+     * @param tCommonfile 通用附件
+     * @return 结果
+     */
+    public int updateTCommonfile(TCommonfile tCommonfile);
+
+    /**
+     * 删除通用附件
+     * 
+     * @param id 通用附件主键
+     * @return 结果
+     */
+    public int deleteTCommonfileById(Long id);
+
+    /**
+     * 批量删除通用附件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTCommonfileByIds(Long[] ids);
+}

+ 69 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITCommonfileService.java

@@ -0,0 +1,69 @@
+package com.ruoyi.rc.service;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TCommonfile;
+
+/**
+ * 通用附件Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-29
+ */
+public interface ITCommonfileService 
+{
+    /**
+     * 查询通用附件列表
+     *
+     * @param tCommonfile 通用附件
+     * @return 通用附件集合
+     */
+    List<TCommonfile> selectAllFileList(TCommonfile tCommonfile);
+
+    /**
+     * 查询通用附件
+     * 
+     * @param id 通用附件主键
+     * @return 通用附件
+     */
+    public TCommonfile selectTCommonfileById(Long id);
+
+    /**
+     * 查询通用附件列表
+     * 
+     * @param tCommonfile 通用附件
+     * @return 通用附件集合
+     */
+    public List<TCommonfile> selectTCommonfileList(TCommonfile tCommonfile);
+
+    /**
+     * 新增通用附件
+     * 
+     * @param tCommonfile 通用附件
+     * @return 结果
+     */
+    public int insertTCommonfile(TCommonfile tCommonfile);
+
+    /**
+     * 修改通用附件
+     * 
+     * @param tCommonfile 通用附件
+     * @return 结果
+     */
+    public int updateTCommonfile(TCommonfile tCommonfile);
+
+    /**
+     * 批量删除通用附件
+     * 
+     * @param ids 需要删除的通用附件主键集合
+     * @return 结果
+     */
+    public int deleteTCommonfileByIds(Long[] ids);
+
+    /**
+     * 删除通用附件信息
+     * 
+     * @param id 通用附件主键
+     * @return 结果
+     */
+    public int deleteTCommonfileById(Long id);
+}

+ 98 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TCommonfileServiceImpl.java

@@ -0,0 +1,98 @@
+package com.ruoyi.rc.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.rc.mapper.TCommonfileMapper;
+import com.ruoyi.rc.domain.TCommonfile;
+import com.ruoyi.rc.service.ITCommonfileService;
+
+/**
+ * 通用附件Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-29
+ */
+@Service
+public class TCommonfileServiceImpl implements ITCommonfileService 
+{
+    @Autowired
+    private TCommonfileMapper tCommonfileMapper;
+
+    @Override
+    public List<TCommonfile> selectAllFileList(TCommonfile tCommonfile) {
+        return tCommonfileMapper.selectAllFileList(tCommonfile);
+    }
+
+    /**
+     * 查询通用附件
+     * 
+     * @param id 通用附件主键
+     * @return 通用附件
+     */
+    @Override
+    public TCommonfile selectTCommonfileById(Long id)
+    {
+        return tCommonfileMapper.selectTCommonfileById(id);
+    }
+
+    /**
+     * 查询通用附件列表
+     * 
+     * @param tCommonfile 通用附件
+     * @return 通用附件
+     */
+    @Override
+    public List<TCommonfile> selectTCommonfileList(TCommonfile tCommonfile)
+    {
+        return tCommonfileMapper.selectTCommonfileList(tCommonfile);
+    }
+
+    /**
+     * 新增通用附件
+     * 
+     * @param tCommonfile 通用附件
+     * @return 结果
+     */
+    @Override
+    public int insertTCommonfile(TCommonfile tCommonfile)
+    {
+        return tCommonfileMapper.insertTCommonfile(tCommonfile);
+    }
+
+    /**
+     * 修改通用附件
+     * 
+     * @param tCommonfile 通用附件
+     * @return 结果
+     */
+    @Override
+    public int updateTCommonfile(TCommonfile tCommonfile)
+    {
+        return tCommonfileMapper.updateTCommonfile(tCommonfile);
+    }
+
+    /**
+     * 批量删除通用附件
+     * 
+     * @param ids 需要删除的通用附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCommonfileByIds(Long[] ids)
+    {
+        return tCommonfileMapper.deleteTCommonfileByIds(ids);
+    }
+
+    /**
+     * 删除通用附件信息
+     * 
+     * @param id 通用附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCommonfileById(Long id)
+    {
+        return tCommonfileMapper.deleteTCommonfileById(id);
+    }
+}

+ 128 - 0
rc-buisness/src/main/resources/mapper/rc/TCommonfileMapper.xml

@@ -0,0 +1,128 @@
+<?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.rc.mapper.TCommonfileMapper">
+    
+    <resultMap type="TCommonfile" id="TCommonfileResult">
+        <result property="id"    column="id"    />
+        <result property="pId"    column="p_id"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="pType"    column="p_type"    />
+        <result property="fileSize"    column="file_size"    />
+        <result property="pValue"    column="p_value"    />
+        <result property="pDate"    column="p_date"    />
+    </resultMap>
+
+    <sql id="selectTCommonfileVo">
+        select id, p_id, file_name, file_url, del_flag, creater_code, createdate, updater_code, updatedate, remarks, p_type, file_size, p_value, p_date from t_commonfile
+    </sql>
+
+    <select id="selectAllFileList" parameterType="TCommonfile" resultMap="TCommonfileResult">
+        select d.file_size , d.p_value, d.p_date ,u.nick_name, d.id, d.p_id, d.file_name, d.file_url, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.p_type from t_commonfile d
+        LEFT JOIN SYS_USER u on d.CREATER_CODE = u.USER_ID
+        <where>
+            <if test="pId != null "> and p_id = #{pId}</if>
+            <if test="pType != null "> and p_type = #{pType}</if>
+            <if test="pValue != null  and pValue != ''"> and p_value = #{pValue}</if>
+            <if test="pDate != null "> and p_date = #{pDate}</if>
+            and d.del_flag = 0
+        </where>
+        order by p_date desc , d.createdate desc
+    </select>
+
+    <select id="selectTCommonfileList" parameterType="TCommonfile" resultMap="TCommonfileResult">
+        <include refid="selectTCommonfileVo"/>
+        <where>  
+            <if test="pId != null "> and p_id = #{pId}</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="pType != null  and pType != ''"> and p_type = #{pType}</if>
+            <if test="fileSize != null  and fileSize != ''"> and file_size = #{fileSize}</if>
+            <if test="pValue != null  and pValue != ''"> and p_value = #{pValue}</if>
+            <if test="pDate != null "> and p_date = #{pDate}</if>
+        </where>
+    </select>
+    
+    <select id="selectTCommonfileById" parameterType="Long" resultMap="TCommonfileResult">
+        <include refid="selectTCommonfileVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTCommonfile" parameterType="TCommonfile" useGeneratedKeys="true" keyProperty="id">
+        insert into t_commonfile
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="pId != null">p_id,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="pType != null">p_type,</if>
+            <if test="fileSize != null">file_size,</if>
+            <if test="pValue != null">p_value,</if>
+            <if test="pDate != null">p_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="pId != null">#{pId},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="pType != null">#{pType},</if>
+            <if test="fileSize != null">#{fileSize},</if>
+            <if test="pValue != null">#{pValue},</if>
+            <if test="pDate != null">#{pDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTCommonfile" parameterType="TCommonfile">
+        update t_commonfile
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="pId != null">p_id = #{pId},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="pType != null">p_type = #{pType},</if>
+            <if test="fileSize != null">file_size = #{fileSize},</if>
+            <if test="pValue != null">p_value = #{pValue},</if>
+            <if test="pDate != null">p_date = #{pDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTCommonfileById" parameterType="Long">
+        delete from t_commonfile where id = #{id}
+    </delete>
+
+    <delete id="deleteTCommonfileByIds" parameterType="String">
+        delete from t_commonfile where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 8 - 0
rc-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java

@@ -119,4 +119,12 @@ public class RuoYiConfig
     {
         return getProfile() + "/upload";
     }
+
+    /**
+     * 获取上传路径
+     */
+    public static String getFilePath(String dir)
+    {
+        return getProfile() + dir;
+    }
 }

+ 1 - 1
rc-generator/src/main/resources/vm/vue/index.vue.vm

@@ -486,7 +486,7 @@ export default {
           // 非顶级节点
           if (data[i].parentId !== 0) {
             // 插入装置列表
-            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId});
+            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId + ""});
           }
         }
       });

+ 53 - 0
ruoyi-ui/src/api/rc/commonfile.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询不分页通用附件列表
+export function allFileList(query) {
+  return request({
+    url: '/rc/commonfile/allFileList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询通用附件列表
+export function listCommonfile(query) {
+  return request({
+    url: '/rc/commonfile/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询通用附件详细
+export function getCommonfile(id) {
+  return request({
+    url: '/rc/commonfile/' + id,
+    method: 'get'
+  })
+}
+
+// 新增通用附件
+export function addCommonfile(data) {
+  return request({
+    url: '/rc/commonfile',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改通用附件
+export function updateCommonfile(data) {
+  return request({
+    url: '/rc/commonfile',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除通用附件
+export function delCommonfile(id) {
+  return request({
+    url: '/rc/commonfile/' + id,
+    method: 'delete'
+  })
+}

+ 154 - 3
ruoyi-ui/src/views/rc/deptinfo/index.vue

@@ -73,13 +73,28 @@
 
     <el-table border v-loading="loading" :data="deptinfoList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="装置" align="center" prop="deptName" />
-      <el-table-column label="年份" align="center" prop="year">
+      <el-table-column label="装置" align="center" prop="deptName" width="120"/>
+      <el-table-column label="年份" align="center" prop="year" width="120">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.year, '{y}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="装置信息" align="center" prop="deptInfo" />
+      <el-table-column label="装置平面图" align="center" width="120">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'deptinfo-plane')"></el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="装置欢迎介绍" align="center" width="120">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'deptinfo-welcome')"></el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="装置视频介绍" align="center" width="120">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'deptinfo-video')"></el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -138,12 +153,62 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 附件对话框 -->
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="800px" append-to-body >
+      <el-upload ref="doc"
+                 :limit="50"
+                 :headers="doc.headers"
+                 :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+                 :disabled="doc.isUploading"
+                 :on-progress="handleFileDocProgress"
+                 :on-success="handleFileDocSuccess"
+                 :auto-upload="true"
+                 drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column label="文件名" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a  class="link-type"  @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column label="大小(Kb)" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
+        <el-table-column label="上传人" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column label="操作" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >下载</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+              v-hasPermi="['training:trainingrecords:file']"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { listDeptinfo, getDeptinfo, delDeptinfo, addDeptinfo, updateDeptinfo } from "@/api/rc/deptinfo";
 import { listDept } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import { addCommonfile, allFileList, delCommonfile, updateCommonfile } from "@/api/rc/commonfile";
 
 export default {
   name: "Deptinfo",
@@ -182,6 +247,32 @@ export default {
       },
       // 装置列表
       deptOptions: [],
+      // 附件参数
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/rc/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: ''
+        },
+        pType: '',
+        pId: null,
+        form: {}
+      },
     };
   },
   created() {
@@ -189,6 +280,66 @@ export default {
     this.getDeptList();
   },
   methods: {
+    /** 附件按钮操作 */
+    handleDoc(row , type) {
+      var typeName = "";
+      if (type === "deptinfo-plane"){
+        typeName = "平面图";
+      } else if (type === "deptinfo-welcome"){
+        typeName = "欢迎介绍";
+      } else if (type === "deptinfo-video"){
+        typeName = "视频介绍";
+      }
+      this.doc.pType = type
+      this.doc.queryParams.pType = type
+      this.doc.id = row.id;
+      this.doc.title = row.deptName + typeName + "(" + new Date(row.year).getFullYear() + ")";
+      this.doc.open = true;
+      this.doc.queryParams.pId = row.id
+      this.doc.pId = row.id
+      this.getFileList();
+    },
+    getFileList(){
+      allFileList(this.doc.queryParams).then(response => {
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true });
+      this.getFileList()
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
     /** 查询装置信息列表 */
     getList() {
       this.loading = true;
@@ -206,7 +357,7 @@ export default {
           // 非顶级节点
           if (data[i].parentId !== 0) {
             // 插入装置列表
-            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId});
+            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId + ""});
           }
         }
       });

+ 0 - 5
ruoyi-ui/src/views/rc/progress/index.vue

@@ -92,7 +92,6 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['rc:progress:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -103,7 +102,6 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['rc:progress:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -113,7 +111,6 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['rc:progress:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -167,14 +164,12 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['rc:progress:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['rc:progress:remove']"
           >删除</el-button>
         </template>
       </el-table-column>

+ 0 - 6
ruoyi-ui/src/views/rc/questionnaire/index.vue

@@ -62,7 +62,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['rc:questionnaire:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -73,7 +72,6 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['rc:questionnaire:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -84,7 +82,6 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['rc:questionnaire:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -94,7 +91,6 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['rc:questionnaire:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -152,14 +148,12 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['rc:questionnaire:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['rc:questionnaire:remove']"
           >删除</el-button>
         </template>
       </el-table-column>

+ 23 - 1
sql/create.sql

@@ -116,4 +116,26 @@ create table t_open_item (
   remarks           varchar(500)  comment '备注',
   dept_id           varchar(255)  comment '装置id',
   primary key (id)
-) engine=innodb auto_increment=100 comment = '开项表';
+) engine=innodb auto_increment=100 comment = '开项表';
+
+-- ----------------------------
+-- 通用附件表
+-- ----------------------------
+create table t_commonfile
+(
+  id bigint(20) comment 'id' not null auto_increment,
+  p_id bigint(20) comment '业务id',
+  file_name varchar(255) comment '文件名',
+  file_url varchar(500) comment '路径',
+  del_flag bigint(20) default 0 comment '删除标识',
+  creater_code varchar(255) comment '创建人',
+  createdate datetime comment '创建时间',
+  updater_code varchar(255) comment '更新人',
+  updatedate datetime comment '更新时间',
+  remarks varchar(255) comment '备注',
+  p_type varchar(64) comment '业务类型',
+  file_size varchar(128) comment '文件大小',
+  p_value varchar(1000) comment '业务字段',
+  p_date datetime comment '业务时间',
+	primary key (id)
+) engine=innodb auto_increment=100 comment = '通用附件表';