xiaofei hace 11 meses
padre
commit
3a5dab1131

+ 7 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -74,4 +74,11 @@ public interface ConditionMapper {
 
     List<String> listPaperNumberFromBasicExamStudent(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
 
+    List<BasicCourse> listCourseForPrintCount(@Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId, @Param("dpr") DataPermissionRule dpr);
+
+    List<BasicCourse> listCourseForScanCount(@Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberForPrintCount(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberForScanCount(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
 }

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

@@ -38,4 +38,6 @@ public interface ExamStudentService extends IService<ExamStudent> {
     void updateAttachmentIdById(ExamStudentInfo t);
 
     int countByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
+
+    void deleteByBasicStudentId(Long basicStudentId);
 }

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

@@ -85,6 +85,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     private MarkTaskService markTaskService;
     @Resource
     private ExamTaskDetailService examTaskDetailService;
+    @Resource
+    private ExamStudentService examStudentService;
 
     @Override
     public IPage<BasicExamStudentResult> page(Long semesterId, Long examId, Long courseId, String paperNumber,
@@ -195,7 +197,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                         throw ExceptionResultEnum.ERROR.exception(stringJoiner.toString());
                     }
                 }
-                markStudentService.deleteByExamIdAndPaperNumberAndStudentCode(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), basicExamStudent.getStudentCode());
+                examStudentService.deleteByBasicStudentId(basicExamStudent.getId());
+                markStudentService.deleteByBasicStudentId(basicExamStudent.getId());
                 // 更新扫描数据
                 long count = markStudentService.countByExamIdAndPaperNumber(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), null);
                 if (count == 0) {

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

@@ -139,6 +139,12 @@ public class ConditionServiceImpl implements ConditionService {
         // 文档管理(577)
         else if ("577".equals(privilegeIdString)) {
             return conditionMapper.listCourseForDocument(examId, dpr);
+        } // 印刷任务统计(2088)
+        else if ("2088".equals(privilegeIdString)) {
+            return conditionMapper.listCourseForPrintCount(examId, openCollegeId, dpr);
+        } // 扫描任务统计(2089)
+        else if ("2089".equals(privilegeIdString)) {
+            return conditionMapper.listCourseForScanCount(examId, openCollegeId, dpr);
         } else {
             return conditionMapper.listCourse(semesterId, examId, enable, printPlanIds, dpr);
         }
@@ -198,7 +204,13 @@ public class ConditionServiceImpl implements ConditionService {
         // 下载管理(653)
         else if ("653".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberFromExamTaskByUserIdAndPass(examId, courseId, dpr);
-        } else {
+        } // 印刷任务统计(2088)
+        else if ("2088".equals(privilegeIdString)) {
+            return conditionMapper.listPaperNumberForPrintCount(examId, courseId, dpr);
+        } // 扫描任务统计(2089)
+        else if ("2089".equals(privilegeIdString)) {
+            return conditionMapper.listPaperNumberForScanCount(examId, courseId, dpr);
+        }else {
             return conditionMapper.listPaperNumber(semesterId, examId, courseId, printPlanIds, dpr);
         }
     }

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

@@ -17,6 +17,7 @@ import com.qmth.distributed.print.business.service.ExamStudentService;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.mark.entity.MarkStudent;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
@@ -132,4 +133,11 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
                 .eq(ExamStudent::getStudentCode, studentCode);
         return this.count(queryWrapper);
     }
+
+    @Override
+    public void deleteByBasicStudentId(Long basicStudentId) {
+        UpdateWrapper<ExamStudent> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().eq(ExamStudent::getBasicStudentId, basicStudentId);
+        this.remove(updateWrapper);
+    }
 }

+ 112 - 0
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -934,4 +934,116 @@
             </if>
         </if>
     </select>
+    <select id="listCourseForPrintCount" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        select
+        distinct bc.id, bc.code,bc.name
+        from exam_task et
+         join basic_course bc on bc.id = et.course_id
+         join t_f_flow_approve tffa on tffa.flow_id = et.flow_id
+        <where>
+            and (et.status = 'SUBMIT' and (et.flow_id is null or (et.flow_id is not null and tffa.status = 'FINISH')))
+            AND et.exam_id = #{examId}
+            <if test="openCollegeId != null">
+                AND bc.teaching_room_id = #{openCollegeId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND et.user_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.courseUserId != null">
+                    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 = et.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>
+        </where>
+    </select>
+    <select id="listCourseForScanCount" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        select
+            distinct bc.id, bc.code,bc.name
+            from mark_paper mp
+             join basic_course bc on bc.id = mp.course_id
+            <where>
+                AND mp.exam_id = #{examId}
+                <if test="openCollegeId != null">
+                    AND bc.teaching_room_id = #{openCollegeId}
+                </if>
+                <if test="dpr != null">
+                    <if test="dpr.requestUserId != null">
+                        AND EXISTS( SELECT 1 FROM  (select exam_id, paper_number,basic_student_id from mark_student where exam_id = #{examId}) ms
+                        join
+                        (select id from basic_exam_student where exam_id = #{examId} and teacher_id = #{dpr.requestUserId}) bes on ms.basic_student_id = bes.id WHERE mp.exam_id = ms.exam_id and mp.paper_number = ms.paper_number)
+                    </if>
+                    <if test="dpr.courseUserId != null">
+                        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 bc.teaching_room_id IN
+                        <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+                </if>
+            </where>
+    </select>
+    <select id="listPaperNumberForPrintCount" resultType="java.lang.String">
+        select
+        distinct et.paper_number
+        from exam_task et
+         join basic_course bc on bc.id = et.course_id
+         join t_f_flow_approve tffa on tffa.flow_id = et.flow_id
+        <where>
+            and (et.status = 'SUBMIT' and (et.flow_id is null or (et.flow_id is not null and tffa.status = 'FINISH')))
+            AND et.exam_id = #{examId}
+            <if test="courseId != null">
+                AND bc.id = #{courseId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND et.user_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.courseUserId != null">
+                    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 = et.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>
+        </where>
+    </select>
+    <select id="listPaperNumberForScanCount" resultType="java.lang.String">
+        select
+        distinct mp.paper_number
+        from mark_paper mp
+         join basic_course bc on bc.id = mp.course_id
+        <where>
+            AND mp.exam_id = #{examId}
+            <if test="courseId != null">
+                AND mp.course_id = #{courseId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND EXISTS( SELECT 1 FROM  (select exam_id, paper_number,basic_student_id from mark_student where exam_id = #{examId}) ms
+                    join
+                    (select id from basic_exam_student where exam_id = #{examId} and teacher_id = #{dpr.requestUserId}) bes on ms.basic_student_id = bes.id WHERE mp.exam_id = ms.exam_id and mp.paper_number = ms.paper_number)
+                </if>
+                <if test="dpr.courseUserId != null">
+                    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 bc.teaching_room_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+    </select>
 </mapper>

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

@@ -209,6 +209,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void updateByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet);
 
     void deleteByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
+    void deleteByBasicStudentId(Long basicStudentId);
 
     Integer maxCardNumber(Long examId, String paperNumber, String paperType);
 

+ 7 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -1805,6 +1805,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         this.remove(updateWrapper);
     }
 
+    @Override
+    public void deleteByBasicStudentId(Long basicStudentId) {
+        UpdateWrapper<MarkStudent> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().eq(MarkStudent::getBasicStudentId, basicStudentId);
+        this.remove(updateWrapper);
+    }
+
     @Override
     public Integer maxCardNumber(Long examId, String paperNumber, String paperType) {
         return this.baseMapper.maxCardNumber(examId, paperNumber, paperType);