Jelajahi Sumber

开项管理 - 页面加载时默认带出当前登录用户所在部门最近一次审计相关内容
开项管理 - 新增开项数据时关联审计记录id

wangggziwen 8 bulan lalu
induk
melakukan
eefd18a083

+ 12 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TAuditController.java

@@ -72,6 +72,18 @@ public class TAuditController extends BaseController
     @Autowired
     private TAuditMapper tAuditMapper;
 
+    /**
+     * 查询最近一次审计信息
+     *
+     * @return
+     */
+    @GetMapping("/getRecentAudit")
+    public AjaxResult getRecentAudit() {
+        TAudit audit = new TAudit();
+        audit.setDeptId(getLoginUser().getDeptId().toString());
+        return AjaxResult.success(tAuditService.selectTAuditLatest(audit));
+    }
+
     /**
      * 查询装置下次审计时间列表
      */

+ 0 - 12
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TMeetingController.java

@@ -54,18 +54,6 @@ public class TMeetingController extends BaseController
     @Autowired
     private ITQuestionnaireService tQuestionnaireService;
 
-    /**
-     * 查询最近一次审计信息
-     *
-     * @return
-     */
-    @GetMapping("/getRecentAudit")
-    public AjaxResult getRecentAudit() {
-        TAudit audit = new TAudit();
-        audit.setDeptId(getLoginUser().getDeptId().toString());
-        return AjaxResult.success(tAuditService.selectTAuditLatest(audit));
-    }
-
     /**
      * 查询CODE列表
      */

+ 1 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TOpenItemController.java

@@ -239,6 +239,7 @@ public class TOpenItemController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TOpenItem tOpenItem)
     {
+        tOpenItem.setAuditId(tQuestionnaireService.selectTQuestionnaireById(tOpenItem.getQuestionnaireId()).getAuditId());
         tOpenItem.setDeptId(getLoginUser().getDeptId().toString());
         int i = tOpenItemService.insertTOpenItem(tOpenItem);
         this.apply(tOpenItem);

+ 35 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TOpenItem.java

@@ -20,6 +20,17 @@ public class TOpenItem extends BaseEntity
     /** id */
     private Long id;
 
+    /** 涉及审计 */
+    @Excel(name = "涉及审计")
+    private Long auditId;
+
+    private String auditName;
+
+    /** 审计时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审计时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
     /** 问题类型 */
     @Excel(name = "问题类型")
     private String type;
@@ -105,6 +116,30 @@ public class TOpenItem extends BaseEntity
     @Excel(name = "章节")
     private String chapName;
 
+    public Long getAuditId() {
+        return auditId;
+    }
+
+    public void setAuditId(Long auditId) {
+        this.auditId = auditId;
+    }
+
+    public String getAuditName() {
+        return auditName;
+    }
+
+    public void setAuditName(String auditName) {
+        this.auditName = auditName;
+    }
+
+    public Date getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(Date auditTime) {
+        this.auditTime = auditTime;
+    }
+
     public String getChapName() {
         return chapName;
     }

+ 21 - 13
rc-buisness/src/main/resources/mapper/rc/TOpenItemMapper.xml

@@ -24,43 +24,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="apNo"    column="ap_no"    />
         <result property="processId"    column="process_id"    />
         <result property="chapName"    column="chap_name"    />
+        <result property="auditId"    column="audit_id"    />
+        <result property="auditTime"    column="audit_time"    />
     </resultMap>
 
     <sql id="selectTOpenItemVo">
         select o.id, o.type, o.questionnaire_id, o.description, o.level, o.open_time, o.close_time, o.status, o.person_in_charge,
         o.reviewer, o.result, o.deadline, o.remarks, o.dept_id,
-        o.ap_no, o.process_id,
+        o.ap_no, o.process_id, o.audit_id,
         u1.nick_name as person_in_charge_name, u2.nick_name as reviewer_name,
         q.directory, q.code, q.name,
-        c.name as chap_name
+        c.name as chap_name,
+        a.audit_time
         from t_open_item as o
         left join sys_user u1 on o.person_in_charge = u1.user_id
         left join sys_user u2 on o.reviewer = u2.user_id
         left join t_questionnaire q on q.id = o.questionnaire_id
         left join t_chapter c on c.id = q.chapter_id
         left join sys_dept d on d.dept_id = o.dept_id
+        left join t_audit a on a.id = o.audit_id
     </sql>
 
     <select id="selectTOpenItemList" parameterType="TOpenItem" resultMap="TOpenItemResult">
         <include refid="selectTOpenItemVo"/>
         <where>  
-            <if test="type != null  and type != ''"> and type = #{type}</if>
-            <if test="questionnaireId != null "> and questionnaire_id = #{questionnaireId}</if>
-            <if test="description != null  and description != ''"> and description = #{description}</if>
-            <if test="level != null  and level != ''"> and level = #{level}</if>
-            <if test="openTime != null "> and open_time = #{openTime}</if>
-            <if test="closeTime != null "> and close_time = #{closeTime}</if>
+            <if test="type != null  and type != ''"> and o.type = #{type}</if>
+            <if test="questionnaireId != null "> and o.questionnaire_id = #{questionnaireId}</if>
+            <if test="description != null  and description != ''"> and o.description = #{description}</if>
+            <if test="level != null  and level != ''"> and o.level = #{level}</if>
+            <if test="openTime != null "> and o.open_time = #{openTime}</if>
+            <if test="closeTime != null "> and o.close_time = #{closeTime}</if>
             <if test="status != null  and status != ''"> and o.status = #{status}</if>
-            <if test="personInCharge != null "> and person_in_charge = #{personInCharge}</if>
-            <if test="reviewer != null "> and reviewer = #{reviewer}</if>
-            <if test="result != null  and result != ''"> and result = #{result}</if>
-            <if test="deadline != null "> and deadline = #{deadline}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="personInCharge != null "> and o.person_in_charge = #{personInCharge}</if>
+            <if test="reviewer != null "> and o.reviewer = #{reviewer}</if>
+            <if test="result != null  and result != ''"> and o.result = #{result}</if>
+            <if test="deadline != null "> and o.deadline = #{deadline}</if>
+            <if test="remarks != null  and remarks != ''"> and o.remarks = #{remarks}</if>
             <if test="deptId != null  and deptId != ''"> and o.dept_id = #{deptId}</if>
             <if test="apNo != null "> and p.ap_no = #{apNo}</if>
             <if test="processId != null "> and p.process_id = #{processId}</if>
             <if test="directory != null "> and q.directory = #{directory}</if>
             <if test="code != null "> and q.code = #{code}</if>
+            <if test="auditId != null "> and o.audit_id = #{auditId}</if>
             ${params.dataScope}
         </where>
         order by o.level desc, o.open_time desc
@@ -89,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
             <if test="apNo != null">ap_no,</if>
             <if test="processId != null">process_id,</if>
+            <if test="auditId != null">audit_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="type != null">#{type},</if>
@@ -106,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">#{deptId},</if>
             <if test="apNo != null">#{apNo},</if>
             <if test="processId != null">#{processId},</if>
+            <if test="auditId != null">#{auditId},</if>
          </trim>
     </insert>
 
@@ -127,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="apNo != null">ap_no = #{apNo},</if>
             <if test="processId != null">process_id = #{processId},</if>
+            <if test="auditId != null">audit_id = #{auditId},</if>
         </trim>
         where id = #{id}
     </update>

+ 8 - 0
ruoyi-ui/src/api/rc/audit.js

@@ -1,5 +1,13 @@
 import request from '@/utils/request'
 
+// 查询最近一次审计信息
+export function getRecentAudit() {
+  return request({
+    url: '/rc/audit/getRecentAudit',
+    method: 'get'
+  })
+}
+
 // 查询装置下次审计时间列表
 export function getNextAuditTimeList() {
   return request({

+ 0 - 8
ruoyi-ui/src/api/rc/meeting.js

@@ -1,13 +1,5 @@
 import request from '@/utils/request'
 
-// 查询最近一次审计信息
-export function getRecentAudit() {
-  return request({
-    url: '/rc/meeting/getRecentAudit',
-    method: 'get'
-  })
-}
-
 // 查询章节列表
 export function listChapter(auditId) {
   return request({

+ 4 - 3
ruoyi-ui/src/views/rc/meeting/index.vue

@@ -96,7 +96,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="涉及审计" align="center" prop="auditName" width="150">
         <template slot-scope="scope">
-          <span>
+          <span v-if="scope.row.deptName != null && scope.row.auditTime != null">
             {{scope.row.deptName}}<br/>
             ({{ parseTime(scope.row.auditTime, '{yy}-{mm}-{dd}') }})
           </span>
@@ -388,9 +388,9 @@
 </template>
 
 <script>
-import { listMeeting, getMeeting, delMeeting, addMeeting, updateMeeting, listChapter, listCode, getRecentAudit } from "@/api/rc/meeting";
+import { listMeeting, getMeeting, delMeeting, addMeeting, updateMeeting, listChapter, listCode } from "@/api/rc/meeting";
 import { listDept } from "@/api/system/dept";
-import { listAllAudit } from "@/api/rc/audit";
+import { listAllAudit, getRecentAudit } from "@/api/rc/audit";
 import { listAllUser } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import { addCommonfile, allFileList, delCommonfile, updateCommonfile } from "@/api/rc/commonfile";
@@ -493,6 +493,7 @@ export default {
     // this.getChapterList();
   },
   methods: {
+    /** 查询当前年份审计装置列表 */
     getRecentAudit() {
       getRecentAudit().then(response => {
         this.queryParams.auditId = response.data.id;

+ 47 - 1
ruoyi-ui/src/views/rc/openitem/index.vue

@@ -1,6 +1,16 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="涉及审计" prop="auditId">
+        <el-select clearable v-model="queryParams.auditId" placeholder="请选择涉及审计" filterable>
+          <el-option
+            v-for="dict in auditOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="目录" prop="directory">
         <el-input
           v-model="queryParams.directory"
@@ -173,6 +183,14 @@
 
     <el-table border v-loading="loading" :data="openitemList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="涉及审计" align="center" prop="auditName" width="150">
+        <template slot-scope="scope">
+          <span v-if="scope.row.deptName != null && scope.row.auditTime != null">
+            {{scope.row.deptName}}<br/>
+            ({{ parseTime(scope.row.auditTime, '{yy}-{mm}-{dd}') }})
+          </span>
+        </template>
+      </el-table-column>
       <el-table-column label="装置" align="center" prop="deptName" width="120"/>
       <el-table-column label="问题类型" align="center" prop="type" width="100">
         <template slot-scope="scope">
@@ -383,6 +401,7 @@
 import { listOpenitem, getOpenitem, delOpenitem, addOpenitem, updateOpenitem } from "@/api/rc/openitem";
 import { listDept } from "@/api/system/dept";
 import { listAllUser } from "@/api/system/user";
+import { listAllAudit, getRecentAudit } from "@/api/rc/audit";
 
 export default {
   name: "Openitem",
@@ -434,14 +453,41 @@ export default {
       deptOptions: [],
       // 用户列表
       userOptions: [],
+      // 审计列表
+      auditOptions: [],
+      recentAudit: null,
     };
   },
   created() {
-    this.getList();
+    this.getRecentAudit();
+    this.getAuditList();
+    // this.getList();
     this.getDeptList();
     this.getUserList();
   },
   methods: {
+    /** 查询当前年份审计装置列表 */
+    getRecentAudit() {
+      getRecentAudit().then(response => {
+        this.queryParams.auditId = response.data.id;
+        this.form.auditId = response.data.id;
+        this.recentAudit = response.data;
+        this.getList();
+        this.handleAuditChange();
+      });
+    },
+    /** 查询审计列表 */
+    getAuditList() {
+      listAllAudit().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          this.auditOptions.push({
+            "dictLabel": data[i].deptName + "(" + data[i].auditTime + ")",
+            "dictValue": data[i].id
+          });
+        }
+      });
+    },
     handleDoc(row , type) {
       this.$router.push({path: '/rc/file', query: {linkId: row.questionnaireId, linkName: 'questionnaire'}})
     },