|
@@ -8,6 +8,7 @@ import java.io.InputStream;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
+import java.util.Comparator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
@@ -741,7 +742,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<StudentScoreEntity> findBy(Long examId, String subjectCode, Integer mainNumber, String subNumber,
|
|
public List<StudentScoreEntity> findBy(Long examId, String subjectCode, Integer mainNumber, String subNumber,
|
|
- Boolean exZero) {
|
|
|
|
|
|
+ Boolean exZero,Integer count) {
|
|
QueryWrapper<StudentScoreEntity> wrapper = new QueryWrapper<>();
|
|
QueryWrapper<StudentScoreEntity> wrapper = new QueryWrapper<>();
|
|
LambdaQueryWrapper<StudentScoreEntity> lw = wrapper.lambda();
|
|
LambdaQueryWrapper<StudentScoreEntity> lw = wrapper.lambda();
|
|
lw.eq(StudentScoreEntity::getExamId, examId);
|
|
lw.eq(StudentScoreEntity::getExamId, examId);
|
|
@@ -754,6 +755,24 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
|
|
wq.or(wq2 -> wq2.eq(StudentScoreEntity::getMarkingScore, 0));
|
|
wq.or(wq2 -> wq2.eq(StudentScoreEntity::getMarkingScore, 0));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- return this.list(wrapper);
|
|
|
|
|
|
+ List<StudentScoreEntity> ret=this.list(wrapper);
|
|
|
|
+ if(CollectionUtils.isEmpty(ret)) {
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ if(count!=null) {
|
|
|
|
+ ret.sort(new Comparator<StudentScoreEntity>() {
|
|
|
|
+ @Override
|
|
|
|
+ public int compare(StudentScoreEntity o1, StudentScoreEntity o2) {
|
|
|
|
+ String c1 = o1.getStudentCode();
|
|
|
|
+ String c2 = o2.getStudentCode();
|
|
|
|
+ return c1.compareTo(c2);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if(ret.size()<=count) {
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ return ret.subList(0, count);
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
}
|
|
}
|