Jelajahi Sumber

Merge remote-tracking branch 'origin/dev_v3.4.0' into dev_v3.4.0

# Conflicts:
#	distributed-print/install/mysql/upgrade/3.4.0.sql
wangliang 11 bulan lalu
induk
melakukan
14874d3274
14 mengubah file dengan 130 tambahan dan 121 penghapusan
  1. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/BasicExamStudentMapper.java
  2. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicExamStudentService.java
  3. 1 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java
  4. 2 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java
  5. 4 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamStudentService.java
  6. 7 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  7. 9 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  8. 8 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  9. 41 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java
  10. 46 46
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  11. 3 0
      distributed-print-business/src/main/resources/mapper/BasicExamStudentMapper.xml
  12. 1 60
      distributed-print/install/mysql/upgrade/3.4.0.sql
  13. 5 5
      distributed-print/src/main/java/com/qmth/distributed/print/api/BasicExamStudentController.java
  14. 1 1
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

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

@@ -23,7 +23,7 @@ import java.util.List;
 public interface BasicExamStudentMapper extends BaseMapper<BasicExamStudent> {
 public interface BasicExamStudentMapper extends BaseMapper<BasicExamStudent> {
 
 
     IPage<BasicExamStudentResult> findBasicExamStudentPage(@Param("iPage") Page<BasicExamStudentResult> iPage,
     IPage<BasicExamStudentResult> findBasicExamStudentPage(@Param("iPage") Page<BasicExamStudentResult> iPage,
-                                                           @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId,
+                                                           @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId,
                                                            @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("teacher") String teacher, @Param("college") String college,
                                                            @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("teacher") String teacher, @Param("college") String college,
                                                            @Param("major") String major, @Param("teachClassName") String teachClassName, @Param("className") String className,
                                                            @Param("major") String major, @Param("teachClassName") String teachClassName, @Param("className") String className,
                                                            @Param("examStudentInfo") String examStudentInfo, @Param("dpr") DataPermissionRule dpr);
                                                            @Param("examStudentInfo") String examStudentInfo, @Param("dpr") DataPermissionRule dpr);

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

@@ -26,7 +26,7 @@ import java.util.List;
  */
  */
 public interface BasicExamStudentService extends IService<BasicExamStudent> {
 public interface BasicExamStudentService extends IService<BasicExamStudent> {
 
 
-    IPage<BasicExamStudentResult> page(Long semesterId, Long examId, Long courseId, String paperNumber, String teacher,
+    IPage<BasicExamStudentResult> page(Long semesterId, Long examId, Long openCollegeId, Long courseId, String paperNumber, String teacher,
                                        String college, String major, String teachClassName, String className, String examStudentInfo, int pageNumber, int pageSize);
                                        String college, String major, String teachClassName, String className, String examStudentInfo, int pageNumber, int pageSize);
 
 
     /**
     /**

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

@@ -40,4 +40,5 @@ public interface ExamDetailCourseService extends IService<ExamDetailCourse> {
 
 
     List<JSONObject> listExamDetailPaperNumber(Long examDetailId);
     List<JSONObject> listExamDetailPaperNumber(Long examDetailId);
 
 
+    void updateTotalSubjects(Long examDetailCourseId, int totalSubjects);
 }
 }

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java

@@ -194,4 +194,6 @@ public interface ExamDetailService extends IService<ExamDetail> {
     List<Long> saveImportExamStudent(ExamPrintPlan examPrintPlan, List<BasicExamStudent> basicExamStudentList, Long createId);
     List<Long> saveImportExamStudent(ExamPrintPlan examPrintPlan, List<BasicExamStudent> basicExamStudentList, Long createId);
 
 
     int countByPrintPlanId(String printPlanId);
     int countByPrintPlanId(String printPlanId);
+
+    void updateTotalSubjects(Long id, int totalSubjects);
 }
 }

+ 4 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamStudentService.java

@@ -40,4 +40,8 @@ public interface ExamStudentService extends IService<ExamStudent> {
     int countByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
     int countByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
 
 
     void deleteByBasicStudentId(Long basicStudentId);
     void deleteByBasicStudentId(Long basicStudentId);
+
+    List<ExamStudent> listByBasicStudentId(Long basicStudentId);
+
+    int countByExamDetailCourseId(Long examDetailCourseId);
 }
 }

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

@@ -13,6 +13,7 @@ import com.qmth.distributed.print.business.bean.dto.ExamStudentDto;
 import com.qmth.distributed.print.business.bean.params.BasicExamStudentParam;
 import com.qmth.distributed.print.business.bean.params.BasicExamStudentParam;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.entity.BasicExamRule;
 import com.qmth.distributed.print.business.entity.BasicExamRule;
+import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.entity.ExamTaskDetail;
 import com.qmth.distributed.print.business.entity.ExamTaskDetail;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
@@ -85,10 +86,14 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Resource
     @Resource
     private ExamTaskDetailService examTaskDetailService;
     private ExamTaskDetailService examTaskDetailService;
     @Resource
     @Resource
+    private ExamDetailService examDetailService;
+    @Resource
+    private ExamDetailCourseService examDetailCourseService;
+    @Resource
     private ExamStudentService examStudentService;
     private ExamStudentService examStudentService;
 
 
     @Override
     @Override
-    public IPage<BasicExamStudentResult> page(Long semesterId, Long examId, Long courseId, String paperNumber,
+    public IPage<BasicExamStudentResult> page(Long semesterId, Long examId, Long openCollegeId, Long courseId, String paperNumber,
                                               String teacher, String college, String major, String teachClassName, String className, String examStudentInfo, int pageNumber,
                                               String teacher, String college, String major, String teachClassName, String className, String examStudentInfo, int pageNumber,
                                               int pageSize) {
                                               int pageSize) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
@@ -103,7 +108,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(requestUser.getSchoolId(), requestUser.getId(),
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(requestUser.getSchoolId(), requestUser.getId(),
                 ServletUtil.getRequest().getServletPath());
                 ServletUtil.getRequest().getServletPath());
         IPage<BasicExamStudentResult> page = this.baseMapper.findBasicExamStudentPage(new Page<>(pageNumber, pageSize),
         IPage<BasicExamStudentResult> page = this.baseMapper.findBasicExamStudentPage(new Page<>(pageNumber, pageSize),
-                requestUser.getSchoolId(), semesterId, examId, courseId, paperNumber, teacher, college, major, teachClassName, className, examStudentInfo, dpr);
+                requestUser.getSchoolId(), semesterId, examId, openCollegeId, courseId, paperNumber, teacher, college, major, teachClassName, className, examStudentInfo, dpr);
         for (BasicExamStudentResult record : page.getRecords()) {
         for (BasicExamStudentResult record : page.getRecords()) {
             Long examStartTime = record.getExamStartTime();
             Long examStartTime = record.getExamStartTime();
             Long examEndTime = record.getExamEndTime();
             Long examEndTime = record.getExamEndTime();

+ 9 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
+import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamStatusEnum;
 import com.qmth.distributed.print.business.mapper.ExamDetailCourseMapper;
 import com.qmth.distributed.print.business.mapper.ExamDetailCourseMapper;
@@ -118,4 +119,12 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
         }
         }
         return jsonObjectList;
         return jsonObjectList;
     }
     }
+
+    @Override
+    public void updateTotalSubjects(Long examDetailCourseId, int totalSubjects) {
+        UpdateWrapper<ExamDetailCourse> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(ExamDetailCourse::getTotalSubjects, totalSubjects)
+                .eq(ExamDetailCourse::getId, examDetailCourseId);
+        this.update(updateWrapper);
+    }
 }
 }

+ 8 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -1131,4 +1131,12 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, printPlanId);
         queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, printPlanId);
         return this.count(queryWrapper);
         return this.count(queryWrapper);
     }
     }
+
+    @Override
+    public void updateTotalSubjects(Long id, int totalSubjects) {
+        UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(ExamDetail::getTotalSubjects, totalSubjects)
+                .eq(ExamDetail::getId, id);
+        this.update(updateWrapper);
+    }
 }
 }

+ 41 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java

@@ -7,19 +7,25 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseDto;
 import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseDto;
 import com.qmth.distributed.print.business.bean.dto.ExamStudentDto;
 import com.qmth.distributed.print.business.bean.dto.ExamStudentDto;
 import com.qmth.distributed.print.business.bean.dto.pdf.ExamStudentInfo;
 import com.qmth.distributed.print.business.bean.dto.pdf.ExamStudentInfo;
+import com.qmth.distributed.print.business.bean.params.ExamTaskSubmitContent;
+import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.mapper.ExamDetailCourseMapper;
 import com.qmth.distributed.print.business.mapper.ExamDetailCourseMapper;
 import com.qmth.distributed.print.business.mapper.ExamStudentMapper;
 import com.qmth.distributed.print.business.mapper.ExamStudentMapper;
 import com.qmth.distributed.print.business.service.BasicExamStudentService;
 import com.qmth.distributed.print.business.service.BasicExamStudentService;
+import com.qmth.distributed.print.business.service.ExamDetailCourseService;
+import com.qmth.distributed.print.business.service.ExamDetailService;
 import com.qmth.distributed.print.business.service.ExamStudentService;
 import com.qmth.distributed.print.business.service.ExamStudentService;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.*;
 import java.util.*;
@@ -36,12 +42,14 @@ import java.util.stream.Collectors;
 @Service
 @Service
 public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamStudent> implements ExamStudentService {
 public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamStudent> implements ExamStudentService {
 
 
-    @Resource
-    private ExamStudentMapper examStudentMapper;
     @Resource
     @Resource
     private ExamDetailCourseMapper examDetailCourseMapper;
     private ExamDetailCourseMapper examDetailCourseMapper;
     @Resource
     @Resource
     private BasicExamStudentService basicExamStudentService;
     private BasicExamStudentService basicExamStudentService;
+    @Resource
+    private ExamDetailService examDetailService;
+    @Resource
+    private ExamDetailCourseService examDetailCourseService;
 
 
     @Override
     @Override
     public List<String> listPaperTypeByExamDetailCourseId(String examDetailCourseId) {
     public List<String> listPaperTypeByExamDetailCourseId(String examDetailCourseId) {
@@ -134,10 +142,38 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
         return this.count(queryWrapper);
         return this.count(queryWrapper);
     }
     }
 
 
+    @Transactional
     @Override
     @Override
     public void deleteByBasicStudentId(Long basicStudentId) {
     public void deleteByBasicStudentId(Long basicStudentId) {
-        UpdateWrapper<ExamStudent> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().eq(ExamStudent::getBasicStudentId, basicStudentId);
-        this.remove(updateWrapper);
+        List<ExamStudent> examStudentList = this.listByBasicStudentId(basicStudentId);
+        List<Long> examStudentIds = examStudentList.stream().map(ExamStudent::getId).collect(Collectors.toList());
+        this.removeByIds(examStudentIds);
+        List<Long> examDetailCourseIds = examStudentList.stream().map(ExamStudent::getExamDetailCourseId).distinct().collect(Collectors.toList());
+        // 更新考场科目表科次
+        for (Long examDetailCourseId : examDetailCourseIds) {
+            examDetailCourseService.updateTotalSubjects(examDetailCourseId, this.countByExamDetailCourseId(examDetailCourseId));
+        }
+        // 更新考场科次
+        List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.listByIds(examDetailCourseIds);
+        for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
+            List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailCourse.getExamDetailId());
+            if (CollectionUtils.isNotEmpty(examDetailCourses)) {
+                examDetailService.updateTotalSubjects(examDetailCourse.getExamDetailId(), examDetailCourses.stream().filter(m->m.getTotalSubjects()!=null).mapToInt(m->m.getTotalSubjects()).sum());
+            }
+        }
+    }
+
+    @Override
+    public List<ExamStudent> listByBasicStudentId(Long basicStudentId) {
+        QueryWrapper<ExamStudent> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ExamStudent::getBasicStudentId, basicStudentId);
+        return this.list(queryWrapper);
+    }
+
+    @Override
+    public int countByExamDetailCourseId(Long examDetailCourseId) {
+        QueryWrapper<ExamStudent> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ExamStudent::getExamDetailCourseId, examDetailCourseId);
+        return this.count(queryWrapper);
     }
     }
 }
 }

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

@@ -373,60 +373,60 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, teachingRoomName);
                     List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, teachingRoomName);
                     if (CollectionUtils.isEmpty(sysOrgList)) {
                     if (CollectionUtils.isEmpty(sysOrgList)) {
                         excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行开课学院[" + teachingRoomName + "]在组织架构中不存在"));
                         excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行开课学院[" + teachingRoomName + "]在组织架构中不存在"));
-                    }
-                    // 课程是否存在并且与名称对应
-                    BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrgList.get(0).getId(), excelCourseCode);
-                    // 校验课程名称和课程代码
-                    if (basicCourse == null) {
-                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行开课学院[" + teachingRoomName + "]下无课程代码[" + excelCourseCode + "]的课程"));
-                    }
-
-                    if (courseCodePaperNumberMap.containsKey(excelCourseCode)) {
-                        String paperNumber = courseCodePaperNumberMap.get(excelCourseCode);
-                        if (paperNumber != null && paperNumber.equals(excelPaperNumber)) {
-                            excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行课程代码[" + excelCourseCode + "]与试卷编号[" + excelPaperNumber + "]有相同数据"));
-                        }
                     } else {
                     } else {
-                        courseCodePaperNumberMap.put(excelCourseCode, excelPaperNumber);
-                    }
-
-                    // 校验试卷编号重复
-                    if (StringUtils.isNotBlank(excelPaperNumber)) {
-                        if (paperNubmerSet.contains(excelPaperNumber)) {
-                            excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "试卷编号[" + excelPaperNumber + "]有相同数据"));
+                        // 课程是否存在并且与名称对应
+                        BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrgList.get(0).getId(), excelCourseCode);
+                        // 校验课程名称和课程代码
+                        if (basicCourse == null) {
+                            excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行开课学院[" + teachingRoomName + "]下无课程代码[" + excelCourseCode + "]的课程"));
+                        }
+                        if (courseCodePaperNumberMap.containsKey(excelCourseCode)) {
+                            String paperNumber = courseCodePaperNumberMap.get(excelCourseCode);
+                            if (paperNumber != null && paperNumber.equals(excelPaperNumber)) {
+                                excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行课程代码[" + excelCourseCode + "]与试卷编号[" + excelPaperNumber + "]有相同数据"));
+                            }
                         } else {
                         } else {
-                            paperNubmerSet.add(excelPaperNumber);
+                            courseCodePaperNumberMap.put(excelCourseCode, excelPaperNumber);
                         }
                         }
-                    }
 
 
-                    // 校验命题老师
-                    AssignTeacherDto assignTeacherDto = sysUserService.listUser(basicCourse.getId(), null);
-                    List<SysUserResult> listUser = Objects.nonNull(assignTeacherDto) ? assignTeacherDto.getAllUserList() : new ArrayList<>();
-                    Map<String, String> userMap = listUser.stream().collect(Collectors.toMap(SysUserResult::getLoginName, SysUserResult::getRealName));
-                    if (userMap == null) {
-                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行课程代码[" + excelCourseCode + "]所属机构下未找到命题老师"));
-                    } else {
-                        List<SysUserResult> courseUserList = Objects.nonNull(assignTeacherDto) ? assignTeacherDto.getCourseUserList() : new ArrayList<>();
-                        Map<String, String> courseUserMap = courseUserList.stream().collect(Collectors.toMap(SysUserResult::getLoginName, SysUserResult::getRealName));
-                        if (!courseUserMap.isEmpty()) {
-                            userMap.putAll(courseUserMap);
-                        }
-                        if (StringUtils.isNotBlank(excelTeacherAccount)) {
-                            if (StringUtils.isBlank(excelTeacherName)) {
-                                excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师姓名不能为空"));
+                        // 校验试卷编号重复
+                        if (StringUtils.isNotBlank(excelPaperNumber)) {
+                            if (paperNubmerSet.contains(excelPaperNumber)) {
+                                excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "试卷编号[" + excelPaperNumber + "]有相同数据"));
                             } else {
                             } else {
-                                if (StringUtils.isBlank(userMap.get(excelTeacherAccount))) {
-                                    excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师工号[" + excelTeacherAccount + "]系统中不存在"));
+                                paperNubmerSet.add(excelPaperNumber);
+                            }
+                        }
+
+                        // 校验命题老师
+                        AssignTeacherDto assignTeacherDto = sysUserService.listUser(basicCourse.getId(), null);
+                        List<SysUserResult> listUser = Objects.nonNull(assignTeacherDto) ? assignTeacherDto.getAllUserList() : new ArrayList<>();
+                        Map<String, String> userMap = listUser.stream().collect(Collectors.toMap(SysUserResult::getLoginName, SysUserResult::getRealName));
+                        if (userMap == null) {
+                            excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行课程代码[" + excelCourseCode + "]所属机构下未找到命题老师"));
+                        } else {
+                            List<SysUserResult> courseUserList = Objects.nonNull(assignTeacherDto) ? assignTeacherDto.getCourseUserList() : new ArrayList<>();
+                            Map<String, String> courseUserMap = courseUserList.stream().collect(Collectors.toMap(SysUserResult::getLoginName, SysUserResult::getRealName));
+                            if (!courseUserMap.isEmpty()) {
+                                userMap.putAll(courseUserMap);
+                            }
+                            if (StringUtils.isNotBlank(excelTeacherAccount)) {
+                                if (StringUtils.isBlank(excelTeacherName)) {
+                                    excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师姓名不能为空"));
                                 } else {
                                 } else {
-                                    String teacherName = userMap.get(excelTeacherAccount);
-                                    if (!excelTeacherName.equals(teacherName)) {
-                                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师姓名与系统不一致。文件中为[" + excelTeacherName + "],用户管理中为[" + teacherName + "]"));
+                                    if (StringUtils.isBlank(userMap.get(excelTeacherAccount))) {
+                                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师工号[" + excelTeacherAccount + "]系统中不存在"));
+                                    } else {
+                                        String teacherName = userMap.get(excelTeacherAccount);
+                                        if (!excelTeacherName.equals(teacherName)) {
+                                            excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师姓名与系统不一致。文件中为[" + excelTeacherName + "],用户管理中为[" + teacherName + "]"));
+                                        }
                                     }
                                     }
                                 }
                                 }
-                            }
-                        } else {
-                            if (StringUtils.isNotBlank(excelTeacherName)) {
-                                excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师工号必填"));
+                            } else {
+                                if (StringUtils.isNotBlank(excelTeacherName)) {
+                                    excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行命题老师工号必填"));
+                                }
                             }
                             }
                         }
                         }
                     }
                     }

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

@@ -50,6 +50,9 @@
             <if test="examId != null">
             <if test="examId != null">
                 AND bes.exam_id = #{examId}
                 AND bes.exam_id = #{examId}
             </if>
             </if>
+            <if test="openCollegeId != null">
+                AND bc.teaching_room_id = #{openCollegeId}
+            </if>
             <if test="courseId != null">
             <if test="courseId != null">
                 AND bes.course_id = #{courseId}
                 AND bes.course_id = #{courseId}
             </if>
             </if>

+ 1 - 60
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -332,63 +332,4 @@ ALTER TABLE `basic_exam_student` ADD INDEX `index1` (`exam_id` ASC, `course_id`
 ALTER TABLE `basic_exam_student` ADD INDEX `index2` (`exam_id` ASC, `paper_number` ASC, `student_code` ASC);
 ALTER TABLE `basic_exam_student` ADD INDEX `index2` (`exam_id` ASC, `paper_number` ASC, `student_code` ASC);
 ALTER TABLE `mark_student` ADD INDEX `index6` (`exam_id` ASC, `paper_number` ASC, `paper_type` ASC);
 ALTER TABLE `mark_student` ADD INDEX `index6` (`exam_id` ASC, `paper_number` ASC, `paper_type` ASC);
 
 
--- 2024-07-16
-DROP TABLE IF EXISTS `tmp_help_topic`;
-CREATE TABLE `tmp_help_topic` (
-                                  `help_topic_id` bigint(20) NOT NULL AUTO_INCREMENT,
-                                  PRIMARY KEY (`help_topic_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4;
-
--- ----------------------------
--- Records of tmp_help_topic
--- ----------------------------
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (1);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (2);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (3);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (4);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (5);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (6);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (7);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (8);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (9);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (10);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (11);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (12);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (13);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (14);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (15);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (16);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (17);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (18);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (19);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (20);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (21);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (22);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (23);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (24);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (25);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (26);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (27);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (28);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (29);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (30);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (31);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (32);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (33);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (34);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (35);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (36);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (37);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (38);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (39);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (40);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (41);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (42);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (43);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (44);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (45);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (46);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (47);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (48);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (49);
-INSERT INTO `tmp_help_topic` (`help_topic_id`) VALUES (50);
+UPDATE `sys_privilege` SET `related` = '888,894,956,957,958' WHERE (`id` = '1179');

+ 5 - 5
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicExamStudentController.java

@@ -57,8 +57,9 @@ public class BasicExamStudentController {
     @ApiOperation(value = "分页查询")
     @ApiOperation(value = "分页查询")
     @RequestMapping(value = "/page", method = RequestMethod.POST)
     @RequestMapping(value = "/page", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = BasicExamStudentResult.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = BasicExamStudentResult.class)})
-    public Result findBasicExamStudentPage(@ApiParam(value = "学期id") @RequestParam(required = false) String semesterId,
-                                           @ApiParam(value = "考试id") @RequestParam(required = false) String examId,
+    public Result findBasicExamStudentPage(@ApiParam(value = "学期id") @RequestParam(required = false) Long semesterId,
+                                           @ApiParam(value = "考试id") @RequestParam(required = false) Long examId,
+                                           @ApiParam(value = "开课学院ID") @RequestParam(required = false) Long openCollegeId,
                                            @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                                            @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                                            @ApiParam(value = "课程ID") @RequestParam(required = false) String paperNumber,
                                            @ApiParam(value = "课程ID") @RequestParam(required = false) String paperNumber,
                                            @ApiParam(value = "教师(工号/姓名)") @RequestParam(required = false) String teacher,
                                            @ApiParam(value = "教师(工号/姓名)") @RequestParam(required = false) String teacher,
@@ -75,9 +76,8 @@ public class BasicExamStudentController {
         if (examId == null) {
         if (examId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
         }
         }
-        return ResultUtil.ok(basicExamStudentService.page(SystemConstant.convertIdToLong(semesterId),
-                SystemConstant.convertIdToLong(examId), courseId, paperNumber, teacher, college, major, teachClassName, className,
-                examStudentInfo, pageNumber, pageSize));
+        return ResultUtil.ok(basicExamStudentService.page(semesterId, examId,openCollegeId, courseId, paperNumber, teacher,
+                college, major, teachClassName, className, examStudentInfo, pageNumber, pageSize));
     }
     }
 
 
     @ApiOperation(value = "新增/编辑")
     @ApiOperation(value = "新增/编辑")

+ 1 - 1
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -338,7 +338,7 @@
     <select id="queryPage"
     <select id="queryPage"
             resultType="com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryVo">
             resultType="com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryVo">
         select t.id,
         select t.id,
-               t.student_code,
+               bes.student_code,
                bes.student_name,
                bes.student_name,
                bc.code courseCode,
                bc.code courseCode,
                bc.name courseName,
                bc.name courseName,