浏览代码

数据权限改动

caozixuan 2 年之前
父节点
当前提交
5db9a2d84b

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java

@@ -31,7 +31,7 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
 
     List<BlurryUserDto> listUser(@Param("schoolId") Long schoolId, @Param("param") String param, @Param("orgIds") Set<Long> orgIds);
 
-    IPage<ExamTaskDto> listTaskApply(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("auditStatus") String auditStatus, @Param("cardRuleId") Long cardRuleId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("userId") Long userId, @Param("dpr") DataPermissionRule dpr, @Param("userName") String userName);
+    IPage<ExamTaskDto> listTaskApply(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("auditStatus") String auditStatus, @Param("cardRuleId") Long cardRuleId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("dpr") DataPermissionRule dpr, @Param("userName") String userName);
 
     IPage<ExamTaskDto> listTaskReviewUnaudited(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("userId") Long userId, @Param("cardRuleId") Long cardRuleId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("dpr") DataPermissionRule dpr, @Param("startCreateTime") Long startCreateTime, @Param("endCreateTime") Long endCreateTime, @Param("createName") String createName, @Param("currentUserId") Long currentUserId);
 

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -769,7 +769,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
-        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskApply(new Page<>(pageNumber, pageSize), schoolId, semesterId, examId, auditStatus, cardRuleId, courseCode, paperNumber, startTime, endTime, sysUser.getId(), dpr, userName);
+        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskApply(new Page<>(pageNumber, pageSize), schoolId, semesterId, examId, auditStatus, cardRuleId, courseCode, paperNumber, startTime, endTime, dpr, userName);
         for (ExamTaskDto record : examTaskDtoIPage.getRecords()) {
             if ((record.getReview() && FlowStatusEnum.FINISH.name().equals(record.getAuditStatus()) && !ExamModelEnum.MODEL3.equals(record.getExamModel()))) {
                 record.setApproveFormStatus(true);

+ 11 - 11
distributed-print-business/src/main/resources/mapper/ExamCardMapper.xml

@@ -121,17 +121,17 @@
             <if test="cardRuleId == '-1'">
                 AND a.create_method != 'STANDARD'
             </if>
-            <if test="dpr != null">
-                <if test="dpr.requestUserId != null">
-                    AND a.create_id = #{dpr.requestUserId}
-                </if>
-                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND a.org_id IN
-                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
-                </if>
-            </if>
+<!--            <if test="dpr != null">-->
+<!--                <if test="dpr.requestUserId != null">-->
+<!--                    AND a.create_id = #{dpr.requestUserId}-->
+<!--                </if>-->
+<!--                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">-->
+<!--                    AND a.org_id IN-->
+<!--                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">-->
+<!--                        #{item}-->
+<!--                    </foreach>-->
+<!--                </if>-->
+<!--            </if>-->
         order by a.id desc
     </select>
     <select id="listCustom" resultType="com.qmth.distributed.print.business.entity.ExamCard">

+ 0 - 3
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -226,9 +226,6 @@
         LEFT JOIN t_f_flow_join tffj on tffj.flow_id = e.flow_id
         <where>
             a.enable = true
-            <if test="userId != null and userId != ''">
-                and a.user_id = #{userId}
-            </if>
             <if test="schoolId != null and schoolId != ''">
                 and a.school_id = #{schoolId}
             </if>

+ 11 - 10
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicRoleDataPermissionServiceImpl.java

@@ -65,18 +65,19 @@ public class BasicRoleDataPermissionServiceImpl extends ServiceImpl<BasicRoleDat
                     .eq(BasicRoleDataPermission::getSchoolId, schoolId)
                     .eq(BasicRoleDataPermission::getRoleId, roleId));
 
-            List<BasicRoleDataPermission> basicRoleDataPermissionList = dataPermissionInfoList.stream().flatMap(e -> {
-                BasicRoleDataPermission basicRoleDataPermission = new BasicRoleDataPermission();
-                basicRoleDataPermission.insertInfo(requestUser.getId());
-                basicRoleDataPermission.setSchoolId(schoolId);
-                basicRoleDataPermission.setRoleId(roleId);
-                basicRoleDataPermission.setPrivilegeId(e.getPrivilegeId());
-                basicRoleDataPermission.setDataPermissionType(e.getDataPermissionType());
-                return Stream.of(basicRoleDataPermission);
-            }).collect(Collectors.toList());
+            List<BasicRoleDataPermission> basicRoleDataPermissionList = dataPermissionInfoList.stream()
+                    .filter(e -> Objects.nonNull(e.getDataPermissionType()))
+                    .flatMap(e -> {
+                        BasicRoleDataPermission basicRoleDataPermission = new BasicRoleDataPermission();
+                        basicRoleDataPermission.insertInfo(requestUser.getId());
+                        basicRoleDataPermission.setSchoolId(schoolId);
+                        basicRoleDataPermission.setRoleId(roleId);
+                        basicRoleDataPermission.setPrivilegeId(e.getPrivilegeId());
+                        basicRoleDataPermission.setDataPermissionType(e.getDataPermissionType());
+                        return Stream.of(basicRoleDataPermission);
+                    }).collect(Collectors.toList());
             this.saveBatch(basicRoleDataPermissionList);
         }
-
     }
 
     @Override