xiaofei 11 mēneši atpakaļ
vecāks
revīzija
7c2968a45a
16 mainītis faili ar 109 papildinājumiem un 83 dzēšanām
  1. 1 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/DeleteBasicExamStudentStatusDto.java
  2. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamStudentService.java
  3. 17 16
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  4. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java
  5. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java
  6. 14 29
      distributed-print-business/src/main/resources/mapper/ConditionMapper.xml
  7. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  8. 3 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanBatchPaperService.java
  9. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java
  10. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperPageService.java
  11. 3 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanStudentPaperService.java
  12. 18 16
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  13. 4 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanBatchPaperServiceImpl.java
  14. 15 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java
  15. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperPageServiceImpl.java
  16. 18 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanStudentPaperServiceImpl.java

+ 1 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/DeleteBasicExamStudentStatusDto.java

@@ -29,12 +29,9 @@ public class DeleteBasicExamStudentStatusDto {
     public DeleteBasicExamStudentStatusDto() {
     }
 
-    public DeleteBasicExamStudentStatusDto(String studentName, String studentCode, String courseCode, String courseName, String openCollege) {
+    public DeleteBasicExamStudentStatusDto(String studentName, String studentCode) {
         this.studentName = studentName;
         this.studentCode = studentCode;
-        this.courseCode = courseCode;
-        this.courseName = courseName;
-        this.openCollege = openCollege;
     }
 
     public String getStudentName() {

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

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

+ 17 - 16
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 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.distributed.print.business.bean.query.BasicExamStudentPageQuery;
-import com.qmth.distributed.print.business.bean.query.BasicExamStudentQuery;
 import com.qmth.distributed.print.business.bean.dto.DeleteBasicExamStudentStatusDto;
 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.query.BasicExamStudentPageQuery;
+import com.qmth.distributed.print.business.bean.query.BasicExamStudentQuery;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.entity.BasicExamRule;
 import com.qmth.distributed.print.business.entity.ExamStudent;
@@ -152,18 +152,21 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     public void deleteBatch(List<Long> idList) {
         if (CollectionUtils.isNotEmpty(idList)) {
             List<BasicExamStudent> basicExamStudentList = this.listByIds(idList);
-            for (BasicExamStudent basicExamStudent : basicExamStudentList) {
-                List<MarkStudent> markStudentList = markStudentService.listByBasicStudentId(basicExamStudent.getId());
-                if (CollectionUtils.isNotEmpty(markStudentList)) {
-                    for (MarkStudent markStudent : markStudentList) {
-                        if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
-                            BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
-                            throw ExceptionResultEnum.ERROR.exception("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + basicExamStudent.getStudentCode() + "]考生已有评卷任务,不允许删除");
-                        }
+            List<Long> basicExamStudentIds = basicExamStudentList.stream().map(BasicExamStudent::getId).collect(Collectors.toList());
+            List<MarkStudent> markStudentList = markStudentService.listByBasicStudentIds(basicExamStudentIds);
+            if (CollectionUtils.isNotEmpty(markStudentList)) {
+                for (MarkStudent markStudent : markStudentList) {
+                    if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
+                        BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
+                        throw ExceptionResultEnum.ERROR.exception("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + markStudent.getStudentCode() + "]考生已有评卷任务,不允许删除");
                     }
                 }
-                examStudentService.deleteByBasicStudentId(basicExamStudent.getId());
-                markStudentService.deleteByBasicStudentId(basicExamStudent.getId());
+            }
+
+
+            if (CollectionUtils.isNotEmpty(basicExamStudentIds)) {
+                examStudentService.deleteByBasicStudentId(basicExamStudentIds);
+                markStudentService.deleteByBasicStudentId(basicExamStudentIds);
             }
 
             Set<String> paperNumberSet = basicExamStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperNumber())).map(BasicExamStudent::getPaperNumber).collect(Collectors.toSet());
@@ -294,7 +297,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
 
         // 试卷编号绑定其它课程
         if (StringUtils.isNotBlank(basicExamStudent.getPaperNumber())) {
-            if(StringUtils.isBlank(basicExamStudent.getExamPlace())){
+            if (StringUtils.isBlank(basicExamStudent.getExamPlace())) {
                 throw ExceptionResultEnum.ERROR.exception("校区(考点)必填");
             }
             if (this.count(new QueryWrapper<BasicExamStudent>().lambda()
@@ -464,12 +467,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         List<BasicExamStudent> basicExamStudentList = this.listByIds(idList);
         List<DeleteBasicExamStudentStatusDto> list = new ArrayList<>();
         for (BasicExamStudent basicExamStudent : basicExamStudentList) {
-            BasicCourse basicCourse = basicCourseService.getById(basicExamStudent.getCourseId());
-            SysOrg sysOrg = sysOrgService.getById(basicCourse != null ? basicCourse.getTeachingRoomId() : null);
             List<MarkStudent> markStudentList = markStudentService.listByStudentId(basicExamStudent.getId());
             Map<Long, List<MarkStudent>> map = markStudentList.stream().collect(Collectors.groupingBy(MarkStudent::getBasicStudentId));
             for (Map.Entry<Long, List<MarkStudent>> entry : map.entrySet()) {
-                DeleteBasicExamStudentStatusDto deleteBasicExamStudentStatusDto = new DeleteBasicExamStudentStatusDto(basicExamStudent.getStudentName(), basicExamStudent.getStudentCode(), basicCourse != null ? basicCourse.getCode() : null, basicCourse != null ? basicCourse.getName() : null, sysOrg != null ? sysOrg.getName() : null);
+                DeleteBasicExamStudentStatusDto deleteBasicExamStudentStatusDto = new DeleteBasicExamStudentStatusDto(basicExamStudent.getStudentName(), basicExamStudent.getStudentCode());
                 deleteBasicExamStudentStatusDto.setScanStatus(entry.getValue().stream().filter(m -> m.getUpload() != null && m.getUpload()).count() > 0);
                 int taskCount = 0;
                 for (MarkStudent markStudent : entry.getValue()) {

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java

@@ -112,8 +112,8 @@ public class ConditionServiceImpl implements ConditionService {
         else if ("42".equals(privilegeIdString)) {
             return conditionMapper.listCourseForQuery(examId, dpr);
         }
-        // 考务明细查询(45)
-        else if ("45".equals(privilegeIdString)) {
+        // 考务数据导入(44)、考务明细查询(45)
+        else if ("44".equals(privilegeIdString) || "45".equals(privilegeIdString)) {
             return conditionMapper.listCourseForExamDetail(semesterId, examId, printPlanIds, dpr);
         }
         // 印刷任务管理(47)
@@ -189,8 +189,8 @@ public class ConditionServiceImpl implements ConditionService {
         else if ("42".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberForQuery(examId, courseId, dpr);
         }
-        // 考务明细查询(45)
-        else if ("45".equals(privilegeIdString)) {
+        // 考务数据导入(44)、考务明细查询(45)
+        else if ("44".equals(privilegeIdString) || "45".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberForExamDetail(semesterId, examId, printPlanIds, courseId, dpr);
         }
         // 印刷任务管理(47)

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

@@ -144,8 +144,8 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
 
     @Transactional
     @Override
-    public void deleteByBasicStudentId(Long basicStudentId) {
-        List<ExamStudent> examStudentList = this.listByBasicStudentId(basicStudentId);
+    public void deleteByBasicStudentId(List<Long> basicExamStudentIds) {
+        List<ExamStudent> examStudentList = this.listByBasicStudentId(basicExamStudentIds);
         if (CollectionUtils.isNotEmpty(examStudentList)) {
             List<Long> examStudentIds = examStudentList.stream().map(ExamStudent::getId).collect(Collectors.toList());
             this.removeByIds(examStudentIds);
@@ -166,9 +166,9 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
     }
 
     @Override
-    public List<ExamStudent> listByBasicStudentId(Long basicStudentId) {
+    public List<ExamStudent> listByBasicStudentId(List<Long> basicExamStudentIds) {
         QueryWrapper<ExamStudent> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamStudent::getBasicStudentId, basicStudentId);
+        queryWrapper.lambda().in(ExamStudent::getBasicStudentId, basicExamStudentIds);
         return this.list(queryWrapper);
     }
 

+ 14 - 29
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -202,25 +202,17 @@
         </where>
     </select>
     <select id="listCourseForScore" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
-        SELECT bc.id,
+        SELECT distinct bc.id,
         bc.code,
         bc.name
-        from basic_course bc
-        where
-        exists (select 1
         FROM
         mark_paper mp
-        left join sys_user su ON mp.user_id = su.id
+        left join basic_course bc ON mp.course_id = bc.id
         left join basic_exam be ON mp.exam_id = be.id
         <where>
-            bc.id = mp.course_id
             and mp.status = #{status}
-            <if test="semesterId != null">
                 AND be.semester_id = #{semesterId}
-            </if>
-            <if test="examId != null">
                 AND mp.exam_id = #{examId}
-            </if>
             <if test="dpr != null">
                 <if test="dpr.requestUserId != null">
                     AND mp.user_id = #{dpr.requestUserId}
@@ -235,7 +227,7 @@
                     </foreach>
                 </if>
             </if>
-        </where>)
+        </where>
         order by bc.code
     </select>
     <select id="listPrintPlanForClient"
@@ -405,17 +397,14 @@
         order by mg.paper_number
     </select>
     <select id="listCourseFromMarkPaper" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
-        SELECT
+        SELECT distinct
             bc.id,
             bc.code,
             bc.name
-        from basic_course bc
-        where
-        exists (select 1
         FROM
         mark_paper mp
-        LEFT JOIN sys_user su ON mp.user_id = su.id
-        where bc.id = mp.course_id and mp.exam_id = #{examId}
+        LEFT JOIN basic_course bc ON mp.course_id = bc.id
+        where  mp.exam_id = #{examId}
         <if test="dpr != null">
             <if test="dpr.requestUserId != null">
                 AND mp.user_id = #{dpr.requestUserId}
@@ -425,19 +414,19 @@
                 #{dpr.courseUserId}) tc WHERE tc.course_id = mp.course_id)
             </if>
             <if test="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>
             </if>
-        </if>)
+        </if>
     </select>
     <select id="listPaperNumberFromMarkPaper" resultType="java.lang.String">
         SELECT
             mp.paper_number paperNumber
         FROM
         mark_paper mp
-        LEFT JOIN sys_user su ON mp.user_id = su.id
+        LEFT JOIN basic_course bc ON mp.course_id = bc.id
         where mp.exam_id = #{examId}
         <if test="courseId != null">
             AND mp.course_id = #{courseId}
@@ -450,7 +439,7 @@
                 AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = mp.course_id)
             </if>
             <if test="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>
@@ -756,16 +745,12 @@
             mp.paper_number paperNumber
         FROM
         mark_paper mp
-        left join sys_user su ON mp.user_id = su.id
+        left join basic_course bc ON mp.course_id = bc.id
         left join basic_exam be ON mp.exam_id = be.id
         <where>
             and mp.status = #{status}
-            <if test="semesterId != null">
-                AND be.semester_id = #{semesterId}
-            </if>
-            <if test="examId != null">
-                AND mp.exam_id = #{examId}
-            </if>
+            AND be.semester_id = #{semesterId}
+            AND mp.exam_id = #{examId}
             <if test="dpr != null">
                 <if test="dpr.requestUserId != null">
                     AND mp.user_id = #{dpr.requestUserId}
@@ -774,7 +759,7 @@
                     AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = mp.course_id)
                 </if>
                 <if test="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 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -209,7 +209,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
     MarkStudent assembleByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet);
 
     void deleteByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
-    void deleteByBasicStudentId(Long basicStudentId);
+    void deleteByBasicStudentId(List<Long> basicExamStudentIds);
 
     Integer maxCardNumber(Long examId, String paperNumber, String paperType);
 
@@ -229,5 +229,5 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
     boolean calcBatchObjectiveScore(List<Long> ids);
 
-    List<MarkStudent> listByBasicStudentId(Long basicStudentId);
+    List<MarkStudent> listByBasicStudentIds(List<Long> basicExamStudentIds);
 }

+ 3 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanBatchPaperService.java

@@ -5,6 +5,8 @@ import com.qmth.teachcloud.mark.entity.ScanBatchPaper;
 import com.qmth.teachcloud.mark.entity.ScanPaper;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -19,5 +21,5 @@ public interface ScanBatchPaperService extends IService<ScanBatchPaper> {
 
 	void update(ScanBatch batch, ScanPaper paper, Long studentId, Integer paperNumber);
 
-    void removeByStudentId(Long studentId);
+    void removeByStudentIds(List<Long> studentIds);
 }

+ 1 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java

@@ -36,6 +36,7 @@ public interface ScanOmrTaskService extends IService<ScanOmrTask> {
     int getFinishStudentCountByExamAndUserId(Long examId, Long courseId, String coursePaperId, String status,DataPermissionRule dpr,String teachClassName);
 
     void deleteByStudentId(Long examId, Long studentId);
+    void deleteByStudentIds(Long examId, List<Long> studentIds);
 
 	int getCount(Long examId, OmrTaskStatus status, String courseCode, String coursePaperId, MarkPaperStatus markPaperStatus, DataPermissionRule dpr);
 

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperPageService.java

@@ -24,5 +24,5 @@ public interface ScanPaperPageService extends IMppService<ScanPaperPage> {
 
 	List<ScanPaperPageVo> listByStudentIds(List<Long> studentIds);
 
-    void removeByPaperId(Long paperId);
+    void removeByPaperIds(List<Long> paperIds);
 }

+ 3 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanStudentPaperService.java

@@ -23,10 +23,13 @@ public interface ScanStudentPaperService extends IService<ScanStudentPaper> {
 
     int removeByStudentId(@NotNull Long studentId);
 
+    int removeByStudentIds(List<Long> studentIds);
+
     void removeByStudentIdAndPaperId(@NotNull Long studentId, @NotNull Long paperId);
 
     ScanStudentPaper findByStudentIdAndPaperNumber(Long studentId, Integer number);
 
     List<ScanStudentPaper> findByPaperIds(List<Long> paperIds);
 
+    List<ScanStudentPaper> listByStudentIds(List<Long> markStudentIds);
 }

+ 18 - 16
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -1795,21 +1795,23 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
 
     @Override
-    public void deleteByBasicStudentId(Long basicStudentId) {
-        List<MarkStudent> markStudentList = this.listByBasicStudentId(basicStudentId);
-        for (MarkStudent markStudent : markStudentList) {
-            List<ScanStudentPaper> scanStudentPaperList = scanStudentPaperService.findByStudentId(markStudent.getId());
-            scanStudentPaperService.removeByStudentId(markStudent.getId());
-            scanBatchPaperService.removeByStudentId(markStudent.getId());
-            scanOmrTaskService.deleteByStudentId(markStudent.getExamId(), markStudent.getId());
-            if (CollectionUtils.isNotEmpty(scanStudentPaperList)) {
-                for (ScanStudentPaper scanStudentPaper : scanStudentPaperList) {
-                    scanPaperPageService.removeByPaperId(scanStudentPaper.getPaperId());
-                    scanPaperService.removeById(scanStudentPaper.getPaperId());
-                }
-            }
-            this.removeById(markStudent.getId());
+    public void deleteByBasicStudentId(List<Long> basicExamStudentIds) {
+        List<MarkStudent> markStudentList = this.listByBasicStudentIds(basicExamStudentIds);
+        List<Long> markStudentIds = markStudentList.stream().map(MarkStudent::getId).collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(markStudentIds)) {
+            return;
         }
+        List<ScanStudentPaper> scanStudentPaperList = scanStudentPaperService.listByStudentIds(markStudentIds);
+        List<Long> paperIds = scanStudentPaperList.stream().map(ScanStudentPaper::getPaperId).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(paperIds)) {
+            scanPaperPageService.removeByPaperIds(paperIds);
+            scanPaperService.removeByIds(paperIds);
+        }
+
+        scanStudentPaperService.removeByStudentIds(markStudentIds);
+        scanBatchPaperService.removeByStudentIds(markStudentIds);
+        scanOmrTaskService.deleteByStudentIds(markStudentList.get(0).getExamId(), markStudentIds);
+        this.removeByIds(markStudentIds);
     }
 
     @Override
@@ -1951,9 +1953,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
 
     @Override
-    public List<MarkStudent> listByBasicStudentId(Long basicStudentId) {
+    public List<MarkStudent> listByBasicStudentIds(List<Long> basicExamStudentIds) {
         QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(MarkStudent::getBasicStudentId, basicStudentId);
+        queryWrapper.lambda().in(MarkStudent::getBasicStudentId, basicExamStudentIds);
         return this.list(queryWrapper);
     }
 }

+ 4 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanBatchPaperServiceImpl.java

@@ -15,6 +15,8 @@ import com.qmth.teachcloud.mark.entity.ScanPaper;
 import com.qmth.teachcloud.mark.mapper.ScanBatchPaperMapper;
 import com.qmth.teachcloud.mark.service.ScanBatchPaperService;
 
+import java.util.List;
+
 /**
  * <p>
  * 服务实现类
@@ -50,10 +52,10 @@ public class ScanBatchPaperServiceImpl extends MppServiceImpl<ScanBatchPaperMapp
     }
 
     @Override
-    public void removeByStudentId(Long studentId) {
+    public void removeByStudentIds(List<Long> studentIds) {
         QueryWrapper<ScanBatchPaper> wrapper = new QueryWrapper<>();
         LambdaQueryWrapper<ScanBatchPaper> lw = wrapper.lambda();
-        lw.eq(ScanBatchPaper::getStudentId, studentId);
+        lw.in(ScanBatchPaper::getStudentId, studentIds);
         this.remove(wrapper);
     }
 }

+ 15 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

@@ -647,6 +647,21 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
         }
     }
 
+    @Transactional
+    @Override
+    public void deleteByStudentIds(Long examId, List<Long> studentIds) {
+        QueryWrapper<ScanOmrTask> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanOmrTask> lw = wrapper.lambda();
+        lw.eq(ScanOmrTask::getExamId, examId);
+        lw.in(ScanOmrTask::getStudentId, studentIds);
+        List<ScanOmrTask> tasks = baseMapper.selectList(wrapper);
+        if (CollectionUtils.isEmpty(tasks)) {
+            return;
+        }
+        List<Long> ids = tasks.stream().map(e -> e.getId()).collect(Collectors.toList());
+        this.removeByIds(ids);
+    }
+
     @Override
     public int getCount(Long examId, OmrTaskStatus status, String courseCode, String coursePaperId,
                         MarkPaperStatus markPaperStatus, DataPermissionRule dpr) {

+ 2 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperPageServiceImpl.java

@@ -67,9 +67,9 @@ public class ScanPaperPageServiceImpl extends MppServiceImpl<ScanPaperPageMapper
     }
 
     @Override
-    public void removeByPaperId(Long paperId) {
+    public void removeByPaperIds(List<Long> paperIds) {
         QueryWrapper<ScanPaperPage> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ScanPaperPage::getPaperId, paperId);
+        queryWrapper.lambda().in(ScanPaperPage::getPaperId, paperIds);
         this.remove(queryWrapper);
     }
 

+ 18 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanStudentPaperServiceImpl.java

@@ -51,6 +51,15 @@ public class ScanStudentPaperServiceImpl extends ServiceImpl<ScanStudentPaperMap
         return this.list(wrapper);
     }
 
+    @Override
+    public List<ScanStudentPaper> listByStudentIds(List<Long> markStudentIds) {
+        QueryWrapper<ScanStudentPaper> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanStudentPaper> lw = wrapper.lambda();
+        lw.in(ScanStudentPaper::getStudentId, markStudentIds);
+        lw.orderByAsc(ScanStudentPaper::getPaperIndex);
+        return this.list(wrapper);
+    }
+
     @Transactional
     @Override
     public int removeByStudentId(Long studentId) {
@@ -60,6 +69,15 @@ public class ScanStudentPaperServiceImpl extends ServiceImpl<ScanStudentPaperMap
         return this.baseMapper.delete(wrapper);
     }
 
+    @Transactional
+    @Override
+    public int removeByStudentIds(List<Long> studentIds) {
+        QueryWrapper<ScanStudentPaper> wrapper = new QueryWrapper<>();
+        LambdaQueryWrapper<ScanStudentPaper> lw = wrapper.lambda();
+        lw.in(ScanStudentPaper::getStudentId, studentIds);
+        return this.baseMapper.delete(wrapper);
+    }
+
     @Override
     public ScanStudentPaper findByStudentIdAndPaperNumber(Long studentId, Integer paperNumber) {
         QueryWrapper<ScanStudentPaper> wrapper = new QueryWrapper<>();