xiatian 3 mesiacov pred
rodič
commit
160c811a7d

+ 11 - 0
src/main/java/cn/com/qmth/am/config/SysProperty.java

@@ -6,6 +6,9 @@ import org.springframework.stereotype.Component;
 @Component
 @Component
 public class SysProperty {
 public class SysProperty {
 
 
+    @Value("${am.student.count}")
+    private Integer studentCount;
+
     @Value("${com.qmth.solar.app-version}")
     @Value("${com.qmth.solar.app-version}")
     private String version;
     private String version;
 
 
@@ -149,4 +152,12 @@ public class SysProperty {
         this.ocrThreadCount = ocrThreadCount;
         this.ocrThreadCount = ocrThreadCount;
     }
     }
 
 
+    public Integer getStudentCount() {
+        return studentCount;
+    }
+
+    public void setStudentCount(Integer studentCount) {
+        this.studentCount = studentCount;
+    }
+
 }
 }

+ 2 - 1
src/main/java/cn/com/qmth/am/dao/stmms/StmmsDao.java

@@ -13,6 +13,7 @@ public interface StmmsDao {
             @Param("mainNumber") Integer mainNumber, @Param("subNumber") String subNumber,
             @Param("mainNumber") Integer mainNumber, @Param("subNumber") String subNumber,
             @Param("examNumber") String examNumber);
             @Param("examNumber") String examNumber);
 
 
-    List<String> getUploadStudent(@Param("examId") Long examId, @Param("subjectCode") String subjectCode);
+    List<String> getUploadStudent(@Param("examId") Long examId, @Param("subjectCode") String subjectCode,
+            @Param("limitCount") Integer limitCount);
 
 
 }
 }

+ 1 - 1
src/main/java/cn/com/qmth/am/service/StmmsService.java

@@ -10,5 +10,5 @@ public interface StmmsService {
     List<Double> getMarkStudent(Long examId, String subjectCode, Integer mainNumber, String subNumber,
     List<Double> getMarkStudent(Long examId, String subjectCode, Integer mainNumber, String subNumber,
             String examNumber);
             String examNumber);
 
 
-    List<String> getUploadStudent(Long examId, String subjectCode);
+    List<String> getUploadStudent(Long examId, String subjectCode, Integer limitCount);
 }
 }

+ 2 - 2
src/main/java/cn/com/qmth/am/service/impl/StmmsServiceImpl.java

@@ -24,7 +24,7 @@ public class StmmsServiceImpl implements StmmsService {
     }
     }
 
 
     @Override
     @Override
-    public List<String> getUploadStudent(Long examId, String subjectCode) {
-        return stmmsDao.getUploadStudent(examId, subjectCode);
+    public List<String> getUploadStudent(Long examId, String subjectCode, Integer limitCount) {
+        return stmmsDao.getUploadStudent(examId, subjectCode, limitCount);
     }
     }
 }
 }

+ 5 - 1
src/main/java/cn/com/qmth/am/service/impl/StudentServiceImpl.java

@@ -16,6 +16,7 @@ import com.qmth.boot.core.exception.StatusException;
 
 
 import cn.com.qmth.am.bean.OcrDto;
 import cn.com.qmth.am.bean.OcrDto;
 import cn.com.qmth.am.bean.StudentScoreVo;
 import cn.com.qmth.am.bean.StudentScoreVo;
+import cn.com.qmth.am.config.SysProperty;
 import cn.com.qmth.am.entity.QuestionEntity;
 import cn.com.qmth.am.entity.QuestionEntity;
 import cn.com.qmth.am.enums.DataStatus;
 import cn.com.qmth.am.enums.DataStatus;
 import cn.com.qmth.am.service.QuestionService;
 import cn.com.qmth.am.service.QuestionService;
@@ -31,6 +32,9 @@ public class StudentServiceImpl implements StudentService {
     @Autowired
     @Autowired
     private StudentService studentService;
     private StudentService studentService;
 
 
+    @Autowired
+    private SysProperty sysProperty;
+
     @Autowired
     @Autowired
     private StmmsService stmmsService;
     private StmmsService stmmsService;
 
 
@@ -58,7 +62,7 @@ public class StudentServiceImpl implements StudentService {
         }
         }
         for (List<QuestionEntity> qlist : qmap.values()) {
         for (List<QuestionEntity> qlist : qmap.values()) {
             List<String> students = stmmsService.getUploadStudent(qlist.get(0).getExamId(),
             List<String> students = stmmsService.getUploadStudent(qlist.get(0).getExamId(),
-                    qlist.get(0).getSubjectCode());
+                    qlist.get(0).getSubjectCode(), sysProperty.getStudentCount());
             if (CollectionUtils.isEmpty(students)) {
             if (CollectionUtils.isEmpty(students)) {
                 continue;
                 continue;
             }
             }

+ 1 - 0
src/main/resources/application.properties

@@ -47,6 +47,7 @@ spring.datasource.dynamic.datasource.data-source-stmms.password=123456
 
 
 am.image-server=https://file.markingcloud.com
 am.image-server=https://file.markingcloud.com
 am.data-dir=./data
 am.data-dir=./data
+am.student.count=1000
 
 
 am.ocr-task.enable=true
 am.ocr-task.enable=true
 am.ocr-thread-count=4
 am.ocr-thread-count=4

+ 1 - 1
src/main/resources/mapper/StmmsMapper.xml

@@ -16,6 +16,6 @@
 		from  eb_exam_student s 
 		from  eb_exam_student s 
 		where
 		where
 		s.exam_id=#{examId} and s.subject_code =#{subjectCode}
 		s.exam_id=#{examId} and s.subject_code =#{subjectCode}
-		and s.is_upload=1 and s.is_absent=0
+		and s.is_upload=1 and s.is_absent=0 limit #{limitCount}
 	</select>
 	</select>
 </mapper>
 </mapper>