|
@@ -1,5 +1,22 @@
|
|
|
package cn.com.qmth.stmms.biz.report.service.impl;
|
|
|
|
|
|
+import java.util.LinkedList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.persistence.criteria.CriteriaBuilder;
|
|
|
+import javax.persistence.criteria.CriteriaQuery;
|
|
|
+import javax.persistence.criteria.Predicate;
|
|
|
+import javax.persistence.criteria.Root;
|
|
|
+
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
+import org.springframework.data.domain.Sort.Direction;
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
import cn.com.qmth.stmms.biz.common.BaseQueryService;
|
|
|
import cn.com.qmth.stmms.biz.exam.dao.ExamSubjectDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
@@ -9,20 +26,6 @@ import cn.com.qmth.stmms.biz.report.query.ReportSubjectQuery;
|
|
|
import cn.com.qmth.stmms.biz.report.service.ReportSubjectClassService;
|
|
|
import cn.com.qmth.stmms.biz.utils.DoubleUtil;
|
|
|
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.jpa.domain.Specification;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
-import javax.persistence.criteria.CriteriaBuilder;
|
|
|
-import javax.persistence.criteria.CriteriaQuery;
|
|
|
-import javax.persistence.criteria.Predicate;
|
|
|
-import javax.persistence.criteria.Root;
|
|
|
-
|
|
|
-import java.util.LinkedList;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* 课程班级分析 service实现
|
|
|
*
|
|
@@ -46,7 +49,8 @@ public class ReportSubjectClassServiceImpl extends BaseQueryService<ReportSubjec
|
|
|
|
|
|
@Override
|
|
|
public List<ReportSubjectClass> findByQuery(final ReportSubjectQuery query) {
|
|
|
- List<ReportSubjectClass> result = reportSubjectClassDao.findAll(new Specification<ReportSubjectClass>() {
|
|
|
+ query.setSort(new Sort(Direction.ASC, "className"));
|
|
|
+ Page<ReportSubjectClass> result = reportSubjectClassDao.findAll(new Specification<ReportSubjectClass>() {
|
|
|
@Override
|
|
|
public Predicate toPredicate(Root<ReportSubjectClass> root, CriteriaQuery<?> cQuery, CriteriaBuilder cb) {
|
|
|
List<Predicate> predicates = new LinkedList<Predicate>();
|
|
@@ -63,8 +67,8 @@ public class ReportSubjectClassServiceImpl extends BaseQueryService<ReportSubjec
|
|
|
return predicates.isEmpty() ? cb.conjunction()
|
|
|
: cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
}
|
|
|
- });
|
|
|
- return result;
|
|
|
+ },query);
|
|
|
+ return result.getContent();
|
|
|
}
|
|
|
|
|
|
@Override
|