Ver Fonte

3.3.0 fix

xiaofei há 1 ano atrás
pai
commit
16d9713f70

+ 5 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java

@@ -12,7 +12,9 @@ import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.UnexistStudentDto;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
+import com.qmth.teachcloud.mark.entity.ScanPaper;
 import org.apache.ibatis.annotations.Param;
+import org.omg.CORBA.MARSHAL;
 
 import java.util.List;
 
@@ -67,4 +69,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 	List<TeacherClassVo> teacherClass(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 
     int selectCountByQuery(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr);
+
+	int countAssigned(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr);
+
 }

+ 0 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanPaperMapper.java

@@ -25,6 +25,4 @@ public interface ScanPaperMapper extends BaseMapper<ScanPaper> {
 	List<PaperVo> findStudentPaper(@Param("studentId")Long studentId);
 
 	List<StudentPaperVo> listByStudentIds(@Param("studentIds")List<Long> studentIds);
-
-    int countAssigned(@Param("scanPaper") ScanPaper scanPaper, @Param("dpr") DataPermissionRule dpr);
 }

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

@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
@@ -130,4 +131,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void updateObjectiveScoreAndScoreList(MarkStudent markStudent);
 
     boolean updateAssignConfirm(Long studentId, boolean assignConfirm);
+
+    int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId, DataPermissionRule dpr);
+
 }

+ 0 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPaperService.java

@@ -25,8 +25,6 @@ public interface ScanPaperService extends IService<ScanPaper> {
 
 	void savePaperAndPages(ScanPaper paper, List<ScanPaperPage> pages);
 
-	int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId, DataPermissionRule dpr);
-
     List<StudentPaperDetailDto> listStudentPaperDetail(Long studentId);
 
 	int getCountByExamAndCardNumber(Long examId, Integer number);

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

@@ -241,8 +241,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         CheckTask ct = vo.getCheckTask();
         ct.setUnexistCount(getCount(examId, ScanStatus.UNEXIST, courseCode, coursePaperId, dpr));
         ct.setUnexistCheckedCount(getCount(examId, ScanStatus.MANUAL_ABSENT, courseCode, coursePaperId, dpr));
-        ct.setAssignedCount(scanPaperService.getAssignedCount(examId, false, courseCode, coursePaperId, dpr));
-        ct.setAssignedCheckedCount(scanPaperService.getAssignedCount(examId, true, courseCode, coursePaperId, dpr));
+        ct.setAssignedCount(getAssignedCount(examId, false, courseCode, coursePaperId, dpr));
+        ct.setAssignedCheckedCount(getAssignedCount(examId, true, courseCode, coursePaperId, dpr));
         ct.setAbsentCheckCount(getOmrAbsentCount(examId, false, courseCode, coursePaperId, dpr));
         ct.setAbsentCheckedCount(getOmrAbsentCount(examId, true, courseCode, coursePaperId, dpr));
         ct.setObjectiveCheckCount(scanOmrTaskService.getCount(examId, OmrTaskStatus.WAITING, courseCode, coursePaperId, dpr));
@@ -1104,4 +1104,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     private int getCount(Long examId, String paperNumber, Double start, Double end) {
         return baseMapper.getCountByScoreRange(examId, paperNumber, start, end);
     }
+
+    @Override
+    public int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId, DataPermissionRule dpr) {
+        MarkStudent markStudent = new MarkStudent();
+        markStudent.setExamId(examId);
+        markStudent.setCourseCode(courseCode);
+        markStudent.setCoursePaperId(coursePaperId);
+        markStudent.setAssigned(true);
+        markStudent.setAssignConfirmed(checked);
+        return baseMapper.countAssigned(markStudent, dpr);
+    }
 }

+ 0 - 12
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPaperServiceImpl.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.boot.core.concurrent.service.ConcurrentService;
 import com.qmth.boot.core.exception.ParameterException;
-import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.mark.bean.papermigrate.PaperMigrateDomain;
@@ -91,17 +90,6 @@ public class ScanPaperServiceImpl extends ServiceImpl<ScanPaperMapper, ScanPaper
         paperPageService.saveOrUpdateBatchByMultiId(pages);
     }
 
-    @Override
-    public int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId, DataPermissionRule dpr) {
-        ScanPaper scanPaper = new ScanPaper();
-        scanPaper.setExamId(examId);
-        scanPaper.setCourseCode(courseCode);
-        scanPaper.setCoursePaperId(coursePaperId);
-        scanPaper.setAssigned(true);
-        scanPaper.setAssignConfirmed(checked);
-        return baseMapper.countAssigned(scanPaper, dpr);
-    }
-
     @Override
     public List<StudentPaperDetailDto> listStudentPaperDetail(Long studentId) {
         return this.baseMapper.listStudentPaperDetail(studentId);

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

@@ -453,4 +453,38 @@
             </if>
         </where>
     </select>
+    <select id="countAssigned" resultType="java.lang.Integer">
+        SELECT
+        count(1)
+        FROM
+            mark_student ms
+                LEFT JOIN sys_user su ON ms.create_id = su.id
+        <where>
+            ms.exam_id = #{markStudent.examId}
+            <if test="markStudent.courseCode != null">
+                AND ms.course_code = #{markStudent.courseCode}
+            </if>
+            <if test="markStudent.coursePaperId != null">
+                AND ms.course_paper_id = #{markStudent.coursePaperId}
+            </if>
+            <if test="markStudent.assigned != null">
+                AND ms.assigned = #{markStudent.assigned}
+            </if>
+            <if test="markStudent.assignConfirmed != null">
+                AND ms.assign_confirmed = #{markStudent.assignConfirmed}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND ms.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND su.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+    </select>
+
 </mapper>

+ 0 - 44
teachcloud-mark/src/main/resources/mapper/ScanPaperMapper.xml

@@ -71,48 +71,4 @@
         </foreach>
         order by t.paper_index
     </select>
-    <select id="countAssigned" resultType="java.lang.Integer">
-        SELECT
-            count(1)
-        FROM
-            scan_student_paper ssp
-                LEFT JOIN
-            scan_paper sp ON ssp.paper_id = sp.id
-        <where>
-            sp.exam_id = #{scanPaper.examId}
-            <if test="scanPaper.assigned != null">
-                AND sp.assigned = #{scanPaper.assigned}
-            </if>
-            <if test="scanPaper.assignConfirmed != null">
-                AND sp.assign_confirmed = #{scanPaper.assignConfirmed}
-            </if>
-            <if test="scanPaper.courseCode != null or scanPaper.coursePaperId != null or dpr != null">
-                AND EXISTS( SELECT
-                        1
-                    FROM
-                        mark_student ms
-                            left join sys_user su on ms.create_id = su.id
-                    WHERE
-                        ssp.student_id = ms.id
-                        <if test="scanPaper.courseCode != null">
-                            AND ms.course_code = #{scanPaper.courseCode}
-                        </if>
-                        <if test="scanPaper.coursePaperId != null">
-                            AND ms.course_paper_id = #{scanPaper.coursePaperId}
-                        </if>
-                        <if test="dpr != null">
-                            <if test="dpr.requestUserId != null">
-                                AND ms.create_id = #{dpr.requestUserId}
-                            </if>
-                            <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                                AND su.org_id IN
-                                <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
-                                    #{item}
-                                </foreach>
-                            </if>
-                        </if>
-                )
-            </if>
-        </where>
-    </select>
 </mapper>