xiatian 2 anos atrás
pai
commit
69f97c6da3

+ 2 - 3
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/RandomPaperServiceImpl.java

@@ -98,8 +98,6 @@ public class RandomPaperServiceImpl implements RandomPaperService {
 			query.addCriteria(Criteria.where("courseId").in(req.getUd().getRefIds()));
 		}
 
-		query.addCriteria(Criteria.where("paperType").is(PaperType.IMPORT));
-
 		if (req.getEnable() != null) {
 			query.addCriteria(Criteria.where("enable").is(req.getEnable()));
 		}
@@ -113,7 +111,7 @@ public class RandomPaperServiceImpl implements RandomPaperService {
 			query.addCriteria(Criteria.where("name").regex(".*?\\.*" + paperName + ".*"));
 		}
 
-		long total = this.mongoTemplate.count(query, Paper.class);
+		long total = this.mongoTemplate.count(query, RandomPaper.class);
 		if (total == 0) {
 			return Page.empty();
 		}
@@ -672,6 +670,7 @@ public class RandomPaperServiceImpl implements RandomPaperService {
 				e = new RandomPaper();
 				e.setCourseId(domain.getCourseId());
 				e.setEnable(true);
+				e.setRootOrgId(domain.getRootOrgId());
 			}
 			e.setName(domain.getName());
 			e.setPaperIds(domain.getPaperIds());