Răsfoiți Sursa

3.4.1 bug修复

xiaofei 9 luni în urmă
părinte
comite
1f277d862c
17 a modificat fișierele cu 94 adăugiri și 66 ștergeri
  1. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java
  2. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  3. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  4. 15 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  5. 6 0
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  6. 3 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java
  7. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java
  8. 3 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ConvertUtil.java
  9. 20 41
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/DateDisposeUtils.java
  10. 8 8
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java
  11. 2 2
      teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml
  12. 2 1
      teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/mapper/TRExamStudentMapper.java
  13. 9 1
      teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TRExamStudentServiceImpl.java
  14. 1 1
      teachcloud-obe/src/main/resources/mapper/ObeCourseOutlineMapper.xml
  15. 1 1
      teachcloud-obe/src/main/resources/mapper/ObeCourseRequirementReportMapper.xml
  16. 4 1
      teachcloud-obe/src/main/resources/mapper/ObeCultureProgramMapper.xml
  17. 15 0
      teachcloud-obe/src/main/resources/mapper/TRExamStudentMapper.xml

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

@@ -116,7 +116,7 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
     public WorkResult getFlowInfo(@Param("flowId") Long flowId, @Param("taskId") Long taskId);
 
     IPage<MakeupExamTaskDto> listMakeupExamTask(@Param("page") Page<MakeupExamTaskDto> page, @Param("printPlanId") Long printPlanId, @Param("semesterId") Long semesterId, @Param("examId") Long examId,
-            @Param("collegeId") Long collegeId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("userName") String userName);
+                                                @Param("collegeId") Long collegeId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("userName") String userName, @Param("campusName") String campusName, @Param("className") String className);
 
     /**
      * 命题任务统计查询

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

@@ -180,7 +180,7 @@ public interface ExamTaskService extends IService<ExamTask> {
 
     ExamTask getByExamIdAndCourseIdAndPaperNumber(Long examId, Long courseId, String paperNumber);
 
-    IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, Integer pageNumber, Integer pageSize);
+    IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, String campusName, String className, Integer pageNumber, Integer pageSize);
 
     void saveMakeupTask(MakeupExamTaskTotalParam makeupExamTaskTotalParam);
 

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

@@ -1756,7 +1756,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     }
 
     @Override
-    public IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, Integer pageNumber, Integer pageSize) {
+    public IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, String campusName, String className, Integer pageNumber, Integer pageSize) {
         if (semesterId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择学期");
         }
@@ -1764,7 +1764,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
         }
         Page<MakeupExamTaskDto> page = new Page<>(pageNumber, pageSize);
-        return this.baseMapper.listMakeupExamTask(page, printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName);
+        return this.baseMapper.listMakeupExamTask(page, printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName, campusName, className);
     }
 
     @Override

+ 15 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java

@@ -28,6 +28,7 @@ import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.*;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.util.ConvertUtil;
+import com.qmth.teachcloud.common.util.DateDisposeUtils;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkGroupDto;
 import com.qmth.teachcloud.mark.dto.mark.setting.MarkGroupSingleDto;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
@@ -36,6 +37,7 @@ import com.qmth.teachcloud.mark.service.MarkPaperService;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -152,8 +154,6 @@ public class ImportLogicServiceImpl implements ImportLogicService {
             basicExamStudent.setSchoolId(schoolId);
             basicExamStudent.setSemesterId(semesterId);
             basicExamStudent.setExamId(examId);
-            basicExamStudent.setRequiredFields(CollectionUtils.isNotEmpty(basicExamStudentImport.getRequiredFieldList()) ? JSON.toJSONString(basicExamStudentImport.getRequiredFieldList()) : null);
-            basicExamStudent.setExtendFields(CollectionUtils.isNotEmpty(basicExamStudentImport.getExtendFieldList()) ? JSON.toJSONString(basicExamStudentImport.getExtendFieldList()) : null);
 
             StringJoiner stringJoiner = new StringJoiner(";");
             // 校验excel内容
@@ -187,11 +187,21 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                     Map<String, Object> timeMap = ConvertUtil.analyzeExamTime(basicExamStudentImport.getExamDate(), basicExamStudentImport.getExamTime());
                     basicExamStudent.setExamStartTime(Long.valueOf(String.valueOf(timeMap.get("startTime"))));
                     basicExamStudent.setExamEndTime(Long.valueOf(String.valueOf(timeMap.get("endTime"))));
+
+                    // 反向更新examDate为标准日期格式,
+                    for (CodeNameEnableDisabledValue codeNameEnableDisabledValue : basicExamStudentImport.getRequiredFieldList()) {
+                        if(codeNameEnableDisabledValue.getCode().equals(RequiredFieldsEnum.EXAM_DATE.getCode())){
+                            codeNameEnableDisabledValue.setValue(String.valueOf(timeMap.get("dateStr")));
+                        }
+                    }
                 } catch (Exception e) {
                     stringJoiner.add(e.getMessage());
                 }
             }
 
+            basicExamStudent.setRequiredFields(CollectionUtils.isNotEmpty(basicExamStudentImport.getRequiredFieldList()) ? JSON.toJSONString(basicExamStudentImport.getRequiredFieldList()) : null);
+            basicExamStudent.setExtendFields(CollectionUtils.isNotEmpty(basicExamStudentImport.getExtendFieldList()) ? JSON.toJSONString(basicExamStudentImport.getExtendFieldList()) : null);
+
             // 校验课程开课学院和课程代码
             if (StringUtils.isNoneBlank(basicExamStudentImport.getCourseCode(), basicExamStudentImport.getTeachingRoomName())) {
                 String key = basicExamStudentImport.getCourseCode() + SystemConstant.HYPHEN + basicExamStudentImport.getTeachingRoomName();
@@ -578,6 +588,9 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                     Map<String, Object> timeMap = ConvertUtil.analyzeExamTime(basicExamStudentImport.getExamDate(), basicExamStudentImport.getExamTime());
                     basicExamStudent.setExamStartTime(Long.valueOf(String.valueOf(timeMap.get("startTime"))));
                     basicExamStudent.setExamEndTime(Long.valueOf(String.valueOf(timeMap.get("endTime"))));
+
+                    // 反向更新examDate为标准日期格式,
+                    basicExamStudentImport.setExamDate(String.valueOf(timeMap.get("dateStr")));
                 } catch (Exception e) {
                     stringJoiner.add(e.getMessage());
                 }

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

@@ -1278,6 +1278,12 @@
         <if test="userName != null and userName !=''">
             AND (su.login_name = #{userName} or su.real_name = #{userName})
         </if>
+        <if test="campusName != null and campusName != ''">
+            AND c.exam_place like concat('%', #{campusName}, '%')
+        </if>
+        <if test="className != null and className != ''">
+            AND c.clazz_name like concat('%', #{className}, '%')
+        </if>
         <if test="collegeId != null">
             AND EXISTS( SELECT
             1

+ 3 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java

@@ -247,9 +247,11 @@ public class ExamPrintPlanController {
                                  @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                  @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                  @ApiParam(value = "命题老师") @RequestParam(value = "userName", required = false) String userName,
+                                 @ApiParam(value = "校区") @RequestParam(value = "campusName", required = false) String campusName,
+                                 @ApiParam(value = "班级") @RequestParam(value = "className", required = false) String className,
                                  @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                  @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<MakeupExamTaskDto> list = examTaskService.listMakeupExamTask(printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName, pageNumber, pageSize);
+        IPage<MakeupExamTaskDto> list = examTaskService.listMakeupExamTask(printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName, campusName, className, pageNumber, pageSize);
         return ResultUtil.ok(list);
     }
 

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -424,7 +424,7 @@ public class SysController {
         }
         Map<String, Object> map = new HashMap<>();
         map.put(SystemConstant.VERSION, SystemConstant.VERSION_VALUE);
-        if (!SystemConstant.ADMIN_CODE_LIST.contains(code.toLowerCase())) {
+        if (StringUtils.isBlank(code) || !SystemConstant.ADMIN_CODE_LIST.contains(code.toLowerCase())) {
             BasicSchool basicSchool = null;
             if (StringUtils.isNotBlank(code)) {
                 basicSchool = commonCacheService.schoolCache(code);

+ 3 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ConvertUtil.java

@@ -99,12 +99,12 @@ public class ConvertUtil {
         DateTime startDate = DateDisposeUtils.parseExamDateTime(startTimeStr);
         DateTime endDate = DateDisposeUtils.parseExamDateTime(endTimeStr);
         if (Objects.isNull(startDate) || Objects.isNull(endDate)) {
-            throw ExceptionResultEnum.ERROR.exception("考试日期正确格式为[2023-01-01或2023/09/01]");
+            throw ExceptionResultEnum.ERROR.exception("考试日期正确格式为[2023-01-01或2023/01/01]");
         }
 
         Date start = new Date(startDate.getTime()), end = new Date(endDate.getTime());
         if (!DateUtils.isSameDay(start, end)) {
-            throw ExceptionResultEnum.ERROR.exception("考试日期正确格式为[2023-01-01或2023/09/01],考试时间正确格式为[08:00-10:00]");
+            throw ExceptionResultEnum.ERROR.exception("考试日期正确格式为[2023-01-01或2023/01/01],考试时间正确格式为[08:00-10:00]");
         }
 
         long startTime, endTime;
@@ -124,6 +124,7 @@ public class ConvertUtil {
         Map<String, Object> timeMap = new HashMap<>();
         timeMap.put("startTime", startTime);
         timeMap.put("endTime", endTime);
+        timeMap.put("dateStr", startDate.toDateStr());
         return timeMap;
 
     }

+ 20 - 41
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/DateDisposeUtils.java

@@ -8,6 +8,8 @@ package com.qmth.teachcloud.common.util;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.apache.commons.lang3.time.DateUtils;
 
@@ -119,56 +121,33 @@ public class DateDisposeUtils extends DateUtils {
     /**
      * 日期型字符串转化为日期 格式
      */
-    public static DateTime parseExamDateTime(Object str) {
-        if (str == null) {
+    public static DateTime parseExamDateTime(String dateStr) {
+        if (dateStr == null) {
             return null;
         }
+        dateStr = StringUtils.replace(dateStr, SystemConstant.ORG_SPLIT, SystemConstant.HYPHEN);
+        int index = dateStr.indexOf(SystemConstant.HYPHEN);
+        DateTime dateTime = null;
         try {
-            DateTime dateTime = null;
-            try {
-                dateTime = DateUtil.parse(str.toString(), "yyyy-MM-dd HH:mm");
-                if (dateTime != null) {
-                    return dateTime;
-                }
-            } catch (Exception e) {
-            }
-            try {
-                dateTime = DateUtil.parse(str.toString(), "yyyy/MM/dd HH:mm");
-                if (dateTime != null) {
-                    return dateTime;
+            if (index == 4) {
+                try {
+                    dateTime = DateUtil.parse(dateStr.toString(), "yyyy-MM-dd HH:mm");
+                } catch (Exception e) {
                 }
-            } catch (Exception e) {
-            }
-            try {
-                dateTime = DateUtil.parse(str.toString(), "yyyy.MM/dd HH:mm");
-                if (dateTime != null) {
-                    return dateTime;
-                }
-            } catch (Exception e) {
-            }
-            try {
-                dateTime = DateUtil.parse(str.toString(), "yyyy.MM.dd HH:mm");
-                if (dateTime != null) {
-                    return dateTime;
+            } else if (index == 1 || index == 2) {
+                try {
+                    dateTime = DateUtil.parse(dateStr.toString(), "MM-dd-yy HH:mm");
+                } catch (Exception e) {
                 }
-            } catch (Exception e) {
             }
-            try {
-                dateTime = DateUtil.parse(str.toString(), "yyyy/MM.dd HH:mm");
-                if (dateTime != null) {
-                    return dateTime;
-                }
-            } catch (Exception e) {
-            }
-//            try {
-//                dateTime = DateUtil.parse(str.toString(), "MM/dd/yy HH:mm");
-//            } catch (Exception e) {
-//            }
-
-            return dateTime;
         } catch (Exception e) {
             e.printStackTrace();
         }
+        if (dateTime != null) {
+            if (dateTime.year() > 2000 && dateTime.month() <= 11 && dateTime.dayOfMonth() <= 31) {
+                return dateTime;
+            }
+        }
         return null;
     }
 

+ 8 - 8
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java

@@ -94,7 +94,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         }
 
         // 校验题号不能重复
-        Map<String, Long> longMap = questions.stream().collect(Collectors.groupingBy(m -> String.valueOf(m.getMainNumber()) + m.getSubNumber(), Collectors.counting()));
+        Map<String, Long> longMap = questions.stream().collect(Collectors.groupingBy(m -> m.getMainNumber() + SystemConstant.HYPHEN + m.getSubNumber(), Collectors.counting()));
         long count = longMap.entrySet().stream().filter(m -> m.getValue().intValue() > 1).count();
         if (count > 0) {
             throw ExceptionResultEnum.ERROR.exception("大题号-小题号有重复数据");
@@ -138,7 +138,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                                 throw ExceptionResultEnum.ERROR.exception("大题号" + markQuestion.getMainNumber() + "小题号" + markQuestion.getSubNumber() + "已分组,不能修改小题满分");
                             }
                             // 主观题改客观题
-                            if(!markQuestion.getObjective() && question.getObjective()){
+                            if (!markQuestion.getObjective() && question.getObjective()) {
                                 throw ExceptionResultEnum.ERROR.exception("大题号" + markQuestion.getMainNumber() + "小题号" + markQuestion.getSubNumber() + "已分组,不能修改为客观题题型");
                             }
                         }
@@ -149,7 +149,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                             throw ExceptionResultEnum.ERROR.exception("间隔分必须大于0");
                         }
                         // 客观题变主观题
-                        if(markQuestion.getObjective() && !question.getObjective()){
+                        if (markQuestion.getObjective() && !question.getObjective()) {
                             // 清除判分策略
                             markQuestion.setObjectivePolicy(null);
                             markQuestion.setObjectivePolicyScore(null);
@@ -157,9 +157,9 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                             markQuestion.setOptionCount(0);
                         }
                         // 客观题
-                        if(question.getObjective()){
+                        if (question.getObjective()) {
                             markQuestion.setOptionCount(question.getOptionCount());
-                            if(!markQuestion.getQuestionType().equals(question.getQuestionType())){
+                            if (!markQuestion.getQuestionType().equals(question.getQuestionType())) {
                                 // 清除判分策略
                                 markQuestion.setObjectivePolicy(null);
                                 markQuestion.setObjectivePolicyScore(null);
@@ -228,12 +228,12 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         // 主观题结构有变动
         List<MarkQuestion> subjectiveQuestions = questions.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
         List<MarkQuestion> subjectiveMarkQuestionList = markQuestionList.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
-        if(!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)){
+        if (!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)) {
             // 未分组的题目
             long unGroupQuestionCount = this.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(examId, paperNumber, false);
             long groupCount = CollectionUtils.size(markGroupService.listGroupByExamIdAndPaperNumber(examId, paperNumber));
             // 考生主观题重新统分
-            markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(),groupCount, unGroupQuestionCount);
+            markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(), groupCount, unGroupQuestionCount);
         }
 
         // 更新分组状态
@@ -455,7 +455,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
 
     @Override
     public List<MarkQuestion> listByExamIdAndPaperNumberAndPaperIndexAndPageIndex(Long examId, String paperNumber,
-                                                                                  Integer paperIndex, Integer pageIndex,boolean isObjective) {
+                                                                                  Integer paperIndex, Integer pageIndex, boolean isObjective) {
         QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(MarkQuestion::getExamId, examId)
                 .eq(MarkQuestion::getPaperNumber, paperNumber)

+ 2 - 2
teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml

@@ -39,9 +39,9 @@
 			s.student_code
 		from mark_student s
 			inner join basic_exam_student bes on s.basic_student_id = bes.id
-			INNER join sys_user su on s.create_id = su.id
+			LEFT JOIN basic_course bc on s.course_id = bc.id
 			<if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-				AND su.org_id IN
+				AND bc.teaching_room_id IN
 				<foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
 					#{item}
 				</foreach>

+ 2 - 1
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/mapper/TRExamStudentMapper.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.obe.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.obe.been.report.StudentCourseInfoDto;
 import com.qmth.teachcloud.obe.been.report.StudentRequirementInfoDto;
 import com.qmth.teachcloud.obe.entity.TRExamStudent;
@@ -22,5 +23,5 @@ public interface TRExamStudentMapper extends BaseMapper<TRExamStudent> {
 
     List<StudentCourseInfoDto> listStudentCourseByCultureProgramIdAndStudentCodeAndSemesterId(@Param("cultureProgramId") Long cultureProgramId, @Param("studentCode") String studentCode, @Param("semesterId") Long semesterId);
 
-    IPage<StudentRequirementInfoDto> requirementStudentPage(@Param("studentRequirementInfoDtoPage") Page<StudentRequirementInfoDto> studentRequirementInfoDtoPage, @Param("cultureProgramId") Long cultureProgramId, @Param("studentCodeOrName") String studentCodeOrName);
+    IPage<StudentRequirementInfoDto> requirementStudentPage(@Param("studentRequirementInfoDtoPage") Page<StudentRequirementInfoDto> studentRequirementInfoDtoPage, @Param("cultureProgramId") Long cultureProgramId, @Param("studentCodeOrName") String studentCodeOrName, @Param("dpr") DataPermissionRule dpr);
 }

+ 9 - 1
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TRExamStudentServiceImpl.java

@@ -5,7 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
+import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.obe.been.obe.CourseRequirementMatrixDto;
 import com.qmth.teachcloud.obe.been.obe.MatrixRequirementDto;
 import com.qmth.teachcloud.obe.been.obe.MatrixSubRequirementDto;
@@ -58,6 +62,8 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
 
     @Resource
     private ObeCourseRequirementReportService obeCourseRequirementReportService;
+    @Resource
+    private BasicRoleDataPermissionService basicRoleDataPermissionService;
 
     /**
      * 获取考生详细报告
@@ -299,7 +305,9 @@ public class TRExamStudentServiceImpl extends ServiceImpl<TRExamStudentMapper, T
 
     @Override
     public IPage<StudentRequirementInfoDto> getRequirementsStudentPage(Long cultureProgramId, String studentCodeOrName, Integer pageNumber, Integer pageSize) {
-        return this.baseMapper.requirementStudentPage(new Page<>(pageNumber, pageSize), cultureProgramId, studentCodeOrName);
+        SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
+        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(requestUser.getSchoolId(), requestUser.getId(), ServletUtil.getRequest().getServletPath());
+        return this.baseMapper.requirementStudentPage(new Page<>(pageNumber, pageSize), cultureProgramId, studentCodeOrName, dpr);
     }
 
 //    /**

+ 1 - 1
teachcloud-obe/src/main/resources/mapper/ObeCourseOutlineMapper.xml

@@ -67,7 +67,7 @@
                     AND oco.user_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.courseUserId != null">
-                    AND EXISTS( SELECT 1 FROM (select course_code from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = bc.code)
+                    AND EXISTS( SELECT 1 FROM (select course_id from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = bc.id)
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                     AND bc.teaching_room_id IN

+ 1 - 1
teachcloud-obe/src/main/resources/mapper/ObeCourseRequirementReportMapper.xml

@@ -25,7 +25,7 @@
                     AND ocp.create_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bp.org_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>

+ 4 - 1
teachcloud-obe/src/main/resources/mapper/ObeCultureProgramMapper.xml

@@ -43,8 +43,11 @@
                 <if test="dpr.requestUserId != null">
                     AND ocp.create_id = #{dpr.requestUserId}
                 </if>
+                <if test="dpr.courseUserId != null">
+                    AND EXISTS( SELECT 1 FROM (select course_id from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_id in (select ocpc.course_id from obe_culture_program_course ocpc where ocpc.culture_program_id = ocp.id))
+                </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                    AND su.org_id IN
+                    AND bp.org_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                         #{item}
                     </foreach>

+ 15 - 0
teachcloud-obe/src/main/resources/mapper/TRExamStudentMapper.xml

@@ -41,10 +41,25 @@
                 LEFT JOIN
             t_r_basic_info rbi ON res.r_basic_info_id = rbi.id
             left join basic_exam_student bes on rbi.exam_id = bes.exam_id and rbi.paper_number = bes.paper_number and res.student_code = bes.student_code
+            left join basic_course bc on rbi.course_id = bc.id
             where rbi.culture_program_id = #{cultureProgramId}
                 <if test="studentCodeOrName != null and studentCodeOrName != ''">
                     AND (res.name LIKE CONCAT('%', #{studentCodeOrName}, '%')
                     OR res.student_code LIKE CONCAT('%', #{studentCodeOrName}, '%'))
                 </if>
+                <if test="dpr != null">
+                    <if test="dpr.requestUserId != null">
+                        AND bes.teacher_id = #{dpr.requestUserId}
+                    </if>
+                    <if test="dpr.courseUserId != null">
+                        AND EXISTS( SELECT 1 FROM (select course_id from teach_course where user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = rbi.course_id)
+                    </if>
+                    <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                        AND bc.teaching_room_id IN
+                        <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+                </if>
     </select>
 </mapper>