Bladeren bron

装置审计记录、定期会议、开项管理模块多部门数据归属处理

wangggziwen 9 maanden geleden
bovenliggende
commit
9e1b86ffea

+ 3 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TAuditServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.rc.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.common.annotation.DataScope;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.rc.mapper.TAuditMapper;
@@ -38,6 +40,7 @@ public class TAuditServiceImpl implements ITAuditService
      * @return 审计记录
      */
     @Override
+    @DataScope(deptAlias = "d")
     public List<TAudit> selectTAuditList(TAudit tAudit)
     {
         return tAuditMapper.selectTAuditList(tAudit);

+ 3 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TMeetingServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.rc.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.common.annotation.DataScope;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.rc.mapper.TMeetingMapper;
@@ -38,6 +40,7 @@ public class TMeetingServiceImpl implements ITMeetingService
      * @return 会议
      */
     @Override
+    @DataScope(deptAlias = "d")
     public List<TMeeting> selectTMeetingList(TMeeting tMeeting)
     {
         return tMeetingMapper.selectTMeetingList(tMeeting);

+ 3 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TOpenItemServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.rc.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.common.annotation.DataScope;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.rc.mapper.TOpenItemMapper;
@@ -38,6 +40,7 @@ public class TOpenItemServiceImpl implements ITOpenItemService
      * @return 开项
      */
     @Override
+    @DataScope(deptAlias = "d")
     public List<TOpenItem> selectTOpenItemList(TOpenItem tOpenItem)
     {
         return tOpenItemMapper.selectTOpenItemList(tOpenItem);

+ 2 - 1
rc-buisness/src/main/resources/mapper/rc/TAuditMapper.xml

@@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTAuditVo">
-        select id, year, pre_audit_time, audit_time, audit_result, remarks, dept_id from t_audit
+        select d.id, d.year, d.pre_audit_time, d.audit_time, d.audit_result, d.remarks, d.dept_id from t_audit d
     </sql>
 
     <select id="selectTAuditList" parameterType="TAudit" resultMap="TAuditResult">
@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditResult != null  and auditResult != ''"> and audit_result = #{auditResult}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="deptId != null "> and dept_id like concat(concat('%', #{deptId}), '%')</if>
+            ${params.dataScope}
         </where>
     </select>
     

+ 5 - 4
rc-buisness/src/main/resources/mapper/rc/TMeetingMapper.xml

@@ -15,10 +15,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTMeetingVo">
-        select m.id, year, questionnaire_id, person_in_charge, remarks, m.dept_id,
+        select d.id, year, questionnaire_id, person_in_charge, remarks, d.dept_id,
         u.nick_name as person_in_charge_name
-        from t_meeting m
-        left join sys_user u on m.person_in_charge = u.user_id
+        from t_meeting d
+        left join sys_user u on d.person_in_charge = u.user_id
     </sql>
 
     <select id="selectTMeetingList" parameterType="TMeeting" resultMap="TMeetingResult">
@@ -28,7 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="questionnaireId != null "> and questionnaire_id = #{questionnaireId}</if>
             <if test="personInCharge != null "> and person_in_charge = #{personInCharge}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
-            <if test="deptId != null  and deptId != ''"> and m.dept_id = #{deptId}</if>
+            <if test="deptId != null  and deptId != ''"> and d.dept_id = #{deptId}</if>
+            ${params.dataScope}
         </where>
     </select>
     

+ 9 - 8
rc-buisness/src/main/resources/mapper/rc/TOpenItemMapper.xml

@@ -26,12 +26,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTOpenItemVo">
-        select id, type, questionnaire_id, description, level, open_time, close_time, o.status, person_in_charge, reviewer, result, deadline, remarks, o.dept_id,
-        o.ap_no, o.process_id,
+        select id, type, questionnaire_id, description, level, open_time, close_time, d.status, person_in_charge, reviewer, result, deadline, remarks, d.dept_id,
+        d.ap_no, d.process_id,
         u1.nick_name as person_in_charge_name, u2.nick_name as reviewer_name
-        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
+        from t_open_item as d
+        left join sys_user u1 on d.person_in_charge = u1.user_id
+        left join sys_user u2 on d.reviewer = u2.user_id
     </sql>
 
     <select id="selectTOpenItemList" parameterType="TOpenItem" resultMap="TOpenItemResult">
@@ -43,21 +43,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="status != null  and status != ''"> and o.status = #{status}</if>
+            <if test="status != null  and status != ''"> and d.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="deptId != null  and deptId != ''"> and o.dept_id = #{deptId}</if>
+            <if test="deptId != null  and deptId != ''"> and d.dept_id = #{deptId}</if>
             <if test="apNo != null "> and p.ap_no = #{apNo}</if>
             <if test="processId != null "> and p.process_id = #{processId}</if>
+            ${params.dataScope}
         </where>
     </select>
     
     <select id="selectTOpenItemById" parameterType="Long" resultMap="TOpenItemResult">
         <include refid="selectTOpenItemVo"/>
-        where o.id = #{id}
+        where d.id = #{id}
     </select>
 
     <insert id="insertTOpenItem" parameterType="TOpenItem" useGeneratedKeys="true" keyProperty="id">