Selaa lähdekoodia

- 章节表、问卷表基础代码(增删改查)
- 装置审计记录详情标签页和组件传参处理(审计记录<->章节<->问卷)

wangggziwen 1 vuosi sitten
vanhempi
commit
c48b185955

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

@@ -0,0 +1,111 @@
+package com.ruoyi.web.controller.rc;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.system.service.ISysDeptService;
+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.rc.domain.TChapter;
+import com.ruoyi.rc.service.ITChapterService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * 章节Controller
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+@RestController
+@RequestMapping("/rc/chapter")
+public class TChapterController extends BaseController
+{
+    @Autowired
+    private ITChapterService tChapterService;
+
+    @Autowired
+    private ISysDeptService deptService;
+
+    /**
+     * 查询章节列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chapter:list')")
+    @GetMapping("/list")
+    public AjaxResult list(TChapter tChapter)
+    {
+        return success(tChapterService.selectTChapterList(tChapter));
+    }
+
+    /**
+     * 导出章节列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chapter:export')")
+    @Log(title = "章节", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TChapter tChapter)
+    {
+        List<TChapter> list = tChapterService.selectTChapterList(tChapter);
+        ExcelUtil<TChapter> util = new ExcelUtil<TChapter>(TChapter.class);
+        util.exportExcel(response, list, "章节数据");
+    }
+
+    /**
+     * 获取章节详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chapter:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tChapterService.selectTChapterById(id));
+    }
+
+    /**
+     * 新增章节
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chapter:add')")
+    @Log(title = "章节", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TChapter tChapter)
+    {
+        if (StringUtils.isNull(tChapter.getDeptId())) {
+            tChapter.setDeptId(getLoginUser().getDeptId().toString());
+        }
+        return toAjax(tChapterService.insertTChapter(tChapter));
+    }
+
+    /**
+     * 修改章节
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chapter:edit')")
+    @Log(title = "章节", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TChapter tChapter)
+    {
+        return toAjax(tChapterService.updateTChapter(tChapter));
+    }
+
+    /**
+     * 删除章节
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chapter:remove')")
+    @Log(title = "章节", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tChapterService.deleteTChapterByIds(ids));
+    }
+}

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

@@ -0,0 +1,129 @@
+package com.ruoyi.web.controller.rc;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.system.service.ISysDeptService;
+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.rc.domain.TQuestionnaire;
+import com.ruoyi.rc.service.ITQuestionnaireService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * 问卷Controller
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+@RestController
+@RequestMapping("/rc/questionnaire")
+public class TQuestionnaireController extends BaseController
+{
+    @Autowired
+    private ITQuestionnaireService tQuestionnaireService;
+
+    @Autowired
+    private ISysDeptService deptService;
+
+    /**
+     * 查询问卷列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnaire:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TQuestionnaire tQuestionnaire)
+    {
+        startPage();
+        List<TQuestionnaire> list = tQuestionnaireService.selectTQuestionnaireList(tQuestionnaire);
+        for (TQuestionnaire obj : list) {
+            String deptId = obj.getDeptId();
+            if (StringUtils.isNotEmpty(deptId)) {
+                if (deptId.indexOf(",") != -1) {
+                    StringBuffer sb = new StringBuffer();
+                    String[] ids = deptId.split(",");
+                    for (String id : ids) {
+                        SysDept sysDept = deptService.selectDeptById(Long.parseLong(id));
+                        sb.append(sysDept.getDeptName()).append(" / ");
+                    }
+                    obj.setDeptName(sb.toString().substring(0, sb.length() - 3));
+                } else {
+                    obj.setDeptName(deptService.selectDeptById(Long.parseLong(deptId)).getDeptName());
+                }
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出问卷列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnaire:export')")
+    @Log(title = "问卷", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TQuestionnaire tQuestionnaire)
+    {
+        List<TQuestionnaire> list = tQuestionnaireService.selectTQuestionnaireList(tQuestionnaire);
+        ExcelUtil<TQuestionnaire> util = new ExcelUtil<TQuestionnaire>(TQuestionnaire.class);
+        util.exportExcel(response, list, "问卷数据");
+    }
+
+    /**
+     * 获取问卷详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnaire:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tQuestionnaireService.selectTQuestionnaireById(id));
+    }
+
+    /**
+     * 新增问卷
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnaire:add')")
+    @Log(title = "问卷", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TQuestionnaire tQuestionnaire)
+    {
+        if (StringUtils.isNull(tQuestionnaire.getDeptId())) {
+            tQuestionnaire.setDeptId(getLoginUser().getDeptId().toString());
+        }
+        return toAjax(tQuestionnaireService.insertTQuestionnaire(tQuestionnaire));
+    }
+
+    /**
+     * 修改问卷
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnaire:edit')")
+    @Log(title = "问卷", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TQuestionnaire tQuestionnaire)
+    {
+        return toAjax(tQuestionnaireService.updateTQuestionnaire(tQuestionnaire));
+    }
+
+    /**
+     * 删除问卷
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnaire:remove')")
+    @Log(title = "问卷", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tQuestionnaireService.deleteTQuestionnaireByIds(ids));
+    }
+}

+ 104 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TChapter.java

@@ -0,0 +1,104 @@
+package com.ruoyi.rc.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;
+
+/**
+ * 章节对象 t_chapter
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+public class TChapter extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 审计记录id */
+    @Excel(name = "审计记录id")
+    private Long auditId;
+
+    /** 序号 */
+    @Excel(name = "序号")
+    private String code;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 装置id */
+    @Excel(name = "装置id")
+    private String deptId;
+
+    /** 装置 */
+    @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 setAuditId(Long auditId) 
+    {
+        this.auditId = auditId;
+    }
+
+    public Long getAuditId() 
+    {
+        return auditId;
+    }
+    public void setCode(String code) 
+    {
+        this.code = code;
+    }
+
+    public String getCode() 
+    {
+        return code;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setDeptId(String deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public String getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("auditId", getAuditId())
+            .append("code", getCode())
+            .append("name", getName())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 272 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TQuestionnaire.java

@@ -0,0 +1,272 @@
+package com.ruoyi.rc.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;
+
+/**
+ * 问卷对象 t_questionnaire
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+public class TQuestionnaire extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 审计记录id */
+    @Excel(name = "审计记录id")
+    private Long auditId;
+
+    /** 章节id */
+    @Excel(name = "章节id")
+    private Long chapterId;
+
+    /** 年份 */
+    @Excel(name = "年份")
+    private String year;
+
+    /** 问卷类型 */
+    @Excel(name = "问卷类型")
+    private String type;
+
+    /** 目录 */
+    @Excel(name = "目录")
+    private String directory;
+
+    /** 序号 */
+    @Excel(name = "序号")
+    private Long code;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** YES/NO/NA */
+    @Excel(name = "YES/NO/NA")
+    private String yesNoNa;
+
+    /** MinimumStandard */
+    @Excel(name = "MinimumStandard")
+    private String minimumStandard;
+
+    /** Good Practices */
+    @Excel(name = "Good Practices")
+    private String goodPractices;
+
+    /** 标准 */
+    @Excel(name = "标准")
+    private String standard;
+
+    /** 完成情况 */
+    @Excel(name = "完成情况")
+    private String completionStatus;
+
+    /** 负责人 */
+    @Excel(name = "负责人")
+    private Long personInCharge;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private Long reviewer;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 装置id */
+    @Excel(name = "装置id")
+    private String deptId;
+
+    /** 装置 */
+    @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 setAuditId(Long auditId) 
+    {
+        this.auditId = auditId;
+    }
+
+    public Long getAuditId() 
+    {
+        return auditId;
+    }
+    public void setChapterId(Long chapterId) 
+    {
+        this.chapterId = chapterId;
+    }
+
+    public Long getChapterId() 
+    {
+        return chapterId;
+    }
+    public void setYear(String year) 
+    {
+        this.year = year;
+    }
+
+    public String getYear() 
+    {
+        return year;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setDirectory(String directory) 
+    {
+        this.directory = directory;
+    }
+
+    public String getDirectory() 
+    {
+        return directory;
+    }
+    public void setCode(Long code) 
+    {
+        this.code = code;
+    }
+
+    public Long getCode() 
+    {
+        return code;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setYesNoNa(String yesNoNa) 
+    {
+        this.yesNoNa = yesNoNa;
+    }
+
+    public String getYesNoNa() 
+    {
+        return yesNoNa;
+    }
+    public void setMinimumStandard(String minimumStandard) 
+    {
+        this.minimumStandard = minimumStandard;
+    }
+
+    public String getMinimumStandard() 
+    {
+        return minimumStandard;
+    }
+    public void setGoodPractices(String goodPractices) 
+    {
+        this.goodPractices = goodPractices;
+    }
+
+    public String getGoodPractices() 
+    {
+        return goodPractices;
+    }
+    public void setStandard(String standard) 
+    {
+        this.standard = standard;
+    }
+
+    public String getStandard() 
+    {
+        return standard;
+    }
+    public void setCompletionStatus(String completionStatus) 
+    {
+        this.completionStatus = completionStatus;
+    }
+
+    public String getCompletionStatus() 
+    {
+        return completionStatus;
+    }
+    public void setPersonInCharge(Long personInCharge) 
+    {
+        this.personInCharge = personInCharge;
+    }
+
+    public Long getPersonInCharge() 
+    {
+        return personInCharge;
+    }
+    public void setReviewer(Long reviewer) 
+    {
+        this.reviewer = reviewer;
+    }
+
+    public Long getReviewer() 
+    {
+        return reviewer;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setDeptId(String deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public String getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("auditId", getAuditId())
+            .append("chapterId", getChapterId())
+            .append("year", getYear())
+            .append("type", getType())
+            .append("directory", getDirectory())
+            .append("code", getCode())
+            .append("name", getName())
+            .append("yesNoNa", getYesNoNa())
+            .append("minimumStandard", getMinimumStandard())
+            .append("goodPractices", getGoodPractices())
+            .append("standard", getStandard())
+            .append("completionStatus", getCompletionStatus())
+            .append("personInCharge", getPersonInCharge())
+            .append("reviewer", getReviewer())
+            .append("remarks", getRemarks())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TChapterMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.mapper;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TChapter;
+
+/**
+ * 章节Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+public interface TChapterMapper 
+{
+    /**
+     * 查询章节
+     * 
+     * @param id 章节主键
+     * @return 章节
+     */
+    public TChapter selectTChapterById(Long id);
+
+    /**
+     * 查询章节列表
+     * 
+     * @param tChapter 章节
+     * @return 章节集合
+     */
+    public List<TChapter> selectTChapterList(TChapter tChapter);
+
+    /**
+     * 新增章节
+     * 
+     * @param tChapter 章节
+     * @return 结果
+     */
+    public int insertTChapter(TChapter tChapter);
+
+    /**
+     * 修改章节
+     * 
+     * @param tChapter 章节
+     * @return 结果
+     */
+    public int updateTChapter(TChapter tChapter);
+
+    /**
+     * 删除章节
+     * 
+     * @param id 章节主键
+     * @return 结果
+     */
+    public int deleteTChapterById(Long id);
+
+    /**
+     * 批量删除章节
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTChapterByIds(Long[] ids);
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TQuestionnaireMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.mapper;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TQuestionnaire;
+
+/**
+ * 问卷Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+public interface TQuestionnaireMapper 
+{
+    /**
+     * 查询问卷
+     * 
+     * @param id 问卷主键
+     * @return 问卷
+     */
+    public TQuestionnaire selectTQuestionnaireById(Long id);
+
+    /**
+     * 查询问卷列表
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 问卷集合
+     */
+    public List<TQuestionnaire> selectTQuestionnaireList(TQuestionnaire tQuestionnaire);
+
+    /**
+     * 新增问卷
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 结果
+     */
+    public int insertTQuestionnaire(TQuestionnaire tQuestionnaire);
+
+    /**
+     * 修改问卷
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 结果
+     */
+    public int updateTQuestionnaire(TQuestionnaire tQuestionnaire);
+
+    /**
+     * 删除问卷
+     * 
+     * @param id 问卷主键
+     * @return 结果
+     */
+    public int deleteTQuestionnaireById(Long id);
+
+    /**
+     * 批量删除问卷
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTQuestionnaireByIds(Long[] ids);
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITChapterService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.service;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TChapter;
+
+/**
+ * 章节Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+public interface ITChapterService 
+{
+    /**
+     * 查询章节
+     * 
+     * @param id 章节主键
+     * @return 章节
+     */
+    public TChapter selectTChapterById(Long id);
+
+    /**
+     * 查询章节列表
+     * 
+     * @param tChapter 章节
+     * @return 章节集合
+     */
+    public List<TChapter> selectTChapterList(TChapter tChapter);
+
+    /**
+     * 新增章节
+     * 
+     * @param tChapter 章节
+     * @return 结果
+     */
+    public int insertTChapter(TChapter tChapter);
+
+    /**
+     * 修改章节
+     * 
+     * @param tChapter 章节
+     * @return 结果
+     */
+    public int updateTChapter(TChapter tChapter);
+
+    /**
+     * 批量删除章节
+     * 
+     * @param ids 需要删除的章节主键集合
+     * @return 结果
+     */
+    public int deleteTChapterByIds(Long[] ids);
+
+    /**
+     * 删除章节信息
+     * 
+     * @param id 章节主键
+     * @return 结果
+     */
+    public int deleteTChapterById(Long id);
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITQuestionnaireService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.service;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TQuestionnaire;
+
+/**
+ * 问卷Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+public interface ITQuestionnaireService 
+{
+    /**
+     * 查询问卷
+     * 
+     * @param id 问卷主键
+     * @return 问卷
+     */
+    public TQuestionnaire selectTQuestionnaireById(Long id);
+
+    /**
+     * 查询问卷列表
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 问卷集合
+     */
+    public List<TQuestionnaire> selectTQuestionnaireList(TQuestionnaire tQuestionnaire);
+
+    /**
+     * 新增问卷
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 结果
+     */
+    public int insertTQuestionnaire(TQuestionnaire tQuestionnaire);
+
+    /**
+     * 修改问卷
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 结果
+     */
+    public int updateTQuestionnaire(TQuestionnaire tQuestionnaire);
+
+    /**
+     * 批量删除问卷
+     * 
+     * @param ids 需要删除的问卷主键集合
+     * @return 结果
+     */
+    public int deleteTQuestionnaireByIds(Long[] ids);
+
+    /**
+     * 删除问卷信息
+     * 
+     * @param id 问卷主键
+     * @return 结果
+     */
+    public int deleteTQuestionnaireById(Long id);
+}

+ 93 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TChapterServiceImpl.java

@@ -0,0 +1,93 @@
+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.TChapterMapper;
+import com.ruoyi.rc.domain.TChapter;
+import com.ruoyi.rc.service.ITChapterService;
+
+/**
+ * 章节Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+@Service
+public class TChapterServiceImpl implements ITChapterService 
+{
+    @Autowired
+    private TChapterMapper tChapterMapper;
+
+    /**
+     * 查询章节
+     * 
+     * @param id 章节主键
+     * @return 章节
+     */
+    @Override
+    public TChapter selectTChapterById(Long id)
+    {
+        return tChapterMapper.selectTChapterById(id);
+    }
+
+    /**
+     * 查询章节列表
+     * 
+     * @param tChapter 章节
+     * @return 章节
+     */
+    @Override
+    public List<TChapter> selectTChapterList(TChapter tChapter)
+    {
+        return tChapterMapper.selectTChapterList(tChapter);
+    }
+
+    /**
+     * 新增章节
+     * 
+     * @param tChapter 章节
+     * @return 结果
+     */
+    @Override
+    public int insertTChapter(TChapter tChapter)
+    {
+        return tChapterMapper.insertTChapter(tChapter);
+    }
+
+    /**
+     * 修改章节
+     * 
+     * @param tChapter 章节
+     * @return 结果
+     */
+    @Override
+    public int updateTChapter(TChapter tChapter)
+    {
+        return tChapterMapper.updateTChapter(tChapter);
+    }
+
+    /**
+     * 批量删除章节
+     * 
+     * @param ids 需要删除的章节主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTChapterByIds(Long[] ids)
+    {
+        return tChapterMapper.deleteTChapterByIds(ids);
+    }
+
+    /**
+     * 删除章节信息
+     * 
+     * @param id 章节主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTChapterById(Long id)
+    {
+        return tChapterMapper.deleteTChapterById(id);
+    }
+}

+ 93 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TQuestionnaireServiceImpl.java

@@ -0,0 +1,93 @@
+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.TQuestionnaireMapper;
+import com.ruoyi.rc.domain.TQuestionnaire;
+import com.ruoyi.rc.service.ITQuestionnaireService;
+
+/**
+ * 问卷Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-24
+ */
+@Service
+public class TQuestionnaireServiceImpl implements ITQuestionnaireService 
+{
+    @Autowired
+    private TQuestionnaireMapper tQuestionnaireMapper;
+
+    /**
+     * 查询问卷
+     * 
+     * @param id 问卷主键
+     * @return 问卷
+     */
+    @Override
+    public TQuestionnaire selectTQuestionnaireById(Long id)
+    {
+        return tQuestionnaireMapper.selectTQuestionnaireById(id);
+    }
+
+    /**
+     * 查询问卷列表
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 问卷
+     */
+    @Override
+    public List<TQuestionnaire> selectTQuestionnaireList(TQuestionnaire tQuestionnaire)
+    {
+        return tQuestionnaireMapper.selectTQuestionnaireList(tQuestionnaire);
+    }
+
+    /**
+     * 新增问卷
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 结果
+     */
+    @Override
+    public int insertTQuestionnaire(TQuestionnaire tQuestionnaire)
+    {
+        return tQuestionnaireMapper.insertTQuestionnaire(tQuestionnaire);
+    }
+
+    /**
+     * 修改问卷
+     * 
+     * @param tQuestionnaire 问卷
+     * @return 结果
+     */
+    @Override
+    public int updateTQuestionnaire(TQuestionnaire tQuestionnaire)
+    {
+        return tQuestionnaireMapper.updateTQuestionnaire(tQuestionnaire);
+    }
+
+    /**
+     * 批量删除问卷
+     * 
+     * @param ids 需要删除的问卷主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTQuestionnaireByIds(Long[] ids)
+    {
+        return tQuestionnaireMapper.deleteTQuestionnaireByIds(ids);
+    }
+
+    /**
+     * 删除问卷信息
+     * 
+     * @param id 问卷主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTQuestionnaireById(Long id)
+    {
+        return tQuestionnaireMapper.deleteTQuestionnaireById(id);
+    }
+}

+ 71 - 0
rc-buisness/src/main/resources/mapper/rc/TChapterMapper.xml

@@ -0,0 +1,71 @@
+<?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.TChapterMapper">
+    
+    <resultMap type="TChapter" id="TChapterResult">
+        <result property="id"    column="id"    />
+        <result property="auditId"    column="audit_id"    />
+        <result property="code"    column="code"    />
+        <result property="name"    column="name"    />
+        <result property="deptId"    column="dept_id"    />
+    </resultMap>
+
+    <sql id="selectTChapterVo">
+        select id, audit_id, code, name, dept_id from t_chapter
+    </sql>
+
+    <select id="selectTChapterList" parameterType="TChapter" resultMap="TChapterResult">
+        <include refid="selectTChapterVo"/>
+        <where>  
+            <if test="auditId != null "> and audit_id = #{auditId}</if>
+            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTChapterById" parameterType="Long" resultMap="TChapterResult">
+        <include refid="selectTChapterVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTChapter" parameterType="TChapter" useGeneratedKeys="true" keyProperty="id">
+        insert into t_chapter
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="auditId != null">audit_id,</if>
+            <if test="code != null">code,</if>
+            <if test="name != null">name,</if>
+            <if test="deptId != null">dept_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="auditId != null">#{auditId},</if>
+            <if test="code != null">#{code},</if>
+            <if test="name != null">#{name},</if>
+            <if test="deptId != null">#{deptId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTChapter" parameterType="TChapter">
+        update t_chapter
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="auditId != null">audit_id = #{auditId},</if>
+            <if test="code != null">code = #{code},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTChapterById" parameterType="Long">
+        delete from t_chapter where id = #{id}
+    </delete>
+
+    <delete id="deleteTChapterByIds" parameterType="String">
+        delete from t_chapter where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 131 - 0
rc-buisness/src/main/resources/mapper/rc/TQuestionnaireMapper.xml

@@ -0,0 +1,131 @@
+<?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.TQuestionnaireMapper">
+    
+    <resultMap type="TQuestionnaire" id="TQuestionnaireResult">
+        <result property="id"    column="id"    />
+        <result property="auditId"    column="audit_id"    />
+        <result property="chapterId"    column="chapter_id"    />
+        <result property="year"    column="year"    />
+        <result property="type"    column="type"    />
+        <result property="directory"    column="directory"    />
+        <result property="code"    column="code"    />
+        <result property="name"    column="name"    />
+        <result property="yesNoNa"    column="yes_no_na"    />
+        <result property="minimumStandard"    column="minimum_standard"    />
+        <result property="goodPractices"    column="good_practices"    />
+        <result property="standard"    column="standard"    />
+        <result property="completionStatus"    column="completion_status"    />
+        <result property="personInCharge"    column="person_in_charge"    />
+        <result property="reviewer"    column="reviewer"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptId"    column="dept_id"    />
+    </resultMap>
+
+    <sql id="selectTQuestionnaireVo">
+        select id, audit_id, chapter_id, year, type, directory, code, name, yes_no_na, minimum_standard, good_practices, standard, completion_status, person_in_charge, reviewer, remarks, dept_id from t_questionnaire
+    </sql>
+
+    <select id="selectTQuestionnaireList" parameterType="TQuestionnaire" resultMap="TQuestionnaireResult">
+        <include refid="selectTQuestionnaireVo"/>
+        <where>  
+            <if test="auditId != null "> and audit_id = #{auditId}</if>
+            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
+            <if test="year != null  and year != ''"> and year = #{year}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="directory != null  and directory != ''"> and directory = #{directory}</if>
+            <if test="code != null "> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="yesNoNa != null  and yesNoNa != ''"> and yes_no_na = #{yesNoNa}</if>
+            <if test="minimumStandard != null  and minimumStandard != ''"> and minimum_standard = #{minimumStandard}</if>
+            <if test="goodPractices != null  and goodPractices != ''"> and good_practices = #{goodPractices}</if>
+            <if test="standard != null  and standard != ''"> and standard = #{standard}</if>
+            <if test="completionStatus != null  and completionStatus != ''"> and completion_status = #{completionStatus}</if>
+            <if test="personInCharge != null "> and person_in_charge = #{personInCharge}</if>
+            <if test="reviewer != null "> and reviewer = #{reviewer}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTQuestionnaireById" parameterType="Long" resultMap="TQuestionnaireResult">
+        <include refid="selectTQuestionnaireVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTQuestionnaire" parameterType="TQuestionnaire" useGeneratedKeys="true" keyProperty="id">
+        insert into t_questionnaire
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="auditId != null">audit_id,</if>
+            <if test="chapterId != null">chapter_id,</if>
+            <if test="year != null">year,</if>
+            <if test="type != null">type,</if>
+            <if test="directory != null">directory,</if>
+            <if test="code != null">code,</if>
+            <if test="name != null">name,</if>
+            <if test="yesNoNa != null">yes_no_na,</if>
+            <if test="minimumStandard != null">minimum_standard,</if>
+            <if test="goodPractices != null">good_practices,</if>
+            <if test="standard != null">standard,</if>
+            <if test="completionStatus != null">completion_status,</if>
+            <if test="personInCharge != null">person_in_charge,</if>
+            <if test="reviewer != null">reviewer,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="deptId != null">dept_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="auditId != null">#{auditId},</if>
+            <if test="chapterId != null">#{chapterId},</if>
+            <if test="year != null">#{year},</if>
+            <if test="type != null">#{type},</if>
+            <if test="directory != null">#{directory},</if>
+            <if test="code != null">#{code},</if>
+            <if test="name != null">#{name},</if>
+            <if test="yesNoNa != null">#{yesNoNa},</if>
+            <if test="minimumStandard != null">#{minimumStandard},</if>
+            <if test="goodPractices != null">#{goodPractices},</if>
+            <if test="standard != null">#{standard},</if>
+            <if test="completionStatus != null">#{completionStatus},</if>
+            <if test="personInCharge != null">#{personInCharge},</if>
+            <if test="reviewer != null">#{reviewer},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="deptId != null">#{deptId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTQuestionnaire" parameterType="TQuestionnaire">
+        update t_questionnaire
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="auditId != null">audit_id = #{auditId},</if>
+            <if test="chapterId != null">chapter_id = #{chapterId},</if>
+            <if test="year != null">year = #{year},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="directory != null">directory = #{directory},</if>
+            <if test="code != null">code = #{code},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="yesNoNa != null">yes_no_na = #{yesNoNa},</if>
+            <if test="minimumStandard != null">minimum_standard = #{minimumStandard},</if>
+            <if test="goodPractices != null">good_practices = #{goodPractices},</if>
+            <if test="standard != null">standard = #{standard},</if>
+            <if test="completionStatus != null">completion_status = #{completionStatus},</if>
+            <if test="personInCharge != null">person_in_charge = #{personInCharge},</if>
+            <if test="reviewer != null">reviewer = #{reviewer},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTQuestionnaireById" parameterType="Long">
+        delete from t_questionnaire where id = #{id}
+    </delete>
+
+    <delete id="deleteTQuestionnaireByIds" parameterType="String">
+        delete from t_questionnaire where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

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

@@ -162,7 +162,7 @@
       <el-table-column label="${comment}" align="center" prop="${javaField}" />
 #end
 #end
-      <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"

+ 44 - 0
ruoyi-ui/src/api/rc/chapter.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询章节列表
+export function listChapter(query) {
+  return request({
+    url: '/rc/chapter/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询章节详细
+export function getChapter(id) {
+  return request({
+    url: '/rc/chapter/' + id,
+    method: 'get'
+  })
+}
+
+// 新增章节
+export function addChapter(data) {
+  return request({
+    url: '/rc/chapter',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改章节
+export function updateChapter(data) {
+  return request({
+    url: '/rc/chapter',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除章节
+export function delChapter(id) {
+  return request({
+    url: '/rc/chapter/' + id,
+    method: 'delete'
+  })
+}

+ 44 - 0
ruoyi-ui/src/api/rc/questionnaire.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询问卷列表
+export function listQuestionnaire(query) {
+  return request({
+    url: '/rc/questionnaire/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询问卷详细
+export function getQuestionnaire(id) {
+  return request({
+    url: '/rc/questionnaire/' + id,
+    method: 'get'
+  })
+}
+
+// 新增问卷
+export function addQuestionnaire(data) {
+  return request({
+    url: '/rc/questionnaire',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改问卷
+export function updateQuestionnaire(data) {
+  return request({
+    url: '/rc/questionnaire',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除问卷
+export function delQuestionnaire(id) {
+  return request({
+    url: '/rc/questionnaire/' + id,
+    method: 'delete'
+  })
+}

+ 14 - 1
ruoyi-ui/src/router/index.js

@@ -87,7 +87,20 @@ export const constantRoutes = [
         meta: { title: '个人中心', icon: 'user' }
       }
     ]
-  }
+  },
+  {
+    path: '/rc',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'auditinfo',
+        component: (resolve) => require(['@/views/rc/auditinfo/index'], resolve),
+        name: 'AuditInfo',
+        meta: { title: '装置审计记录详情' }
+      }
+    ]
+  },
 ]
 
 // 动态路由,基于用户权限动态去加载

+ 14 - 0
ruoyi-ui/src/views/rc/audit/index.vue

@@ -123,6 +123,11 @@
             @click="handleDelete(scope.row)"
             v-hasPermi="['rc:audit:remove']"
           >删除</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleInfo(scope.row)"
+          >详情</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -238,6 +243,15 @@ export default {
     this.getDeptList();
   },
   methods: {
+    /** 详情 */
+    handleInfo(row) {
+      this.$router.push({
+        path: "/rc/auditinfo",
+        query: {
+          auditId: row.id
+        }
+      });
+    },
     /** 查询审计记录列表 */
     getList() {
       this.loading = true;

+ 31 - 0
ruoyi-ui/src/views/rc/auditinfo/index.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <el-col :span="5" :xs="24">
+        <chapter ref="chapter" @questionnaire="getQuestionnaire"></chapter>
+      </el-col>
+      <el-col :span="19" :xs="24">
+        <questionnaire ref="questionnaire"></questionnaire>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import Chapter from "../chapter";
+import Questionnaire from "../questionnaire";
+
+export default {
+  name: "AuditInfo",
+  components: { Chapter, Questionnaire },
+  mounted() {
+    this.$refs.chapter.getList(this.$route.query.auditId);
+    this.$refs.questionnaire.getList(this.$route.query.auditId, null);
+  },
+  methods: {
+    getQuestionnaire(chapterId) {
+      this.$refs.questionnaire.getList(null, chapterId);
+    }
+  }
+};
+</script>

+ 212 - 0
ruoyi-ui/src/views/rc/chapter/index.vue

@@ -0,0 +1,212 @@
+<template>
+  <div class="app-container" style="padding: 0px;">
+    <span>
+      <div class="head-container">
+      <el-input
+        v-model="queryParams.name"
+        placeholder="请输入章节名称"
+        clearable
+        size="small"
+        prefix-icon="el-icon-search"
+        style="margin-bottom: 20px"
+      />
+      </div>
+      <div class="head-container">
+        <el-table
+          ref="chapterList"
+          v-loading="loading"
+          :data="chapterList"
+          style="margin-bottom: 20px"
+          border
+          class="menuTable"
+          @row-click="handleNodeClick"
+          :show-header="false">
+          <el-table-column align="center" prop="code" width="50" :show-overflow-tooltip="true"/>
+          <el-table-column align="center" prop="name"/>
+        </el-table>
+      </div>
+    </span>
+  </div>
+</template>
+
+<script>
+import { listChapter, getChapter, delChapter, addChapter, updateChapter } from "@/api/rc/chapter";
+import { listDept } from "@/api/system/dept";
+
+export default {
+  name: "Chapter",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 章节表格数据
+      chapterList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        auditId: null,
+        code: null,
+        name: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      // 装置列表
+      deptOptions: [],
+    };
+  },
+  created() {
+    // this.getList();
+    this.getDeptList();
+  },
+  methods: {
+    // 节点单击事件
+    handleNodeClick(row) {
+      this.$emit('questionnaire', row.id);
+    },
+    /** 查询章节列表 */
+    getList(auditId) {
+      this.loading = true;
+      if (auditId != null) {
+        this.queryParams.auditId = auditId;
+      }
+      listChapter(this.queryParams).then(response => {
+        this.chapterList = response.data;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询装置列表 */
+    getDeptList() {
+      listDept().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          // 非顶级节点
+          if (data[i].parentId !== 0) {
+            // 插入装置列表
+            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId});
+          }
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        auditId: null,
+        code: null,
+        name: null,
+        deptId: 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
+      getChapter(id).then(response => {
+        // 字符串转数组
+        if (response.data.deptId != null && response.data.deptId != "") {
+            response.data.deptId = response.data.deptId.split(",").map(Number);
+        } else {
+            response.data.deptId = [];
+        }
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改章节";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 数组转字符串
+          if (this.form.deptId != null) {
+              this.form.deptId = this.form.deptId.toString();
+          }
+          if (this.form.id != null) {
+            updateChapter(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addChapter(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 delChapter(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('rc/chapter/export', {
+        ...this.queryParams
+      }, `chapter_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>
+
+<style scoped>
+  .menuTable {
+    cursor: pointer;  /*鼠标悬停变小手*/
+  }
+</style>

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

@@ -0,0 +1,367 @@
+<template>
+  <div class="app-container" style="padding: 0px;">
+
+    <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="['rc:questionnaire: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="['rc:questionnaire: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="['rc:questionnaire: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="['rc:questionnaire:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="questionnaireList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="审计记录id" align="center" prop="auditId" />
+      <el-table-column label="章节id" align="center" prop="chapterId" />
+      <el-table-column label="年份" align="center" prop="year" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.year, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="问卷类型" align="center" prop="type" />
+      <el-table-column label="目录" align="center" prop="directory" />
+      <el-table-column label="序号" align="center" prop="code" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="YES/NO/NA" align="center" prop="yesNoNa" />
+      <el-table-column label="MinimumStandard" align="center" prop="minimumStandard" />
+      <el-table-column label="Good Practices" align="center" prop="goodPractices" />
+      <el-table-column label="标准" align="center" prop="standard" />
+      <el-table-column label="完成情况" align="center" prop="completionStatus" />
+      <el-table-column label="负责人" align="center" prop="personInCharge" />
+      <el-table-column label="审核人" align="center" prop="reviewer" />
+      <el-table-column label="备注" align="center" prop="remarks" />
+      <el-table-column label="装置id" align="center" prop="deptId" />
+      <el-table-column label="操作" align="center" width="120" fixed="right" 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="['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>
+    </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="审计记录id" prop="auditId">
+          <el-input v-model="form.auditId" placeholder="请输入审计记录id" />
+        </el-form-item>
+        <el-form-item label="章节id" prop="chapterId">
+          <el-input v-model="form.chapterId" placeholder="请输入章节id" />
+        </el-form-item>
+        <el-form-item label="年份" prop="year">
+          <el-date-picker clearable
+            v-model="form.year"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请选择年份">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="目录" prop="directory">
+          <el-input v-model="form.directory" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="序号" prop="code">
+          <el-input v-model="form.code" placeholder="请输入序号" />
+        </el-form-item>
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="YES/NO/NA" prop="yesNoNa">
+          <el-input v-model="form.yesNoNa" placeholder="请输入YES/NO/NA" />
+        </el-form-item>
+        <el-form-item label="MinimumStandard" prop="minimumStandard">
+          <el-input v-model="form.minimumStandard" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="Good Practices" prop="goodPractices">
+          <el-input v-model="form.goodPractices" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="标准" prop="standard">
+          <el-input v-model="form.standard" placeholder="请输入标准" />
+        </el-form-item>
+        <el-form-item label="负责人" prop="personInCharge">
+          <el-input v-model="form.personInCharge" placeholder="请输入负责人" />
+        </el-form-item>
+        <el-form-item label="审核人" prop="reviewer">
+          <el-input v-model="form.reviewer" placeholder="请输入审核人" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="装置id" prop="deptId">
+          <el-input v-model="form.deptId" placeholder="请输入装置id" />
+        </el-form-item>
+        <el-form-item label="装置" prop="deptId">
+          <el-select clearable multiple v-model="form.deptId" placeholder="请选择装置">
+            <el-option
+              v-for="dict in deptOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </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 { listQuestionnaire, getQuestionnaire, delQuestionnaire, addQuestionnaire, updateQuestionnaire } from "@/api/rc/questionnaire";
+import { listDept } from "@/api/system/dept";
+
+export default {
+  name: "Questionnaire",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 问卷表格数据
+      questionnaireList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        auditId: null,
+        chapterId: null,
+        year: null,
+        type: null,
+        directory: null,
+        code: null,
+        name: null,
+        yesNoNa: null,
+        minimumStandard: null,
+        goodPractices: null,
+        standard: null,
+        completionStatus: null,
+        personInCharge: null,
+        reviewer: null,
+        remarks: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      // 装置列表
+      deptOptions: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getDeptList();
+  },
+  methods: {
+    /** 查询问卷列表 */
+    getList(auditId, chapterId) {
+      this.loading = true;
+      if (chapterId != null) {
+        this.queryParams.chapterId = chapterId;
+      }
+      if (auditId != null) {
+        this.queryParams.auditId = auditId;
+      }
+      listQuestionnaire(this.queryParams).then(response => {
+        this.questionnaireList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询装置列表 */
+    getDeptList() {
+      listDept().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          // 非顶级节点
+          if (data[i].parentId !== 0) {
+            // 插入装置列表
+            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId});
+          }
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        auditId: null,
+        chapterId: null,
+        year: null,
+        type: null,
+        directory: null,
+        code: null,
+        name: null,
+        yesNoNa: null,
+        minimumStandard: null,
+        goodPractices: null,
+        standard: null,
+        completionStatus: null,
+        personInCharge: null,
+        reviewer: null,
+        remarks: null,
+        deptId: 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
+      getQuestionnaire(id).then(response => {
+        // 字符串转数组
+        if (response.data.deptId != null && response.data.deptId != "") {
+            response.data.deptId = response.data.deptId.split(",").map(Number);
+        } else {
+            response.data.deptId = [];
+        }
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改问卷";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 数组转字符串
+          if (this.form.deptId != null) {
+              this.form.deptId = this.form.deptId.toString();
+          }
+          if (this.form.id != null) {
+            updateQuestionnaire(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addQuestionnaire(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 delQuestionnaire(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('rc/questionnaire/export', {
+        ...this.queryParams
+      }, `questionnaire_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>