Bladeren bron

2023-4-3 修改定时排风,部门数据权限过滤维度,根据创建人的部分维度过滤,安全准入查询添加添加一个根据申请人的维度。

chaiyunlong 2 jaren geleden
bovenliggende
commit
6d546613b0

+ 3 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabTimedExhaustServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
+import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.StringUtils;
@@ -14,6 +15,7 @@ import com.zd.laboratory.mapper.LabTimedExhaustJoinsubMapper;
 import com.zd.laboratory.mapper.LabTimedExhaustMapper;
 import com.zd.laboratory.service.ILabTimedExhaustService;
 import com.zd.model.constant.BaseConstants;
+import com.zd.model.domain.per.PerPrefix;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -58,6 +60,7 @@ public class LabTimedExhaustServiceImpl implements ILabTimedExhaustService {
      * @return 定时排风集合
      */
     @Override
+    @DataScope(deptAlias = "ur", userAlias = "te", permi = PerPrefix.LABORATORY_EXHAUST)
     public List <LabTimedExhaust> selectLabTimedExhaustList(LabTimedExhaust labTimedExhaust) {
         return labTimedExhaustMapper.selectLabTimedExhaustList(labTimedExhaust);
     }

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSecurityApplyMapper.xml

@@ -145,6 +145,13 @@
             <if test="subjectId != null "> and subject_id = #{subjectId}</if>
             <if test="subjectAdminid != null "> and subject_adminid = #{subjectAdminid}</if>
             <if test="subjectName != null  and subjectName != ''"> and subject_name like concat('%', #{subjectName}, '%')</if>
+            <if test="searchValue != null  and searchValue != ''">
+                and (
+                t.subject_name like concat('%', #{searchValue}, '%')
+                or
+                t.user_name like concat('%', #{searchValue}, '%')
+                )
+            </if>
             <if test="securityCertificate != null  and securityCertificate != ''"> and security_certificate = #{securityCertificate}</if>
             <if test="securityCommitment != null  and securityCommitment != ''"> and security_commitment = #{securityCommitment}</if>
             <if test="riskReport != null  and riskReport != ''"> and risk_report = #{riskReport}</if>

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabTimedExhaustMapper.xml

@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT DISTINCT te.id,te.`task_name`,te.`exhaust_period`,te.`execution_date_type`,te.`execution_date`,te.`exhaust_type`,te.`user_id`,
         te.`create_by`,te.`create_time`,te.`update_by`,te.`update_time`,te.`remark`
         FROM lab_timed_exhaust te
+        inner join sys_user ur on te.`user_id` = ur.`user_id`
     </sql>
     <delete id="deleteLabTimedExhaustByIds">
         delete from lab_timed_exhaust where id = #{ids}