|
@@ -10,10 +10,15 @@ import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.nlpcn.commons.lang.util.StringUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Example;
|
|
import org.springframework.data.domain.Example;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
|
+import org.springframework.data.mongodb.core.query.Criteria;
|
|
|
|
+import org.springframework.data.mongodb.core.query.Query;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
@@ -91,6 +96,9 @@ public class PaperService {
|
|
@Autowired
|
|
@Autowired
|
|
ComTaskService comTaskService;
|
|
ComTaskService comTaskService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private MongoTemplate mongoTemplate;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询所有已导入试卷
|
|
* 查询所有已导入试卷
|
|
*
|
|
*
|
|
@@ -106,6 +114,33 @@ public class PaperService {
|
|
return paperRepo.findAll(Example.of(importPaper), new PageRequest(curPage - 1, pageSize));
|
|
return paperRepo.findAll(Example.of(importPaper), new PageRequest(curPage - 1, pageSize));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查询所有待审核和审核不通过的导入试卷
|
|
|
|
+ * @param paperSearchInfo
|
|
|
|
+ * @param curPage
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Page<Paper> getImportPapersNotSuccess(PaperSearchInfo paperSearchInfo, int curPage, int pageSize) {
|
|
|
|
+ Query query = new Query();
|
|
|
|
+ if(paperSearchInfo.getPaperStatus()!=null){
|
|
|
|
+ query.addCriteria(Criteria.where("paperStatus").is(paperSearchInfo.getPaperStatus()));
|
|
|
|
+ }else{
|
|
|
|
+ query.addCriteria(Criteria.where("paperStatus").ne(PaperStatus.PASS));
|
|
|
|
+ }
|
|
|
|
+ query.addCriteria(Criteria.where("paperType").is(PaperType.IMPORT));
|
|
|
|
+ query.addCriteria(Criteria.where("orgId").is(paperSearchInfo.getOrgId()));
|
|
|
|
+ if(StringUtil.isNotBlank(paperSearchInfo.getCourseNo())){
|
|
|
|
+ query.addCriteria(Criteria.where("courseNo").is(paperSearchInfo.getCourseNo()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ long totalNumber = this.mongoTemplate.count(query, Paper.class);
|
|
|
|
+ query.limit(pageSize);
|
|
|
|
+ query.skip((curPage-1)*pageSize);
|
|
|
|
+ List<Paper> paperList = this.mongoTemplate.find(query, Paper.class);
|
|
|
|
+ return new PageImpl<Paper>(paperList,new PageRequest(curPage - 1, pageSize),totalNumber);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据条件查询
|
|
* 根据条件查询
|
|
* @param paperSearchInfo
|
|
* @param paperSearchInfo
|